@flyingboat/upup 0.1.2 → 0.2.1
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 +12 -1
- package/dist/bundle.js +1688 -63
- package/package.json +36 -31
package/dist/bundle.js
CHANGED
|
@@ -1,63 +1,1601 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "node:module";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
|
+
import * as process$1 from "node:process";
|
|
3
4
|
|
|
4
|
-
//#region
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var __create = Object.create;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
16
|
+
key = keys[i];
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
18
|
+
__defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/cli-color.ts
|
|
34
|
+
const ESC = "\x1B[";
|
|
35
|
+
const codes = {
|
|
36
|
+
reset: `${ESC}0m`,
|
|
37
|
+
bold: `${ESC}1m`,
|
|
38
|
+
dim: `${ESC}2m`,
|
|
39
|
+
italic: `${ESC}3m`,
|
|
40
|
+
underline: `${ESC}4m`,
|
|
41
|
+
black: `${ESC}30m`,
|
|
42
|
+
red: `${ESC}31m`,
|
|
43
|
+
green: `${ESC}32m`,
|
|
44
|
+
yellow: `${ESC}33m`,
|
|
45
|
+
blue: `${ESC}34m`,
|
|
46
|
+
magenta: `${ESC}35m`,
|
|
47
|
+
cyan: `${ESC}36m`,
|
|
48
|
+
white: `${ESC}37m`,
|
|
49
|
+
test: `${ESC}38m`,
|
|
50
|
+
orange: `${ESC}38;5;208m`,
|
|
51
|
+
gray: `${ESC}90m`
|
|
52
|
+
};
|
|
53
|
+
const enabled = process.stdout?.isTTY ?? false;
|
|
54
|
+
function wrap(text, ...styles) {
|
|
55
|
+
if (!enabled) return text;
|
|
56
|
+
return styles.join("") + text + codes.reset;
|
|
12
57
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
58
|
+
const green = (t) => wrap(t, codes.green);
|
|
59
|
+
const yellow = (t) => wrap(t, codes.yellow);
|
|
60
|
+
const gray = (t) => wrap(t, codes.gray);
|
|
61
|
+
const bold = (t) => wrap(t, codes.bold);
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/cli-table.ts
|
|
65
|
+
const leftTopCorner = "┌";
|
|
66
|
+
const rightTopCorner = "┐";
|
|
67
|
+
const leftBottomCorner = "└";
|
|
68
|
+
const rightBottomCorner = "┘";
|
|
69
|
+
const leftMiddleCorner = "├";
|
|
70
|
+
const rightMiddleCorner = "┤";
|
|
71
|
+
const horizontal = "─";
|
|
72
|
+
const vertical = "│";
|
|
73
|
+
function renderTable(rows) {
|
|
74
|
+
console.log(table(rows).join("\n"));
|
|
75
|
+
}
|
|
76
|
+
function table(rows) {
|
|
77
|
+
const content = [];
|
|
78
|
+
const headers = Object.keys(rows[0]);
|
|
79
|
+
const nbrCols = headers.length;
|
|
80
|
+
const colMaxWidth = [];
|
|
81
|
+
for (const row of rows) {
|
|
82
|
+
let index = 0;
|
|
83
|
+
for (const col of headers) {
|
|
84
|
+
if (!colMaxWidth[index]) colMaxWidth[index] = headers[index].length;
|
|
85
|
+
if (row[col].length > colMaxWidth[index]) colMaxWidth[index] = row[col].length;
|
|
86
|
+
index++;
|
|
30
87
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
88
|
+
}
|
|
89
|
+
const tableWidth = colMaxWidth.reduce((a, b) => a + b, nbrCols * 4) + 1;
|
|
90
|
+
const headerLine = new Line();
|
|
91
|
+
for (let i = 0; i < headers.length; i++) headerLine.push(cell(headers[i], colMaxWidth[i], (v) => bold(v)));
|
|
92
|
+
content.push(...header(headerLine, tableWidth));
|
|
93
|
+
for (const row of rows) {
|
|
94
|
+
let j = 0;
|
|
95
|
+
const rowLine = new Line();
|
|
96
|
+
for (const col of headers) {
|
|
97
|
+
let wrapper;
|
|
98
|
+
if (col === "status") {
|
|
99
|
+
if (row.status === "need update") wrapper = (v) => yellow(v);
|
|
100
|
+
else if (row.status === "ok") wrapper = (v) => green(v);
|
|
101
|
+
}
|
|
102
|
+
if (col === "package" && row.status === "need update") wrapper = (v) => bold(v);
|
|
103
|
+
if (!wrapper && row.status !== "need update") wrapper = (v) => gray(v);
|
|
104
|
+
if (!wrapper && row.status === "need update") wrapper = (v) => v;
|
|
105
|
+
rowLine.push(superCell(row[col], colMaxWidth[j], wrapper));
|
|
106
|
+
j++;
|
|
107
|
+
}
|
|
108
|
+
content.push(rowLine.toString());
|
|
109
|
+
}
|
|
110
|
+
content.push(bottomSeparator(tableWidth));
|
|
111
|
+
return content;
|
|
35
112
|
}
|
|
36
|
-
|
|
37
|
-
|
|
113
|
+
var Line = class {
|
|
114
|
+
content = [];
|
|
115
|
+
push(text) {
|
|
116
|
+
this.content.push(text);
|
|
117
|
+
}
|
|
118
|
+
toString(delimiter = ` ${vertical} `) {
|
|
119
|
+
return `${vertical} ${this.content.join(delimiter)} ${vertical}`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
function header(headerLine, width) {
|
|
123
|
+
return [
|
|
124
|
+
topSeparator(width),
|
|
125
|
+
headerLine.toString(),
|
|
126
|
+
middleSeparator(width)
|
|
127
|
+
];
|
|
38
128
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
129
|
+
function cell(value, maxWidth, wrap) {
|
|
130
|
+
let space = "";
|
|
131
|
+
const pad = maxWidth - value.length;
|
|
132
|
+
if (pad > 0) space = " ".repeat(pad);
|
|
133
|
+
if (wrap) value = wrap(value);
|
|
134
|
+
return `${value} ${space}`;
|
|
44
135
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
136
|
+
function superCell(value, maxWidth, wrap) {
|
|
137
|
+
if (!wrap) switch (value) {
|
|
138
|
+
case "-": return cell(value, maxWidth, (v) => gray(v));
|
|
139
|
+
default: return cell(value, maxWidth, wrap);
|
|
140
|
+
}
|
|
141
|
+
return cell(value, maxWidth, wrap);
|
|
47
142
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
143
|
+
function separator(width, corner) {
|
|
144
|
+
if (!corner) return horizontal.repeat(width);
|
|
145
|
+
return `${corner.left ?? leftTopCorner}${horizontal.repeat(width - 2)}${corner.right ?? rightTopCorner}`;
|
|
50
146
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
147
|
+
function middleSeparator(width) {
|
|
148
|
+
return separator(width, {
|
|
149
|
+
left: leftMiddleCorner,
|
|
150
|
+
right: rightMiddleCorner
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function bottomSeparator(width) {
|
|
154
|
+
return separator(width, {
|
|
155
|
+
left: leftBottomCorner,
|
|
156
|
+
right: rightBottomCorner
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function topSeparator(width) {
|
|
160
|
+
return separator(width, {
|
|
161
|
+
left: leftTopCorner,
|
|
162
|
+
right: rightTopCorner
|
|
163
|
+
});
|
|
54
164
|
}
|
|
55
165
|
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
|
|
168
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
169
|
+
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
170
|
+
const MAX_LENGTH = 256;
|
|
171
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
172
|
+
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
173
|
+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
174
|
+
const RELEASE_TYPES = [
|
|
175
|
+
"major",
|
|
176
|
+
"premajor",
|
|
177
|
+
"minor",
|
|
178
|
+
"preminor",
|
|
179
|
+
"patch",
|
|
180
|
+
"prepatch",
|
|
181
|
+
"prerelease"
|
|
182
|
+
];
|
|
183
|
+
module.exports = {
|
|
184
|
+
MAX_LENGTH,
|
|
185
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
186
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
187
|
+
MAX_SAFE_INTEGER,
|
|
188
|
+
RELEASE_TYPES,
|
|
189
|
+
SEMVER_SPEC_VERSION,
|
|
190
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
191
|
+
FLAG_LOOSE: 2
|
|
192
|
+
};
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js
|
|
197
|
+
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
198
|
+
const debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
199
|
+
module.exports = debug;
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js
|
|
204
|
+
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
205
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
206
|
+
const debug = require_debug();
|
|
207
|
+
exports = module.exports = {};
|
|
208
|
+
const re = exports.re = [];
|
|
209
|
+
const safeRe = exports.safeRe = [];
|
|
210
|
+
const src = exports.src = [];
|
|
211
|
+
const safeSrc = exports.safeSrc = [];
|
|
212
|
+
const t = exports.t = {};
|
|
213
|
+
let R = 0;
|
|
214
|
+
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
215
|
+
const safeRegexReplacements = [
|
|
216
|
+
["\\s", 1],
|
|
217
|
+
["\\d", MAX_LENGTH],
|
|
218
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
219
|
+
];
|
|
220
|
+
const makeSafeRegex = (value) => {
|
|
221
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
222
|
+
return value;
|
|
223
|
+
};
|
|
224
|
+
const createToken = (name, value, isGlobal) => {
|
|
225
|
+
const safe = makeSafeRegex(value);
|
|
226
|
+
const index = R++;
|
|
227
|
+
debug(name, index, value);
|
|
228
|
+
t[name] = index;
|
|
229
|
+
src[index] = value;
|
|
230
|
+
safeSrc[index] = safe;
|
|
231
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
232
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
233
|
+
};
|
|
234
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
235
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
236
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
237
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
238
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
239
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
240
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
241
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
242
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
243
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
244
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
245
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
246
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
247
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
248
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
249
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
250
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
251
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
252
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
253
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
254
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
255
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
256
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
257
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
258
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
259
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
260
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
261
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
262
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
263
|
+
exports.tildeTrimReplace = "$1~";
|
|
264
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
265
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
266
|
+
createToken("LONECARET", "(?:\\^)");
|
|
267
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
268
|
+
exports.caretTrimReplace = "$1^";
|
|
269
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
270
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
271
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
272
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
273
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
274
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
275
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
276
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
277
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
278
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
279
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
280
|
+
}));
|
|
281
|
+
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js
|
|
284
|
+
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
285
|
+
const looseOption = Object.freeze({ loose: true });
|
|
286
|
+
const emptyOpts = Object.freeze({});
|
|
287
|
+
const parseOptions = (options) => {
|
|
288
|
+
if (!options) return emptyOpts;
|
|
289
|
+
if (typeof options !== "object") return looseOption;
|
|
290
|
+
return options;
|
|
291
|
+
};
|
|
292
|
+
module.exports = parseOptions;
|
|
293
|
+
}));
|
|
294
|
+
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js
|
|
297
|
+
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
298
|
+
const numeric = /^[0-9]+$/;
|
|
299
|
+
const compareIdentifiers = (a, b) => {
|
|
300
|
+
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
301
|
+
const anum = numeric.test(a);
|
|
302
|
+
const bnum = numeric.test(b);
|
|
303
|
+
if (anum && bnum) {
|
|
304
|
+
a = +a;
|
|
305
|
+
b = +b;
|
|
306
|
+
}
|
|
307
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
308
|
+
};
|
|
309
|
+
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
310
|
+
module.exports = {
|
|
311
|
+
compareIdentifiers,
|
|
312
|
+
rcompareIdentifiers
|
|
313
|
+
};
|
|
314
|
+
}));
|
|
315
|
+
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js
|
|
318
|
+
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
319
|
+
const debug = require_debug();
|
|
320
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
321
|
+
const { safeRe: re, t } = require_re();
|
|
322
|
+
const parseOptions = require_parse_options();
|
|
323
|
+
const { compareIdentifiers } = require_identifiers();
|
|
324
|
+
var SemVer = class SemVer {
|
|
325
|
+
constructor(version, options) {
|
|
326
|
+
options = parseOptions(options);
|
|
327
|
+
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
328
|
+
else version = version.version;
|
|
329
|
+
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
330
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
331
|
+
debug("SemVer", version, options);
|
|
332
|
+
this.options = options;
|
|
333
|
+
this.loose = !!options.loose;
|
|
334
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
335
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
336
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
337
|
+
this.raw = version;
|
|
338
|
+
this.major = +m[1];
|
|
339
|
+
this.minor = +m[2];
|
|
340
|
+
this.patch = +m[3];
|
|
341
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
342
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
343
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
344
|
+
if (!m[4]) this.prerelease = [];
|
|
345
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
346
|
+
if (/^[0-9]+$/.test(id)) {
|
|
347
|
+
const num = +id;
|
|
348
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
349
|
+
}
|
|
350
|
+
return id;
|
|
351
|
+
});
|
|
352
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
353
|
+
this.format();
|
|
354
|
+
}
|
|
355
|
+
format() {
|
|
356
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
357
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
358
|
+
return this.version;
|
|
359
|
+
}
|
|
360
|
+
toString() {
|
|
361
|
+
return this.version;
|
|
362
|
+
}
|
|
363
|
+
compare(other) {
|
|
364
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
365
|
+
if (!(other instanceof SemVer)) {
|
|
366
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
367
|
+
other = new SemVer(other, this.options);
|
|
368
|
+
}
|
|
369
|
+
if (other.version === this.version) return 0;
|
|
370
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
371
|
+
}
|
|
372
|
+
compareMain(other) {
|
|
373
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
374
|
+
if (this.major < other.major) return -1;
|
|
375
|
+
if (this.major > other.major) return 1;
|
|
376
|
+
if (this.minor < other.minor) return -1;
|
|
377
|
+
if (this.minor > other.minor) return 1;
|
|
378
|
+
if (this.patch < other.patch) return -1;
|
|
379
|
+
if (this.patch > other.patch) return 1;
|
|
380
|
+
return 0;
|
|
381
|
+
}
|
|
382
|
+
comparePre(other) {
|
|
383
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
384
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
385
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
386
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
387
|
+
let i = 0;
|
|
388
|
+
do {
|
|
389
|
+
const a = this.prerelease[i];
|
|
390
|
+
const b = other.prerelease[i];
|
|
391
|
+
debug("prerelease compare", i, a, b);
|
|
392
|
+
if (a === void 0 && b === void 0) return 0;
|
|
393
|
+
else if (b === void 0) return 1;
|
|
394
|
+
else if (a === void 0) return -1;
|
|
395
|
+
else if (a === b) continue;
|
|
396
|
+
else return compareIdentifiers(a, b);
|
|
397
|
+
} while (++i);
|
|
398
|
+
}
|
|
399
|
+
compareBuild(other) {
|
|
400
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
401
|
+
let i = 0;
|
|
402
|
+
do {
|
|
403
|
+
const a = this.build[i];
|
|
404
|
+
const b = other.build[i];
|
|
405
|
+
debug("build compare", i, a, b);
|
|
406
|
+
if (a === void 0 && b === void 0) return 0;
|
|
407
|
+
else if (b === void 0) return 1;
|
|
408
|
+
else if (a === void 0) return -1;
|
|
409
|
+
else if (a === b) continue;
|
|
410
|
+
else return compareIdentifiers(a, b);
|
|
411
|
+
} while (++i);
|
|
412
|
+
}
|
|
413
|
+
inc(release, identifier, identifierBase) {
|
|
414
|
+
if (release.startsWith("pre")) {
|
|
415
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
416
|
+
if (identifier) {
|
|
417
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
418
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
switch (release) {
|
|
422
|
+
case "premajor":
|
|
423
|
+
this.prerelease.length = 0;
|
|
424
|
+
this.patch = 0;
|
|
425
|
+
this.minor = 0;
|
|
426
|
+
this.major++;
|
|
427
|
+
this.inc("pre", identifier, identifierBase);
|
|
428
|
+
break;
|
|
429
|
+
case "preminor":
|
|
430
|
+
this.prerelease.length = 0;
|
|
431
|
+
this.patch = 0;
|
|
432
|
+
this.minor++;
|
|
433
|
+
this.inc("pre", identifier, identifierBase);
|
|
434
|
+
break;
|
|
435
|
+
case "prepatch":
|
|
436
|
+
this.prerelease.length = 0;
|
|
437
|
+
this.inc("patch", identifier, identifierBase);
|
|
438
|
+
this.inc("pre", identifier, identifierBase);
|
|
439
|
+
break;
|
|
440
|
+
case "prerelease":
|
|
441
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
442
|
+
this.inc("pre", identifier, identifierBase);
|
|
443
|
+
break;
|
|
444
|
+
case "release":
|
|
445
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
446
|
+
this.prerelease.length = 0;
|
|
447
|
+
break;
|
|
448
|
+
case "major":
|
|
449
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
450
|
+
this.minor = 0;
|
|
451
|
+
this.patch = 0;
|
|
452
|
+
this.prerelease = [];
|
|
453
|
+
break;
|
|
454
|
+
case "minor":
|
|
455
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
456
|
+
this.patch = 0;
|
|
457
|
+
this.prerelease = [];
|
|
458
|
+
break;
|
|
459
|
+
case "patch":
|
|
460
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
461
|
+
this.prerelease = [];
|
|
462
|
+
break;
|
|
463
|
+
case "pre": {
|
|
464
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
465
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
466
|
+
else {
|
|
467
|
+
let i = this.prerelease.length;
|
|
468
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
469
|
+
this.prerelease[i]++;
|
|
470
|
+
i = -2;
|
|
471
|
+
}
|
|
472
|
+
if (i === -1) {
|
|
473
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
474
|
+
this.prerelease.push(base);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (identifier) {
|
|
478
|
+
let prerelease = [identifier, base];
|
|
479
|
+
if (identifierBase === false) prerelease = [identifier];
|
|
480
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
481
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
482
|
+
} else this.prerelease = prerelease;
|
|
483
|
+
}
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
default: throw new Error(`invalid increment argument: ${release}`);
|
|
487
|
+
}
|
|
488
|
+
this.raw = this.format();
|
|
489
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
490
|
+
return this;
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
module.exports = SemVer;
|
|
494
|
+
}));
|
|
495
|
+
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
|
|
498
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
499
|
+
const SemVer = require_semver$1();
|
|
500
|
+
const parse = (version, options, throwErrors = false) => {
|
|
501
|
+
if (version instanceof SemVer) return version;
|
|
502
|
+
try {
|
|
503
|
+
return new SemVer(version, options);
|
|
504
|
+
} catch (er) {
|
|
505
|
+
if (!throwErrors) return null;
|
|
506
|
+
throw er;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
module.exports = parse;
|
|
510
|
+
}));
|
|
511
|
+
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
|
|
514
|
+
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
515
|
+
const parse = require_parse();
|
|
516
|
+
const valid = (version, options) => {
|
|
517
|
+
const v = parse(version, options);
|
|
518
|
+
return v ? v.version : null;
|
|
519
|
+
};
|
|
520
|
+
module.exports = valid;
|
|
521
|
+
}));
|
|
522
|
+
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
|
|
525
|
+
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
526
|
+
const parse = require_parse();
|
|
527
|
+
const clean = (version, options) => {
|
|
528
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
529
|
+
return s ? s.version : null;
|
|
530
|
+
};
|
|
531
|
+
module.exports = clean;
|
|
532
|
+
}));
|
|
533
|
+
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
|
|
536
|
+
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
537
|
+
const SemVer = require_semver$1();
|
|
538
|
+
const inc = (version, release, options, identifier, identifierBase) => {
|
|
539
|
+
if (typeof options === "string") {
|
|
540
|
+
identifierBase = identifier;
|
|
541
|
+
identifier = options;
|
|
542
|
+
options = void 0;
|
|
543
|
+
}
|
|
544
|
+
try {
|
|
545
|
+
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
546
|
+
} catch (er) {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
module.exports = inc;
|
|
551
|
+
}));
|
|
552
|
+
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
|
|
555
|
+
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
556
|
+
const parse = require_parse();
|
|
557
|
+
const diff = (version1, version2) => {
|
|
558
|
+
const v1 = parse(version1, null, true);
|
|
559
|
+
const v2 = parse(version2, null, true);
|
|
560
|
+
const comparison = v1.compare(v2);
|
|
561
|
+
if (comparison === 0) return null;
|
|
562
|
+
const v1Higher = comparison > 0;
|
|
563
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
564
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
565
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
566
|
+
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
567
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
568
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
569
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
570
|
+
return "patch";
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const prefix = highHasPre ? "pre" : "";
|
|
574
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
575
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
576
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
577
|
+
return "prerelease";
|
|
578
|
+
};
|
|
579
|
+
module.exports = diff;
|
|
580
|
+
}));
|
|
581
|
+
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
|
|
584
|
+
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
585
|
+
const SemVer = require_semver$1();
|
|
586
|
+
const major = (a, loose) => new SemVer(a, loose).major;
|
|
587
|
+
module.exports = major;
|
|
588
|
+
}));
|
|
589
|
+
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
|
|
592
|
+
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
593
|
+
const SemVer = require_semver$1();
|
|
594
|
+
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
595
|
+
module.exports = minor;
|
|
596
|
+
}));
|
|
597
|
+
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
|
|
600
|
+
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
601
|
+
const SemVer = require_semver$1();
|
|
602
|
+
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
603
|
+
module.exports = patch;
|
|
604
|
+
}));
|
|
605
|
+
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
|
|
608
|
+
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
609
|
+
const parse = require_parse();
|
|
610
|
+
const prerelease = (version, options) => {
|
|
611
|
+
const parsed = parse(version, options);
|
|
612
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
613
|
+
};
|
|
614
|
+
module.exports = prerelease;
|
|
615
|
+
}));
|
|
616
|
+
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
|
|
619
|
+
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
620
|
+
const SemVer = require_semver$1();
|
|
621
|
+
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
622
|
+
module.exports = compare;
|
|
623
|
+
}));
|
|
624
|
+
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
|
|
627
|
+
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
628
|
+
const compare = require_compare();
|
|
629
|
+
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
630
|
+
module.exports = rcompare;
|
|
631
|
+
}));
|
|
632
|
+
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
|
|
635
|
+
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
636
|
+
const compare = require_compare();
|
|
637
|
+
const compareLoose = (a, b) => compare(a, b, true);
|
|
638
|
+
module.exports = compareLoose;
|
|
639
|
+
}));
|
|
640
|
+
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
|
|
643
|
+
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
644
|
+
const SemVer = require_semver$1();
|
|
645
|
+
const compareBuild = (a, b, loose) => {
|
|
646
|
+
const versionA = new SemVer(a, loose);
|
|
647
|
+
const versionB = new SemVer(b, loose);
|
|
648
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
649
|
+
};
|
|
650
|
+
module.exports = compareBuild;
|
|
651
|
+
}));
|
|
652
|
+
|
|
653
|
+
//#endregion
|
|
654
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
|
|
655
|
+
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
656
|
+
const compareBuild = require_compare_build();
|
|
657
|
+
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
658
|
+
module.exports = sort;
|
|
659
|
+
}));
|
|
660
|
+
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
|
|
663
|
+
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
664
|
+
const compareBuild = require_compare_build();
|
|
665
|
+
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
666
|
+
module.exports = rsort;
|
|
667
|
+
}));
|
|
668
|
+
|
|
669
|
+
//#endregion
|
|
670
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
|
|
671
|
+
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
672
|
+
const compare = require_compare();
|
|
673
|
+
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
674
|
+
module.exports = gt;
|
|
675
|
+
}));
|
|
676
|
+
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
|
|
679
|
+
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
680
|
+
const compare = require_compare();
|
|
681
|
+
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
682
|
+
module.exports = lt;
|
|
683
|
+
}));
|
|
684
|
+
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
|
|
687
|
+
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
688
|
+
const compare = require_compare();
|
|
689
|
+
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
690
|
+
module.exports = eq;
|
|
691
|
+
}));
|
|
692
|
+
|
|
693
|
+
//#endregion
|
|
694
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
|
|
695
|
+
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
696
|
+
const compare = require_compare();
|
|
697
|
+
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
698
|
+
module.exports = neq;
|
|
699
|
+
}));
|
|
700
|
+
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
|
|
703
|
+
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
704
|
+
const compare = require_compare();
|
|
705
|
+
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
706
|
+
module.exports = gte;
|
|
707
|
+
}));
|
|
708
|
+
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
|
|
711
|
+
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
712
|
+
const compare = require_compare();
|
|
713
|
+
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
714
|
+
module.exports = lte;
|
|
715
|
+
}));
|
|
716
|
+
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
|
|
719
|
+
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
720
|
+
const eq = require_eq();
|
|
721
|
+
const neq = require_neq();
|
|
722
|
+
const gt = require_gt();
|
|
723
|
+
const gte = require_gte();
|
|
724
|
+
const lt = require_lt();
|
|
725
|
+
const lte = require_lte();
|
|
726
|
+
const cmp = (a, op, b, loose) => {
|
|
727
|
+
switch (op) {
|
|
728
|
+
case "===":
|
|
729
|
+
if (typeof a === "object") a = a.version;
|
|
730
|
+
if (typeof b === "object") b = b.version;
|
|
731
|
+
return a === b;
|
|
732
|
+
case "!==":
|
|
733
|
+
if (typeof a === "object") a = a.version;
|
|
734
|
+
if (typeof b === "object") b = b.version;
|
|
735
|
+
return a !== b;
|
|
736
|
+
case "":
|
|
737
|
+
case "=":
|
|
738
|
+
case "==": return eq(a, b, loose);
|
|
739
|
+
case "!=": return neq(a, b, loose);
|
|
740
|
+
case ">": return gt(a, b, loose);
|
|
741
|
+
case ">=": return gte(a, b, loose);
|
|
742
|
+
case "<": return lt(a, b, loose);
|
|
743
|
+
case "<=": return lte(a, b, loose);
|
|
744
|
+
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
module.exports = cmp;
|
|
748
|
+
}));
|
|
749
|
+
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
|
|
752
|
+
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
753
|
+
const SemVer = require_semver$1();
|
|
754
|
+
const parse = require_parse();
|
|
755
|
+
const { safeRe: re, t } = require_re();
|
|
756
|
+
const coerce = (version, options) => {
|
|
757
|
+
if (version instanceof SemVer) return version;
|
|
758
|
+
if (typeof version === "number") version = String(version);
|
|
759
|
+
if (typeof version !== "string") return null;
|
|
760
|
+
options = options || {};
|
|
761
|
+
let match = null;
|
|
762
|
+
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
763
|
+
else {
|
|
764
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
765
|
+
let next;
|
|
766
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
767
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
768
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
769
|
+
}
|
|
770
|
+
coerceRtlRegex.lastIndex = -1;
|
|
771
|
+
}
|
|
772
|
+
if (match === null) return null;
|
|
773
|
+
const major = match[2];
|
|
774
|
+
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
775
|
+
};
|
|
776
|
+
module.exports = coerce;
|
|
777
|
+
}));
|
|
778
|
+
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
|
|
781
|
+
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
782
|
+
var LRUCache = class {
|
|
783
|
+
constructor() {
|
|
784
|
+
this.max = 1e3;
|
|
785
|
+
this.map = /* @__PURE__ */ new Map();
|
|
786
|
+
}
|
|
787
|
+
get(key) {
|
|
788
|
+
const value = this.map.get(key);
|
|
789
|
+
if (value === void 0) return;
|
|
790
|
+
else {
|
|
791
|
+
this.map.delete(key);
|
|
792
|
+
this.map.set(key, value);
|
|
793
|
+
return value;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
delete(key) {
|
|
797
|
+
return this.map.delete(key);
|
|
798
|
+
}
|
|
799
|
+
set(key, value) {
|
|
800
|
+
if (!this.delete(key) && value !== void 0) {
|
|
801
|
+
if (this.map.size >= this.max) {
|
|
802
|
+
const firstKey = this.map.keys().next().value;
|
|
803
|
+
this.delete(firstKey);
|
|
804
|
+
}
|
|
805
|
+
this.map.set(key, value);
|
|
806
|
+
}
|
|
807
|
+
return this;
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
module.exports = LRUCache;
|
|
811
|
+
}));
|
|
812
|
+
|
|
813
|
+
//#endregion
|
|
814
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
|
|
815
|
+
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
816
|
+
const SPACE_CHARACTERS = /\s+/g;
|
|
817
|
+
var Range = class Range {
|
|
818
|
+
constructor(range, options) {
|
|
819
|
+
options = parseOptions(options);
|
|
820
|
+
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
821
|
+
else return new Range(range.raw, options);
|
|
822
|
+
if (range instanceof Comparator) {
|
|
823
|
+
this.raw = range.value;
|
|
824
|
+
this.set = [[range]];
|
|
825
|
+
this.formatted = void 0;
|
|
826
|
+
return this;
|
|
827
|
+
}
|
|
828
|
+
this.options = options;
|
|
829
|
+
this.loose = !!options.loose;
|
|
830
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
831
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
832
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
833
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
834
|
+
if (this.set.length > 1) {
|
|
835
|
+
const first = this.set[0];
|
|
836
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
837
|
+
if (this.set.length === 0) this.set = [first];
|
|
838
|
+
else if (this.set.length > 1) {
|
|
839
|
+
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
840
|
+
this.set = [c];
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
this.formatted = void 0;
|
|
846
|
+
}
|
|
847
|
+
get range() {
|
|
848
|
+
if (this.formatted === void 0) {
|
|
849
|
+
this.formatted = "";
|
|
850
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
851
|
+
if (i > 0) this.formatted += "||";
|
|
852
|
+
const comps = this.set[i];
|
|
853
|
+
for (let k = 0; k < comps.length; k++) {
|
|
854
|
+
if (k > 0) this.formatted += " ";
|
|
855
|
+
this.formatted += comps[k].toString().trim();
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return this.formatted;
|
|
860
|
+
}
|
|
861
|
+
format() {
|
|
862
|
+
return this.range;
|
|
863
|
+
}
|
|
864
|
+
toString() {
|
|
865
|
+
return this.range;
|
|
866
|
+
}
|
|
867
|
+
parseRange(range) {
|
|
868
|
+
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
869
|
+
const cached = cache.get(memoKey);
|
|
870
|
+
if (cached) return cached;
|
|
871
|
+
const loose = this.options.loose;
|
|
872
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
873
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
874
|
+
debug("hyphen replace", range);
|
|
875
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
876
|
+
debug("comparator trim", range);
|
|
877
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
878
|
+
debug("tilde trim", range);
|
|
879
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
880
|
+
debug("caret trim", range);
|
|
881
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
882
|
+
if (loose) rangeList = rangeList.filter((comp) => {
|
|
883
|
+
debug("loose invalid filter", comp, this.options);
|
|
884
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
885
|
+
});
|
|
886
|
+
debug("range list", rangeList);
|
|
887
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
888
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
889
|
+
for (const comp of comparators) {
|
|
890
|
+
if (isNullSet(comp)) return [comp];
|
|
891
|
+
rangeMap.set(comp.value, comp);
|
|
892
|
+
}
|
|
893
|
+
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
894
|
+
const result = [...rangeMap.values()];
|
|
895
|
+
cache.set(memoKey, result);
|
|
896
|
+
return result;
|
|
897
|
+
}
|
|
898
|
+
intersects(range, options) {
|
|
899
|
+
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
900
|
+
return this.set.some((thisComparators) => {
|
|
901
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
902
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
903
|
+
return rangeComparators.every((rangeComparator) => {
|
|
904
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
test(version) {
|
|
911
|
+
if (!version) return false;
|
|
912
|
+
if (typeof version === "string") try {
|
|
913
|
+
version = new SemVer(version, this.options);
|
|
914
|
+
} catch (er) {
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
918
|
+
return false;
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
module.exports = Range;
|
|
922
|
+
const cache = new (require_lrucache())();
|
|
923
|
+
const parseOptions = require_parse_options();
|
|
924
|
+
const Comparator = require_comparator();
|
|
925
|
+
const debug = require_debug();
|
|
926
|
+
const SemVer = require_semver$1();
|
|
927
|
+
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
928
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
929
|
+
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
930
|
+
const isAny = (c) => c.value === "";
|
|
931
|
+
const isSatisfiable = (comparators, options) => {
|
|
932
|
+
let result = true;
|
|
933
|
+
const remainingComparators = comparators.slice();
|
|
934
|
+
let testComparator = remainingComparators.pop();
|
|
935
|
+
while (result && remainingComparators.length) {
|
|
936
|
+
result = remainingComparators.every((otherComparator) => {
|
|
937
|
+
return testComparator.intersects(otherComparator, options);
|
|
938
|
+
});
|
|
939
|
+
testComparator = remainingComparators.pop();
|
|
940
|
+
}
|
|
941
|
+
return result;
|
|
942
|
+
};
|
|
943
|
+
const parseComparator = (comp, options) => {
|
|
944
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
945
|
+
debug("comp", comp, options);
|
|
946
|
+
comp = replaceCarets(comp, options);
|
|
947
|
+
debug("caret", comp);
|
|
948
|
+
comp = replaceTildes(comp, options);
|
|
949
|
+
debug("tildes", comp);
|
|
950
|
+
comp = replaceXRanges(comp, options);
|
|
951
|
+
debug("xrange", comp);
|
|
952
|
+
comp = replaceStars(comp, options);
|
|
953
|
+
debug("stars", comp);
|
|
954
|
+
return comp;
|
|
955
|
+
};
|
|
956
|
+
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
957
|
+
const replaceTildes = (comp, options) => {
|
|
958
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
959
|
+
};
|
|
960
|
+
const replaceTilde = (comp, options) => {
|
|
961
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
962
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
963
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
964
|
+
let ret;
|
|
965
|
+
if (isX(M)) ret = "";
|
|
966
|
+
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
967
|
+
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
968
|
+
else if (pr) {
|
|
969
|
+
debug("replaceTilde pr", pr);
|
|
970
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
971
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
972
|
+
debug("tilde return", ret);
|
|
973
|
+
return ret;
|
|
974
|
+
});
|
|
975
|
+
};
|
|
976
|
+
const replaceCarets = (comp, options) => {
|
|
977
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
978
|
+
};
|
|
979
|
+
const replaceCaret = (comp, options) => {
|
|
980
|
+
debug("caret", comp, options);
|
|
981
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
982
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
983
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
984
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
985
|
+
let ret;
|
|
986
|
+
if (isX(M)) ret = "";
|
|
987
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
988
|
+
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
989
|
+
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
990
|
+
else if (pr) {
|
|
991
|
+
debug("replaceCaret pr", pr);
|
|
992
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
993
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
994
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
995
|
+
} else {
|
|
996
|
+
debug("no pr");
|
|
997
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
998
|
+
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
999
|
+
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1000
|
+
}
|
|
1001
|
+
debug("caret return", ret);
|
|
1002
|
+
return ret;
|
|
1003
|
+
});
|
|
1004
|
+
};
|
|
1005
|
+
const replaceXRanges = (comp, options) => {
|
|
1006
|
+
debug("replaceXRanges", comp, options);
|
|
1007
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1008
|
+
};
|
|
1009
|
+
const replaceXRange = (comp, options) => {
|
|
1010
|
+
comp = comp.trim();
|
|
1011
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1012
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1013
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1014
|
+
const xM = isX(M);
|
|
1015
|
+
const xm = xM || isX(m);
|
|
1016
|
+
const xp = xm || isX(p);
|
|
1017
|
+
const anyX = xp;
|
|
1018
|
+
if (gtlt === "=" && anyX) gtlt = "";
|
|
1019
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1020
|
+
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
1021
|
+
else ret = "*";
|
|
1022
|
+
else if (gtlt && anyX) {
|
|
1023
|
+
if (xm) m = 0;
|
|
1024
|
+
p = 0;
|
|
1025
|
+
if (gtlt === ">") {
|
|
1026
|
+
gtlt = ">=";
|
|
1027
|
+
if (xm) {
|
|
1028
|
+
M = +M + 1;
|
|
1029
|
+
m = 0;
|
|
1030
|
+
p = 0;
|
|
1031
|
+
} else {
|
|
1032
|
+
m = +m + 1;
|
|
1033
|
+
p = 0;
|
|
1034
|
+
}
|
|
1035
|
+
} else if (gtlt === "<=") {
|
|
1036
|
+
gtlt = "<";
|
|
1037
|
+
if (xm) M = +M + 1;
|
|
1038
|
+
else m = +m + 1;
|
|
1039
|
+
}
|
|
1040
|
+
if (gtlt === "<") pr = "-0";
|
|
1041
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1042
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1043
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1044
|
+
debug("xRange return", ret);
|
|
1045
|
+
return ret;
|
|
1046
|
+
});
|
|
1047
|
+
};
|
|
1048
|
+
const replaceStars = (comp, options) => {
|
|
1049
|
+
debug("replaceStars", comp, options);
|
|
1050
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1051
|
+
};
|
|
1052
|
+
const replaceGTE0 = (comp, options) => {
|
|
1053
|
+
debug("replaceGTE0", comp, options);
|
|
1054
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1055
|
+
};
|
|
1056
|
+
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1057
|
+
if (isX(fM)) from = "";
|
|
1058
|
+
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1059
|
+
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1060
|
+
else if (fpr) from = `>=${from}`;
|
|
1061
|
+
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1062
|
+
if (isX(tM)) to = "";
|
|
1063
|
+
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
1064
|
+
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
1065
|
+
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1066
|
+
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1067
|
+
else to = `<=${to}`;
|
|
1068
|
+
return `${from} ${to}`.trim();
|
|
1069
|
+
};
|
|
1070
|
+
const testSet = (set, version, options) => {
|
|
1071
|
+
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
1072
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1073
|
+
for (let i = 0; i < set.length; i++) {
|
|
1074
|
+
debug(set[i].semver);
|
|
1075
|
+
if (set[i].semver === Comparator.ANY) continue;
|
|
1076
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1077
|
+
const allowed = set[i].semver;
|
|
1078
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
return false;
|
|
1082
|
+
}
|
|
1083
|
+
return true;
|
|
1084
|
+
};
|
|
1085
|
+
}));
|
|
1086
|
+
|
|
1087
|
+
//#endregion
|
|
1088
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
|
|
1089
|
+
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1090
|
+
const ANY = Symbol("SemVer ANY");
|
|
1091
|
+
var Comparator = class Comparator {
|
|
1092
|
+
static get ANY() {
|
|
1093
|
+
return ANY;
|
|
1094
|
+
}
|
|
1095
|
+
constructor(comp, options) {
|
|
1096
|
+
options = parseOptions(options);
|
|
1097
|
+
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
1098
|
+
else comp = comp.value;
|
|
1099
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1100
|
+
debug("comparator", comp, options);
|
|
1101
|
+
this.options = options;
|
|
1102
|
+
this.loose = !!options.loose;
|
|
1103
|
+
this.parse(comp);
|
|
1104
|
+
if (this.semver === ANY) this.value = "";
|
|
1105
|
+
else this.value = this.operator + this.semver.version;
|
|
1106
|
+
debug("comp", this);
|
|
1107
|
+
}
|
|
1108
|
+
parse(comp) {
|
|
1109
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1110
|
+
const m = comp.match(r);
|
|
1111
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1112
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1113
|
+
if (this.operator === "=") this.operator = "";
|
|
1114
|
+
if (!m[2]) this.semver = ANY;
|
|
1115
|
+
else this.semver = new SemVer(m[2], this.options.loose);
|
|
1116
|
+
}
|
|
1117
|
+
toString() {
|
|
1118
|
+
return this.value;
|
|
1119
|
+
}
|
|
1120
|
+
test(version) {
|
|
1121
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1122
|
+
if (this.semver === ANY || version === ANY) return true;
|
|
1123
|
+
if (typeof version === "string") try {
|
|
1124
|
+
version = new SemVer(version, this.options);
|
|
1125
|
+
} catch (er) {
|
|
1126
|
+
return false;
|
|
1127
|
+
}
|
|
1128
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1129
|
+
}
|
|
1130
|
+
intersects(comp, options) {
|
|
1131
|
+
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
1132
|
+
if (this.operator === "") {
|
|
1133
|
+
if (this.value === "") return true;
|
|
1134
|
+
return new Range(comp.value, options).test(this.value);
|
|
1135
|
+
} else if (comp.operator === "") {
|
|
1136
|
+
if (comp.value === "") return true;
|
|
1137
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1138
|
+
}
|
|
1139
|
+
options = parseOptions(options);
|
|
1140
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1141
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1142
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1143
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1144
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1145
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1146
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1147
|
+
return false;
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
module.exports = Comparator;
|
|
1151
|
+
const parseOptions = require_parse_options();
|
|
1152
|
+
const { safeRe: re, t } = require_re();
|
|
1153
|
+
const cmp = require_cmp();
|
|
1154
|
+
const debug = require_debug();
|
|
1155
|
+
const SemVer = require_semver$1();
|
|
1156
|
+
const Range = require_range();
|
|
1157
|
+
}));
|
|
1158
|
+
|
|
1159
|
+
//#endregion
|
|
1160
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
|
|
1161
|
+
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1162
|
+
const Range = require_range();
|
|
1163
|
+
const satisfies = (version, range, options) => {
|
|
1164
|
+
try {
|
|
1165
|
+
range = new Range(range, options);
|
|
1166
|
+
} catch (er) {
|
|
1167
|
+
return false;
|
|
1168
|
+
}
|
|
1169
|
+
return range.test(version);
|
|
1170
|
+
};
|
|
1171
|
+
module.exports = satisfies;
|
|
1172
|
+
}));
|
|
1173
|
+
|
|
1174
|
+
//#endregion
|
|
1175
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
|
|
1176
|
+
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1177
|
+
const Range = require_range();
|
|
1178
|
+
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1179
|
+
module.exports = toComparators;
|
|
1180
|
+
}));
|
|
1181
|
+
|
|
1182
|
+
//#endregion
|
|
1183
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
|
|
1184
|
+
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1185
|
+
const SemVer = require_semver$1();
|
|
1186
|
+
const Range = require_range();
|
|
1187
|
+
const maxSatisfying = (versions, range, options) => {
|
|
1188
|
+
let max = null;
|
|
1189
|
+
let maxSV = null;
|
|
1190
|
+
let rangeObj = null;
|
|
1191
|
+
try {
|
|
1192
|
+
rangeObj = new Range(range, options);
|
|
1193
|
+
} catch (er) {
|
|
1194
|
+
return null;
|
|
1195
|
+
}
|
|
1196
|
+
versions.forEach((v) => {
|
|
1197
|
+
if (rangeObj.test(v)) {
|
|
1198
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1199
|
+
max = v;
|
|
1200
|
+
maxSV = new SemVer(max, options);
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
return max;
|
|
1205
|
+
};
|
|
1206
|
+
module.exports = maxSatisfying;
|
|
1207
|
+
}));
|
|
1208
|
+
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
|
|
1211
|
+
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1212
|
+
const SemVer = require_semver$1();
|
|
1213
|
+
const Range = require_range();
|
|
1214
|
+
const minSatisfying = (versions, range, options) => {
|
|
1215
|
+
let min = null;
|
|
1216
|
+
let minSV = null;
|
|
1217
|
+
let rangeObj = null;
|
|
1218
|
+
try {
|
|
1219
|
+
rangeObj = new Range(range, options);
|
|
1220
|
+
} catch (er) {
|
|
1221
|
+
return null;
|
|
1222
|
+
}
|
|
1223
|
+
versions.forEach((v) => {
|
|
1224
|
+
if (rangeObj.test(v)) {
|
|
1225
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1226
|
+
min = v;
|
|
1227
|
+
minSV = new SemVer(min, options);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
return min;
|
|
1232
|
+
};
|
|
1233
|
+
module.exports = minSatisfying;
|
|
1234
|
+
}));
|
|
1235
|
+
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
|
|
1238
|
+
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1239
|
+
const SemVer = require_semver$1();
|
|
1240
|
+
const Range = require_range();
|
|
1241
|
+
const gt = require_gt();
|
|
1242
|
+
const minVersion = (range, loose) => {
|
|
1243
|
+
range = new Range(range, loose);
|
|
1244
|
+
let minver = new SemVer("0.0.0");
|
|
1245
|
+
if (range.test(minver)) return minver;
|
|
1246
|
+
minver = new SemVer("0.0.0-0");
|
|
1247
|
+
if (range.test(minver)) return minver;
|
|
1248
|
+
minver = null;
|
|
1249
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1250
|
+
const comparators = range.set[i];
|
|
1251
|
+
let setMin = null;
|
|
1252
|
+
comparators.forEach((comparator) => {
|
|
1253
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1254
|
+
switch (comparator.operator) {
|
|
1255
|
+
case ">":
|
|
1256
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
1257
|
+
else compver.prerelease.push(0);
|
|
1258
|
+
compver.raw = compver.format();
|
|
1259
|
+
case "":
|
|
1260
|
+
case ">=":
|
|
1261
|
+
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1262
|
+
break;
|
|
1263
|
+
case "<":
|
|
1264
|
+
case "<=": break;
|
|
1265
|
+
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1269
|
+
}
|
|
1270
|
+
if (minver && range.test(minver)) return minver;
|
|
1271
|
+
return null;
|
|
1272
|
+
};
|
|
1273
|
+
module.exports = minVersion;
|
|
1274
|
+
}));
|
|
1275
|
+
|
|
1276
|
+
//#endregion
|
|
1277
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
|
|
1278
|
+
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1279
|
+
const Range = require_range();
|
|
1280
|
+
const validRange = (range, options) => {
|
|
1281
|
+
try {
|
|
1282
|
+
return new Range(range, options).range || "*";
|
|
1283
|
+
} catch (er) {
|
|
1284
|
+
return null;
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1287
|
+
module.exports = validRange;
|
|
1288
|
+
}));
|
|
1289
|
+
|
|
1290
|
+
//#endregion
|
|
1291
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
|
|
1292
|
+
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1293
|
+
const SemVer = require_semver$1();
|
|
1294
|
+
const Comparator = require_comparator();
|
|
1295
|
+
const { ANY } = Comparator;
|
|
1296
|
+
const Range = require_range();
|
|
1297
|
+
const satisfies = require_satisfies();
|
|
1298
|
+
const gt = require_gt();
|
|
1299
|
+
const lt = require_lt();
|
|
1300
|
+
const lte = require_lte();
|
|
1301
|
+
const gte = require_gte();
|
|
1302
|
+
const outside = (version, range, hilo, options) => {
|
|
1303
|
+
version = new SemVer(version, options);
|
|
1304
|
+
range = new Range(range, options);
|
|
1305
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1306
|
+
switch (hilo) {
|
|
1307
|
+
case ">":
|
|
1308
|
+
gtfn = gt;
|
|
1309
|
+
ltefn = lte;
|
|
1310
|
+
ltfn = lt;
|
|
1311
|
+
comp = ">";
|
|
1312
|
+
ecomp = ">=";
|
|
1313
|
+
break;
|
|
1314
|
+
case "<":
|
|
1315
|
+
gtfn = lt;
|
|
1316
|
+
ltefn = gte;
|
|
1317
|
+
ltfn = gt;
|
|
1318
|
+
comp = "<";
|
|
1319
|
+
ecomp = "<=";
|
|
1320
|
+
break;
|
|
1321
|
+
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1322
|
+
}
|
|
1323
|
+
if (satisfies(version, range, options)) return false;
|
|
1324
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1325
|
+
const comparators = range.set[i];
|
|
1326
|
+
let high = null;
|
|
1327
|
+
let low = null;
|
|
1328
|
+
comparators.forEach((comparator) => {
|
|
1329
|
+
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
1330
|
+
high = high || comparator;
|
|
1331
|
+
low = low || comparator;
|
|
1332
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1333
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1334
|
+
});
|
|
1335
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1336
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1337
|
+
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1338
|
+
}
|
|
1339
|
+
return true;
|
|
1340
|
+
};
|
|
1341
|
+
module.exports = outside;
|
|
1342
|
+
}));
|
|
1343
|
+
|
|
1344
|
+
//#endregion
|
|
1345
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
|
|
1346
|
+
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1347
|
+
const outside = require_outside();
|
|
1348
|
+
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1349
|
+
module.exports = gtr;
|
|
1350
|
+
}));
|
|
1351
|
+
|
|
1352
|
+
//#endregion
|
|
1353
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
|
|
1354
|
+
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1355
|
+
const outside = require_outside();
|
|
1356
|
+
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1357
|
+
module.exports = ltr;
|
|
1358
|
+
}));
|
|
1359
|
+
|
|
1360
|
+
//#endregion
|
|
1361
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
|
|
1362
|
+
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1363
|
+
const Range = require_range();
|
|
1364
|
+
const intersects = (r1, r2, options) => {
|
|
1365
|
+
r1 = new Range(r1, options);
|
|
1366
|
+
r2 = new Range(r2, options);
|
|
1367
|
+
return r1.intersects(r2, options);
|
|
1368
|
+
};
|
|
1369
|
+
module.exports = intersects;
|
|
1370
|
+
}));
|
|
1371
|
+
|
|
1372
|
+
//#endregion
|
|
1373
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
|
|
1374
|
+
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1375
|
+
const satisfies = require_satisfies();
|
|
1376
|
+
const compare = require_compare();
|
|
1377
|
+
module.exports = (versions, range, options) => {
|
|
1378
|
+
const set = [];
|
|
1379
|
+
let first = null;
|
|
1380
|
+
let prev = null;
|
|
1381
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1382
|
+
for (const version of v) if (satisfies(version, range, options)) {
|
|
1383
|
+
prev = version;
|
|
1384
|
+
if (!first) first = version;
|
|
1385
|
+
} else {
|
|
1386
|
+
if (prev) set.push([first, prev]);
|
|
1387
|
+
prev = null;
|
|
1388
|
+
first = null;
|
|
1389
|
+
}
|
|
1390
|
+
if (first) set.push([first, null]);
|
|
1391
|
+
const ranges = [];
|
|
1392
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
1393
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
1394
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
1395
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
1396
|
+
else ranges.push(`${min} - ${max}`);
|
|
1397
|
+
const simplified = ranges.join(" || ");
|
|
1398
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1399
|
+
return simplified.length < original.length ? simplified : range;
|
|
1400
|
+
};
|
|
1401
|
+
}));
|
|
1402
|
+
|
|
1403
|
+
//#endregion
|
|
1404
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
|
|
1405
|
+
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1406
|
+
const Range = require_range();
|
|
1407
|
+
const Comparator = require_comparator();
|
|
1408
|
+
const { ANY } = Comparator;
|
|
1409
|
+
const satisfies = require_satisfies();
|
|
1410
|
+
const compare = require_compare();
|
|
1411
|
+
const subset = (sub, dom, options = {}) => {
|
|
1412
|
+
if (sub === dom) return true;
|
|
1413
|
+
sub = new Range(sub, options);
|
|
1414
|
+
dom = new Range(dom, options);
|
|
1415
|
+
let sawNonNull = false;
|
|
1416
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1417
|
+
for (const simpleDom of dom.set) {
|
|
1418
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1419
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1420
|
+
if (isSub) continue OUTER;
|
|
1421
|
+
}
|
|
1422
|
+
if (sawNonNull) return false;
|
|
1423
|
+
}
|
|
1424
|
+
return true;
|
|
1425
|
+
};
|
|
1426
|
+
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1427
|
+
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1428
|
+
const simpleSubset = (sub, dom, options) => {
|
|
1429
|
+
if (sub === dom) return true;
|
|
1430
|
+
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
1431
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
1432
|
+
else sub = minimumVersion;
|
|
1433
|
+
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1434
|
+
else dom = minimumVersion;
|
|
1435
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1436
|
+
let gt, lt;
|
|
1437
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
1438
|
+
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
1439
|
+
else eqSet.add(c.semver);
|
|
1440
|
+
if (eqSet.size > 1) return null;
|
|
1441
|
+
let gtltComp;
|
|
1442
|
+
if (gt && lt) {
|
|
1443
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1444
|
+
if (gtltComp > 0) return null;
|
|
1445
|
+
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
1446
|
+
}
|
|
1447
|
+
for (const eq of eqSet) {
|
|
1448
|
+
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1449
|
+
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1450
|
+
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
1451
|
+
return true;
|
|
1452
|
+
}
|
|
1453
|
+
let higher, lower;
|
|
1454
|
+
let hasDomLT, hasDomGT;
|
|
1455
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1456
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1457
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1458
|
+
for (const c of dom) {
|
|
1459
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1460
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1461
|
+
if (gt) {
|
|
1462
|
+
if (needDomGTPre) {
|
|
1463
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
1464
|
+
}
|
|
1465
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1466
|
+
higher = higherGT(gt, c, options);
|
|
1467
|
+
if (higher === c && higher !== gt) return false;
|
|
1468
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
|
|
1469
|
+
}
|
|
1470
|
+
if (lt) {
|
|
1471
|
+
if (needDomLTPre) {
|
|
1472
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
1473
|
+
}
|
|
1474
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1475
|
+
lower = lowerLT(lt, c, options);
|
|
1476
|
+
if (lower === c && lower !== lt) return false;
|
|
1477
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
|
|
1478
|
+
}
|
|
1479
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1480
|
+
}
|
|
1481
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
1482
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
1483
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
1484
|
+
return true;
|
|
1485
|
+
};
|
|
1486
|
+
const higherGT = (a, b, options) => {
|
|
1487
|
+
if (!a) return b;
|
|
1488
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1489
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1490
|
+
};
|
|
1491
|
+
const lowerLT = (a, b, options) => {
|
|
1492
|
+
if (!a) return b;
|
|
1493
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1494
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1495
|
+
};
|
|
1496
|
+
module.exports = subset;
|
|
1497
|
+
}));
|
|
1498
|
+
|
|
1499
|
+
//#endregion
|
|
1500
|
+
//#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js
|
|
1501
|
+
var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1502
|
+
const internalRe = require_re();
|
|
1503
|
+
const constants = require_constants();
|
|
1504
|
+
const SemVer = require_semver$1();
|
|
1505
|
+
const identifiers = require_identifiers();
|
|
1506
|
+
const parse = require_parse();
|
|
1507
|
+
const valid = require_valid$1();
|
|
1508
|
+
const clean = require_clean();
|
|
1509
|
+
const inc = require_inc();
|
|
1510
|
+
const diff = require_diff();
|
|
1511
|
+
const major = require_major();
|
|
1512
|
+
const minor = require_minor();
|
|
1513
|
+
const patch = require_patch();
|
|
1514
|
+
const prerelease = require_prerelease();
|
|
1515
|
+
const compare = require_compare();
|
|
1516
|
+
const rcompare = require_rcompare();
|
|
1517
|
+
const compareLoose = require_compare_loose();
|
|
1518
|
+
const compareBuild = require_compare_build();
|
|
1519
|
+
const sort = require_sort();
|
|
1520
|
+
const rsort = require_rsort();
|
|
1521
|
+
const gt = require_gt();
|
|
1522
|
+
const lt = require_lt();
|
|
1523
|
+
const eq = require_eq();
|
|
1524
|
+
const neq = require_neq();
|
|
1525
|
+
const gte = require_gte();
|
|
1526
|
+
const lte = require_lte();
|
|
1527
|
+
const cmp = require_cmp();
|
|
1528
|
+
const coerce = require_coerce();
|
|
1529
|
+
const Comparator = require_comparator();
|
|
1530
|
+
const Range = require_range();
|
|
1531
|
+
const satisfies = require_satisfies();
|
|
1532
|
+
const toComparators = require_to_comparators();
|
|
1533
|
+
const maxSatisfying = require_max_satisfying();
|
|
1534
|
+
const minSatisfying = require_min_satisfying();
|
|
1535
|
+
const minVersion = require_min_version();
|
|
1536
|
+
const validRange = require_valid();
|
|
1537
|
+
const outside = require_outside();
|
|
1538
|
+
const gtr = require_gtr();
|
|
1539
|
+
const ltr = require_ltr();
|
|
1540
|
+
const intersects = require_intersects();
|
|
1541
|
+
const simplifyRange = require_simplify();
|
|
1542
|
+
const subset = require_subset();
|
|
1543
|
+
module.exports = {
|
|
1544
|
+
parse,
|
|
1545
|
+
valid,
|
|
1546
|
+
clean,
|
|
1547
|
+
inc,
|
|
1548
|
+
diff,
|
|
1549
|
+
major,
|
|
1550
|
+
minor,
|
|
1551
|
+
patch,
|
|
1552
|
+
prerelease,
|
|
1553
|
+
compare,
|
|
1554
|
+
rcompare,
|
|
1555
|
+
compareLoose,
|
|
1556
|
+
compareBuild,
|
|
1557
|
+
sort,
|
|
1558
|
+
rsort,
|
|
1559
|
+
gt,
|
|
1560
|
+
lt,
|
|
1561
|
+
eq,
|
|
1562
|
+
neq,
|
|
1563
|
+
gte,
|
|
1564
|
+
lte,
|
|
1565
|
+
cmp,
|
|
1566
|
+
coerce,
|
|
1567
|
+
Comparator,
|
|
1568
|
+
Range,
|
|
1569
|
+
satisfies,
|
|
1570
|
+
toComparators,
|
|
1571
|
+
maxSatisfying,
|
|
1572
|
+
minSatisfying,
|
|
1573
|
+
minVersion,
|
|
1574
|
+
validRange,
|
|
1575
|
+
outside,
|
|
1576
|
+
gtr,
|
|
1577
|
+
ltr,
|
|
1578
|
+
intersects,
|
|
1579
|
+
simplifyRange,
|
|
1580
|
+
subset,
|
|
1581
|
+
SemVer,
|
|
1582
|
+
re: internalRe.re,
|
|
1583
|
+
src: internalRe.src,
|
|
1584
|
+
tokens: internalRe.t,
|
|
1585
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1586
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1587
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1588
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1589
|
+
};
|
|
1590
|
+
}));
|
|
1591
|
+
|
|
56
1592
|
//#endregion
|
|
57
1593
|
//#region src/helpers.ts
|
|
1594
|
+
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
58
1595
|
const minute = 6e4;
|
|
59
1596
|
const hour = 60 * minute;
|
|
60
1597
|
const day = 24 * hour;
|
|
1598
|
+
const month = 30 * day;
|
|
61
1599
|
const year = 365 * day;
|
|
62
1600
|
function plural(n, unit) {
|
|
63
1601
|
return `${n} ${unit}${n === 1 ? "" : "s"}`;
|
|
@@ -66,9 +1604,24 @@ function timeAgoFromAge(ts) {
|
|
|
66
1604
|
if (ts < minute) return plural(0, "min");
|
|
67
1605
|
if (ts < hour) return plural(Math.floor(ts / minute), "min");
|
|
68
1606
|
if (ts < day) return plural(Math.floor(ts / hour), "hour");
|
|
69
|
-
if (ts < year)
|
|
1607
|
+
if (ts < year) {
|
|
1608
|
+
if (ts >= month) return plural(Math.floor(ts / month), "month");
|
|
1609
|
+
return plural(Math.floor(ts / day), "day");
|
|
1610
|
+
}
|
|
70
1611
|
return plural(Math.floor(ts / year), "year");
|
|
71
1612
|
}
|
|
1613
|
+
function getBump(current, latest) {
|
|
1614
|
+
if (!import_semver.default.prerelease(current) && import_semver.default.prerelease(latest)) return "prerelease";
|
|
1615
|
+
const c = import_semver.default.coerce(current)?.version;
|
|
1616
|
+
const l = import_semver.default.coerce(latest)?.version;
|
|
1617
|
+
if (!c || !l) return "invalid";
|
|
1618
|
+
const d = import_semver.default.diff(c, l);
|
|
1619
|
+
if (!d) return "none";
|
|
1620
|
+
if (d === "major" || d === "premajor") return "major";
|
|
1621
|
+
if (d === "minor" || d === "preminor") return "minor";
|
|
1622
|
+
if (d === "patch" || d === "prepatch") return "patch";
|
|
1623
|
+
return "prerelease";
|
|
1624
|
+
}
|
|
72
1625
|
|
|
73
1626
|
//#endregion
|
|
74
1627
|
//#region src/cli.ts
|
|
@@ -101,48 +1654,119 @@ function renderDepsTable(rows, refreshInterval = defaultRefreshInterval) {
|
|
|
101
1654
|
const nDeps = rows.filter((x) => x.dep.type === "dep").length;
|
|
102
1655
|
const nDevDeps = rows.filter((x) => x.dep.type === "devDep").length;
|
|
103
1656
|
const fn = (r) => {
|
|
1657
|
+
if (r.status === "error") console.error(`Failed to fetch ${r.dep.name}`);
|
|
1658
|
+
let age = r.dep.versionValid ? "-" : "invalid version";
|
|
1659
|
+
if (!r.dep.localDep && r.dep.versionValid) age = r.dep.versionAge ? timeAgoFromAge(r.dep.versionAge) : spinner(refreshInterval);
|
|
1660
|
+
let latestAge = r.dep.localDep ? "-" : spinner(refreshInterval);
|
|
1661
|
+
if (!r.dep.localDep && r.dep.latestVersionAge) latestAge = timeAgoFromAge(r.dep.latestVersionAge);
|
|
1662
|
+
const status = r.status === "pending" ? spinner(refreshInterval) : r.status === "done" && r.needUpdate ? "need update" : "ok";
|
|
1663
|
+
const change = r.needUpdate ? getBump(r.dep.version, r.dep.latestVersion ?? "") : "-";
|
|
104
1664
|
return {
|
|
105
1665
|
package: r.dep.name,
|
|
106
1666
|
current: r.dep.version,
|
|
107
|
-
age
|
|
1667
|
+
age,
|
|
108
1668
|
latest: r.dep.latestVersion ?? spinner(refreshInterval),
|
|
109
|
-
latestAge
|
|
110
|
-
status
|
|
1669
|
+
latestAge,
|
|
1670
|
+
status,
|
|
1671
|
+
change
|
|
111
1672
|
};
|
|
112
1673
|
};
|
|
113
1674
|
if (nDeps > 0) {
|
|
114
1675
|
console.log(`${nDeps} Dependencies`);
|
|
115
|
-
|
|
1676
|
+
renderTable(rows.filter((x) => x.dep.type === "dep").map((r) => fn(r)));
|
|
116
1677
|
}
|
|
117
1678
|
if (nDevDeps > 0) {
|
|
1679
|
+
if (nDeps > 0) console.log("");
|
|
118
1680
|
console.log(`${nDevDeps} Dev Dependencies`);
|
|
119
|
-
|
|
1681
|
+
renderTable(rows.filter((x) => x.dep.type === "devDep").map((r) => fn(r)));
|
|
120
1682
|
}
|
|
121
1683
|
}
|
|
122
1684
|
|
|
1685
|
+
//#endregion
|
|
1686
|
+
//#region src/npm.ts
|
|
1687
|
+
function getPackageJson(packageJsonPath) {
|
|
1688
|
+
const packageJsonContent = fs.readFileSync(packageJsonPath, "utf-8");
|
|
1689
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
1690
|
+
return {
|
|
1691
|
+
deps: packageJson.dependencies || {},
|
|
1692
|
+
devDeps: packageJson.devDependencies || {}
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
function getPackageJsonDeps(packageJsonPath) {
|
|
1696
|
+
const packageJson = getPackageJson(packageJsonPath);
|
|
1697
|
+
const deps = [];
|
|
1698
|
+
const fn = (entries, t) => {
|
|
1699
|
+
for (const [name, version] of Object.entries(entries)) {
|
|
1700
|
+
const localDep = version.startsWith("file:") || version.startsWith("workspace:");
|
|
1701
|
+
const v = localDep ? version : normalizeVersion(version);
|
|
1702
|
+
deps.push({
|
|
1703
|
+
type: t,
|
|
1704
|
+
localDep,
|
|
1705
|
+
name,
|
|
1706
|
+
version: v,
|
|
1707
|
+
versionValid: true,
|
|
1708
|
+
versionAge: void 0,
|
|
1709
|
+
info: void 0,
|
|
1710
|
+
latestVersion: void 0,
|
|
1711
|
+
latestVersionAge: void 0
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
};
|
|
1715
|
+
fn(packageJson.deps, "dep");
|
|
1716
|
+
fn(packageJson.devDeps, "devDep");
|
|
1717
|
+
return deps;
|
|
1718
|
+
}
|
|
1719
|
+
function normalizeVersion(version) {
|
|
1720
|
+
return version.replace(/^[^0-9]/, "");
|
|
1721
|
+
}
|
|
1722
|
+
async function getPkgRegistryInfo(pkg) {
|
|
1723
|
+
const url = `https://registry.npmjs.org/${pkg}`;
|
|
1724
|
+
const response = await fetch(url);
|
|
1725
|
+
if (!response.ok) throw new Error(`Failed to fetch ${url}`);
|
|
1726
|
+
return response.json();
|
|
1727
|
+
}
|
|
1728
|
+
function getVersionReleaseDateOf(info, version) {
|
|
1729
|
+
return info.time[version] || void 0;
|
|
1730
|
+
}
|
|
1731
|
+
function getLatestVersion(info) {
|
|
1732
|
+
return info["dist-tags"].latest ?? void 0;
|
|
1733
|
+
}
|
|
1734
|
+
function getVersionAgeOf(info, version) {
|
|
1735
|
+
const releaseDate = getVersionReleaseDateOf(info, version);
|
|
1736
|
+
return releaseDate ? Date.now() - new Date(releaseDate).getTime() : void 0;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
123
1739
|
//#endregion
|
|
124
1740
|
//#region src/main.ts
|
|
125
|
-
if (!process || !process.argv) {
|
|
1741
|
+
if (!process$1 || !process$1.argv) {
|
|
126
1742
|
console.log("no process");
|
|
127
|
-
process.exit(1);
|
|
1743
|
+
process$1.exit(1);
|
|
128
1744
|
}
|
|
129
|
-
let args = process.argv;
|
|
1745
|
+
let args = process$1.argv;
|
|
130
1746
|
args = args.slice(2);
|
|
131
|
-
let
|
|
132
|
-
|
|
1747
|
+
let ci = false;
|
|
1748
|
+
let cwd = process$1.cwd();
|
|
1749
|
+
if (args.length > 0) for (const arg of args) if (arg.startsWith("--")) {
|
|
1750
|
+
if (arg === "--ci") ci = true;
|
|
1751
|
+
} else cwd = args[0];
|
|
133
1752
|
const refreshInterval = 80;
|
|
134
1753
|
async function run() {
|
|
1754
|
+
console.log("Checking for packages updates ...\n");
|
|
135
1755
|
const renderer = new Renderer((props) => {
|
|
136
|
-
console.clear();
|
|
137
|
-
console.log("Checking for updates...\n");
|
|
1756
|
+
if (!ci) console.clear();
|
|
138
1757
|
renderDepsTable(props.deps);
|
|
139
1758
|
});
|
|
140
|
-
const
|
|
1759
|
+
const pkgFile = `${cwd}/package.json`;
|
|
1760
|
+
if (!fs.existsSync(pkgFile)) {
|
|
1761
|
+
console.error(`package.json file not found at ${cwd}`);
|
|
1762
|
+
process$1.exit(1);
|
|
1763
|
+
}
|
|
1764
|
+
const props = { deps: getPackageJsonDeps(pkgFile).map((dep) => ({
|
|
141
1765
|
dep,
|
|
142
1766
|
needUpdate: false,
|
|
143
1767
|
status: "pending"
|
|
144
1768
|
})) };
|
|
145
|
-
const ticker = setInterval(() => renderer.render(props), refreshInterval);
|
|
1769
|
+
const ticker = ci ? null : setInterval(() => renderer.render(props), refreshInterval);
|
|
146
1770
|
const tasks = props.deps.map(async (row) => {
|
|
147
1771
|
try {
|
|
148
1772
|
if (row.dep.localDep) {
|
|
@@ -154,24 +1778,25 @@ async function run() {
|
|
|
154
1778
|
row.dep.latestVersion = getLatestVersion(info);
|
|
155
1779
|
if (row.dep.latestVersion) row.dep.latestVersionAge = getVersionAgeOf(info, row.dep.latestVersion);
|
|
156
1780
|
row.dep.versionAge = getVersionAgeOf(info, row.dep.version);
|
|
1781
|
+
if (!row.dep.versionAge) row.dep.versionValid = false;
|
|
157
1782
|
row.needUpdate = row.dep.version !== row.dep.latestVersion;
|
|
158
1783
|
row.status = "done";
|
|
159
1784
|
} catch {
|
|
160
1785
|
row.status = "error";
|
|
161
1786
|
} finally {
|
|
162
|
-
renderer.render(props);
|
|
1787
|
+
if (!ci) renderer.render(props);
|
|
163
1788
|
}
|
|
164
1789
|
});
|
|
165
1790
|
await Promise.all(tasks);
|
|
166
|
-
clearInterval(ticker);
|
|
1791
|
+
if (ticker) clearInterval(ticker);
|
|
167
1792
|
renderer.render(props);
|
|
168
1793
|
const nOutdated = props.deps.filter((x) => x.needUpdate).length;
|
|
169
1794
|
const nUpToDate = props.deps.filter((x) => !x.needUpdate).length;
|
|
170
|
-
console.log(`\n${nOutdated} outdated, ${nUpToDate} up to date`);
|
|
1795
|
+
console.log(`\n${yellow(`${nOutdated}`)} outdated, ${green(`${nUpToDate}`)} up to date`);
|
|
171
1796
|
}
|
|
172
1797
|
run().catch((err) => {
|
|
173
1798
|
console.error(err);
|
|
174
|
-
process.exit(1);
|
|
1799
|
+
process$1.exit(1);
|
|
175
1800
|
});
|
|
176
1801
|
|
|
177
1802
|
//#endregion
|