@gowelle/stint-agent 1.2.20 → 1.2.22
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 +8 -23
- package/dist/{StatusDashboard-UXWLHFTD.js → StatusDashboard-LYZL3IQH.js} +2 -2
- package/dist/api-U7WJAW3E.js +7 -0
- package/dist/{chunk-GOS22L3R.js → chunk-7H6J2KCA.js} +2 -4
- package/dist/{chunk-L7PFNRLV.js → chunk-KMYPMLEH.js} +8 -4
- package/dist/{chunk-ABDHDLEJ.js → chunk-TQHWJWBZ.js} +68 -1
- package/dist/chunk-ZNBNEPPK.js +648 -0
- package/dist/daemon/runner.js +6 -41
- package/dist/index.js +2093 -8
- package/package.json +6 -1
- package/dist/api-RQW35VGT.js +0 -7
- package/dist/chunk-BH4OTBYH.js +0 -2618
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
commitQueue,
|
|
4
|
-
versionService,
|
|
5
4
|
websocketService
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZNBNEPPK.js";
|
|
7
6
|
import {
|
|
8
7
|
apiService
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KMYPMLEH.js";
|
|
10
9
|
import {
|
|
11
10
|
getPidFilePath,
|
|
12
11
|
gitService,
|
|
@@ -15,12 +14,1944 @@ import {
|
|
|
15
14
|
projectService,
|
|
16
15
|
spawnDetached,
|
|
17
16
|
validatePidFile
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TQHWJWBZ.js";
|
|
19
18
|
import {
|
|
19
|
+
__commonJS,
|
|
20
|
+
__toESM,
|
|
20
21
|
authService,
|
|
21
22
|
config,
|
|
22
23
|
logger
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7H6J2KCA.js";
|
|
25
|
+
|
|
26
|
+
// node_modules/semver/internal/constants.js
|
|
27
|
+
var require_constants = __commonJS({
|
|
28
|
+
"node_modules/semver/internal/constants.js"(exports, module) {
|
|
29
|
+
"use strict";
|
|
30
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
31
|
+
var MAX_LENGTH = 256;
|
|
32
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
33
|
+
9007199254740991;
|
|
34
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
35
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
36
|
+
var RELEASE_TYPES = [
|
|
37
|
+
"major",
|
|
38
|
+
"premajor",
|
|
39
|
+
"minor",
|
|
40
|
+
"preminor",
|
|
41
|
+
"patch",
|
|
42
|
+
"prepatch",
|
|
43
|
+
"prerelease"
|
|
44
|
+
];
|
|
45
|
+
module.exports = {
|
|
46
|
+
MAX_LENGTH,
|
|
47
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
48
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
49
|
+
MAX_SAFE_INTEGER,
|
|
50
|
+
RELEASE_TYPES,
|
|
51
|
+
SEMVER_SPEC_VERSION,
|
|
52
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
53
|
+
FLAG_LOOSE: 2
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// node_modules/semver/internal/debug.js
|
|
59
|
+
var require_debug = __commonJS({
|
|
60
|
+
"node_modules/semver/internal/debug.js"(exports, module) {
|
|
61
|
+
"use strict";
|
|
62
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
63
|
+
};
|
|
64
|
+
module.exports = debug;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// node_modules/semver/internal/re.js
|
|
69
|
+
var require_re = __commonJS({
|
|
70
|
+
"node_modules/semver/internal/re.js"(exports, module) {
|
|
71
|
+
"use strict";
|
|
72
|
+
var {
|
|
73
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
74
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
75
|
+
MAX_LENGTH
|
|
76
|
+
} = require_constants();
|
|
77
|
+
var debug = require_debug();
|
|
78
|
+
exports = module.exports = {};
|
|
79
|
+
var re = exports.re = [];
|
|
80
|
+
var safeRe = exports.safeRe = [];
|
|
81
|
+
var src = exports.src = [];
|
|
82
|
+
var safeSrc = exports.safeSrc = [];
|
|
83
|
+
var t = exports.t = {};
|
|
84
|
+
var R = 0;
|
|
85
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
86
|
+
var safeRegexReplacements = [
|
|
87
|
+
["\\s", 1],
|
|
88
|
+
["\\d", MAX_LENGTH],
|
|
89
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
90
|
+
];
|
|
91
|
+
var makeSafeRegex = (value) => {
|
|
92
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
93
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
94
|
+
}
|
|
95
|
+
return value;
|
|
96
|
+
};
|
|
97
|
+
var createToken = (name, value, isGlobal) => {
|
|
98
|
+
const safe = makeSafeRegex(value);
|
|
99
|
+
const index = R++;
|
|
100
|
+
debug(name, index, value);
|
|
101
|
+
t[name] = index;
|
|
102
|
+
src[index] = value;
|
|
103
|
+
safeSrc[index] = safe;
|
|
104
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
105
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
106
|
+
};
|
|
107
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
108
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
109
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
110
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
111
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
112
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
113
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
114
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
115
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
116
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
117
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
118
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
119
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
120
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
121
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
122
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
123
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
124
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
125
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
126
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
127
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
128
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
129
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
130
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
131
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
132
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
133
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
134
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
135
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
136
|
+
exports.tildeTrimReplace = "$1~";
|
|
137
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
138
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
139
|
+
createToken("LONECARET", "(?:\\^)");
|
|
140
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
141
|
+
exports.caretTrimReplace = "$1^";
|
|
142
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
143
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
144
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
145
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
146
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
147
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
148
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
149
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
150
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
151
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
152
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// node_modules/semver/internal/parse-options.js
|
|
157
|
+
var require_parse_options = __commonJS({
|
|
158
|
+
"node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
159
|
+
"use strict";
|
|
160
|
+
var looseOption = Object.freeze({ loose: true });
|
|
161
|
+
var emptyOpts = Object.freeze({});
|
|
162
|
+
var parseOptions = (options) => {
|
|
163
|
+
if (!options) {
|
|
164
|
+
return emptyOpts;
|
|
165
|
+
}
|
|
166
|
+
if (typeof options !== "object") {
|
|
167
|
+
return looseOption;
|
|
168
|
+
}
|
|
169
|
+
return options;
|
|
170
|
+
};
|
|
171
|
+
module.exports = parseOptions;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// node_modules/semver/internal/identifiers.js
|
|
176
|
+
var require_identifiers = __commonJS({
|
|
177
|
+
"node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
178
|
+
"use strict";
|
|
179
|
+
var numeric = /^[0-9]+$/;
|
|
180
|
+
var compareIdentifiers = (a, b) => {
|
|
181
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
182
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
183
|
+
}
|
|
184
|
+
const anum = numeric.test(a);
|
|
185
|
+
const bnum = numeric.test(b);
|
|
186
|
+
if (anum && bnum) {
|
|
187
|
+
a = +a;
|
|
188
|
+
b = +b;
|
|
189
|
+
}
|
|
190
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
191
|
+
};
|
|
192
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
193
|
+
module.exports = {
|
|
194
|
+
compareIdentifiers,
|
|
195
|
+
rcompareIdentifiers
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// node_modules/semver/classes/semver.js
|
|
201
|
+
var require_semver = __commonJS({
|
|
202
|
+
"node_modules/semver/classes/semver.js"(exports, module) {
|
|
203
|
+
"use strict";
|
|
204
|
+
var debug = require_debug();
|
|
205
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
206
|
+
var { safeRe: re, t } = require_re();
|
|
207
|
+
var parseOptions = require_parse_options();
|
|
208
|
+
var { compareIdentifiers } = require_identifiers();
|
|
209
|
+
var SemVer = class _SemVer {
|
|
210
|
+
constructor(version, options) {
|
|
211
|
+
options = parseOptions(options);
|
|
212
|
+
if (version instanceof _SemVer) {
|
|
213
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
214
|
+
return version;
|
|
215
|
+
} else {
|
|
216
|
+
version = version.version;
|
|
217
|
+
}
|
|
218
|
+
} else if (typeof version !== "string") {
|
|
219
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
220
|
+
}
|
|
221
|
+
if (version.length > MAX_LENGTH) {
|
|
222
|
+
throw new TypeError(
|
|
223
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
debug("SemVer", version, options);
|
|
227
|
+
this.options = options;
|
|
228
|
+
this.loose = !!options.loose;
|
|
229
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
230
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
231
|
+
if (!m) {
|
|
232
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
233
|
+
}
|
|
234
|
+
this.raw = version;
|
|
235
|
+
this.major = +m[1];
|
|
236
|
+
this.minor = +m[2];
|
|
237
|
+
this.patch = +m[3];
|
|
238
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
239
|
+
throw new TypeError("Invalid major version");
|
|
240
|
+
}
|
|
241
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
242
|
+
throw new TypeError("Invalid minor version");
|
|
243
|
+
}
|
|
244
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
245
|
+
throw new TypeError("Invalid patch version");
|
|
246
|
+
}
|
|
247
|
+
if (!m[4]) {
|
|
248
|
+
this.prerelease = [];
|
|
249
|
+
} else {
|
|
250
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
251
|
+
if (/^[0-9]+$/.test(id)) {
|
|
252
|
+
const num = +id;
|
|
253
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
254
|
+
return num;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return id;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
261
|
+
this.format();
|
|
262
|
+
}
|
|
263
|
+
format() {
|
|
264
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
265
|
+
if (this.prerelease.length) {
|
|
266
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
267
|
+
}
|
|
268
|
+
return this.version;
|
|
269
|
+
}
|
|
270
|
+
toString() {
|
|
271
|
+
return this.version;
|
|
272
|
+
}
|
|
273
|
+
compare(other) {
|
|
274
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
275
|
+
if (!(other instanceof _SemVer)) {
|
|
276
|
+
if (typeof other === "string" && other === this.version) {
|
|
277
|
+
return 0;
|
|
278
|
+
}
|
|
279
|
+
other = new _SemVer(other, this.options);
|
|
280
|
+
}
|
|
281
|
+
if (other.version === this.version) {
|
|
282
|
+
return 0;
|
|
283
|
+
}
|
|
284
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
285
|
+
}
|
|
286
|
+
compareMain(other) {
|
|
287
|
+
if (!(other instanceof _SemVer)) {
|
|
288
|
+
other = new _SemVer(other, this.options);
|
|
289
|
+
}
|
|
290
|
+
if (this.major < other.major) {
|
|
291
|
+
return -1;
|
|
292
|
+
}
|
|
293
|
+
if (this.major > other.major) {
|
|
294
|
+
return 1;
|
|
295
|
+
}
|
|
296
|
+
if (this.minor < other.minor) {
|
|
297
|
+
return -1;
|
|
298
|
+
}
|
|
299
|
+
if (this.minor > other.minor) {
|
|
300
|
+
return 1;
|
|
301
|
+
}
|
|
302
|
+
if (this.patch < other.patch) {
|
|
303
|
+
return -1;
|
|
304
|
+
}
|
|
305
|
+
if (this.patch > other.patch) {
|
|
306
|
+
return 1;
|
|
307
|
+
}
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
310
|
+
comparePre(other) {
|
|
311
|
+
if (!(other instanceof _SemVer)) {
|
|
312
|
+
other = new _SemVer(other, this.options);
|
|
313
|
+
}
|
|
314
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
315
|
+
return -1;
|
|
316
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
317
|
+
return 1;
|
|
318
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
319
|
+
return 0;
|
|
320
|
+
}
|
|
321
|
+
let i = 0;
|
|
322
|
+
do {
|
|
323
|
+
const a = this.prerelease[i];
|
|
324
|
+
const b = other.prerelease[i];
|
|
325
|
+
debug("prerelease compare", i, a, b);
|
|
326
|
+
if (a === void 0 && b === void 0) {
|
|
327
|
+
return 0;
|
|
328
|
+
} else if (b === void 0) {
|
|
329
|
+
return 1;
|
|
330
|
+
} else if (a === void 0) {
|
|
331
|
+
return -1;
|
|
332
|
+
} else if (a === b) {
|
|
333
|
+
continue;
|
|
334
|
+
} else {
|
|
335
|
+
return compareIdentifiers(a, b);
|
|
336
|
+
}
|
|
337
|
+
} while (++i);
|
|
338
|
+
}
|
|
339
|
+
compareBuild(other) {
|
|
340
|
+
if (!(other instanceof _SemVer)) {
|
|
341
|
+
other = new _SemVer(other, this.options);
|
|
342
|
+
}
|
|
343
|
+
let i = 0;
|
|
344
|
+
do {
|
|
345
|
+
const a = this.build[i];
|
|
346
|
+
const b = other.build[i];
|
|
347
|
+
debug("build compare", i, a, b);
|
|
348
|
+
if (a === void 0 && b === void 0) {
|
|
349
|
+
return 0;
|
|
350
|
+
} else if (b === void 0) {
|
|
351
|
+
return 1;
|
|
352
|
+
} else if (a === void 0) {
|
|
353
|
+
return -1;
|
|
354
|
+
} else if (a === b) {
|
|
355
|
+
continue;
|
|
356
|
+
} else {
|
|
357
|
+
return compareIdentifiers(a, b);
|
|
358
|
+
}
|
|
359
|
+
} while (++i);
|
|
360
|
+
}
|
|
361
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
362
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
363
|
+
inc(release, identifier, identifierBase) {
|
|
364
|
+
if (release.startsWith("pre")) {
|
|
365
|
+
if (!identifier && identifierBase === false) {
|
|
366
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
367
|
+
}
|
|
368
|
+
if (identifier) {
|
|
369
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
370
|
+
if (!match || match[1] !== identifier) {
|
|
371
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
switch (release) {
|
|
376
|
+
case "premajor":
|
|
377
|
+
this.prerelease.length = 0;
|
|
378
|
+
this.patch = 0;
|
|
379
|
+
this.minor = 0;
|
|
380
|
+
this.major++;
|
|
381
|
+
this.inc("pre", identifier, identifierBase);
|
|
382
|
+
break;
|
|
383
|
+
case "preminor":
|
|
384
|
+
this.prerelease.length = 0;
|
|
385
|
+
this.patch = 0;
|
|
386
|
+
this.minor++;
|
|
387
|
+
this.inc("pre", identifier, identifierBase);
|
|
388
|
+
break;
|
|
389
|
+
case "prepatch":
|
|
390
|
+
this.prerelease.length = 0;
|
|
391
|
+
this.inc("patch", identifier, identifierBase);
|
|
392
|
+
this.inc("pre", identifier, identifierBase);
|
|
393
|
+
break;
|
|
394
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
395
|
+
// prepatch.
|
|
396
|
+
case "prerelease":
|
|
397
|
+
if (this.prerelease.length === 0) {
|
|
398
|
+
this.inc("patch", identifier, identifierBase);
|
|
399
|
+
}
|
|
400
|
+
this.inc("pre", identifier, identifierBase);
|
|
401
|
+
break;
|
|
402
|
+
case "release":
|
|
403
|
+
if (this.prerelease.length === 0) {
|
|
404
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
405
|
+
}
|
|
406
|
+
this.prerelease.length = 0;
|
|
407
|
+
break;
|
|
408
|
+
case "major":
|
|
409
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
410
|
+
this.major++;
|
|
411
|
+
}
|
|
412
|
+
this.minor = 0;
|
|
413
|
+
this.patch = 0;
|
|
414
|
+
this.prerelease = [];
|
|
415
|
+
break;
|
|
416
|
+
case "minor":
|
|
417
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
418
|
+
this.minor++;
|
|
419
|
+
}
|
|
420
|
+
this.patch = 0;
|
|
421
|
+
this.prerelease = [];
|
|
422
|
+
break;
|
|
423
|
+
case "patch":
|
|
424
|
+
if (this.prerelease.length === 0) {
|
|
425
|
+
this.patch++;
|
|
426
|
+
}
|
|
427
|
+
this.prerelease = [];
|
|
428
|
+
break;
|
|
429
|
+
// This probably shouldn't be used publicly.
|
|
430
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
431
|
+
case "pre": {
|
|
432
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
433
|
+
if (this.prerelease.length === 0) {
|
|
434
|
+
this.prerelease = [base];
|
|
435
|
+
} else {
|
|
436
|
+
let i = this.prerelease.length;
|
|
437
|
+
while (--i >= 0) {
|
|
438
|
+
if (typeof this.prerelease[i] === "number") {
|
|
439
|
+
this.prerelease[i]++;
|
|
440
|
+
i = -2;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (i === -1) {
|
|
444
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
445
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
446
|
+
}
|
|
447
|
+
this.prerelease.push(base);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
if (identifier) {
|
|
451
|
+
let prerelease = [identifier, base];
|
|
452
|
+
if (identifierBase === false) {
|
|
453
|
+
prerelease = [identifier];
|
|
454
|
+
}
|
|
455
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
456
|
+
if (isNaN(this.prerelease[1])) {
|
|
457
|
+
this.prerelease = prerelease;
|
|
458
|
+
}
|
|
459
|
+
} else {
|
|
460
|
+
this.prerelease = prerelease;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
default:
|
|
466
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
467
|
+
}
|
|
468
|
+
this.raw = this.format();
|
|
469
|
+
if (this.build.length) {
|
|
470
|
+
this.raw += `+${this.build.join(".")}`;
|
|
471
|
+
}
|
|
472
|
+
return this;
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
module.exports = SemVer;
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// node_modules/semver/functions/parse.js
|
|
480
|
+
var require_parse = __commonJS({
|
|
481
|
+
"node_modules/semver/functions/parse.js"(exports, module) {
|
|
482
|
+
"use strict";
|
|
483
|
+
var SemVer = require_semver();
|
|
484
|
+
var parse = (version, options, throwErrors = false) => {
|
|
485
|
+
if (version instanceof SemVer) {
|
|
486
|
+
return version;
|
|
487
|
+
}
|
|
488
|
+
try {
|
|
489
|
+
return new SemVer(version, options);
|
|
490
|
+
} catch (er) {
|
|
491
|
+
if (!throwErrors) {
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
|
+
throw er;
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
module.exports = parse;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
// node_modules/semver/functions/valid.js
|
|
502
|
+
var require_valid = __commonJS({
|
|
503
|
+
"node_modules/semver/functions/valid.js"(exports, module) {
|
|
504
|
+
"use strict";
|
|
505
|
+
var parse = require_parse();
|
|
506
|
+
var valid = (version, options) => {
|
|
507
|
+
const v = parse(version, options);
|
|
508
|
+
return v ? v.version : null;
|
|
509
|
+
};
|
|
510
|
+
module.exports = valid;
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
// node_modules/semver/functions/clean.js
|
|
515
|
+
var require_clean = __commonJS({
|
|
516
|
+
"node_modules/semver/functions/clean.js"(exports, module) {
|
|
517
|
+
"use strict";
|
|
518
|
+
var parse = require_parse();
|
|
519
|
+
var clean = (version, options) => {
|
|
520
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
521
|
+
return s ? s.version : null;
|
|
522
|
+
};
|
|
523
|
+
module.exports = clean;
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
// node_modules/semver/functions/inc.js
|
|
528
|
+
var require_inc = __commonJS({
|
|
529
|
+
"node_modules/semver/functions/inc.js"(exports, module) {
|
|
530
|
+
"use strict";
|
|
531
|
+
var SemVer = require_semver();
|
|
532
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
533
|
+
if (typeof options === "string") {
|
|
534
|
+
identifierBase = identifier;
|
|
535
|
+
identifier = options;
|
|
536
|
+
options = void 0;
|
|
537
|
+
}
|
|
538
|
+
try {
|
|
539
|
+
return new SemVer(
|
|
540
|
+
version instanceof SemVer ? version.version : version,
|
|
541
|
+
options
|
|
542
|
+
).inc(release, identifier, identifierBase).version;
|
|
543
|
+
} catch (er) {
|
|
544
|
+
return null;
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
module.exports = inc;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// node_modules/semver/functions/diff.js
|
|
552
|
+
var require_diff = __commonJS({
|
|
553
|
+
"node_modules/semver/functions/diff.js"(exports, module) {
|
|
554
|
+
"use strict";
|
|
555
|
+
var parse = require_parse();
|
|
556
|
+
var diff = (version1, version2) => {
|
|
557
|
+
const v1 = parse(version1, null, true);
|
|
558
|
+
const v2 = parse(version2, null, true);
|
|
559
|
+
const comparison = v1.compare(v2);
|
|
560
|
+
if (comparison === 0) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
const v1Higher = comparison > 0;
|
|
564
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
565
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
566
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
567
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
568
|
+
if (lowHasPre && !highHasPre) {
|
|
569
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
570
|
+
return "major";
|
|
571
|
+
}
|
|
572
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
573
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
574
|
+
return "minor";
|
|
575
|
+
}
|
|
576
|
+
return "patch";
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const prefix = highHasPre ? "pre" : "";
|
|
580
|
+
if (v1.major !== v2.major) {
|
|
581
|
+
return prefix + "major";
|
|
582
|
+
}
|
|
583
|
+
if (v1.minor !== v2.minor) {
|
|
584
|
+
return prefix + "minor";
|
|
585
|
+
}
|
|
586
|
+
if (v1.patch !== v2.patch) {
|
|
587
|
+
return prefix + "patch";
|
|
588
|
+
}
|
|
589
|
+
return "prerelease";
|
|
590
|
+
};
|
|
591
|
+
module.exports = diff;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
// node_modules/semver/functions/major.js
|
|
596
|
+
var require_major = __commonJS({
|
|
597
|
+
"node_modules/semver/functions/major.js"(exports, module) {
|
|
598
|
+
"use strict";
|
|
599
|
+
var SemVer = require_semver();
|
|
600
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
601
|
+
module.exports = major;
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
// node_modules/semver/functions/minor.js
|
|
606
|
+
var require_minor = __commonJS({
|
|
607
|
+
"node_modules/semver/functions/minor.js"(exports, module) {
|
|
608
|
+
"use strict";
|
|
609
|
+
var SemVer = require_semver();
|
|
610
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
611
|
+
module.exports = minor;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
// node_modules/semver/functions/patch.js
|
|
616
|
+
var require_patch = __commonJS({
|
|
617
|
+
"node_modules/semver/functions/patch.js"(exports, module) {
|
|
618
|
+
"use strict";
|
|
619
|
+
var SemVer = require_semver();
|
|
620
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
621
|
+
module.exports = patch;
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// node_modules/semver/functions/prerelease.js
|
|
626
|
+
var require_prerelease = __commonJS({
|
|
627
|
+
"node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
628
|
+
"use strict";
|
|
629
|
+
var parse = require_parse();
|
|
630
|
+
var prerelease = (version, options) => {
|
|
631
|
+
const parsed = parse(version, options);
|
|
632
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
633
|
+
};
|
|
634
|
+
module.exports = prerelease;
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
// node_modules/semver/functions/compare.js
|
|
639
|
+
var require_compare = __commonJS({
|
|
640
|
+
"node_modules/semver/functions/compare.js"(exports, module) {
|
|
641
|
+
"use strict";
|
|
642
|
+
var SemVer = require_semver();
|
|
643
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
644
|
+
module.exports = compare;
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
// node_modules/semver/functions/rcompare.js
|
|
649
|
+
var require_rcompare = __commonJS({
|
|
650
|
+
"node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
651
|
+
"use strict";
|
|
652
|
+
var compare = require_compare();
|
|
653
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
654
|
+
module.exports = rcompare;
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
// node_modules/semver/functions/compare-loose.js
|
|
659
|
+
var require_compare_loose = __commonJS({
|
|
660
|
+
"node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
661
|
+
"use strict";
|
|
662
|
+
var compare = require_compare();
|
|
663
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
664
|
+
module.exports = compareLoose;
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
// node_modules/semver/functions/compare-build.js
|
|
669
|
+
var require_compare_build = __commonJS({
|
|
670
|
+
"node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
671
|
+
"use strict";
|
|
672
|
+
var SemVer = require_semver();
|
|
673
|
+
var compareBuild = (a, b, loose) => {
|
|
674
|
+
const versionA = new SemVer(a, loose);
|
|
675
|
+
const versionB = new SemVer(b, loose);
|
|
676
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
677
|
+
};
|
|
678
|
+
module.exports = compareBuild;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// node_modules/semver/functions/sort.js
|
|
683
|
+
var require_sort = __commonJS({
|
|
684
|
+
"node_modules/semver/functions/sort.js"(exports, module) {
|
|
685
|
+
"use strict";
|
|
686
|
+
var compareBuild = require_compare_build();
|
|
687
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
688
|
+
module.exports = sort;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
// node_modules/semver/functions/rsort.js
|
|
693
|
+
var require_rsort = __commonJS({
|
|
694
|
+
"node_modules/semver/functions/rsort.js"(exports, module) {
|
|
695
|
+
"use strict";
|
|
696
|
+
var compareBuild = require_compare_build();
|
|
697
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
698
|
+
module.exports = rsort;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
// node_modules/semver/functions/gt.js
|
|
703
|
+
var require_gt = __commonJS({
|
|
704
|
+
"node_modules/semver/functions/gt.js"(exports, module) {
|
|
705
|
+
"use strict";
|
|
706
|
+
var compare = require_compare();
|
|
707
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
708
|
+
module.exports = gt;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
// node_modules/semver/functions/lt.js
|
|
713
|
+
var require_lt = __commonJS({
|
|
714
|
+
"node_modules/semver/functions/lt.js"(exports, module) {
|
|
715
|
+
"use strict";
|
|
716
|
+
var compare = require_compare();
|
|
717
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
718
|
+
module.exports = lt;
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
// node_modules/semver/functions/eq.js
|
|
723
|
+
var require_eq = __commonJS({
|
|
724
|
+
"node_modules/semver/functions/eq.js"(exports, module) {
|
|
725
|
+
"use strict";
|
|
726
|
+
var compare = require_compare();
|
|
727
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
728
|
+
module.exports = eq;
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
// node_modules/semver/functions/neq.js
|
|
733
|
+
var require_neq = __commonJS({
|
|
734
|
+
"node_modules/semver/functions/neq.js"(exports, module) {
|
|
735
|
+
"use strict";
|
|
736
|
+
var compare = require_compare();
|
|
737
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
738
|
+
module.exports = neq;
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
// node_modules/semver/functions/gte.js
|
|
743
|
+
var require_gte = __commonJS({
|
|
744
|
+
"node_modules/semver/functions/gte.js"(exports, module) {
|
|
745
|
+
"use strict";
|
|
746
|
+
var compare = require_compare();
|
|
747
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
748
|
+
module.exports = gte;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
// node_modules/semver/functions/lte.js
|
|
753
|
+
var require_lte = __commonJS({
|
|
754
|
+
"node_modules/semver/functions/lte.js"(exports, module) {
|
|
755
|
+
"use strict";
|
|
756
|
+
var compare = require_compare();
|
|
757
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
758
|
+
module.exports = lte;
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// node_modules/semver/functions/cmp.js
|
|
763
|
+
var require_cmp = __commonJS({
|
|
764
|
+
"node_modules/semver/functions/cmp.js"(exports, module) {
|
|
765
|
+
"use strict";
|
|
766
|
+
var eq = require_eq();
|
|
767
|
+
var neq = require_neq();
|
|
768
|
+
var gt = require_gt();
|
|
769
|
+
var gte = require_gte();
|
|
770
|
+
var lt = require_lt();
|
|
771
|
+
var lte = require_lte();
|
|
772
|
+
var cmp = (a, op, b, loose) => {
|
|
773
|
+
switch (op) {
|
|
774
|
+
case "===":
|
|
775
|
+
if (typeof a === "object") {
|
|
776
|
+
a = a.version;
|
|
777
|
+
}
|
|
778
|
+
if (typeof b === "object") {
|
|
779
|
+
b = b.version;
|
|
780
|
+
}
|
|
781
|
+
return a === b;
|
|
782
|
+
case "!==":
|
|
783
|
+
if (typeof a === "object") {
|
|
784
|
+
a = a.version;
|
|
785
|
+
}
|
|
786
|
+
if (typeof b === "object") {
|
|
787
|
+
b = b.version;
|
|
788
|
+
}
|
|
789
|
+
return a !== b;
|
|
790
|
+
case "":
|
|
791
|
+
case "=":
|
|
792
|
+
case "==":
|
|
793
|
+
return eq(a, b, loose);
|
|
794
|
+
case "!=":
|
|
795
|
+
return neq(a, b, loose);
|
|
796
|
+
case ">":
|
|
797
|
+
return gt(a, b, loose);
|
|
798
|
+
case ">=":
|
|
799
|
+
return gte(a, b, loose);
|
|
800
|
+
case "<":
|
|
801
|
+
return lt(a, b, loose);
|
|
802
|
+
case "<=":
|
|
803
|
+
return lte(a, b, loose);
|
|
804
|
+
default:
|
|
805
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
module.exports = cmp;
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
// node_modules/semver/functions/coerce.js
|
|
813
|
+
var require_coerce = __commonJS({
|
|
814
|
+
"node_modules/semver/functions/coerce.js"(exports, module) {
|
|
815
|
+
"use strict";
|
|
816
|
+
var SemVer = require_semver();
|
|
817
|
+
var parse = require_parse();
|
|
818
|
+
var { safeRe: re, t } = require_re();
|
|
819
|
+
var coerce = (version, options) => {
|
|
820
|
+
if (version instanceof SemVer) {
|
|
821
|
+
return version;
|
|
822
|
+
}
|
|
823
|
+
if (typeof version === "number") {
|
|
824
|
+
version = String(version);
|
|
825
|
+
}
|
|
826
|
+
if (typeof version !== "string") {
|
|
827
|
+
return null;
|
|
828
|
+
}
|
|
829
|
+
options = options || {};
|
|
830
|
+
let match = null;
|
|
831
|
+
if (!options.rtl) {
|
|
832
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
833
|
+
} else {
|
|
834
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
835
|
+
let next;
|
|
836
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
837
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
838
|
+
match = next;
|
|
839
|
+
}
|
|
840
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
841
|
+
}
|
|
842
|
+
coerceRtlRegex.lastIndex = -1;
|
|
843
|
+
}
|
|
844
|
+
if (match === null) {
|
|
845
|
+
return null;
|
|
846
|
+
}
|
|
847
|
+
const major = match[2];
|
|
848
|
+
const minor = match[3] || "0";
|
|
849
|
+
const patch = match[4] || "0";
|
|
850
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
851
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
852
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
853
|
+
};
|
|
854
|
+
module.exports = coerce;
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
// node_modules/semver/internal/lrucache.js
|
|
859
|
+
var require_lrucache = __commonJS({
|
|
860
|
+
"node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
861
|
+
"use strict";
|
|
862
|
+
var LRUCache = class {
|
|
863
|
+
constructor() {
|
|
864
|
+
this.max = 1e3;
|
|
865
|
+
this.map = /* @__PURE__ */ new Map();
|
|
866
|
+
}
|
|
867
|
+
get(key) {
|
|
868
|
+
const value = this.map.get(key);
|
|
869
|
+
if (value === void 0) {
|
|
870
|
+
return void 0;
|
|
871
|
+
} else {
|
|
872
|
+
this.map.delete(key);
|
|
873
|
+
this.map.set(key, value);
|
|
874
|
+
return value;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
delete(key) {
|
|
878
|
+
return this.map.delete(key);
|
|
879
|
+
}
|
|
880
|
+
set(key, value) {
|
|
881
|
+
const deleted = this.delete(key);
|
|
882
|
+
if (!deleted && value !== void 0) {
|
|
883
|
+
if (this.map.size >= this.max) {
|
|
884
|
+
const firstKey = this.map.keys().next().value;
|
|
885
|
+
this.delete(firstKey);
|
|
886
|
+
}
|
|
887
|
+
this.map.set(key, value);
|
|
888
|
+
}
|
|
889
|
+
return this;
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
module.exports = LRUCache;
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
// node_modules/semver/classes/range.js
|
|
897
|
+
var require_range = __commonJS({
|
|
898
|
+
"node_modules/semver/classes/range.js"(exports, module) {
|
|
899
|
+
"use strict";
|
|
900
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
901
|
+
var Range = class _Range {
|
|
902
|
+
constructor(range, options) {
|
|
903
|
+
options = parseOptions(options);
|
|
904
|
+
if (range instanceof _Range) {
|
|
905
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
906
|
+
return range;
|
|
907
|
+
} else {
|
|
908
|
+
return new _Range(range.raw, options);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
if (range instanceof Comparator) {
|
|
912
|
+
this.raw = range.value;
|
|
913
|
+
this.set = [[range]];
|
|
914
|
+
this.formatted = void 0;
|
|
915
|
+
return this;
|
|
916
|
+
}
|
|
917
|
+
this.options = options;
|
|
918
|
+
this.loose = !!options.loose;
|
|
919
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
920
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
921
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
922
|
+
if (!this.set.length) {
|
|
923
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
924
|
+
}
|
|
925
|
+
if (this.set.length > 1) {
|
|
926
|
+
const first = this.set[0];
|
|
927
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
928
|
+
if (this.set.length === 0) {
|
|
929
|
+
this.set = [first];
|
|
930
|
+
} else if (this.set.length > 1) {
|
|
931
|
+
for (const c of this.set) {
|
|
932
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
933
|
+
this.set = [c];
|
|
934
|
+
break;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
this.formatted = void 0;
|
|
940
|
+
}
|
|
941
|
+
get range() {
|
|
942
|
+
if (this.formatted === void 0) {
|
|
943
|
+
this.formatted = "";
|
|
944
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
945
|
+
if (i > 0) {
|
|
946
|
+
this.formatted += "||";
|
|
947
|
+
}
|
|
948
|
+
const comps = this.set[i];
|
|
949
|
+
for (let k = 0; k < comps.length; k++) {
|
|
950
|
+
if (k > 0) {
|
|
951
|
+
this.formatted += " ";
|
|
952
|
+
}
|
|
953
|
+
this.formatted += comps[k].toString().trim();
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
return this.formatted;
|
|
958
|
+
}
|
|
959
|
+
format() {
|
|
960
|
+
return this.range;
|
|
961
|
+
}
|
|
962
|
+
toString() {
|
|
963
|
+
return this.range;
|
|
964
|
+
}
|
|
965
|
+
parseRange(range) {
|
|
966
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
967
|
+
const memoKey = memoOpts + ":" + range;
|
|
968
|
+
const cached = cache.get(memoKey);
|
|
969
|
+
if (cached) {
|
|
970
|
+
return cached;
|
|
971
|
+
}
|
|
972
|
+
const loose = this.options.loose;
|
|
973
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
974
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
975
|
+
debug("hyphen replace", range);
|
|
976
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
977
|
+
debug("comparator trim", range);
|
|
978
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
979
|
+
debug("tilde trim", range);
|
|
980
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
981
|
+
debug("caret trim", range);
|
|
982
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
983
|
+
if (loose) {
|
|
984
|
+
rangeList = rangeList.filter((comp) => {
|
|
985
|
+
debug("loose invalid filter", comp, this.options);
|
|
986
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
debug("range list", rangeList);
|
|
990
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
991
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
992
|
+
for (const comp of comparators) {
|
|
993
|
+
if (isNullSet(comp)) {
|
|
994
|
+
return [comp];
|
|
995
|
+
}
|
|
996
|
+
rangeMap.set(comp.value, comp);
|
|
997
|
+
}
|
|
998
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
999
|
+
rangeMap.delete("");
|
|
1000
|
+
}
|
|
1001
|
+
const result = [...rangeMap.values()];
|
|
1002
|
+
cache.set(memoKey, result);
|
|
1003
|
+
return result;
|
|
1004
|
+
}
|
|
1005
|
+
intersects(range, options) {
|
|
1006
|
+
if (!(range instanceof _Range)) {
|
|
1007
|
+
throw new TypeError("a Range is required");
|
|
1008
|
+
}
|
|
1009
|
+
return this.set.some((thisComparators) => {
|
|
1010
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1011
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1012
|
+
return rangeComparators.every((rangeComparator) => {
|
|
1013
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
1020
|
+
test(version) {
|
|
1021
|
+
if (!version) {
|
|
1022
|
+
return false;
|
|
1023
|
+
}
|
|
1024
|
+
if (typeof version === "string") {
|
|
1025
|
+
try {
|
|
1026
|
+
version = new SemVer(version, this.options);
|
|
1027
|
+
} catch (er) {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1032
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
1033
|
+
return true;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
return false;
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
module.exports = Range;
|
|
1040
|
+
var LRU = require_lrucache();
|
|
1041
|
+
var cache = new LRU();
|
|
1042
|
+
var parseOptions = require_parse_options();
|
|
1043
|
+
var Comparator = require_comparator();
|
|
1044
|
+
var debug = require_debug();
|
|
1045
|
+
var SemVer = require_semver();
|
|
1046
|
+
var {
|
|
1047
|
+
safeRe: re,
|
|
1048
|
+
t,
|
|
1049
|
+
comparatorTrimReplace,
|
|
1050
|
+
tildeTrimReplace,
|
|
1051
|
+
caretTrimReplace
|
|
1052
|
+
} = require_re();
|
|
1053
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1054
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1055
|
+
var isAny = (c) => c.value === "";
|
|
1056
|
+
var isSatisfiable = (comparators, options) => {
|
|
1057
|
+
let result = true;
|
|
1058
|
+
const remainingComparators = comparators.slice();
|
|
1059
|
+
let testComparator = remainingComparators.pop();
|
|
1060
|
+
while (result && remainingComparators.length) {
|
|
1061
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1062
|
+
return testComparator.intersects(otherComparator, options);
|
|
1063
|
+
});
|
|
1064
|
+
testComparator = remainingComparators.pop();
|
|
1065
|
+
}
|
|
1066
|
+
return result;
|
|
1067
|
+
};
|
|
1068
|
+
var parseComparator = (comp, options) => {
|
|
1069
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
1070
|
+
debug("comp", comp, options);
|
|
1071
|
+
comp = replaceCarets(comp, options);
|
|
1072
|
+
debug("caret", comp);
|
|
1073
|
+
comp = replaceTildes(comp, options);
|
|
1074
|
+
debug("tildes", comp);
|
|
1075
|
+
comp = replaceXRanges(comp, options);
|
|
1076
|
+
debug("xrange", comp);
|
|
1077
|
+
comp = replaceStars(comp, options);
|
|
1078
|
+
debug("stars", comp);
|
|
1079
|
+
return comp;
|
|
1080
|
+
};
|
|
1081
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1082
|
+
var replaceTildes = (comp, options) => {
|
|
1083
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1084
|
+
};
|
|
1085
|
+
var replaceTilde = (comp, options) => {
|
|
1086
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1087
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1088
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1089
|
+
let ret;
|
|
1090
|
+
if (isX(M)) {
|
|
1091
|
+
ret = "";
|
|
1092
|
+
} else if (isX(m)) {
|
|
1093
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1094
|
+
} else if (isX(p)) {
|
|
1095
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1096
|
+
} else if (pr) {
|
|
1097
|
+
debug("replaceTilde pr", pr);
|
|
1098
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1099
|
+
} else {
|
|
1100
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1101
|
+
}
|
|
1102
|
+
debug("tilde return", ret);
|
|
1103
|
+
return ret;
|
|
1104
|
+
});
|
|
1105
|
+
};
|
|
1106
|
+
var replaceCarets = (comp, options) => {
|
|
1107
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1108
|
+
};
|
|
1109
|
+
var replaceCaret = (comp, options) => {
|
|
1110
|
+
debug("caret", comp, options);
|
|
1111
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1112
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1113
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1114
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1115
|
+
let ret;
|
|
1116
|
+
if (isX(M)) {
|
|
1117
|
+
ret = "";
|
|
1118
|
+
} else if (isX(m)) {
|
|
1119
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1120
|
+
} else if (isX(p)) {
|
|
1121
|
+
if (M === "0") {
|
|
1122
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1123
|
+
} else {
|
|
1124
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1125
|
+
}
|
|
1126
|
+
} else if (pr) {
|
|
1127
|
+
debug("replaceCaret pr", pr);
|
|
1128
|
+
if (M === "0") {
|
|
1129
|
+
if (m === "0") {
|
|
1130
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1131
|
+
} else {
|
|
1132
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1133
|
+
}
|
|
1134
|
+
} else {
|
|
1135
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1136
|
+
}
|
|
1137
|
+
} else {
|
|
1138
|
+
debug("no pr");
|
|
1139
|
+
if (M === "0") {
|
|
1140
|
+
if (m === "0") {
|
|
1141
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1142
|
+
} else {
|
|
1143
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1144
|
+
}
|
|
1145
|
+
} else {
|
|
1146
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
debug("caret return", ret);
|
|
1150
|
+
return ret;
|
|
1151
|
+
});
|
|
1152
|
+
};
|
|
1153
|
+
var replaceXRanges = (comp, options) => {
|
|
1154
|
+
debug("replaceXRanges", comp, options);
|
|
1155
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1156
|
+
};
|
|
1157
|
+
var replaceXRange = (comp, options) => {
|
|
1158
|
+
comp = comp.trim();
|
|
1159
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1160
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1161
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1162
|
+
const xM = isX(M);
|
|
1163
|
+
const xm = xM || isX(m);
|
|
1164
|
+
const xp = xm || isX(p);
|
|
1165
|
+
const anyX = xp;
|
|
1166
|
+
if (gtlt === "=" && anyX) {
|
|
1167
|
+
gtlt = "";
|
|
1168
|
+
}
|
|
1169
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1170
|
+
if (xM) {
|
|
1171
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1172
|
+
ret = "<0.0.0-0";
|
|
1173
|
+
} else {
|
|
1174
|
+
ret = "*";
|
|
1175
|
+
}
|
|
1176
|
+
} else if (gtlt && anyX) {
|
|
1177
|
+
if (xm) {
|
|
1178
|
+
m = 0;
|
|
1179
|
+
}
|
|
1180
|
+
p = 0;
|
|
1181
|
+
if (gtlt === ">") {
|
|
1182
|
+
gtlt = ">=";
|
|
1183
|
+
if (xm) {
|
|
1184
|
+
M = +M + 1;
|
|
1185
|
+
m = 0;
|
|
1186
|
+
p = 0;
|
|
1187
|
+
} else {
|
|
1188
|
+
m = +m + 1;
|
|
1189
|
+
p = 0;
|
|
1190
|
+
}
|
|
1191
|
+
} else if (gtlt === "<=") {
|
|
1192
|
+
gtlt = "<";
|
|
1193
|
+
if (xm) {
|
|
1194
|
+
M = +M + 1;
|
|
1195
|
+
} else {
|
|
1196
|
+
m = +m + 1;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
if (gtlt === "<") {
|
|
1200
|
+
pr = "-0";
|
|
1201
|
+
}
|
|
1202
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1203
|
+
} else if (xm) {
|
|
1204
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1205
|
+
} else if (xp) {
|
|
1206
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1207
|
+
}
|
|
1208
|
+
debug("xRange return", ret);
|
|
1209
|
+
return ret;
|
|
1210
|
+
});
|
|
1211
|
+
};
|
|
1212
|
+
var replaceStars = (comp, options) => {
|
|
1213
|
+
debug("replaceStars", comp, options);
|
|
1214
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1215
|
+
};
|
|
1216
|
+
var replaceGTE0 = (comp, options) => {
|
|
1217
|
+
debug("replaceGTE0", comp, options);
|
|
1218
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1219
|
+
};
|
|
1220
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1221
|
+
if (isX(fM)) {
|
|
1222
|
+
from = "";
|
|
1223
|
+
} else if (isX(fm)) {
|
|
1224
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1225
|
+
} else if (isX(fp)) {
|
|
1226
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1227
|
+
} else if (fpr) {
|
|
1228
|
+
from = `>=${from}`;
|
|
1229
|
+
} else {
|
|
1230
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1231
|
+
}
|
|
1232
|
+
if (isX(tM)) {
|
|
1233
|
+
to = "";
|
|
1234
|
+
} else if (isX(tm)) {
|
|
1235
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1236
|
+
} else if (isX(tp)) {
|
|
1237
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1238
|
+
} else if (tpr) {
|
|
1239
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1240
|
+
} else if (incPr) {
|
|
1241
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1242
|
+
} else {
|
|
1243
|
+
to = `<=${to}`;
|
|
1244
|
+
}
|
|
1245
|
+
return `${from} ${to}`.trim();
|
|
1246
|
+
};
|
|
1247
|
+
var testSet = (set, version, options) => {
|
|
1248
|
+
for (let i = 0; i < set.length; i++) {
|
|
1249
|
+
if (!set[i].test(version)) {
|
|
1250
|
+
return false;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1254
|
+
for (let i = 0; i < set.length; i++) {
|
|
1255
|
+
debug(set[i].semver);
|
|
1256
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1257
|
+
continue;
|
|
1258
|
+
}
|
|
1259
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1260
|
+
const allowed = set[i].semver;
|
|
1261
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1262
|
+
return true;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
return false;
|
|
1267
|
+
}
|
|
1268
|
+
return true;
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
// node_modules/semver/classes/comparator.js
|
|
1274
|
+
var require_comparator = __commonJS({
|
|
1275
|
+
"node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1276
|
+
"use strict";
|
|
1277
|
+
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1278
|
+
var Comparator = class _Comparator {
|
|
1279
|
+
static get ANY() {
|
|
1280
|
+
return ANY;
|
|
1281
|
+
}
|
|
1282
|
+
constructor(comp, options) {
|
|
1283
|
+
options = parseOptions(options);
|
|
1284
|
+
if (comp instanceof _Comparator) {
|
|
1285
|
+
if (comp.loose === !!options.loose) {
|
|
1286
|
+
return comp;
|
|
1287
|
+
} else {
|
|
1288
|
+
comp = comp.value;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1292
|
+
debug("comparator", comp, options);
|
|
1293
|
+
this.options = options;
|
|
1294
|
+
this.loose = !!options.loose;
|
|
1295
|
+
this.parse(comp);
|
|
1296
|
+
if (this.semver === ANY) {
|
|
1297
|
+
this.value = "";
|
|
1298
|
+
} else {
|
|
1299
|
+
this.value = this.operator + this.semver.version;
|
|
1300
|
+
}
|
|
1301
|
+
debug("comp", this);
|
|
1302
|
+
}
|
|
1303
|
+
parse(comp) {
|
|
1304
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1305
|
+
const m = comp.match(r);
|
|
1306
|
+
if (!m) {
|
|
1307
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1308
|
+
}
|
|
1309
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1310
|
+
if (this.operator === "=") {
|
|
1311
|
+
this.operator = "";
|
|
1312
|
+
}
|
|
1313
|
+
if (!m[2]) {
|
|
1314
|
+
this.semver = ANY;
|
|
1315
|
+
} else {
|
|
1316
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
toString() {
|
|
1320
|
+
return this.value;
|
|
1321
|
+
}
|
|
1322
|
+
test(version) {
|
|
1323
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1324
|
+
if (this.semver === ANY || version === ANY) {
|
|
1325
|
+
return true;
|
|
1326
|
+
}
|
|
1327
|
+
if (typeof version === "string") {
|
|
1328
|
+
try {
|
|
1329
|
+
version = new SemVer(version, this.options);
|
|
1330
|
+
} catch (er) {
|
|
1331
|
+
return false;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1335
|
+
}
|
|
1336
|
+
intersects(comp, options) {
|
|
1337
|
+
if (!(comp instanceof _Comparator)) {
|
|
1338
|
+
throw new TypeError("a Comparator is required");
|
|
1339
|
+
}
|
|
1340
|
+
if (this.operator === "") {
|
|
1341
|
+
if (this.value === "") {
|
|
1342
|
+
return true;
|
|
1343
|
+
}
|
|
1344
|
+
return new Range(comp.value, options).test(this.value);
|
|
1345
|
+
} else if (comp.operator === "") {
|
|
1346
|
+
if (comp.value === "") {
|
|
1347
|
+
return true;
|
|
1348
|
+
}
|
|
1349
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1350
|
+
}
|
|
1351
|
+
options = parseOptions(options);
|
|
1352
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1356
|
+
return false;
|
|
1357
|
+
}
|
|
1358
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1359
|
+
return true;
|
|
1360
|
+
}
|
|
1361
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1362
|
+
return true;
|
|
1363
|
+
}
|
|
1364
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1365
|
+
return true;
|
|
1366
|
+
}
|
|
1367
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1368
|
+
return true;
|
|
1369
|
+
}
|
|
1370
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1371
|
+
return true;
|
|
1372
|
+
}
|
|
1373
|
+
return false;
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
module.exports = Comparator;
|
|
1377
|
+
var parseOptions = require_parse_options();
|
|
1378
|
+
var { safeRe: re, t } = require_re();
|
|
1379
|
+
var cmp = require_cmp();
|
|
1380
|
+
var debug = require_debug();
|
|
1381
|
+
var SemVer = require_semver();
|
|
1382
|
+
var Range = require_range();
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
// node_modules/semver/functions/satisfies.js
|
|
1387
|
+
var require_satisfies = __commonJS({
|
|
1388
|
+
"node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1389
|
+
"use strict";
|
|
1390
|
+
var Range = require_range();
|
|
1391
|
+
var satisfies = (version, range, options) => {
|
|
1392
|
+
try {
|
|
1393
|
+
range = new Range(range, options);
|
|
1394
|
+
} catch (er) {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
return range.test(version);
|
|
1398
|
+
};
|
|
1399
|
+
module.exports = satisfies;
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
|
|
1403
|
+
// node_modules/semver/ranges/to-comparators.js
|
|
1404
|
+
var require_to_comparators = __commonJS({
|
|
1405
|
+
"node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1406
|
+
"use strict";
|
|
1407
|
+
var Range = require_range();
|
|
1408
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1409
|
+
module.exports = toComparators;
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
// node_modules/semver/ranges/max-satisfying.js
|
|
1414
|
+
var require_max_satisfying = __commonJS({
|
|
1415
|
+
"node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1416
|
+
"use strict";
|
|
1417
|
+
var SemVer = require_semver();
|
|
1418
|
+
var Range = require_range();
|
|
1419
|
+
var maxSatisfying = (versions, range, options) => {
|
|
1420
|
+
let max = null;
|
|
1421
|
+
let maxSV = null;
|
|
1422
|
+
let rangeObj = null;
|
|
1423
|
+
try {
|
|
1424
|
+
rangeObj = new Range(range, options);
|
|
1425
|
+
} catch (er) {
|
|
1426
|
+
return null;
|
|
1427
|
+
}
|
|
1428
|
+
versions.forEach((v) => {
|
|
1429
|
+
if (rangeObj.test(v)) {
|
|
1430
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1431
|
+
max = v;
|
|
1432
|
+
maxSV = new SemVer(max, options);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
return max;
|
|
1437
|
+
};
|
|
1438
|
+
module.exports = maxSatisfying;
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
|
|
1442
|
+
// node_modules/semver/ranges/min-satisfying.js
|
|
1443
|
+
var require_min_satisfying = __commonJS({
|
|
1444
|
+
"node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1445
|
+
"use strict";
|
|
1446
|
+
var SemVer = require_semver();
|
|
1447
|
+
var Range = require_range();
|
|
1448
|
+
var minSatisfying = (versions, range, options) => {
|
|
1449
|
+
let min = null;
|
|
1450
|
+
let minSV = null;
|
|
1451
|
+
let rangeObj = null;
|
|
1452
|
+
try {
|
|
1453
|
+
rangeObj = new Range(range, options);
|
|
1454
|
+
} catch (er) {
|
|
1455
|
+
return null;
|
|
1456
|
+
}
|
|
1457
|
+
versions.forEach((v) => {
|
|
1458
|
+
if (rangeObj.test(v)) {
|
|
1459
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1460
|
+
min = v;
|
|
1461
|
+
minSV = new SemVer(min, options);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
return min;
|
|
1466
|
+
};
|
|
1467
|
+
module.exports = minSatisfying;
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
|
|
1471
|
+
// node_modules/semver/ranges/min-version.js
|
|
1472
|
+
var require_min_version = __commonJS({
|
|
1473
|
+
"node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1474
|
+
"use strict";
|
|
1475
|
+
var SemVer = require_semver();
|
|
1476
|
+
var Range = require_range();
|
|
1477
|
+
var gt = require_gt();
|
|
1478
|
+
var minVersion = (range, loose) => {
|
|
1479
|
+
range = new Range(range, loose);
|
|
1480
|
+
let minver = new SemVer("0.0.0");
|
|
1481
|
+
if (range.test(minver)) {
|
|
1482
|
+
return minver;
|
|
1483
|
+
}
|
|
1484
|
+
minver = new SemVer("0.0.0-0");
|
|
1485
|
+
if (range.test(minver)) {
|
|
1486
|
+
return minver;
|
|
1487
|
+
}
|
|
1488
|
+
minver = null;
|
|
1489
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1490
|
+
const comparators = range.set[i];
|
|
1491
|
+
let setMin = null;
|
|
1492
|
+
comparators.forEach((comparator) => {
|
|
1493
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1494
|
+
switch (comparator.operator) {
|
|
1495
|
+
case ">":
|
|
1496
|
+
if (compver.prerelease.length === 0) {
|
|
1497
|
+
compver.patch++;
|
|
1498
|
+
} else {
|
|
1499
|
+
compver.prerelease.push(0);
|
|
1500
|
+
}
|
|
1501
|
+
compver.raw = compver.format();
|
|
1502
|
+
/* fallthrough */
|
|
1503
|
+
case "":
|
|
1504
|
+
case ">=":
|
|
1505
|
+
if (!setMin || gt(compver, setMin)) {
|
|
1506
|
+
setMin = compver;
|
|
1507
|
+
}
|
|
1508
|
+
break;
|
|
1509
|
+
case "<":
|
|
1510
|
+
case "<=":
|
|
1511
|
+
break;
|
|
1512
|
+
/* istanbul ignore next */
|
|
1513
|
+
default:
|
|
1514
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1515
|
+
}
|
|
1516
|
+
});
|
|
1517
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1518
|
+
minver = setMin;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
if (minver && range.test(minver)) {
|
|
1522
|
+
return minver;
|
|
1523
|
+
}
|
|
1524
|
+
return null;
|
|
1525
|
+
};
|
|
1526
|
+
module.exports = minVersion;
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
|
|
1530
|
+
// node_modules/semver/ranges/valid.js
|
|
1531
|
+
var require_valid2 = __commonJS({
|
|
1532
|
+
"node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1533
|
+
"use strict";
|
|
1534
|
+
var Range = require_range();
|
|
1535
|
+
var validRange = (range, options) => {
|
|
1536
|
+
try {
|
|
1537
|
+
return new Range(range, options).range || "*";
|
|
1538
|
+
} catch (er) {
|
|
1539
|
+
return null;
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
module.exports = validRange;
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
|
|
1546
|
+
// node_modules/semver/ranges/outside.js
|
|
1547
|
+
var require_outside = __commonJS({
|
|
1548
|
+
"node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1549
|
+
"use strict";
|
|
1550
|
+
var SemVer = require_semver();
|
|
1551
|
+
var Comparator = require_comparator();
|
|
1552
|
+
var { ANY } = Comparator;
|
|
1553
|
+
var Range = require_range();
|
|
1554
|
+
var satisfies = require_satisfies();
|
|
1555
|
+
var gt = require_gt();
|
|
1556
|
+
var lt = require_lt();
|
|
1557
|
+
var lte = require_lte();
|
|
1558
|
+
var gte = require_gte();
|
|
1559
|
+
var outside = (version, range, hilo, options) => {
|
|
1560
|
+
version = new SemVer(version, options);
|
|
1561
|
+
range = new Range(range, options);
|
|
1562
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1563
|
+
switch (hilo) {
|
|
1564
|
+
case ">":
|
|
1565
|
+
gtfn = gt;
|
|
1566
|
+
ltefn = lte;
|
|
1567
|
+
ltfn = lt;
|
|
1568
|
+
comp = ">";
|
|
1569
|
+
ecomp = ">=";
|
|
1570
|
+
break;
|
|
1571
|
+
case "<":
|
|
1572
|
+
gtfn = lt;
|
|
1573
|
+
ltefn = gte;
|
|
1574
|
+
ltfn = gt;
|
|
1575
|
+
comp = "<";
|
|
1576
|
+
ecomp = "<=";
|
|
1577
|
+
break;
|
|
1578
|
+
default:
|
|
1579
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1580
|
+
}
|
|
1581
|
+
if (satisfies(version, range, options)) {
|
|
1582
|
+
return false;
|
|
1583
|
+
}
|
|
1584
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1585
|
+
const comparators = range.set[i];
|
|
1586
|
+
let high = null;
|
|
1587
|
+
let low = null;
|
|
1588
|
+
comparators.forEach((comparator) => {
|
|
1589
|
+
if (comparator.semver === ANY) {
|
|
1590
|
+
comparator = new Comparator(">=0.0.0");
|
|
1591
|
+
}
|
|
1592
|
+
high = high || comparator;
|
|
1593
|
+
low = low || comparator;
|
|
1594
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
1595
|
+
high = comparator;
|
|
1596
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1597
|
+
low = comparator;
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
1601
|
+
return false;
|
|
1602
|
+
}
|
|
1603
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1604
|
+
return false;
|
|
1605
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1606
|
+
return false;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
return true;
|
|
1610
|
+
};
|
|
1611
|
+
module.exports = outside;
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
|
|
1615
|
+
// node_modules/semver/ranges/gtr.js
|
|
1616
|
+
var require_gtr = __commonJS({
|
|
1617
|
+
"node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
1618
|
+
"use strict";
|
|
1619
|
+
var outside = require_outside();
|
|
1620
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1621
|
+
module.exports = gtr;
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1625
|
+
// node_modules/semver/ranges/ltr.js
|
|
1626
|
+
var require_ltr = __commonJS({
|
|
1627
|
+
"node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
1628
|
+
"use strict";
|
|
1629
|
+
var outside = require_outside();
|
|
1630
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1631
|
+
module.exports = ltr;
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
|
|
1635
|
+
// node_modules/semver/ranges/intersects.js
|
|
1636
|
+
var require_intersects = __commonJS({
|
|
1637
|
+
"node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
1638
|
+
"use strict";
|
|
1639
|
+
var Range = require_range();
|
|
1640
|
+
var intersects = (r1, r2, options) => {
|
|
1641
|
+
r1 = new Range(r1, options);
|
|
1642
|
+
r2 = new Range(r2, options);
|
|
1643
|
+
return r1.intersects(r2, options);
|
|
1644
|
+
};
|
|
1645
|
+
module.exports = intersects;
|
|
1646
|
+
}
|
|
1647
|
+
});
|
|
1648
|
+
|
|
1649
|
+
// node_modules/semver/ranges/simplify.js
|
|
1650
|
+
var require_simplify = __commonJS({
|
|
1651
|
+
"node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
1652
|
+
"use strict";
|
|
1653
|
+
var satisfies = require_satisfies();
|
|
1654
|
+
var compare = require_compare();
|
|
1655
|
+
module.exports = (versions, range, options) => {
|
|
1656
|
+
const set = [];
|
|
1657
|
+
let first = null;
|
|
1658
|
+
let prev = null;
|
|
1659
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1660
|
+
for (const version of v) {
|
|
1661
|
+
const included = satisfies(version, range, options);
|
|
1662
|
+
if (included) {
|
|
1663
|
+
prev = version;
|
|
1664
|
+
if (!first) {
|
|
1665
|
+
first = version;
|
|
1666
|
+
}
|
|
1667
|
+
} else {
|
|
1668
|
+
if (prev) {
|
|
1669
|
+
set.push([first, prev]);
|
|
1670
|
+
}
|
|
1671
|
+
prev = null;
|
|
1672
|
+
first = null;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
if (first) {
|
|
1676
|
+
set.push([first, null]);
|
|
1677
|
+
}
|
|
1678
|
+
const ranges = [];
|
|
1679
|
+
for (const [min, max] of set) {
|
|
1680
|
+
if (min === max) {
|
|
1681
|
+
ranges.push(min);
|
|
1682
|
+
} else if (!max && min === v[0]) {
|
|
1683
|
+
ranges.push("*");
|
|
1684
|
+
} else if (!max) {
|
|
1685
|
+
ranges.push(`>=${min}`);
|
|
1686
|
+
} else if (min === v[0]) {
|
|
1687
|
+
ranges.push(`<=${max}`);
|
|
1688
|
+
} else {
|
|
1689
|
+
ranges.push(`${min} - ${max}`);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
const simplified = ranges.join(" || ");
|
|
1693
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1694
|
+
return simplified.length < original.length ? simplified : range;
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
});
|
|
1698
|
+
|
|
1699
|
+
// node_modules/semver/ranges/subset.js
|
|
1700
|
+
var require_subset = __commonJS({
|
|
1701
|
+
"node_modules/semver/ranges/subset.js"(exports, module) {
|
|
1702
|
+
"use strict";
|
|
1703
|
+
var Range = require_range();
|
|
1704
|
+
var Comparator = require_comparator();
|
|
1705
|
+
var { ANY } = Comparator;
|
|
1706
|
+
var satisfies = require_satisfies();
|
|
1707
|
+
var compare = require_compare();
|
|
1708
|
+
var subset = (sub, dom, options = {}) => {
|
|
1709
|
+
if (sub === dom) {
|
|
1710
|
+
return true;
|
|
1711
|
+
}
|
|
1712
|
+
sub = new Range(sub, options);
|
|
1713
|
+
dom = new Range(dom, options);
|
|
1714
|
+
let sawNonNull = false;
|
|
1715
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1716
|
+
for (const simpleDom of dom.set) {
|
|
1717
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1718
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1719
|
+
if (isSub) {
|
|
1720
|
+
continue OUTER;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
if (sawNonNull) {
|
|
1724
|
+
return false;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
return true;
|
|
1728
|
+
};
|
|
1729
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1730
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
1731
|
+
var simpleSubset = (sub, dom, options) => {
|
|
1732
|
+
if (sub === dom) {
|
|
1733
|
+
return true;
|
|
1734
|
+
}
|
|
1735
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1736
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1737
|
+
return true;
|
|
1738
|
+
} else if (options.includePrerelease) {
|
|
1739
|
+
sub = minimumVersionWithPreRelease;
|
|
1740
|
+
} else {
|
|
1741
|
+
sub = minimumVersion;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1745
|
+
if (options.includePrerelease) {
|
|
1746
|
+
return true;
|
|
1747
|
+
} else {
|
|
1748
|
+
dom = minimumVersion;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1752
|
+
let gt, lt;
|
|
1753
|
+
for (const c of sub) {
|
|
1754
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1755
|
+
gt = higherGT(gt, c, options);
|
|
1756
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1757
|
+
lt = lowerLT(lt, c, options);
|
|
1758
|
+
} else {
|
|
1759
|
+
eqSet.add(c.semver);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
if (eqSet.size > 1) {
|
|
1763
|
+
return null;
|
|
1764
|
+
}
|
|
1765
|
+
let gtltComp;
|
|
1766
|
+
if (gt && lt) {
|
|
1767
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1768
|
+
if (gtltComp > 0) {
|
|
1769
|
+
return null;
|
|
1770
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1771
|
+
return null;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
for (const eq of eqSet) {
|
|
1775
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1776
|
+
return null;
|
|
1777
|
+
}
|
|
1778
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1779
|
+
return null;
|
|
1780
|
+
}
|
|
1781
|
+
for (const c of dom) {
|
|
1782
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1783
|
+
return false;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
return true;
|
|
1787
|
+
}
|
|
1788
|
+
let higher, lower;
|
|
1789
|
+
let hasDomLT, hasDomGT;
|
|
1790
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1791
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1792
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1793
|
+
needDomLTPre = false;
|
|
1794
|
+
}
|
|
1795
|
+
for (const c of dom) {
|
|
1796
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1797
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1798
|
+
if (gt) {
|
|
1799
|
+
if (needDomGTPre) {
|
|
1800
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1801
|
+
needDomGTPre = false;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1805
|
+
higher = higherGT(gt, c, options);
|
|
1806
|
+
if (higher === c && higher !== gt) {
|
|
1807
|
+
return false;
|
|
1808
|
+
}
|
|
1809
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
1810
|
+
return false;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
if (lt) {
|
|
1814
|
+
if (needDomLTPre) {
|
|
1815
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1816
|
+
needDomLTPre = false;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1820
|
+
lower = lowerLT(lt, c, options);
|
|
1821
|
+
if (lower === c && lower !== lt) {
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
1825
|
+
return false;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1829
|
+
return false;
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1833
|
+
return false;
|
|
1834
|
+
}
|
|
1835
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1836
|
+
return false;
|
|
1837
|
+
}
|
|
1838
|
+
if (needDomGTPre || needDomLTPre) {
|
|
1839
|
+
return false;
|
|
1840
|
+
}
|
|
1841
|
+
return true;
|
|
1842
|
+
};
|
|
1843
|
+
var higherGT = (a, b, options) => {
|
|
1844
|
+
if (!a) {
|
|
1845
|
+
return b;
|
|
1846
|
+
}
|
|
1847
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1848
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1849
|
+
};
|
|
1850
|
+
var lowerLT = (a, b, options) => {
|
|
1851
|
+
if (!a) {
|
|
1852
|
+
return b;
|
|
1853
|
+
}
|
|
1854
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1855
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1856
|
+
};
|
|
1857
|
+
module.exports = subset;
|
|
1858
|
+
}
|
|
1859
|
+
});
|
|
1860
|
+
|
|
1861
|
+
// node_modules/semver/index.js
|
|
1862
|
+
var require_semver2 = __commonJS({
|
|
1863
|
+
"node_modules/semver/index.js"(exports, module) {
|
|
1864
|
+
"use strict";
|
|
1865
|
+
var internalRe = require_re();
|
|
1866
|
+
var constants = require_constants();
|
|
1867
|
+
var SemVer = require_semver();
|
|
1868
|
+
var identifiers = require_identifiers();
|
|
1869
|
+
var parse = require_parse();
|
|
1870
|
+
var valid = require_valid();
|
|
1871
|
+
var clean = require_clean();
|
|
1872
|
+
var inc = require_inc();
|
|
1873
|
+
var diff = require_diff();
|
|
1874
|
+
var major = require_major();
|
|
1875
|
+
var minor = require_minor();
|
|
1876
|
+
var patch = require_patch();
|
|
1877
|
+
var prerelease = require_prerelease();
|
|
1878
|
+
var compare = require_compare();
|
|
1879
|
+
var rcompare = require_rcompare();
|
|
1880
|
+
var compareLoose = require_compare_loose();
|
|
1881
|
+
var compareBuild = require_compare_build();
|
|
1882
|
+
var sort = require_sort();
|
|
1883
|
+
var rsort = require_rsort();
|
|
1884
|
+
var gt = require_gt();
|
|
1885
|
+
var lt = require_lt();
|
|
1886
|
+
var eq = require_eq();
|
|
1887
|
+
var neq = require_neq();
|
|
1888
|
+
var gte = require_gte();
|
|
1889
|
+
var lte = require_lte();
|
|
1890
|
+
var cmp = require_cmp();
|
|
1891
|
+
var coerce = require_coerce();
|
|
1892
|
+
var Comparator = require_comparator();
|
|
1893
|
+
var Range = require_range();
|
|
1894
|
+
var satisfies = require_satisfies();
|
|
1895
|
+
var toComparators = require_to_comparators();
|
|
1896
|
+
var maxSatisfying = require_max_satisfying();
|
|
1897
|
+
var minSatisfying = require_min_satisfying();
|
|
1898
|
+
var minVersion = require_min_version();
|
|
1899
|
+
var validRange = require_valid2();
|
|
1900
|
+
var outside = require_outside();
|
|
1901
|
+
var gtr = require_gtr();
|
|
1902
|
+
var ltr = require_ltr();
|
|
1903
|
+
var intersects = require_intersects();
|
|
1904
|
+
var simplifyRange = require_simplify();
|
|
1905
|
+
var subset = require_subset();
|
|
1906
|
+
module.exports = {
|
|
1907
|
+
parse,
|
|
1908
|
+
valid,
|
|
1909
|
+
clean,
|
|
1910
|
+
inc,
|
|
1911
|
+
diff,
|
|
1912
|
+
major,
|
|
1913
|
+
minor,
|
|
1914
|
+
patch,
|
|
1915
|
+
prerelease,
|
|
1916
|
+
compare,
|
|
1917
|
+
rcompare,
|
|
1918
|
+
compareLoose,
|
|
1919
|
+
compareBuild,
|
|
1920
|
+
sort,
|
|
1921
|
+
rsort,
|
|
1922
|
+
gt,
|
|
1923
|
+
lt,
|
|
1924
|
+
eq,
|
|
1925
|
+
neq,
|
|
1926
|
+
gte,
|
|
1927
|
+
lte,
|
|
1928
|
+
cmp,
|
|
1929
|
+
coerce,
|
|
1930
|
+
Comparator,
|
|
1931
|
+
Range,
|
|
1932
|
+
satisfies,
|
|
1933
|
+
toComparators,
|
|
1934
|
+
maxSatisfying,
|
|
1935
|
+
minSatisfying,
|
|
1936
|
+
minVersion,
|
|
1937
|
+
validRange,
|
|
1938
|
+
outside,
|
|
1939
|
+
gtr,
|
|
1940
|
+
ltr,
|
|
1941
|
+
intersects,
|
|
1942
|
+
simplifyRange,
|
|
1943
|
+
subset,
|
|
1944
|
+
SemVer,
|
|
1945
|
+
re: internalRe.re,
|
|
1946
|
+
src: internalRe.src,
|
|
1947
|
+
tokens: internalRe.t,
|
|
1948
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1949
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1950
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1951
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
24
1955
|
|
|
25
1956
|
// src/index.ts
|
|
26
1957
|
import "dotenv/config";
|
|
@@ -621,7 +2552,7 @@ function registerStatusCommand(program2) {
|
|
|
621
2552
|
try {
|
|
622
2553
|
const { render } = await import("ink");
|
|
623
2554
|
const { createElement } = await import("react");
|
|
624
|
-
const { StatusDashboard } = await import("./StatusDashboard-
|
|
2555
|
+
const { StatusDashboard } = await import("./StatusDashboard-LYZL3IQH.js");
|
|
625
2556
|
render(createElement(StatusDashboard, { cwd }));
|
|
626
2557
|
return;
|
|
627
2558
|
} catch (error) {
|
|
@@ -729,10 +2660,12 @@ function registerSyncCommand(program2) {
|
|
|
729
2660
|
spinner.text = `Found ${totalFiles} files to analyze...`;
|
|
730
2661
|
spinner.text = "Getting branch information...";
|
|
731
2662
|
const repoInfo = await gitService.getRepoInfo(cwd);
|
|
2663
|
+
spinner.text = "Getting changed files...";
|
|
2664
|
+
const changedFiles = await gitService.getChangedFiles(cwd);
|
|
732
2665
|
spinner.text = "Preparing sync payload...";
|
|
733
2666
|
const syncSpinner = ora7("Connecting to server...").start();
|
|
734
2667
|
try {
|
|
735
|
-
await apiService.syncProject(linkedProject.projectId, repoInfo);
|
|
2668
|
+
await apiService.syncProject(linkedProject.projectId, repoInfo, changedFiles);
|
|
736
2669
|
syncSpinner.succeed("Server sync completed");
|
|
737
2670
|
} catch (error) {
|
|
738
2671
|
syncSpinner.fail("Server sync failed");
|
|
@@ -741,6 +2674,7 @@ function registerSyncCommand(program2) {
|
|
|
741
2674
|
console.log(chalk7.green("\n\u2713 Repository sync completed"));
|
|
742
2675
|
console.log(chalk7.gray("\u2500".repeat(50)));
|
|
743
2676
|
console.log(`${chalk7.bold("Files:")} ${totalFiles} total (${status.staged.length} staged, ${status.unstaged.length} modified, ${status.untracked.length} untracked)`);
|
|
2677
|
+
console.log(`${chalk7.bold("Changed:")} ${changedFiles.length} files synced for commit selection`);
|
|
744
2678
|
console.log(`${chalk7.bold("Project ID:")} ${linkedProject.projectId}`);
|
|
745
2679
|
console.log(`${chalk7.bold("Branch:")} ${repoInfo.currentBranch}`);
|
|
746
2680
|
console.log(`${chalk7.bold("Commit:")} ${repoInfo.lastCommitSha.substring(0, 7)} - ${repoInfo.lastCommitMessage}`);
|
|
@@ -1635,6 +3569,157 @@ function registerUninstallCommand(program2) {
|
|
|
1635
3569
|
import ora12 from "ora";
|
|
1636
3570
|
import chalk12 from "chalk";
|
|
1637
3571
|
|
|
3572
|
+
// src/services/version.ts
|
|
3573
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
3574
|
+
import fs3 from "fs";
|
|
3575
|
+
import path5 from "path";
|
|
3576
|
+
import os5 from "os";
|
|
3577
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3578
|
+
var CACHE_TTL = 60 * 60 * 1e3;
|
|
3579
|
+
var CACHE_FILE = path5.join(os5.homedir(), ".config", "stint", "version-cache.json");
|
|
3580
|
+
var PACKAGE_NAME = "@gowelle/stint-agent";
|
|
3581
|
+
var VersionService = class {
|
|
3582
|
+
currentVersion;
|
|
3583
|
+
constructor(currentVersion) {
|
|
3584
|
+
this.currentVersion = currentVersion;
|
|
3585
|
+
}
|
|
3586
|
+
/**
|
|
3587
|
+
* Check if an update is available
|
|
3588
|
+
* @param channel - Release channel to check (stable or beta)
|
|
3589
|
+
* @returns Version information including update availability
|
|
3590
|
+
*/
|
|
3591
|
+
async checkForUpdates(channel = "stable") {
|
|
3592
|
+
try {
|
|
3593
|
+
const registryData = await this.fetchRegistryData();
|
|
3594
|
+
let latestVersion;
|
|
3595
|
+
if (channel === "beta") {
|
|
3596
|
+
latestVersion = registryData["dist-tags"].beta || registryData["dist-tags"].latest;
|
|
3597
|
+
if (!registryData["dist-tags"].beta) {
|
|
3598
|
+
logger.warn("version", "No beta channel available, using stable");
|
|
3599
|
+
}
|
|
3600
|
+
} else {
|
|
3601
|
+
latestVersion = registryData["dist-tags"].latest;
|
|
3602
|
+
}
|
|
3603
|
+
if (!latestVersion || !import_semver.default.valid(latestVersion)) {
|
|
3604
|
+
throw new Error(`Invalid latest version: ${latestVersion}`);
|
|
3605
|
+
}
|
|
3606
|
+
if (!import_semver.default.valid(this.currentVersion)) {
|
|
3607
|
+
throw new Error(`Invalid current version: ${this.currentVersion}`);
|
|
3608
|
+
}
|
|
3609
|
+
const hasUpdate = import_semver.default.gt(latestVersion, this.currentVersion);
|
|
3610
|
+
logger.info("version", `Current: ${this.currentVersion}, Latest (${channel}): ${latestVersion}, Update available: ${hasUpdate}`);
|
|
3611
|
+
return {
|
|
3612
|
+
current: this.currentVersion,
|
|
3613
|
+
latest: latestVersion,
|
|
3614
|
+
hasUpdate,
|
|
3615
|
+
channel
|
|
3616
|
+
};
|
|
3617
|
+
} catch (error) {
|
|
3618
|
+
logger.error("version", "Failed to check for updates", error);
|
|
3619
|
+
throw error;
|
|
3620
|
+
}
|
|
3621
|
+
}
|
|
3622
|
+
/**
|
|
3623
|
+
* Get the latest version for a specific channel
|
|
3624
|
+
* @param channel - Release channel (stable or beta)
|
|
3625
|
+
* @returns Latest version string
|
|
3626
|
+
*/
|
|
3627
|
+
async getLatestVersion(channel = "stable") {
|
|
3628
|
+
const registryData = await this.fetchRegistryData();
|
|
3629
|
+
return channel === "beta" ? registryData["dist-tags"].beta || registryData["dist-tags"].latest : registryData["dist-tags"].latest;
|
|
3630
|
+
}
|
|
3631
|
+
/**
|
|
3632
|
+
* Fetch registry data from npm, using cache if available
|
|
3633
|
+
* @returns Registry response data
|
|
3634
|
+
*/
|
|
3635
|
+
async fetchRegistryData() {
|
|
3636
|
+
const cachedData = this.loadCache();
|
|
3637
|
+
if (cachedData && Date.now() - cachedData.timestamp < CACHE_TTL) {
|
|
3638
|
+
logger.debug("version", "Using cached registry data");
|
|
3639
|
+
return cachedData.data;
|
|
3640
|
+
}
|
|
3641
|
+
logger.debug("version", "Fetching fresh registry data");
|
|
3642
|
+
const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`);
|
|
3643
|
+
if (!response.ok) {
|
|
3644
|
+
throw new Error(`Failed to fetch registry data: ${response.status} ${response.statusText}`);
|
|
3645
|
+
}
|
|
3646
|
+
const data = await response.json();
|
|
3647
|
+
this.saveCache(data);
|
|
3648
|
+
return data;
|
|
3649
|
+
}
|
|
3650
|
+
/**
|
|
3651
|
+
* Load cached registry data
|
|
3652
|
+
* @returns Cached data or null if not available/expired
|
|
3653
|
+
*/
|
|
3654
|
+
loadCache() {
|
|
3655
|
+
try {
|
|
3656
|
+
if (!fs3.existsSync(CACHE_FILE)) {
|
|
3657
|
+
return null;
|
|
3658
|
+
}
|
|
3659
|
+
const content = fs3.readFileSync(CACHE_FILE, "utf8");
|
|
3660
|
+
return JSON.parse(content);
|
|
3661
|
+
} catch (error) {
|
|
3662
|
+
logger.debug("version", "Failed to load cache", error);
|
|
3663
|
+
return null;
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
/**
|
|
3667
|
+
* Save registry data to cache
|
|
3668
|
+
* @param data - Registry data to cache
|
|
3669
|
+
*/
|
|
3670
|
+
saveCache(data) {
|
|
3671
|
+
try {
|
|
3672
|
+
const cacheDir = path5.dirname(CACHE_FILE);
|
|
3673
|
+
if (!fs3.existsSync(cacheDir)) {
|
|
3674
|
+
fs3.mkdirSync(cacheDir, { recursive: true });
|
|
3675
|
+
}
|
|
3676
|
+
const cache = {
|
|
3677
|
+
timestamp: Date.now(),
|
|
3678
|
+
data
|
|
3679
|
+
};
|
|
3680
|
+
fs3.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2));
|
|
3681
|
+
} catch (error) {
|
|
3682
|
+
logger.debug("version", "Failed to save cache", error);
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
/**
|
|
3686
|
+
* Clear the version cache
|
|
3687
|
+
*/
|
|
3688
|
+
clearCache() {
|
|
3689
|
+
try {
|
|
3690
|
+
if (fs3.existsSync(CACHE_FILE)) {
|
|
3691
|
+
fs3.unlinkSync(CACHE_FILE);
|
|
3692
|
+
logger.debug("version", "Cache cleared");
|
|
3693
|
+
}
|
|
3694
|
+
} catch (error) {
|
|
3695
|
+
logger.debug("version", "Failed to clear cache", error);
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
};
|
|
3699
|
+
function getCurrentVersion() {
|
|
3700
|
+
try {
|
|
3701
|
+
let currentDir = path5.dirname(fileURLToPath2(import.meta.url));
|
|
3702
|
+
let packageJsonPath = null;
|
|
3703
|
+
for (let i = 0; i < 5; i++) {
|
|
3704
|
+
const testPath = path5.join(currentDir, "package.json");
|
|
3705
|
+
if (fs3.existsSync(testPath)) {
|
|
3706
|
+
packageJsonPath = testPath;
|
|
3707
|
+
break;
|
|
3708
|
+
}
|
|
3709
|
+
currentDir = path5.dirname(currentDir);
|
|
3710
|
+
}
|
|
3711
|
+
if (!packageJsonPath) {
|
|
3712
|
+
throw new Error("package.json not found");
|
|
3713
|
+
}
|
|
3714
|
+
const packageJson = JSON.parse(fs3.readFileSync(packageJsonPath, "utf8"));
|
|
3715
|
+
return packageJson.version;
|
|
3716
|
+
} catch (error) {
|
|
3717
|
+
logger.error("version", "Failed to read package version", error);
|
|
3718
|
+
return "0.0.0";
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
var versionService = new VersionService(getCurrentVersion());
|
|
3722
|
+
|
|
1638
3723
|
// src/services/update.ts
|
|
1639
3724
|
import { execSync as execSync2 } from "child_process";
|
|
1640
3725
|
import ora11 from "ora";
|
|
@@ -2069,7 +4154,7 @@ function registerDoctorCommand(program2) {
|
|
|
2069
4154
|
}
|
|
2070
4155
|
|
|
2071
4156
|
// src/index.ts
|
|
2072
|
-
var AGENT_VERSION = "1.2.
|
|
4157
|
+
var AGENT_VERSION = "1.2.22";
|
|
2073
4158
|
var program = new Command();
|
|
2074
4159
|
program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION, "-v, --version", "output the current version").addHelpText("after", `
|
|
2075
4160
|
${chalk14.bold("Examples:")}
|