@lynx-js/devtool-connector 0.13.1 → 0.16.2
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/CHANGELOG.md +13 -0
- package/LICENSE +1 -1
- package/README.md +18 -134
- package/dist/2.js +2019 -0
- package/dist/{346.js → a.js} +102 -143
- package/dist/client-id.d.ts +0 -6
- package/dist/command/client.d.ts +8 -7
- package/dist/command/contract.d.ts +82 -24
- package/dist/command/core.d.ts +11 -10
- package/dist/command/in-process-client.d.ts +16 -0
- package/dist/command/index.d.ts +28 -20
- package/dist/command/index.js +177 -159
- package/dist/command/list-clients.d.ts +6 -0
- package/dist/command/list-sessions.d.ts +5 -0
- package/dist/command/open.d.ts +5 -0
- package/dist/command/query.d.ts +1 -1
- package/dist/command/reactlynx/controller.d.ts +3 -3
- package/dist/command/reactlynx/model.d.ts +7 -7
- package/dist/command/reactlynx/protocol.d.ts +0 -1
- package/dist/command/reactlynx/session.d.ts +3 -3
- package/dist/command/reactlynx/types.d.ts +7 -7
- package/dist/command/ref-actions.d.ts +4 -4
- package/dist/command/result.d.ts +0 -1
- package/dist/command/screenshot-annotation.d.ts +2 -2
- package/dist/command/screenshot.d.ts +2 -2
- package/dist/command/snapshot.d.ts +2 -2
- package/dist/command/source-info.d.ts +20 -0
- package/dist/command/targets.d.ts +8 -10
- package/dist/command/timeout.d.ts +3 -0
- package/dist/command/wait-for-client.d.ts +5 -0
- package/dist/daemon/device-connection.d.ts +4 -3
- package/dist/daemon/entry.js +18 -20
- package/dist/daemon/index.d.ts +7 -2
- package/dist/daemon/index.js +7 -3
- package/dist/daemon/inspector-assets.d.ts +11 -0
- package/dist/daemon/manager.d.ts +12 -4
- package/dist/daemon/protocol.d.ts +20 -16
- package/dist/daemon/server.d.ts +7 -1
- package/dist/daemon/static-server.d.ts +3 -1
- package/dist/f.js +5790 -0
- package/dist/f1.js +737 -0
- package/dist/{962.js → h.js} +841 -3259
- package/dist/{712.js → hb.js} +26 -19
- package/dist/i.js +2505 -0
- package/dist/index.d.ts +13 -18
- package/dist/index.js +3 -2
- package/dist/main.d.ts +2 -0
- package/dist/main.js +3 -0
- package/dist/request-id.d.ts +1 -0
- package/dist/streams/cdp.d.ts +3 -3
- package/dist/streams/customized.d.ts +5 -5
- package/dist/streams/index.d.ts +4 -3
- package/dist/streams/index.js +1 -1
- package/dist/streams/utils.d.ts +3 -3
- package/dist/{872.js → t.js} +364 -301
- package/dist/transport/adb-shell-types.d.ts +14 -0
- package/dist/transport/android-app-icon-helper.d.ts +1 -0
- package/dist/transport/android.d.ts +13 -3
- package/dist/transport/base.d.ts +2 -9
- package/dist/transport/daemon.d.ts +3 -2
- package/dist/transport/desktop.d.ts +1 -1
- package/dist/transport/hdt.d.ts +13 -0
- package/dist/transport/index.d.ts +9 -9
- package/dist/transport/index.js +2 -3
- package/dist/transport/ios.d.ts +2 -2
- package/dist/transport/peertalk.d.ts +4 -3
- package/dist/transport/stream-lifecycle.d.ts +4 -0
- package/dist/transport/transport.d.ts +4 -8
- package/dist/transport/usbmux.d.ts +5 -5
- package/dist/transport/ws-stream.d.ts +3 -10
- package/dist/types.d.ts +27 -54
- package/dist/{63.js → ws-stream.js} +23 -24
- package/package.json +32 -22
- package/dist/390.js +0 -329
- package/dist/556.js +0 -258
- package/dist/61.js +0 -3432
package/dist/2.js
ADDED
|
@@ -0,0 +1,2019 @@
|
|
|
1
|
+
import { isatty } from "node:tty";
|
|
2
|
+
import { formatWithOptions, inspect } from "node:util";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { once } from "node:events";
|
|
5
|
+
import { closeSync, openSync } from "node:fs";
|
|
6
|
+
import promises from "node:fs/promises";
|
|
7
|
+
import node_http from "node:http";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import node_net from "node:net";
|
|
10
|
+
import node_os from "node:os";
|
|
11
|
+
import node_path from "node:path";
|
|
12
|
+
import { performance } from "node:perf_hooks";
|
|
13
|
+
import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
14
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
15
|
+
__webpack_require__.add({
|
|
16
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
17
|
+
const ANY = Symbol('SemVer ANY');
|
|
18
|
+
class Comparator {
|
|
19
|
+
static get ANY() {
|
|
20
|
+
return ANY;
|
|
21
|
+
}
|
|
22
|
+
constructor(comp, options){
|
|
23
|
+
options = parseOptions(options);
|
|
24
|
+
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
25
|
+
else comp = comp.value;
|
|
26
|
+
comp = comp.trim().split(/\s+/).join(' ');
|
|
27
|
+
debug('comparator', comp, options);
|
|
28
|
+
this.options = options;
|
|
29
|
+
this.loose = !!options.loose;
|
|
30
|
+
this.parse(comp);
|
|
31
|
+
if (this.semver === ANY) this.value = '';
|
|
32
|
+
else this.value = this.operator + this.semver.version;
|
|
33
|
+
debug('comp', this);
|
|
34
|
+
}
|
|
35
|
+
parse(comp) {
|
|
36
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
37
|
+
const m = comp.match(r);
|
|
38
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
39
|
+
this.operator = void 0 !== m[1] ? m[1] : '';
|
|
40
|
+
if ('=' === this.operator) this.operator = '';
|
|
41
|
+
if (m[2]) this.semver = new SemVer(m[2], this.options.loose);
|
|
42
|
+
else this.semver = ANY;
|
|
43
|
+
}
|
|
44
|
+
toString() {
|
|
45
|
+
return this.value;
|
|
46
|
+
}
|
|
47
|
+
test(version) {
|
|
48
|
+
debug('Comparator.test', version, this.options.loose);
|
|
49
|
+
if (this.semver === ANY || version === ANY) return true;
|
|
50
|
+
if ('string' == typeof version) try {
|
|
51
|
+
version = new SemVer(version, this.options);
|
|
52
|
+
} catch (er) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
56
|
+
}
|
|
57
|
+
intersects(comp, options) {
|
|
58
|
+
if (!(comp instanceof Comparator)) throw new TypeError('a Comparator is required');
|
|
59
|
+
if ('' === this.operator) {
|
|
60
|
+
if ('' === this.value) return true;
|
|
61
|
+
return new Range(comp.value, options).test(this.value);
|
|
62
|
+
} else if ('' === comp.operator) {
|
|
63
|
+
if ('' === comp.value) return true;
|
|
64
|
+
return new Range(this.value, options).test(comp.semver);
|
|
65
|
+
}
|
|
66
|
+
options = parseOptions(options);
|
|
67
|
+
if (options.includePrerelease && ('<0.0.0-0' === this.value || '<0.0.0-0' === comp.value)) return false;
|
|
68
|
+
if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) return false;
|
|
69
|
+
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) return true;
|
|
70
|
+
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) return true;
|
|
71
|
+
if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) return true;
|
|
72
|
+
if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) return true;
|
|
73
|
+
if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) return true;
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
module.exports = Comparator;
|
|
78
|
+
const parseOptions = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js");
|
|
79
|
+
const { safeRe: re, t } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js");
|
|
80
|
+
const cmp = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js");
|
|
81
|
+
const debug = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js");
|
|
82
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
83
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
84
|
+
},
|
|
85
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
86
|
+
const SPACE_CHARACTERS = /\s+/g;
|
|
87
|
+
class Range {
|
|
88
|
+
constructor(range, options){
|
|
89
|
+
options = parseOptions(options);
|
|
90
|
+
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
91
|
+
else return new Range(range.raw, options);
|
|
92
|
+
if (range instanceof Comparator) {
|
|
93
|
+
this.raw = range.value;
|
|
94
|
+
this.set = [
|
|
95
|
+
[
|
|
96
|
+
range
|
|
97
|
+
]
|
|
98
|
+
];
|
|
99
|
+
this.formatted = void 0;
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
this.options = options;
|
|
103
|
+
this.loose = !!options.loose;
|
|
104
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
105
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ');
|
|
106
|
+
this.set = this.raw.split('||').map((r)=>this.parseRange(r.trim())).filter((c)=>c.length);
|
|
107
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
108
|
+
if (this.set.length > 1) {
|
|
109
|
+
const first = this.set[0];
|
|
110
|
+
this.set = this.set.filter((c)=>!isNullSet(c[0]));
|
|
111
|
+
if (0 === this.set.length) this.set = [
|
|
112
|
+
first
|
|
113
|
+
];
|
|
114
|
+
else if (this.set.length > 1) {
|
|
115
|
+
for (const c of this.set)if (1 === c.length && isAny(c[0])) {
|
|
116
|
+
this.set = [
|
|
117
|
+
c
|
|
118
|
+
];
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
this.formatted = void 0;
|
|
124
|
+
}
|
|
125
|
+
get range() {
|
|
126
|
+
if (void 0 === this.formatted) {
|
|
127
|
+
this.formatted = '';
|
|
128
|
+
for(let i = 0; i < this.set.length; i++){
|
|
129
|
+
if (i > 0) this.formatted += '||';
|
|
130
|
+
const comps = this.set[i];
|
|
131
|
+
for(let k = 0; k < comps.length; k++){
|
|
132
|
+
if (k > 0) this.formatted += ' ';
|
|
133
|
+
this.formatted += comps[k].toString().trim();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return this.formatted;
|
|
138
|
+
}
|
|
139
|
+
format() {
|
|
140
|
+
return this.range;
|
|
141
|
+
}
|
|
142
|
+
toString() {
|
|
143
|
+
return this.range;
|
|
144
|
+
}
|
|
145
|
+
parseRange(range) {
|
|
146
|
+
range = range.replace(BUILDSTRIPRE, '');
|
|
147
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
148
|
+
const memoKey = memoOpts + ':' + range;
|
|
149
|
+
const cached = cache.get(memoKey);
|
|
150
|
+
if (cached) return cached;
|
|
151
|
+
const loose = this.options.loose;
|
|
152
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
153
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
154
|
+
debug('hyphen replace', range);
|
|
155
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
156
|
+
debug('comparator trim', range);
|
|
157
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
158
|
+
debug('tilde trim', range);
|
|
159
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
160
|
+
debug('caret trim', range);
|
|
161
|
+
let rangeList = range.split(' ').map((comp)=>parseComparator(comp, this.options)).join(' ').split(/\s+/).map((comp)=>replaceGTE0(comp, this.options));
|
|
162
|
+
if (loose) rangeList = rangeList.filter((comp)=>{
|
|
163
|
+
debug('loose invalid filter', comp, this.options);
|
|
164
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
165
|
+
});
|
|
166
|
+
debug('range list', rangeList);
|
|
167
|
+
const rangeMap = new Map();
|
|
168
|
+
const comparators = rangeList.map((comp)=>new Comparator(comp, this.options));
|
|
169
|
+
for (const comp of comparators){
|
|
170
|
+
if (isNullSet(comp)) return [
|
|
171
|
+
comp
|
|
172
|
+
];
|
|
173
|
+
rangeMap.set(comp.value, comp);
|
|
174
|
+
}
|
|
175
|
+
if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('');
|
|
176
|
+
const result = [
|
|
177
|
+
...rangeMap.values()
|
|
178
|
+
];
|
|
179
|
+
cache.set(memoKey, result);
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
intersects(range, options) {
|
|
183
|
+
if (!(range instanceof Range)) throw new TypeError('a Range is required');
|
|
184
|
+
return this.set.some((thisComparators)=>isSatisfiable(thisComparators, options) && range.set.some((rangeComparators)=>isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator)=>rangeComparators.every((rangeComparator)=>thisComparator.intersects(rangeComparator, options)))));
|
|
185
|
+
}
|
|
186
|
+
test(version) {
|
|
187
|
+
if (!version) return false;
|
|
188
|
+
if ('string' == typeof version) try {
|
|
189
|
+
version = new SemVer(version, this.options);
|
|
190
|
+
} catch (er) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
for(let i = 0; i < this.set.length; i++)if (testSet(this.set[i], version, this.options)) return true;
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
module.exports = Range;
|
|
198
|
+
const LRU = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js");
|
|
199
|
+
const cache = new LRU();
|
|
200
|
+
const parseOptions = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js");
|
|
201
|
+
const Comparator = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js");
|
|
202
|
+
const debug = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js");
|
|
203
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
204
|
+
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js");
|
|
205
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js");
|
|
206
|
+
const BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g');
|
|
207
|
+
const isNullSet = (c)=>'<0.0.0-0' === c.value;
|
|
208
|
+
const isAny = (c)=>'' === c.value;
|
|
209
|
+
const isSatisfiable = (comparators, options)=>{
|
|
210
|
+
let result = true;
|
|
211
|
+
const remainingComparators = comparators.slice();
|
|
212
|
+
let testComparator = remainingComparators.pop();
|
|
213
|
+
while(result && remainingComparators.length){
|
|
214
|
+
result = remainingComparators.every((otherComparator)=>testComparator.intersects(otherComparator, options));
|
|
215
|
+
testComparator = remainingComparators.pop();
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
};
|
|
219
|
+
const parseComparator = (comp, options)=>{
|
|
220
|
+
comp = comp.replace(re[t.BUILD], '');
|
|
221
|
+
debug('comp', comp, options);
|
|
222
|
+
comp = replaceCarets(comp, options);
|
|
223
|
+
debug('caret', comp);
|
|
224
|
+
comp = replaceTildes(comp, options);
|
|
225
|
+
debug('tildes', comp);
|
|
226
|
+
comp = replaceXRanges(comp, options);
|
|
227
|
+
debug('xrange', comp);
|
|
228
|
+
comp = replaceStars(comp, options);
|
|
229
|
+
debug('stars', comp);
|
|
230
|
+
return comp;
|
|
231
|
+
};
|
|
232
|
+
const isX = (id)=>!id || 'x' === id.toLowerCase() || '*' === id;
|
|
233
|
+
const invalidXRangeOrder = (M, m, p)=>isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
234
|
+
const replaceTildes = (comp, options)=>comp.trim().split(/\s+/).map((c)=>replaceTilde(c, options)).join(' ');
|
|
235
|
+
const replaceTilde = (comp, options)=>{
|
|
236
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
237
|
+
const z = options.includePrerelease ? '-0' : '';
|
|
238
|
+
return comp.replace(r, (_, M, m, p, pr)=>{
|
|
239
|
+
debug('tilde', comp, _, M, m, p, pr);
|
|
240
|
+
let ret;
|
|
241
|
+
if (isX(M)) ret = '';
|
|
242
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
243
|
+
else if (isX(p)) ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
244
|
+
else if (pr) {
|
|
245
|
+
debug('replaceTilde pr', pr);
|
|
246
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
247
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
248
|
+
debug('tilde return', ret);
|
|
249
|
+
return ret;
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
const replaceCarets = (comp, options)=>comp.trim().split(/\s+/).map((c)=>replaceCaret(c, options)).join(' ');
|
|
253
|
+
const replaceCaret = (comp, options)=>{
|
|
254
|
+
debug('caret', comp, options);
|
|
255
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
256
|
+
const z = options.includePrerelease ? '-0' : '';
|
|
257
|
+
return comp.replace(r, (_, M, m, p, pr)=>{
|
|
258
|
+
debug('caret', comp, _, M, m, p, pr);
|
|
259
|
+
let ret;
|
|
260
|
+
if (isX(M)) ret = '';
|
|
261
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
262
|
+
else if (isX(p)) ret = '0' === M ? `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` : `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
263
|
+
else if (pr) {
|
|
264
|
+
debug('replaceCaret pr', pr);
|
|
265
|
+
ret = '0' === M ? '0' === m ? `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0` : `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0` : `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
266
|
+
} else {
|
|
267
|
+
debug('no pr');
|
|
268
|
+
ret = '0' === M ? '0' === m ? `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0` : `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0` : `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
269
|
+
}
|
|
270
|
+
debug('caret return', ret);
|
|
271
|
+
return ret;
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
const replaceXRanges = (comp, options)=>{
|
|
275
|
+
debug('replaceXRanges', comp, options);
|
|
276
|
+
return comp.split(/\s+/).map((c)=>replaceXRange(c, options)).join(' ');
|
|
277
|
+
};
|
|
278
|
+
const replaceXRange = (comp, options)=>{
|
|
279
|
+
comp = comp.trim();
|
|
280
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
281
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr)=>{
|
|
282
|
+
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
|
283
|
+
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
284
|
+
const xM = isX(M);
|
|
285
|
+
const xm = xM || isX(m);
|
|
286
|
+
const xp = xm || isX(p);
|
|
287
|
+
const anyX = xp;
|
|
288
|
+
if ('=' === gtlt && anyX) gtlt = '';
|
|
289
|
+
pr = options.includePrerelease ? '-0' : '';
|
|
290
|
+
if (xM) ret = '>' === gtlt || '<' === gtlt ? '<0.0.0-0' : '*';
|
|
291
|
+
else if (gtlt && anyX) {
|
|
292
|
+
if (xm) m = 0;
|
|
293
|
+
p = 0;
|
|
294
|
+
if ('>' === gtlt) {
|
|
295
|
+
gtlt = '>=';
|
|
296
|
+
if (xm) {
|
|
297
|
+
M = +M + 1;
|
|
298
|
+
m = 0;
|
|
299
|
+
p = 0;
|
|
300
|
+
} else {
|
|
301
|
+
m = +m + 1;
|
|
302
|
+
p = 0;
|
|
303
|
+
}
|
|
304
|
+
} else if ('<=' === gtlt) {
|
|
305
|
+
gtlt = '<';
|
|
306
|
+
if (xm) M = +M + 1;
|
|
307
|
+
else m = +m + 1;
|
|
308
|
+
}
|
|
309
|
+
if ('<' === gtlt) pr = '-0';
|
|
310
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
311
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
312
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
313
|
+
debug('xRange return', ret);
|
|
314
|
+
return ret;
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
const replaceStars = (comp, options)=>{
|
|
318
|
+
debug('replaceStars', comp, options);
|
|
319
|
+
return comp.trim().replace(re[t.STAR], '');
|
|
320
|
+
};
|
|
321
|
+
const replaceGTE0 = (comp, options)=>{
|
|
322
|
+
debug('replaceGTE0', comp, options);
|
|
323
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');
|
|
324
|
+
};
|
|
325
|
+
const hyphenReplace = (incPr)=>($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr)=>{
|
|
326
|
+
from = isX(fM) ? '' : isX(fm) ? `>=${fM}.0.0${incPr ? '-0' : ''}` : isX(fp) ? `>=${fM}.${fm}.0${incPr ? '-0' : ''}` : fpr ? `>=${from}` : `>=${from}${incPr ? '-0' : ''}`;
|
|
327
|
+
to = isX(tM) ? '' : isX(tm) ? `<${+tM + 1}.0.0-0` : isX(tp) ? `<${tM}.${+tm + 1}.0-0` : tpr ? `<=${tM}.${tm}.${tp}-${tpr}` : incPr ? `<${tM}.${tm}.${+tp + 1}-0` : `<=${to}`;
|
|
328
|
+
return `${from} ${to}`.trim();
|
|
329
|
+
};
|
|
330
|
+
const testSet = (set, version, options)=>{
|
|
331
|
+
for(let i = 0; i < set.length; i++)if (!set[i].test(version)) return false;
|
|
332
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
333
|
+
for(let i = 0; i < set.length; i++){
|
|
334
|
+
debug(set[i].semver);
|
|
335
|
+
if (set[i].semver !== Comparator.ANY) {
|
|
336
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
337
|
+
const allowed = set[i].semver;
|
|
338
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
return true;
|
|
345
|
+
};
|
|
346
|
+
},
|
|
347
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
348
|
+
const debug = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js");
|
|
349
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js");
|
|
350
|
+
const { safeRe: re, t } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js");
|
|
351
|
+
const parseOptions = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js");
|
|
352
|
+
const { compareIdentifiers } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js");
|
|
353
|
+
const isPrereleaseIdentifier = (prerelease, identifier)=>{
|
|
354
|
+
const identifiers = identifier.split('.');
|
|
355
|
+
if (identifiers.length > prerelease.length) return false;
|
|
356
|
+
for(let i = 0; i < identifiers.length; i++)if (0 !== compareIdentifiers(prerelease[i], identifiers[i])) return false;
|
|
357
|
+
return true;
|
|
358
|
+
};
|
|
359
|
+
class SemVer {
|
|
360
|
+
constructor(version, options){
|
|
361
|
+
options = parseOptions(options);
|
|
362
|
+
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
363
|
+
else version = version.version;
|
|
364
|
+
else if ('string' != typeof version) throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
365
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
366
|
+
debug('SemVer', version, options);
|
|
367
|
+
this.options = options;
|
|
368
|
+
this.loose = !!options.loose;
|
|
369
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
370
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
371
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
372
|
+
this.raw = version;
|
|
373
|
+
this.major = +m[1];
|
|
374
|
+
this.minor = +m[2];
|
|
375
|
+
this.patch = +m[3];
|
|
376
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version');
|
|
377
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version');
|
|
378
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version');
|
|
379
|
+
if (m[4]) this.prerelease = m[4].split('.').map((id)=>{
|
|
380
|
+
if (/^[0-9]+$/.test(id)) {
|
|
381
|
+
const num = +id;
|
|
382
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
383
|
+
}
|
|
384
|
+
return id;
|
|
385
|
+
});
|
|
386
|
+
else this.prerelease = [];
|
|
387
|
+
this.build = m[5] ? m[5].split('.') : [];
|
|
388
|
+
this.format();
|
|
389
|
+
}
|
|
390
|
+
format() {
|
|
391
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
392
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join('.')}`;
|
|
393
|
+
return this.version;
|
|
394
|
+
}
|
|
395
|
+
toString() {
|
|
396
|
+
return this.version;
|
|
397
|
+
}
|
|
398
|
+
compare(other) {
|
|
399
|
+
debug('SemVer.compare', this.version, this.options, other);
|
|
400
|
+
if (!(other instanceof SemVer)) {
|
|
401
|
+
if ('string' == typeof other && other === this.version) return 0;
|
|
402
|
+
other = new SemVer(other, this.options);
|
|
403
|
+
}
|
|
404
|
+
if (other.version === this.version) return 0;
|
|
405
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
406
|
+
}
|
|
407
|
+
compareMain(other) {
|
|
408
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
409
|
+
if (this.major < other.major) return -1;
|
|
410
|
+
if (this.major > other.major) return 1;
|
|
411
|
+
if (this.minor < other.minor) return -1;
|
|
412
|
+
if (this.minor > other.minor) return 1;
|
|
413
|
+
if (this.patch < other.patch) return -1;
|
|
414
|
+
if (this.patch > other.patch) return 1;
|
|
415
|
+
return 0;
|
|
416
|
+
}
|
|
417
|
+
comparePre(other) {
|
|
418
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
419
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
420
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
421
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
422
|
+
let i = 0;
|
|
423
|
+
do {
|
|
424
|
+
const a = this.prerelease[i];
|
|
425
|
+
const b = other.prerelease[i];
|
|
426
|
+
debug('prerelease compare', i, a, b);
|
|
427
|
+
if (void 0 === a && void 0 === b) return 0;
|
|
428
|
+
else if (void 0 === b) return 1;
|
|
429
|
+
else if (void 0 === a) return -1;
|
|
430
|
+
else if (a === b) continue;
|
|
431
|
+
else return compareIdentifiers(a, b);
|
|
432
|
+
}while (++i);
|
|
433
|
+
}
|
|
434
|
+
compareBuild(other) {
|
|
435
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
436
|
+
let i = 0;
|
|
437
|
+
do {
|
|
438
|
+
const a = this.build[i];
|
|
439
|
+
const b = other.build[i];
|
|
440
|
+
debug('build compare', i, a, b);
|
|
441
|
+
if (void 0 === a && void 0 === b) return 0;
|
|
442
|
+
else if (void 0 === b) return 1;
|
|
443
|
+
else if (void 0 === a) return -1;
|
|
444
|
+
else if (a === b) continue;
|
|
445
|
+
else return compareIdentifiers(a, b);
|
|
446
|
+
}while (++i);
|
|
447
|
+
}
|
|
448
|
+
inc(release, identifier, identifierBase) {
|
|
449
|
+
if (release.startsWith('pre')) {
|
|
450
|
+
if (!identifier && false === identifierBase) throw new Error('invalid increment argument: identifier is empty');
|
|
451
|
+
if (identifier) {
|
|
452
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
453
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
switch(release){
|
|
457
|
+
case 'premajor':
|
|
458
|
+
this.prerelease.length = 0;
|
|
459
|
+
this.patch = 0;
|
|
460
|
+
this.minor = 0;
|
|
461
|
+
this.major++;
|
|
462
|
+
this.inc('pre', identifier, identifierBase);
|
|
463
|
+
break;
|
|
464
|
+
case 'preminor':
|
|
465
|
+
this.prerelease.length = 0;
|
|
466
|
+
this.patch = 0;
|
|
467
|
+
this.minor++;
|
|
468
|
+
this.inc('pre', identifier, identifierBase);
|
|
469
|
+
break;
|
|
470
|
+
case 'prepatch':
|
|
471
|
+
this.prerelease.length = 0;
|
|
472
|
+
this.inc('patch', identifier, identifierBase);
|
|
473
|
+
this.inc('pre', identifier, identifierBase);
|
|
474
|
+
break;
|
|
475
|
+
case 'prerelease':
|
|
476
|
+
if (0 === this.prerelease.length) this.inc('patch', identifier, identifierBase);
|
|
477
|
+
this.inc('pre', identifier, identifierBase);
|
|
478
|
+
break;
|
|
479
|
+
case 'release':
|
|
480
|
+
if (0 === this.prerelease.length) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
481
|
+
this.prerelease.length = 0;
|
|
482
|
+
break;
|
|
483
|
+
case 'major':
|
|
484
|
+
if (0 !== this.minor || 0 !== this.patch || 0 === this.prerelease.length) this.major++;
|
|
485
|
+
this.minor = 0;
|
|
486
|
+
this.patch = 0;
|
|
487
|
+
this.prerelease = [];
|
|
488
|
+
break;
|
|
489
|
+
case 'minor':
|
|
490
|
+
if (0 !== this.patch || 0 === this.prerelease.length) this.minor++;
|
|
491
|
+
this.patch = 0;
|
|
492
|
+
this.prerelease = [];
|
|
493
|
+
break;
|
|
494
|
+
case 'patch':
|
|
495
|
+
if (0 === this.prerelease.length) this.patch++;
|
|
496
|
+
this.prerelease = [];
|
|
497
|
+
break;
|
|
498
|
+
case 'pre':
|
|
499
|
+
{
|
|
500
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
501
|
+
if (0 === this.prerelease.length) this.prerelease = [
|
|
502
|
+
base
|
|
503
|
+
];
|
|
504
|
+
else {
|
|
505
|
+
let i = this.prerelease.length;
|
|
506
|
+
while(--i >= 0)if ('number' == typeof this.prerelease[i]) {
|
|
507
|
+
this.prerelease[i]++;
|
|
508
|
+
i = -2;
|
|
509
|
+
}
|
|
510
|
+
if (-1 === i) {
|
|
511
|
+
if (identifier === this.prerelease.join('.') && false === identifierBase) throw new Error('invalid increment argument: identifier already exists');
|
|
512
|
+
this.prerelease.push(base);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (identifier) {
|
|
516
|
+
let prerelease = [
|
|
517
|
+
identifier,
|
|
518
|
+
base
|
|
519
|
+
];
|
|
520
|
+
if (false === identifierBase) prerelease = [
|
|
521
|
+
identifier
|
|
522
|
+
];
|
|
523
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
524
|
+
const prereleaseBase = this.prerelease[identifier.split('.').length];
|
|
525
|
+
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
526
|
+
} else this.prerelease = prerelease;
|
|
527
|
+
}
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
default:
|
|
531
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
532
|
+
}
|
|
533
|
+
this.raw = this.format();
|
|
534
|
+
if (this.build.length) this.raw += `+${this.build.join('.')}`;
|
|
535
|
+
return this;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
module.exports = SemVer;
|
|
539
|
+
},
|
|
540
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
541
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
542
|
+
const clean = (version, options)=>{
|
|
543
|
+
const s = parse(version.trim().replace(/^[=v]+/, ''), options);
|
|
544
|
+
return s ? s.version : null;
|
|
545
|
+
};
|
|
546
|
+
module.exports = clean;
|
|
547
|
+
},
|
|
548
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
549
|
+
const eq = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js");
|
|
550
|
+
const neq = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js");
|
|
551
|
+
const gt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js");
|
|
552
|
+
const gte = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js");
|
|
553
|
+
const lt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js");
|
|
554
|
+
const lte = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js");
|
|
555
|
+
const cmp = (a, op, b, loose)=>{
|
|
556
|
+
switch(op){
|
|
557
|
+
case '===':
|
|
558
|
+
if ('object' == typeof a) a = a.version;
|
|
559
|
+
if ('object' == typeof b) b = b.version;
|
|
560
|
+
return a === b;
|
|
561
|
+
case '!==':
|
|
562
|
+
if ('object' == typeof a) a = a.version;
|
|
563
|
+
if ('object' == typeof b) b = b.version;
|
|
564
|
+
return a !== b;
|
|
565
|
+
case '':
|
|
566
|
+
case '=':
|
|
567
|
+
case '==':
|
|
568
|
+
return eq(a, b, loose);
|
|
569
|
+
case '!=':
|
|
570
|
+
return neq(a, b, loose);
|
|
571
|
+
case '>':
|
|
572
|
+
return gt(a, b, loose);
|
|
573
|
+
case '>=':
|
|
574
|
+
return gte(a, b, loose);
|
|
575
|
+
case '<':
|
|
576
|
+
return lt(a, b, loose);
|
|
577
|
+
case '<=':
|
|
578
|
+
return lte(a, b, loose);
|
|
579
|
+
default:
|
|
580
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
module.exports = cmp;
|
|
584
|
+
},
|
|
585
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
586
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
587
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
588
|
+
const { safeRe: re, t } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js");
|
|
589
|
+
const coerce = (version, options)=>{
|
|
590
|
+
if (version instanceof SemVer) return version;
|
|
591
|
+
if ('number' == typeof version) version = String(version);
|
|
592
|
+
if ('string' != typeof version) return null;
|
|
593
|
+
options = options || {};
|
|
594
|
+
let match = null;
|
|
595
|
+
if (options.rtl) {
|
|
596
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
597
|
+
let next;
|
|
598
|
+
while((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)){
|
|
599
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
600
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
601
|
+
}
|
|
602
|
+
coerceRtlRegex.lastIndex = -1;
|
|
603
|
+
} else match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
604
|
+
if (null === match) return null;
|
|
605
|
+
const major = match[2];
|
|
606
|
+
const minor = match[3] || '0';
|
|
607
|
+
const patch = match[4] || '0';
|
|
608
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
|
|
609
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
|
|
610
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
611
|
+
};
|
|
612
|
+
module.exports = coerce;
|
|
613
|
+
},
|
|
614
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
615
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
616
|
+
const compareBuild = (a, b, loose)=>{
|
|
617
|
+
const versionA = new SemVer(a, loose);
|
|
618
|
+
const versionB = new SemVer(b, loose);
|
|
619
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
620
|
+
};
|
|
621
|
+
module.exports = compareBuild;
|
|
622
|
+
},
|
|
623
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
624
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
625
|
+
const compareLoose = (a, b)=>compare(a, b, true);
|
|
626
|
+
module.exports = compareLoose;
|
|
627
|
+
},
|
|
628
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
629
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
630
|
+
const compare = (a, b, loose)=>new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
631
|
+
module.exports = compare;
|
|
632
|
+
},
|
|
633
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
634
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
635
|
+
const diff = (version1, version2)=>{
|
|
636
|
+
const v1 = parse(version1, null, true);
|
|
637
|
+
const v2 = parse(version2, null, true);
|
|
638
|
+
const comparison = v1.compare(v2);
|
|
639
|
+
if (0 === comparison) return null;
|
|
640
|
+
const v1Higher = comparison > 0;
|
|
641
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
642
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
643
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
644
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
645
|
+
if (lowHasPre && !highHasPre) {
|
|
646
|
+
if (!lowVersion.patch && !lowVersion.minor) return 'major';
|
|
647
|
+
if (0 === lowVersion.compareMain(highVersion)) {
|
|
648
|
+
if (lowVersion.minor && !lowVersion.patch) return 'minor';
|
|
649
|
+
return 'patch';
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
const prefix = highHasPre ? 'pre' : '';
|
|
653
|
+
if (v1.major !== v2.major) return prefix + 'major';
|
|
654
|
+
if (v1.minor !== v2.minor) return prefix + 'minor';
|
|
655
|
+
if (v1.patch !== v2.patch) return prefix + 'patch';
|
|
656
|
+
return 'prerelease';
|
|
657
|
+
};
|
|
658
|
+
module.exports = diff;
|
|
659
|
+
},
|
|
660
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
661
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
662
|
+
const eq = (a, b, loose)=>0 === compare(a, b, loose);
|
|
663
|
+
module.exports = eq;
|
|
664
|
+
},
|
|
665
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
666
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
667
|
+
const gt = (a, b, loose)=>compare(a, b, loose) > 0;
|
|
668
|
+
module.exports = gt;
|
|
669
|
+
},
|
|
670
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
671
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
672
|
+
const gte = (a, b, loose)=>compare(a, b, loose) >= 0;
|
|
673
|
+
module.exports = gte;
|
|
674
|
+
},
|
|
675
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
676
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
677
|
+
const inc = (version, release, options, identifier, identifierBase)=>{
|
|
678
|
+
if ('string' == typeof options) {
|
|
679
|
+
identifierBase = identifier;
|
|
680
|
+
identifier = options;
|
|
681
|
+
options = void 0;
|
|
682
|
+
}
|
|
683
|
+
try {
|
|
684
|
+
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
685
|
+
} catch (er) {
|
|
686
|
+
return null;
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
module.exports = inc;
|
|
690
|
+
},
|
|
691
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
692
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
693
|
+
const lt = (a, b, loose)=>compare(a, b, loose) < 0;
|
|
694
|
+
module.exports = lt;
|
|
695
|
+
},
|
|
696
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
697
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
698
|
+
const lte = (a, b, loose)=>compare(a, b, loose) <= 0;
|
|
699
|
+
module.exports = lte;
|
|
700
|
+
},
|
|
701
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
702
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
703
|
+
const major = (a, loose)=>new SemVer(a, loose).major;
|
|
704
|
+
module.exports = major;
|
|
705
|
+
},
|
|
706
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
707
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
708
|
+
const minor = (a, loose)=>new SemVer(a, loose).minor;
|
|
709
|
+
module.exports = minor;
|
|
710
|
+
},
|
|
711
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
712
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
713
|
+
const neq = (a, b, loose)=>0 !== compare(a, b, loose);
|
|
714
|
+
module.exports = neq;
|
|
715
|
+
},
|
|
716
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
717
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
718
|
+
const parse = (version, options, throwErrors = false)=>{
|
|
719
|
+
if (version instanceof SemVer) return version;
|
|
720
|
+
try {
|
|
721
|
+
return new SemVer(version, options);
|
|
722
|
+
} catch (er) {
|
|
723
|
+
if (!throwErrors) return null;
|
|
724
|
+
throw er;
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
module.exports = parse;
|
|
728
|
+
},
|
|
729
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
730
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
731
|
+
const patch = (a, loose)=>new SemVer(a, loose).patch;
|
|
732
|
+
module.exports = patch;
|
|
733
|
+
},
|
|
734
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
735
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
736
|
+
const prerelease = (version, options)=>{
|
|
737
|
+
const parsed = parse(version, options);
|
|
738
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
739
|
+
};
|
|
740
|
+
module.exports = prerelease;
|
|
741
|
+
},
|
|
742
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
743
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
744
|
+
const rcompare = (a, b, loose)=>compare(b, a, loose);
|
|
745
|
+
module.exports = rcompare;
|
|
746
|
+
},
|
|
747
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
748
|
+
const compareBuild = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js");
|
|
749
|
+
const rsort = (list, loose)=>list.sort((a, b)=>compareBuild(b, a, loose));
|
|
750
|
+
module.exports = rsort;
|
|
751
|
+
},
|
|
752
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
753
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
754
|
+
const satisfies = (version, range, options)=>{
|
|
755
|
+
try {
|
|
756
|
+
range = new Range(range, options);
|
|
757
|
+
} catch (er) {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
return range.test(version);
|
|
761
|
+
};
|
|
762
|
+
module.exports = satisfies;
|
|
763
|
+
},
|
|
764
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
765
|
+
const compareBuild = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js");
|
|
766
|
+
const sort = (list, loose)=>list.sort((a, b)=>compareBuild(a, b, loose));
|
|
767
|
+
module.exports = sort;
|
|
768
|
+
},
|
|
769
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
770
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
771
|
+
const constants = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js");
|
|
772
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
773
|
+
const truncate = (version, truncation, options)=>{
|
|
774
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
775
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
776
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
777
|
+
};
|
|
778
|
+
const cloneInputVersion = (version, options)=>{
|
|
779
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
780
|
+
return parse(versionStringToParse, options);
|
|
781
|
+
};
|
|
782
|
+
const doTruncation = (version, truncation)=>{
|
|
783
|
+
if (isPrerelease(truncation)) return version.version;
|
|
784
|
+
version.prerelease = [];
|
|
785
|
+
switch(truncation){
|
|
786
|
+
case 'major':
|
|
787
|
+
version.minor = 0;
|
|
788
|
+
version.patch = 0;
|
|
789
|
+
break;
|
|
790
|
+
case 'minor':
|
|
791
|
+
version.patch = 0;
|
|
792
|
+
break;
|
|
793
|
+
}
|
|
794
|
+
return version.format();
|
|
795
|
+
};
|
|
796
|
+
const isPrerelease = (type)=>type.startsWith('pre');
|
|
797
|
+
module.exports = truncate;
|
|
798
|
+
},
|
|
799
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
800
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
801
|
+
const valid = (version, options)=>{
|
|
802
|
+
const v = parse(version, options);
|
|
803
|
+
return v ? v.version : null;
|
|
804
|
+
};
|
|
805
|
+
module.exports = valid;
|
|
806
|
+
},
|
|
807
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
808
|
+
const internalRe = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js");
|
|
809
|
+
const constants = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js");
|
|
810
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
811
|
+
const identifiers = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js");
|
|
812
|
+
const parse = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js");
|
|
813
|
+
const valid = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js");
|
|
814
|
+
const clean = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js");
|
|
815
|
+
const inc = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js");
|
|
816
|
+
const diff = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js");
|
|
817
|
+
const major = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js");
|
|
818
|
+
const minor = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js");
|
|
819
|
+
const patch = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js");
|
|
820
|
+
const prerelease = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js");
|
|
821
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
822
|
+
const rcompare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js");
|
|
823
|
+
const compareLoose = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js");
|
|
824
|
+
const compareBuild = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js");
|
|
825
|
+
const sort = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js");
|
|
826
|
+
const rsort = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js");
|
|
827
|
+
const gt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js");
|
|
828
|
+
const lt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js");
|
|
829
|
+
const eq = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js");
|
|
830
|
+
const neq = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js");
|
|
831
|
+
const gte = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js");
|
|
832
|
+
const lte = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js");
|
|
833
|
+
const cmp = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js");
|
|
834
|
+
const coerce = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js");
|
|
835
|
+
const truncate = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js");
|
|
836
|
+
const Comparator = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js");
|
|
837
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
838
|
+
const satisfies = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js");
|
|
839
|
+
const toComparators = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js");
|
|
840
|
+
const maxSatisfying = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js");
|
|
841
|
+
const minSatisfying = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js");
|
|
842
|
+
const minVersion = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js");
|
|
843
|
+
const validRange = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js");
|
|
844
|
+
const outside = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js");
|
|
845
|
+
const gtr = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js");
|
|
846
|
+
const ltr = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js");
|
|
847
|
+
const intersects = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js");
|
|
848
|
+
const simplifyRange = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js");
|
|
849
|
+
const subset = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js");
|
|
850
|
+
module.exports = {
|
|
851
|
+
parse,
|
|
852
|
+
valid,
|
|
853
|
+
clean,
|
|
854
|
+
inc,
|
|
855
|
+
diff,
|
|
856
|
+
major,
|
|
857
|
+
minor,
|
|
858
|
+
patch,
|
|
859
|
+
prerelease,
|
|
860
|
+
compare,
|
|
861
|
+
rcompare,
|
|
862
|
+
compareLoose,
|
|
863
|
+
compareBuild,
|
|
864
|
+
sort,
|
|
865
|
+
rsort,
|
|
866
|
+
gt,
|
|
867
|
+
lt,
|
|
868
|
+
eq,
|
|
869
|
+
neq,
|
|
870
|
+
gte,
|
|
871
|
+
lte,
|
|
872
|
+
cmp,
|
|
873
|
+
coerce,
|
|
874
|
+
truncate,
|
|
875
|
+
Comparator,
|
|
876
|
+
Range,
|
|
877
|
+
satisfies,
|
|
878
|
+
toComparators,
|
|
879
|
+
maxSatisfying,
|
|
880
|
+
minSatisfying,
|
|
881
|
+
minVersion,
|
|
882
|
+
validRange,
|
|
883
|
+
outside,
|
|
884
|
+
gtr,
|
|
885
|
+
ltr,
|
|
886
|
+
intersects,
|
|
887
|
+
simplifyRange,
|
|
888
|
+
subset,
|
|
889
|
+
SemVer,
|
|
890
|
+
re: internalRe.re,
|
|
891
|
+
src: internalRe.src,
|
|
892
|
+
tokens: internalRe.t,
|
|
893
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
894
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
895
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
896
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
897
|
+
};
|
|
898
|
+
},
|
|
899
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js" (module) {
|
|
900
|
+
const SEMVER_SPEC_VERSION = '2.0.0';
|
|
901
|
+
const MAX_LENGTH = 256;
|
|
902
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
903
|
+
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
904
|
+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
905
|
+
const RELEASE_TYPES = [
|
|
906
|
+
'major',
|
|
907
|
+
'premajor',
|
|
908
|
+
'minor',
|
|
909
|
+
'preminor',
|
|
910
|
+
'patch',
|
|
911
|
+
'prepatch',
|
|
912
|
+
'prerelease'
|
|
913
|
+
];
|
|
914
|
+
module.exports = {
|
|
915
|
+
MAX_LENGTH,
|
|
916
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
917
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
918
|
+
MAX_SAFE_INTEGER,
|
|
919
|
+
RELEASE_TYPES,
|
|
920
|
+
SEMVER_SPEC_VERSION,
|
|
921
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
922
|
+
FLAG_LOOSE: 2
|
|
923
|
+
};
|
|
924
|
+
},
|
|
925
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js" (module) {
|
|
926
|
+
const debug = 'object' == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args)=>console.error('SEMVER', ...args) : ()=>{};
|
|
927
|
+
module.exports = debug;
|
|
928
|
+
},
|
|
929
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js" (module) {
|
|
930
|
+
const numeric = /^[0-9]+$/;
|
|
931
|
+
const compareIdentifiers = (a, b)=>{
|
|
932
|
+
if ('number' == typeof a && 'number' == typeof b) return a === b ? 0 : a < b ? -1 : 1;
|
|
933
|
+
const anum = numeric.test(a);
|
|
934
|
+
const bnum = numeric.test(b);
|
|
935
|
+
if (anum && bnum) {
|
|
936
|
+
a *= 1;
|
|
937
|
+
b *= 1;
|
|
938
|
+
}
|
|
939
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
940
|
+
};
|
|
941
|
+
const rcompareIdentifiers = (a, b)=>compareIdentifiers(b, a);
|
|
942
|
+
module.exports = {
|
|
943
|
+
compareIdentifiers,
|
|
944
|
+
rcompareIdentifiers
|
|
945
|
+
};
|
|
946
|
+
},
|
|
947
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js" (module) {
|
|
948
|
+
class LRUCache {
|
|
949
|
+
constructor(){
|
|
950
|
+
this.max = 1000;
|
|
951
|
+
this.map = new Map();
|
|
952
|
+
}
|
|
953
|
+
get(key) {
|
|
954
|
+
const value = this.map.get(key);
|
|
955
|
+
if (void 0 === value) return;
|
|
956
|
+
else {
|
|
957
|
+
this.map.delete(key);
|
|
958
|
+
this.map.set(key, value);
|
|
959
|
+
return value;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
delete(key) {
|
|
963
|
+
return this.map.delete(key);
|
|
964
|
+
}
|
|
965
|
+
set(key, value) {
|
|
966
|
+
const deleted = this.delete(key);
|
|
967
|
+
if (!deleted && void 0 !== value) {
|
|
968
|
+
if (this.map.size >= this.max) {
|
|
969
|
+
const firstKey = this.map.keys().next().value;
|
|
970
|
+
this.delete(firstKey);
|
|
971
|
+
}
|
|
972
|
+
this.map.set(key, value);
|
|
973
|
+
}
|
|
974
|
+
return this;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
module.exports = LRUCache;
|
|
978
|
+
},
|
|
979
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js" (module) {
|
|
980
|
+
const looseOption = Object.freeze({
|
|
981
|
+
loose: true
|
|
982
|
+
});
|
|
983
|
+
const emptyOpts = Object.freeze({});
|
|
984
|
+
const parseOptions = (options)=>{
|
|
985
|
+
if (!options) return emptyOpts;
|
|
986
|
+
if ('object' != typeof options) return looseOption;
|
|
987
|
+
return options;
|
|
988
|
+
};
|
|
989
|
+
module.exports = parseOptions;
|
|
990
|
+
},
|
|
991
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js" (module, exports, __webpack_require__) {
|
|
992
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js");
|
|
993
|
+
const debug = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js");
|
|
994
|
+
exports = module.exports = {};
|
|
995
|
+
const re = exports.re = [];
|
|
996
|
+
const safeRe = exports.safeRe = [];
|
|
997
|
+
const src = exports.src = [];
|
|
998
|
+
const safeSrc = exports.safeSrc = [];
|
|
999
|
+
const t = exports.t = {};
|
|
1000
|
+
let R = 0;
|
|
1001
|
+
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
|
|
1002
|
+
const safeRegexReplacements = [
|
|
1003
|
+
[
|
|
1004
|
+
'\\s',
|
|
1005
|
+
1
|
|
1006
|
+
],
|
|
1007
|
+
[
|
|
1008
|
+
'\\d',
|
|
1009
|
+
MAX_LENGTH
|
|
1010
|
+
],
|
|
1011
|
+
[
|
|
1012
|
+
LETTERDASHNUMBER,
|
|
1013
|
+
MAX_SAFE_BUILD_LENGTH
|
|
1014
|
+
]
|
|
1015
|
+
];
|
|
1016
|
+
const makeSafeRegex = (value)=>{
|
|
1017
|
+
for (const [token, max] of safeRegexReplacements)value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
1018
|
+
return value;
|
|
1019
|
+
};
|
|
1020
|
+
const createToken = (name, value, isGlobal)=>{
|
|
1021
|
+
const safe = makeSafeRegex(value);
|
|
1022
|
+
const index = R++;
|
|
1023
|
+
debug(name, index, value);
|
|
1024
|
+
t[name] = index;
|
|
1025
|
+
src[index] = value;
|
|
1026
|
+
safeSrc[index] = safe;
|
|
1027
|
+
re[index] = new RegExp(value, isGlobal ? 'g' : void 0);
|
|
1028
|
+
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : void 0);
|
|
1029
|
+
};
|
|
1030
|
+
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
1031
|
+
createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
|
|
1032
|
+
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
1033
|
+
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
1034
|
+
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
1035
|
+
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
1036
|
+
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
1037
|
+
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
1038
|
+
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
1039
|
+
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
|
|
1040
|
+
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
1041
|
+
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
1042
|
+
createToken('FULL', `^${src[t.FULLPLAIN]}$`);
|
|
1043
|
+
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
1044
|
+
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
|
|
1045
|
+
createToken('GTLT', '((?:<|>)?=?)');
|
|
1046
|
+
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
1047
|
+
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
1048
|
+
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
1049
|
+
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
1050
|
+
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
1051
|
+
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1052
|
+
createToken('COERCEPLAIN', `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
1053
|
+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
1054
|
+
createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + "(?:$|[^\\d])");
|
|
1055
|
+
createToken('COERCERTL', src[t.COERCE], true);
|
|
1056
|
+
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
1057
|
+
createToken('LONETILDE', '(?:~>?)');
|
|
1058
|
+
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
1059
|
+
exports.tildeTrimReplace = '$1~';
|
|
1060
|
+
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
1061
|
+
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1062
|
+
createToken('LONECARET', '(?:\\^)');
|
|
1063
|
+
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
1064
|
+
exports.caretTrimReplace = '$1^';
|
|
1065
|
+
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
1066
|
+
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1067
|
+
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
1068
|
+
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
1069
|
+
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
1070
|
+
exports.comparatorTrimReplace = '$1$2$3';
|
|
1071
|
+
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*\$`);
|
|
1072
|
+
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*\$`);
|
|
1073
|
+
createToken('STAR', '(<|>)?=?\\s*\\*');
|
|
1074
|
+
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
|
|
1075
|
+
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
1076
|
+
},
|
|
1077
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1078
|
+
const outside = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js");
|
|
1079
|
+
const gtr = (version, range, options)=>outside(version, range, '>', options);
|
|
1080
|
+
module.exports = gtr;
|
|
1081
|
+
},
|
|
1082
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1083
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1084
|
+
const intersects = (r1, r2, options)=>{
|
|
1085
|
+
r1 = new Range(r1, options);
|
|
1086
|
+
r2 = new Range(r2, options);
|
|
1087
|
+
return r1.intersects(r2, options);
|
|
1088
|
+
};
|
|
1089
|
+
module.exports = intersects;
|
|
1090
|
+
},
|
|
1091
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1092
|
+
const outside = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js");
|
|
1093
|
+
const ltr = (version, range, options)=>outside(version, range, '<', options);
|
|
1094
|
+
module.exports = ltr;
|
|
1095
|
+
},
|
|
1096
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1097
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
1098
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1099
|
+
const maxSatisfying = (versions, range, options)=>{
|
|
1100
|
+
let max = null;
|
|
1101
|
+
let maxSV = null;
|
|
1102
|
+
let rangeObj = null;
|
|
1103
|
+
try {
|
|
1104
|
+
rangeObj = new Range(range, options);
|
|
1105
|
+
} catch (er) {
|
|
1106
|
+
return null;
|
|
1107
|
+
}
|
|
1108
|
+
versions.forEach((v)=>{
|
|
1109
|
+
if (rangeObj.test(v)) {
|
|
1110
|
+
if (!max || -1 === maxSV.compare(v)) {
|
|
1111
|
+
max = v;
|
|
1112
|
+
maxSV = new SemVer(max, options);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
return max;
|
|
1117
|
+
};
|
|
1118
|
+
module.exports = maxSatisfying;
|
|
1119
|
+
},
|
|
1120
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1121
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
1122
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1123
|
+
const minSatisfying = (versions, range, options)=>{
|
|
1124
|
+
let min = null;
|
|
1125
|
+
let minSV = null;
|
|
1126
|
+
let rangeObj = null;
|
|
1127
|
+
try {
|
|
1128
|
+
rangeObj = new Range(range, options);
|
|
1129
|
+
} catch (er) {
|
|
1130
|
+
return null;
|
|
1131
|
+
}
|
|
1132
|
+
versions.forEach((v)=>{
|
|
1133
|
+
if (rangeObj.test(v)) {
|
|
1134
|
+
if (!min || 1 === minSV.compare(v)) {
|
|
1135
|
+
min = v;
|
|
1136
|
+
minSV = new SemVer(min, options);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
return min;
|
|
1141
|
+
};
|
|
1142
|
+
module.exports = minSatisfying;
|
|
1143
|
+
},
|
|
1144
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1145
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
1146
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1147
|
+
const gt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js");
|
|
1148
|
+
const minVersion = (range, loose)=>{
|
|
1149
|
+
range = new Range(range, loose);
|
|
1150
|
+
let minver = new SemVer('0.0.0');
|
|
1151
|
+
if (range.test(minver)) return minver;
|
|
1152
|
+
minver = new SemVer('0.0.0-0');
|
|
1153
|
+
if (range.test(minver)) return minver;
|
|
1154
|
+
minver = null;
|
|
1155
|
+
for(let i = 0; i < range.set.length; ++i){
|
|
1156
|
+
const comparators = range.set[i];
|
|
1157
|
+
let setMin = null;
|
|
1158
|
+
comparators.forEach((comparator)=>{
|
|
1159
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1160
|
+
switch(comparator.operator){
|
|
1161
|
+
case '>':
|
|
1162
|
+
if (0 === compver.prerelease.length) compver.patch++;
|
|
1163
|
+
else compver.prerelease.push(0);
|
|
1164
|
+
compver.raw = compver.format();
|
|
1165
|
+
case '':
|
|
1166
|
+
case '>=':
|
|
1167
|
+
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1168
|
+
break;
|
|
1169
|
+
case '<':
|
|
1170
|
+
case '<=':
|
|
1171
|
+
break;
|
|
1172
|
+
default:
|
|
1173
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1177
|
+
}
|
|
1178
|
+
if (minver && range.test(minver)) return minver;
|
|
1179
|
+
return null;
|
|
1180
|
+
};
|
|
1181
|
+
module.exports = minVersion;
|
|
1182
|
+
},
|
|
1183
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1184
|
+
const SemVer = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js");
|
|
1185
|
+
const Comparator = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js");
|
|
1186
|
+
const { ANY } = Comparator;
|
|
1187
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1188
|
+
const satisfies = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js");
|
|
1189
|
+
const gt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js");
|
|
1190
|
+
const lt = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js");
|
|
1191
|
+
const lte = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js");
|
|
1192
|
+
const gte = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js");
|
|
1193
|
+
const outside = (version, range, hilo, options)=>{
|
|
1194
|
+
version = new SemVer(version, options);
|
|
1195
|
+
range = new Range(range, options);
|
|
1196
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1197
|
+
switch(hilo){
|
|
1198
|
+
case '>':
|
|
1199
|
+
gtfn = gt;
|
|
1200
|
+
ltefn = lte;
|
|
1201
|
+
ltfn = lt;
|
|
1202
|
+
comp = '>';
|
|
1203
|
+
ecomp = '>=';
|
|
1204
|
+
break;
|
|
1205
|
+
case '<':
|
|
1206
|
+
gtfn = lt;
|
|
1207
|
+
ltefn = gte;
|
|
1208
|
+
ltfn = gt;
|
|
1209
|
+
comp = '<';
|
|
1210
|
+
ecomp = '<=';
|
|
1211
|
+
break;
|
|
1212
|
+
default:
|
|
1213
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1214
|
+
}
|
|
1215
|
+
if (satisfies(version, range, options)) return false;
|
|
1216
|
+
for(let i = 0; i < range.set.length; ++i){
|
|
1217
|
+
const comparators = range.set[i];
|
|
1218
|
+
let high = null;
|
|
1219
|
+
let low = null;
|
|
1220
|
+
comparators.forEach((comparator)=>{
|
|
1221
|
+
if (comparator.semver === ANY) comparator = new Comparator('>=0.0.0');
|
|
1222
|
+
high = high || comparator;
|
|
1223
|
+
low = low || comparator;
|
|
1224
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1225
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1226
|
+
});
|
|
1227
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1228
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1229
|
+
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1230
|
+
}
|
|
1231
|
+
return true;
|
|
1232
|
+
};
|
|
1233
|
+
module.exports = outside;
|
|
1234
|
+
},
|
|
1235
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1236
|
+
const satisfies = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js");
|
|
1237
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
1238
|
+
module.exports = (versions, range, options)=>{
|
|
1239
|
+
const set = [];
|
|
1240
|
+
let first = null;
|
|
1241
|
+
let prev = null;
|
|
1242
|
+
const v = versions.sort((a, b)=>compare(a, b, options));
|
|
1243
|
+
for (const version of v){
|
|
1244
|
+
const included = satisfies(version, range, options);
|
|
1245
|
+
if (included) {
|
|
1246
|
+
prev = version;
|
|
1247
|
+
if (!first) first = version;
|
|
1248
|
+
} else {
|
|
1249
|
+
if (prev) set.push([
|
|
1250
|
+
first,
|
|
1251
|
+
prev
|
|
1252
|
+
]);
|
|
1253
|
+
prev = null;
|
|
1254
|
+
first = null;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
if (first) set.push([
|
|
1258
|
+
first,
|
|
1259
|
+
null
|
|
1260
|
+
]);
|
|
1261
|
+
const ranges = [];
|
|
1262
|
+
for (const [min, max] of set)if (min === max) ranges.push(min);
|
|
1263
|
+
else if (max || min !== v[0]) if (max) if (min === v[0]) ranges.push(`<=${max}`);
|
|
1264
|
+
else ranges.push(`${min} - ${max}`);
|
|
1265
|
+
else ranges.push(`>=${min}`);
|
|
1266
|
+
else ranges.push('*');
|
|
1267
|
+
const simplified = ranges.join(' || ');
|
|
1268
|
+
const original = 'string' == typeof range.raw ? range.raw : String(range);
|
|
1269
|
+
return simplified.length < original.length ? simplified : range;
|
|
1270
|
+
};
|
|
1271
|
+
},
|
|
1272
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1273
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1274
|
+
const Comparator = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js");
|
|
1275
|
+
const { ANY } = Comparator;
|
|
1276
|
+
const satisfies = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js");
|
|
1277
|
+
const compare = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js");
|
|
1278
|
+
const subset = (sub, dom, options = {})=>{
|
|
1279
|
+
if (sub === dom) return true;
|
|
1280
|
+
sub = new Range(sub, options);
|
|
1281
|
+
dom = new Range(dom, options);
|
|
1282
|
+
let sawNonNull = false;
|
|
1283
|
+
OUTER: for (const simpleSub of sub.set){
|
|
1284
|
+
for (const simpleDom of dom.set){
|
|
1285
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1286
|
+
sawNonNull = sawNonNull || null !== isSub;
|
|
1287
|
+
if (isSub) continue OUTER;
|
|
1288
|
+
}
|
|
1289
|
+
if (sawNonNull) return false;
|
|
1290
|
+
}
|
|
1291
|
+
return true;
|
|
1292
|
+
};
|
|
1293
|
+
const minimumVersionWithPreRelease = [
|
|
1294
|
+
new Comparator('>=0.0.0-0')
|
|
1295
|
+
];
|
|
1296
|
+
const minimumVersion = [
|
|
1297
|
+
new Comparator('>=0.0.0')
|
|
1298
|
+
];
|
|
1299
|
+
const simpleSubset = (sub, dom, options)=>{
|
|
1300
|
+
if (sub === dom) return true;
|
|
1301
|
+
if (1 === sub.length && sub[0].semver === ANY) if (1 === dom.length && dom[0].semver === ANY) return true;
|
|
1302
|
+
else sub = options.includePrerelease ? minimumVersionWithPreRelease : minimumVersion;
|
|
1303
|
+
if (1 === dom.length && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1304
|
+
else dom = minimumVersion;
|
|
1305
|
+
const eqSet = new Set();
|
|
1306
|
+
let gt, lt;
|
|
1307
|
+
for (const c of sub)if ('>' === c.operator || '>=' === c.operator) gt = higherGT(gt, c, options);
|
|
1308
|
+
else if ('<' === c.operator || '<=' === c.operator) lt = lowerLT(lt, c, options);
|
|
1309
|
+
else eqSet.add(c.semver);
|
|
1310
|
+
if (eqSet.size > 1) return null;
|
|
1311
|
+
let gtltComp;
|
|
1312
|
+
if (gt && lt) {
|
|
1313
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1314
|
+
if (gtltComp > 0) return null;
|
|
1315
|
+
else if (0 === gtltComp && ('>=' !== gt.operator || '<=' !== lt.operator)) return null;
|
|
1316
|
+
}
|
|
1317
|
+
for (const eq of eqSet){
|
|
1318
|
+
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1319
|
+
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1320
|
+
for (const c of dom)if (!satisfies(eq, String(c), options)) return false;
|
|
1321
|
+
return true;
|
|
1322
|
+
}
|
|
1323
|
+
let higher, lower;
|
|
1324
|
+
let hasDomLT, hasDomGT;
|
|
1325
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1326
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1327
|
+
if (needDomLTPre && 1 === needDomLTPre.prerelease.length && '<' === lt.operator && 0 === needDomLTPre.prerelease[0]) needDomLTPre = false;
|
|
1328
|
+
for (const c of dom){
|
|
1329
|
+
hasDomGT = hasDomGT || '>' === c.operator || '>=' === c.operator;
|
|
1330
|
+
hasDomLT = hasDomLT || '<' === c.operator || '<=' === c.operator;
|
|
1331
|
+
if (gt) {
|
|
1332
|
+
if (needDomGTPre) {
|
|
1333
|
+
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;
|
|
1334
|
+
}
|
|
1335
|
+
if ('>' === c.operator || '>=' === c.operator) {
|
|
1336
|
+
higher = higherGT(gt, c, options);
|
|
1337
|
+
if (higher === c && higher !== gt) return false;
|
|
1338
|
+
} else if ('>=' === gt.operator && !c.test(gt.semver)) return false;
|
|
1339
|
+
}
|
|
1340
|
+
if (lt) {
|
|
1341
|
+
if (needDomLTPre) {
|
|
1342
|
+
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;
|
|
1343
|
+
}
|
|
1344
|
+
if ('<' === c.operator || '<=' === c.operator) {
|
|
1345
|
+
lower = lowerLT(lt, c, options);
|
|
1346
|
+
if (lower === c && lower !== lt) return false;
|
|
1347
|
+
} else if ('<=' === lt.operator && !c.test(lt.semver)) return false;
|
|
1348
|
+
}
|
|
1349
|
+
if (!c.operator && (lt || gt) && 0 !== gtltComp) return false;
|
|
1350
|
+
}
|
|
1351
|
+
if (gt && hasDomLT && !lt && 0 !== gtltComp) return false;
|
|
1352
|
+
if (lt && hasDomGT && !gt && 0 !== gtltComp) return false;
|
|
1353
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
1354
|
+
return true;
|
|
1355
|
+
};
|
|
1356
|
+
const higherGT = (a, b, options)=>{
|
|
1357
|
+
if (!a) return b;
|
|
1358
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1359
|
+
return comp > 0 ? a : comp < 0 ? b : '>' === b.operator && '>=' === a.operator ? b : a;
|
|
1360
|
+
};
|
|
1361
|
+
const lowerLT = (a, b, options)=>{
|
|
1362
|
+
if (!a) return b;
|
|
1363
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1364
|
+
return comp < 0 ? a : comp > 0 ? b : '<' === b.operator && '<=' === a.operator ? b : a;
|
|
1365
|
+
};
|
|
1366
|
+
module.exports = subset;
|
|
1367
|
+
},
|
|
1368
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1369
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1370
|
+
const toComparators = (range, options)=>new Range(range, options).set.map((comp)=>comp.map((c)=>c.value).join(' ').trim().split(' '));
|
|
1371
|
+
module.exports = toComparators;
|
|
1372
|
+
},
|
|
1373
|
+
"../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1374
|
+
const Range = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js");
|
|
1375
|
+
const validRange = (range, options)=>{
|
|
1376
|
+
try {
|
|
1377
|
+
return new Range(range, options).range || '*';
|
|
1378
|
+
} catch (er) {
|
|
1379
|
+
return null;
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
module.exports = validRange;
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
function coerce(value) {
|
|
1386
|
+
if (value instanceof Error) return value.stack || value.message;
|
|
1387
|
+
return value;
|
|
1388
|
+
}
|
|
1389
|
+
function selectColor(colors, namespace) {
|
|
1390
|
+
let hash = 0;
|
|
1391
|
+
for(let i = 0; i < namespace.length; i++){
|
|
1392
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
1393
|
+
hash |= 0;
|
|
1394
|
+
}
|
|
1395
|
+
return colors[Math.abs(hash) % colors.length];
|
|
1396
|
+
}
|
|
1397
|
+
function matchesTemplate(search, template) {
|
|
1398
|
+
let searchIndex = 0;
|
|
1399
|
+
let templateIndex = 0;
|
|
1400
|
+
let starIndex = -1;
|
|
1401
|
+
let matchIndex = 0;
|
|
1402
|
+
while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || "*" === template[templateIndex])) if ("*" === template[templateIndex]) {
|
|
1403
|
+
starIndex = templateIndex;
|
|
1404
|
+
matchIndex = searchIndex;
|
|
1405
|
+
templateIndex++;
|
|
1406
|
+
} else {
|
|
1407
|
+
searchIndex++;
|
|
1408
|
+
templateIndex++;
|
|
1409
|
+
}
|
|
1410
|
+
else {
|
|
1411
|
+
if (-1 === starIndex) return false;
|
|
1412
|
+
templateIndex = starIndex + 1;
|
|
1413
|
+
matchIndex++;
|
|
1414
|
+
searchIndex = matchIndex;
|
|
1415
|
+
}
|
|
1416
|
+
while(templateIndex < template.length && "*" === template[templateIndex])templateIndex++;
|
|
1417
|
+
return templateIndex === template.length;
|
|
1418
|
+
}
|
|
1419
|
+
function humanize(value) {
|
|
1420
|
+
if (value >= 1e3) return `${(value / 1e3).toFixed(1)}s`;
|
|
1421
|
+
return `${value}ms`;
|
|
1422
|
+
}
|
|
1423
|
+
let globalNamespaces = "";
|
|
1424
|
+
function createDebug(namespace, options) {
|
|
1425
|
+
let prevTime;
|
|
1426
|
+
let enableOverride;
|
|
1427
|
+
let namespacesCache;
|
|
1428
|
+
let enabledCache;
|
|
1429
|
+
const debug = (...args)=>{
|
|
1430
|
+
if (!debug.enabled) return;
|
|
1431
|
+
const curr = Date.now();
|
|
1432
|
+
const diff = curr - (prevTime || curr);
|
|
1433
|
+
prevTime = curr;
|
|
1434
|
+
args[0] = coerce(args[0]);
|
|
1435
|
+
if ("string" != typeof args[0]) args.unshift("%O");
|
|
1436
|
+
let index = 0;
|
|
1437
|
+
args[0] = args[0].replace(/%([a-z%])/gi, (match, format)=>{
|
|
1438
|
+
if ("%%" === match) return "%";
|
|
1439
|
+
index++;
|
|
1440
|
+
const formatter = options.formatters[format];
|
|
1441
|
+
if ("function" == typeof formatter) {
|
|
1442
|
+
const value = args[index];
|
|
1443
|
+
match = formatter.call(debug, value);
|
|
1444
|
+
args.splice(index, 1);
|
|
1445
|
+
index--;
|
|
1446
|
+
}
|
|
1447
|
+
return match;
|
|
1448
|
+
});
|
|
1449
|
+
options.formatArgs.call(debug, diff, args);
|
|
1450
|
+
debug.log(...args);
|
|
1451
|
+
};
|
|
1452
|
+
debug.extend = function(namespace, delimiter = ":") {
|
|
1453
|
+
return createDebug(this.namespace + delimiter + namespace, {
|
|
1454
|
+
useColors: this.useColors,
|
|
1455
|
+
color: this.color,
|
|
1456
|
+
formatArgs: this.formatArgs,
|
|
1457
|
+
formatters: this.formatters,
|
|
1458
|
+
inspectOpts: this.inspectOpts,
|
|
1459
|
+
log: this.log,
|
|
1460
|
+
humanize: this.humanize
|
|
1461
|
+
});
|
|
1462
|
+
};
|
|
1463
|
+
Object.assign(debug, options);
|
|
1464
|
+
debug.namespace = namespace;
|
|
1465
|
+
Object.defineProperty(debug, "enabled", {
|
|
1466
|
+
enumerable: true,
|
|
1467
|
+
configurable: false,
|
|
1468
|
+
get: ()=>{
|
|
1469
|
+
if (null != enableOverride) return enableOverride;
|
|
1470
|
+
if (namespacesCache !== globalNamespaces) {
|
|
1471
|
+
namespacesCache = globalNamespaces;
|
|
1472
|
+
enabledCache = enabled(namespace);
|
|
1473
|
+
}
|
|
1474
|
+
return enabledCache;
|
|
1475
|
+
},
|
|
1476
|
+
set: (v)=>{
|
|
1477
|
+
enableOverride = v;
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
return debug;
|
|
1481
|
+
}
|
|
1482
|
+
let names = [];
|
|
1483
|
+
let skips = [];
|
|
1484
|
+
function enable(namespaces) {
|
|
1485
|
+
globalNamespaces = namespaces;
|
|
1486
|
+
names = [];
|
|
1487
|
+
skips = [];
|
|
1488
|
+
const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
1489
|
+
for (const ns of split)if ("-" === ns[0]) skips.push(ns.slice(1));
|
|
1490
|
+
else names.push(ns);
|
|
1491
|
+
}
|
|
1492
|
+
function enabled(name) {
|
|
1493
|
+
for (const skip of skips)if (matchesTemplate(name, skip)) return false;
|
|
1494
|
+
for (const ns of names)if (matchesTemplate(name, ns)) return true;
|
|
1495
|
+
return false;
|
|
1496
|
+
}
|
|
1497
|
+
let ansi_env = {};
|
|
1498
|
+
try {
|
|
1499
|
+
process.env.DEBUG;
|
|
1500
|
+
ansi_env = process.env;
|
|
1501
|
+
} catch (_unused) {}
|
|
1502
|
+
const ansi_colors = process.stderr.getColorDepth && process.stderr.getColorDepth(ansi_env) > 2 ? [
|
|
1503
|
+
20,
|
|
1504
|
+
21,
|
|
1505
|
+
26,
|
|
1506
|
+
27,
|
|
1507
|
+
32,
|
|
1508
|
+
33,
|
|
1509
|
+
38,
|
|
1510
|
+
39,
|
|
1511
|
+
40,
|
|
1512
|
+
41,
|
|
1513
|
+
42,
|
|
1514
|
+
43,
|
|
1515
|
+
44,
|
|
1516
|
+
45,
|
|
1517
|
+
56,
|
|
1518
|
+
57,
|
|
1519
|
+
62,
|
|
1520
|
+
63,
|
|
1521
|
+
68,
|
|
1522
|
+
69,
|
|
1523
|
+
74,
|
|
1524
|
+
75,
|
|
1525
|
+
76,
|
|
1526
|
+
77,
|
|
1527
|
+
78,
|
|
1528
|
+
79,
|
|
1529
|
+
80,
|
|
1530
|
+
81,
|
|
1531
|
+
92,
|
|
1532
|
+
93,
|
|
1533
|
+
98,
|
|
1534
|
+
99,
|
|
1535
|
+
112,
|
|
1536
|
+
113,
|
|
1537
|
+
128,
|
|
1538
|
+
129,
|
|
1539
|
+
134,
|
|
1540
|
+
135,
|
|
1541
|
+
148,
|
|
1542
|
+
149,
|
|
1543
|
+
160,
|
|
1544
|
+
161,
|
|
1545
|
+
162,
|
|
1546
|
+
163,
|
|
1547
|
+
164,
|
|
1548
|
+
165,
|
|
1549
|
+
166,
|
|
1550
|
+
167,
|
|
1551
|
+
168,
|
|
1552
|
+
169,
|
|
1553
|
+
170,
|
|
1554
|
+
171,
|
|
1555
|
+
172,
|
|
1556
|
+
173,
|
|
1557
|
+
178,
|
|
1558
|
+
179,
|
|
1559
|
+
184,
|
|
1560
|
+
185,
|
|
1561
|
+
196,
|
|
1562
|
+
197,
|
|
1563
|
+
198,
|
|
1564
|
+
199,
|
|
1565
|
+
200,
|
|
1566
|
+
201,
|
|
1567
|
+
202,
|
|
1568
|
+
203,
|
|
1569
|
+
204,
|
|
1570
|
+
205,
|
|
1571
|
+
206,
|
|
1572
|
+
207,
|
|
1573
|
+
208,
|
|
1574
|
+
209,
|
|
1575
|
+
214,
|
|
1576
|
+
215,
|
|
1577
|
+
220,
|
|
1578
|
+
221
|
|
1579
|
+
] : [
|
|
1580
|
+
6,
|
|
1581
|
+
2,
|
|
1582
|
+
3,
|
|
1583
|
+
4,
|
|
1584
|
+
5,
|
|
1585
|
+
1
|
|
1586
|
+
];
|
|
1587
|
+
const inspectOpts = Object.keys(ansi_env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
|
|
1588
|
+
const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
|
|
1589
|
+
let value = ansi_env[key];
|
|
1590
|
+
const lowerCase = "string" == typeof value && value.toLowerCase();
|
|
1591
|
+
value = "null" === value ? null : "yes" === lowerCase || "on" === lowerCase || "true" === lowerCase || "enabled" === lowerCase ? true : "no" === lowerCase || "off" === lowerCase || "false" === lowerCase || "disabled" === lowerCase ? false : Number(value);
|
|
1592
|
+
obj[prop] = value;
|
|
1593
|
+
return obj;
|
|
1594
|
+
}, Object.create(null));
|
|
1595
|
+
function ansi_useColors() {
|
|
1596
|
+
return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
|
|
1597
|
+
}
|
|
1598
|
+
function getDate() {
|
|
1599
|
+
if (inspectOpts.hideDate) return "";
|
|
1600
|
+
return `${(/* @__PURE__ */ new Date()).toISOString()} `;
|
|
1601
|
+
}
|
|
1602
|
+
function formatArgs(diff, args) {
|
|
1603
|
+
const { namespace: name, useColors } = this;
|
|
1604
|
+
if (useColors) {
|
|
1605
|
+
const c = this.color;
|
|
1606
|
+
const colorCode = `\u{1B}[3${c < 8 ? c : `8;5;${c}`}`;
|
|
1607
|
+
const prefix = ` ${colorCode};1m${name} \u{1B}[0m`;
|
|
1608
|
+
args[0] = prefix + args[0].split("\n").join(`\n${prefix}`);
|
|
1609
|
+
args.push(`${colorCode}m+${this.humanize(diff)}\u{1B}[0m`);
|
|
1610
|
+
} else args[0] = `${getDate()}${name} ${args[0]}`;
|
|
1611
|
+
}
|
|
1612
|
+
function log(...args) {
|
|
1613
|
+
process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}\n`);
|
|
1614
|
+
}
|
|
1615
|
+
const defaultOptions = {
|
|
1616
|
+
useColors: ansi_useColors(),
|
|
1617
|
+
formatArgs: formatArgs,
|
|
1618
|
+
formatters: {
|
|
1619
|
+
o (v) {
|
|
1620
|
+
this.inspectOpts.colors = this.useColors;
|
|
1621
|
+
return inspect(v, this.inspectOpts).split("\n").map((str)=>str.trim()).join(" ");
|
|
1622
|
+
},
|
|
1623
|
+
O (v) {
|
|
1624
|
+
this.inspectOpts.colors = this.useColors;
|
|
1625
|
+
return inspect(v, this.inspectOpts);
|
|
1626
|
+
}
|
|
1627
|
+
},
|
|
1628
|
+
inspectOpts: inspectOpts,
|
|
1629
|
+
log: log,
|
|
1630
|
+
humanize: humanize
|
|
1631
|
+
};
|
|
1632
|
+
function ansi_createDebug(namespace, options) {
|
|
1633
|
+
var _ref;
|
|
1634
|
+
const color = null != (_ref = options && options.color) ? _ref : selectColor(ansi_colors, namespace);
|
|
1635
|
+
return createDebug(namespace, Object.assign(defaultOptions, {
|
|
1636
|
+
color
|
|
1637
|
+
}, options));
|
|
1638
|
+
}
|
|
1639
|
+
enable(ansi_env.DEBUG || "");
|
|
1640
|
+
const DAEMON_PRODUCT = "@lynx-js/devtool-connector";
|
|
1641
|
+
function isCustomizedMessage(msg) {
|
|
1642
|
+
return "object" == typeof msg && null !== msg && "Customized" === msg.event;
|
|
1643
|
+
}
|
|
1644
|
+
function isControlRequest(msg) {
|
|
1645
|
+
return "object" == typeof msg && null !== msg && "Control" === msg.event;
|
|
1646
|
+
}
|
|
1647
|
+
function isListClientsRequest(msg) {
|
|
1648
|
+
return "object" == typeof msg && null !== msg && "ListClients" === msg.event;
|
|
1649
|
+
}
|
|
1650
|
+
function isPingEvent(msg) {
|
|
1651
|
+
return "object" == typeof msg && null !== msg && "Ping" === msg.event;
|
|
1652
|
+
}
|
|
1653
|
+
function isRegisterEvent(msg) {
|
|
1654
|
+
return "object" == typeof msg && null !== msg && "Register" === msg.event;
|
|
1655
|
+
}
|
|
1656
|
+
const DAEMON_WS_PATH = "/devtool/connector";
|
|
1657
|
+
const DAEMON_VERSION_PATH = `${DAEMON_WS_PATH}/version`;
|
|
1658
|
+
const DAEMON_SHUTDOWN_PATH = `${DAEMON_WS_PATH}/shutdown`;
|
|
1659
|
+
const DAEMON_INSPECTOR_PATH = `${DAEMON_WS_PATH}/inspector`;
|
|
1660
|
+
const DAEMON_COMMAND_PATH_PREFIX = "/command/";
|
|
1661
|
+
var package_namespaceObject = {
|
|
1662
|
+
rE: "0.16.2"
|
|
1663
|
+
};
|
|
1664
|
+
const CONNECTOR_VERSION = package_namespaceObject.rE;
|
|
1665
|
+
const node_modules_semver = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js");
|
|
1666
|
+
const manager_debug = ansi_createDebug("devtool-mcp-server:daemon:manager");
|
|
1667
|
+
const DEBUG_ROUTER_DIR = node_path.join(node_os.homedir(), ".DebugRouterConnector");
|
|
1668
|
+
const LOG = node_path.join(DEBUG_ROUTER_DIR, "daemon.log");
|
|
1669
|
+
const ERR = node_path.join(DEBUG_ROUTER_DIR, "daemon.err");
|
|
1670
|
+
const DAEMON_CONVERGENCE_TIMEOUT_MS = 15000;
|
|
1671
|
+
const DIRECT_TRANSPORT_ENVIRONMENT_VARIABLES = [
|
|
1672
|
+
"ADB_SERVER_HOST",
|
|
1673
|
+
"ADB_SERVER_PORT"
|
|
1674
|
+
];
|
|
1675
|
+
function isCompatibleDaemonVersion(version, currentVersion) {
|
|
1676
|
+
const daemonVersion = (0, node_modules_semver.valid)(version);
|
|
1677
|
+
const callerVersion = (0, node_modules_semver.valid)(currentVersion);
|
|
1678
|
+
return null !== daemonVersion && null !== callerVersion && (0, node_modules_semver.satisfies)(daemonVersion, `^${callerVersion}`);
|
|
1679
|
+
}
|
|
1680
|
+
function createDaemonProcessEnvironment(env) {
|
|
1681
|
+
const daemonEnvironment = {
|
|
1682
|
+
...env,
|
|
1683
|
+
DEBUG: env["DEBUG"] ?? ""
|
|
1684
|
+
};
|
|
1685
|
+
for (const name of DIRECT_TRANSPORT_ENVIRONMENT_VARIABLES)delete daemonEnvironment[name];
|
|
1686
|
+
return daemonEnvironment;
|
|
1687
|
+
}
|
|
1688
|
+
class DaemonLifecycleError extends Error {
|
|
1689
|
+
code = "ERR_DAEMON_LIFECYCLE";
|
|
1690
|
+
constructor(message, options){
|
|
1691
|
+
super(message, options);
|
|
1692
|
+
this.name = "DaemonLifecycleError";
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
function isDaemonLifecycleError(error) {
|
|
1696
|
+
if (error instanceof DaemonLifecycleError) return true;
|
|
1697
|
+
return "object" == typeof error && null !== error && "code" in error && "ERR_DAEMON_LIFECYCLE" === error.code;
|
|
1698
|
+
}
|
|
1699
|
+
function resolveDaemonEntryPath(moduleUrl = import.meta.url) {
|
|
1700
|
+
const connectorPackageJson = createRequire(moduleUrl).resolve("@lynx-js/devtool-connector/package.json");
|
|
1701
|
+
return createRequire(connectorPackageJson).resolve("#daemon-entry");
|
|
1702
|
+
}
|
|
1703
|
+
class DaemonLifecycle {
|
|
1704
|
+
identity;
|
|
1705
|
+
constructor(identity = {
|
|
1706
|
+
product: DAEMON_PRODUCT,
|
|
1707
|
+
version: CONNECTOR_VERSION,
|
|
1708
|
+
lifecycleProtocol: 1,
|
|
1709
|
+
commandProtocol: 1
|
|
1710
|
+
}){
|
|
1711
|
+
this.identity = Object.freeze({
|
|
1712
|
+
...identity
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
resolveEntryPath() {
|
|
1716
|
+
return resolveDaemonEntryPath();
|
|
1717
|
+
}
|
|
1718
|
+
createProcessEnvironment() {
|
|
1719
|
+
return createDaemonProcessEnvironment(process.env);
|
|
1720
|
+
}
|
|
1721
|
+
#ensureTasks = new Map();
|
|
1722
|
+
ensureRunning(port = 21783, _options = {}) {
|
|
1723
|
+
const existing = this.#ensureTasks.get(port);
|
|
1724
|
+
if (existing) return existing;
|
|
1725
|
+
const task = this.#ensureCompatibleDaemon(port);
|
|
1726
|
+
this.#ensureTasks.set(port, task);
|
|
1727
|
+
return task.finally(()=>{
|
|
1728
|
+
if (this.#ensureTasks.get(port) === task) this.#ensureTasks.delete(port);
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
async kill(port = 21783) {
|
|
1732
|
+
const probe = await this.#probe(port);
|
|
1733
|
+
if ("absent" === probe.kind) return;
|
|
1734
|
+
if ("daemon" !== probe.kind) throw new Error(`Refusing to stop the unknown process listening on port ${port}.`);
|
|
1735
|
+
if (void 0 !== probe.metadata.product && probe.metadata.product !== this.identity.product) throw new DaemonLifecycleError(`Refusing to stop another daemon product on port ${port}.`);
|
|
1736
|
+
const result = await this.#requestShutdown(port, probe.metadata);
|
|
1737
|
+
if ("conflict" === result) throw new DaemonLifecycleError(`Connector daemon on port ${port} changed before it could be stopped. Retry against the current instance.`);
|
|
1738
|
+
if ("accepted" !== result) throw new Error(`Connector daemon on port ${port} refused the shutdown request.`);
|
|
1739
|
+
if (!await this.#waitForInstanceChange(port, probe.metadata, 3000)) throw new DaemonLifecycleError(`Connector daemon ${this.#describe(probe.metadata)} did not stop within 3000ms.`);
|
|
1740
|
+
}
|
|
1741
|
+
async #ensureCompatibleDaemon(port) {
|
|
1742
|
+
const url = `ws://127.0.0.1:${port}${DAEMON_WS_PATH}`;
|
|
1743
|
+
const deadline = performance.now() + DAEMON_CONVERGENCE_TIMEOUT_MS;
|
|
1744
|
+
while(true){
|
|
1745
|
+
const probe = await this.#probe(port);
|
|
1746
|
+
if ("unknown" === probe.kind) throw new DaemonLifecycleError(`Port ${port} is occupied by an unknown process. Stop it or choose another port, then retry.`);
|
|
1747
|
+
if ("daemon" === probe.kind && this.#isCompatible(probe.metadata)) {
|
|
1748
|
+
manager_debug("compatible daemon already running on port %d: %O", port, probe.metadata);
|
|
1749
|
+
return url;
|
|
1750
|
+
}
|
|
1751
|
+
if (performance.now() >= deadline) break;
|
|
1752
|
+
if ("absent" === probe.kind) {
|
|
1753
|
+
manager_debug("daemon not running on port %d, spawning", port);
|
|
1754
|
+
await this.#spawn(port);
|
|
1755
|
+
const readyTimeout = Math.max(1, Math.min(5000, deadline - performance.now()));
|
|
1756
|
+
const started = await this.#waitReady(port, readyTimeout);
|
|
1757
|
+
if ("daemon" === started.kind && this.#isCompatible(started.metadata)) {
|
|
1758
|
+
manager_debug("daemon is ready on port %d: %O", port, started.metadata);
|
|
1759
|
+
return url;
|
|
1760
|
+
}
|
|
1761
|
+
if ("unknown" === started.kind) throw new DaemonLifecycleError(`Port ${port} was claimed by an unknown process while the connector daemon was starting.`);
|
|
1762
|
+
if ("absent" === started.kind) manager_debug("daemon candidate did not become ready on port %d; re-evaluating within convergence window", port);
|
|
1763
|
+
continue;
|
|
1764
|
+
}
|
|
1765
|
+
this.#assertSafeUpgrade(probe.metadata, port);
|
|
1766
|
+
manager_debug("stopping incompatible daemon on port %d: %O", port, probe.metadata);
|
|
1767
|
+
const shutdown = await this.#requestShutdown(port, probe.metadata);
|
|
1768
|
+
if ("conflict" === shutdown) {
|
|
1769
|
+
manager_debug("daemon changed before shutdown on port %d; probing the winner", port);
|
|
1770
|
+
continue;
|
|
1771
|
+
}
|
|
1772
|
+
if ("accepted" !== shutdown) {
|
|
1773
|
+
if (await this.#waitForInstanceChange(port, probe.metadata, 3000)) {
|
|
1774
|
+
manager_debug("daemon changed after a competing shutdown on port %d; probing the winner", port);
|
|
1775
|
+
continue;
|
|
1776
|
+
}
|
|
1777
|
+
throw new DaemonLifecycleError(`Connector daemon ${this.#describe(probe.metadata)} on port ${port} refused a safe restart.`);
|
|
1778
|
+
}
|
|
1779
|
+
if (!await this.#waitForInstanceChange(port, probe.metadata, 3000)) throw new DaemonLifecycleError(`Connector daemon ${this.#describe(probe.metadata)} on port ${port} did not stop within 3000ms.`);
|
|
1780
|
+
}
|
|
1781
|
+
throw new DaemonLifecycleError(`Connector daemon on port ${port} did not converge within ${DAEMON_CONVERGENCE_TIMEOUT_MS}ms.`);
|
|
1782
|
+
}
|
|
1783
|
+
#isCompatible(metadata) {
|
|
1784
|
+
return metadata.product === this.identity.product && isCompatibleDaemonVersion(metadata.version, this.identity.version) && metadata.lifecycleProtocol === this.identity.lifecycleProtocol && metadata.commandProtocol === this.identity.commandProtocol && metadata.browserPreviewProtocol === this.identity.browserPreviewProtocol && "string" == typeof metadata.instanceId && "" !== metadata.instanceId;
|
|
1785
|
+
}
|
|
1786
|
+
#assertSafeUpgrade(metadata, port) {
|
|
1787
|
+
if (void 0 !== metadata.product && metadata.product !== this.identity.product) throw new DaemonLifecycleError(`Port ${port} reports daemon product ${JSON.stringify(metadata.product)} instead of ${this.identity.product}. Refusing to replace it.`);
|
|
1788
|
+
if (metadata.version === this.identity.version) return;
|
|
1789
|
+
const runningVersion = (0, node_modules_semver.valid)(metadata.version);
|
|
1790
|
+
const callerVersion = (0, node_modules_semver.valid)(this.identity.version);
|
|
1791
|
+
if (!runningVersion || !callerVersion) throw new DaemonLifecycleError(`Cannot safely compare connector daemon version ${JSON.stringify(metadata.version)} with caller version ${JSON.stringify(this.identity.version)} on port ${port}.`);
|
|
1792
|
+
if ((0, node_modules_semver.gt)(runningVersion, callerVersion)) throw new DaemonLifecycleError(`Connector daemon ${runningVersion} on port ${port} is newer than caller ${callerVersion}. Upgrade the caller instead of downgrading the daemon.`);
|
|
1793
|
+
}
|
|
1794
|
+
async #probe(port) {
|
|
1795
|
+
const firstMetadata = await this.#getMetadata(port);
|
|
1796
|
+
if (firstMetadata) return {
|
|
1797
|
+
kind: "daemon",
|
|
1798
|
+
metadata: firstMetadata
|
|
1799
|
+
};
|
|
1800
|
+
if (!await this.#isAlive(port)) return {
|
|
1801
|
+
kind: "absent"
|
|
1802
|
+
};
|
|
1803
|
+
const secondMetadata = await this.#getMetadata(port);
|
|
1804
|
+
if (secondMetadata) return {
|
|
1805
|
+
kind: "daemon",
|
|
1806
|
+
metadata: secondMetadata
|
|
1807
|
+
};
|
|
1808
|
+
return await this.#isAlive(port) ? {
|
|
1809
|
+
kind: "unknown"
|
|
1810
|
+
} : {
|
|
1811
|
+
kind: "absent"
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
async #isAlive(port) {
|
|
1815
|
+
return new Promise((resolve)=>{
|
|
1816
|
+
const socket = node_net.createConnection({
|
|
1817
|
+
host: "127.0.0.1",
|
|
1818
|
+
port
|
|
1819
|
+
}, ()=>{
|
|
1820
|
+
socket.destroy();
|
|
1821
|
+
resolve(true);
|
|
1822
|
+
});
|
|
1823
|
+
socket.on("error", ()=>{
|
|
1824
|
+
socket.destroy();
|
|
1825
|
+
resolve(false);
|
|
1826
|
+
});
|
|
1827
|
+
socket.setTimeout(1000, ()=>{
|
|
1828
|
+
socket.destroy();
|
|
1829
|
+
resolve(false);
|
|
1830
|
+
});
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
#getMetadata(port) {
|
|
1834
|
+
return new Promise((resolve)=>{
|
|
1835
|
+
let settled = false;
|
|
1836
|
+
const finish = (value)=>{
|
|
1837
|
+
if (settled) return;
|
|
1838
|
+
settled = true;
|
|
1839
|
+
resolve(value);
|
|
1840
|
+
};
|
|
1841
|
+
const request = node_http.get({
|
|
1842
|
+
headers: {
|
|
1843
|
+
connection: "close"
|
|
1844
|
+
},
|
|
1845
|
+
host: "127.0.0.1",
|
|
1846
|
+
path: DAEMON_VERSION_PATH,
|
|
1847
|
+
port,
|
|
1848
|
+
timeout: 1000
|
|
1849
|
+
}, (response)=>{
|
|
1850
|
+
let body = "";
|
|
1851
|
+
response.setEncoding("utf8");
|
|
1852
|
+
response.on("data", (chunk)=>{
|
|
1853
|
+
if (body.length < 16384) body += chunk;
|
|
1854
|
+
});
|
|
1855
|
+
response.on("aborted", ()=>finish(null));
|
|
1856
|
+
response.on("error", ()=>finish(null));
|
|
1857
|
+
response.on("end", ()=>{
|
|
1858
|
+
if (200 !== response.statusCode) return void finish(null);
|
|
1859
|
+
try {
|
|
1860
|
+
finish(this.#parseMetadata(JSON.parse(body)));
|
|
1861
|
+
} catch {
|
|
1862
|
+
finish(null);
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
});
|
|
1866
|
+
request.on("timeout", ()=>{
|
|
1867
|
+
finish(null);
|
|
1868
|
+
request.destroy();
|
|
1869
|
+
});
|
|
1870
|
+
request.on("error", ()=>finish(null));
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
#parseMetadata(value) {
|
|
1874
|
+
if ("object" != typeof value || null === value || Array.isArray(value)) return null;
|
|
1875
|
+
const record = value;
|
|
1876
|
+
if ("string" != typeof record["version"] || "" === record["version"]) return null;
|
|
1877
|
+
const metadata = {
|
|
1878
|
+
version: record["version"]
|
|
1879
|
+
};
|
|
1880
|
+
if ("string" == typeof record["product"]) metadata.product = record["product"];
|
|
1881
|
+
if ("number" == typeof record["lifecycleProtocol"]) metadata.lifecycleProtocol = record["lifecycleProtocol"];
|
|
1882
|
+
if ("number" == typeof record["commandProtocol"]) metadata.commandProtocol = record["commandProtocol"];
|
|
1883
|
+
if ("number" == typeof record["browserPreviewProtocol"]) metadata.browserPreviewProtocol = record["browserPreviewProtocol"];
|
|
1884
|
+
if ("string" == typeof record["instanceId"]) metadata.instanceId = record["instanceId"];
|
|
1885
|
+
if ("number" == typeof record["startedAt"]) metadata.startedAt = record["startedAt"];
|
|
1886
|
+
return metadata;
|
|
1887
|
+
}
|
|
1888
|
+
#requestShutdown(port, metadata) {
|
|
1889
|
+
return new Promise((resolve)=>{
|
|
1890
|
+
let settled = false;
|
|
1891
|
+
const finish = (result)=>{
|
|
1892
|
+
if (settled) return;
|
|
1893
|
+
settled = true;
|
|
1894
|
+
resolve(result);
|
|
1895
|
+
};
|
|
1896
|
+
const shutdownRequest = void 0 === metadata.instanceId ? void 0 : {
|
|
1897
|
+
expectedInstanceId: metadata.instanceId
|
|
1898
|
+
};
|
|
1899
|
+
const body = void 0 === shutdownRequest ? void 0 : JSON.stringify(shutdownRequest);
|
|
1900
|
+
const request = node_http.request({
|
|
1901
|
+
headers: void 0 === body ? {
|
|
1902
|
+
connection: "close"
|
|
1903
|
+
} : {
|
|
1904
|
+
connection: "close",
|
|
1905
|
+
"content-length": Buffer.byteLength(body),
|
|
1906
|
+
"content-type": "application/json"
|
|
1907
|
+
},
|
|
1908
|
+
host: "127.0.0.1",
|
|
1909
|
+
method: "POST",
|
|
1910
|
+
path: DAEMON_SHUTDOWN_PATH,
|
|
1911
|
+
port,
|
|
1912
|
+
timeout: 1000
|
|
1913
|
+
}, (response)=>{
|
|
1914
|
+
response.resume();
|
|
1915
|
+
response.on("aborted", ()=>finish("refused"));
|
|
1916
|
+
response.on("error", ()=>finish("refused"));
|
|
1917
|
+
response.on("end", ()=>{
|
|
1918
|
+
if (202 === response.statusCode) finish("accepted");
|
|
1919
|
+
else 409 === response.statusCode ? finish("conflict") : finish("refused");
|
|
1920
|
+
});
|
|
1921
|
+
});
|
|
1922
|
+
request.on("timeout", ()=>{
|
|
1923
|
+
finish("refused");
|
|
1924
|
+
request.destroy();
|
|
1925
|
+
});
|
|
1926
|
+
request.on("error", ()=>finish("refused"));
|
|
1927
|
+
request.end(body);
|
|
1928
|
+
});
|
|
1929
|
+
}
|
|
1930
|
+
async #waitForInstanceChange(port, previous, timeoutMs) {
|
|
1931
|
+
const deadline = Date.now() + timeoutMs;
|
|
1932
|
+
while(Date.now() < deadline){
|
|
1933
|
+
const current = await this.#probe(port);
|
|
1934
|
+
if ("absent" === current.kind) return true;
|
|
1935
|
+
if ("daemon" === current.kind && !this.#isSameInstance(previous, current.metadata)) return true;
|
|
1936
|
+
await promises_setTimeout(100);
|
|
1937
|
+
}
|
|
1938
|
+
return false;
|
|
1939
|
+
}
|
|
1940
|
+
#isSameInstance(left, right) {
|
|
1941
|
+
if (void 0 !== left.instanceId) return left.instanceId === right.instanceId;
|
|
1942
|
+
return void 0 === right.instanceId && left.product === right.product && left.version === right.version;
|
|
1943
|
+
}
|
|
1944
|
+
async #spawn(port) {
|
|
1945
|
+
await promises.mkdir(DEBUG_ROUTER_DIR, {
|
|
1946
|
+
recursive: true
|
|
1947
|
+
});
|
|
1948
|
+
const entryPath = this.resolveEntryPath();
|
|
1949
|
+
const out = openSync(LOG, "w");
|
|
1950
|
+
const err = openSync(ERR, "w");
|
|
1951
|
+
const child = spawn(process.execPath, [
|
|
1952
|
+
entryPath,
|
|
1953
|
+
"--port",
|
|
1954
|
+
String(port)
|
|
1955
|
+
], {
|
|
1956
|
+
detached: true,
|
|
1957
|
+
stdio: [
|
|
1958
|
+
"ignore",
|
|
1959
|
+
out,
|
|
1960
|
+
err,
|
|
1961
|
+
"ipc"
|
|
1962
|
+
],
|
|
1963
|
+
env: this.createProcessEnvironment()
|
|
1964
|
+
});
|
|
1965
|
+
closeSync(out);
|
|
1966
|
+
closeSync(err);
|
|
1967
|
+
manager_debug("spawned daemon candidate with pid %d", child.pid);
|
|
1968
|
+
const controller = new AbortController();
|
|
1969
|
+
let outcome;
|
|
1970
|
+
try {
|
|
1971
|
+
outcome = await Promise.race([
|
|
1972
|
+
once(child, "message", {
|
|
1973
|
+
signal: controller.signal
|
|
1974
|
+
}).then(()=>"listening"),
|
|
1975
|
+
once(child, "exit", {
|
|
1976
|
+
signal: controller.signal
|
|
1977
|
+
}).then(()=>"exited"),
|
|
1978
|
+
promises_setTimeout(5000, "timeout", {
|
|
1979
|
+
signal: controller.signal
|
|
1980
|
+
})
|
|
1981
|
+
]);
|
|
1982
|
+
} catch (error) {
|
|
1983
|
+
controller.abort();
|
|
1984
|
+
await this.#terminateCandidate(child);
|
|
1985
|
+
throw error;
|
|
1986
|
+
} finally{
|
|
1987
|
+
controller.abort();
|
|
1988
|
+
}
|
|
1989
|
+
if ("timeout" === outcome) await this.#terminateCandidate(child);
|
|
1990
|
+
if ("listening" === outcome) {
|
|
1991
|
+
if (child.connected) child.disconnect();
|
|
1992
|
+
child.unref();
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
async #terminateCandidate(child) {
|
|
1996
|
+
if (void 0 === child.pid || null !== child.exitCode || null !== child.signalCode) return;
|
|
1997
|
+
const exited = once(child, "exit");
|
|
1998
|
+
child.kill("SIGKILL");
|
|
1999
|
+
await exited;
|
|
2000
|
+
}
|
|
2001
|
+
async #waitReady(port, timeoutMs) {
|
|
2002
|
+
const deadline = Date.now() + timeoutMs;
|
|
2003
|
+
let lastProbe = {
|
|
2004
|
+
kind: "absent"
|
|
2005
|
+
};
|
|
2006
|
+
while(Date.now() < deadline){
|
|
2007
|
+
lastProbe = await this.#probe(port);
|
|
2008
|
+
if ("daemon" === lastProbe.kind) break;
|
|
2009
|
+
await promises_setTimeout(100);
|
|
2010
|
+
}
|
|
2011
|
+
return lastProbe;
|
|
2012
|
+
}
|
|
2013
|
+
#describe(metadata) {
|
|
2014
|
+
const instance = metadata.instanceId ? ` instance ${metadata.instanceId}` : " legacy instance";
|
|
2015
|
+
return `${metadata.version}${instance}`;
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
const DaemonManager = new DaemonLifecycle();
|
|
2019
|
+
export { CONNECTOR_VERSION, DAEMON_COMMAND_PATH_PREFIX, DAEMON_INSPECTOR_PATH, DAEMON_PRODUCT, DAEMON_SHUTDOWN_PATH, DAEMON_VERSION_PATH, DAEMON_WS_PATH, DaemonLifecycle, DaemonLifecycleError, DaemonManager, ansi_createDebug, createDaemonProcessEnvironment, isControlRequest, isCustomizedMessage, isDaemonLifecycleError, isListClientsRequest, isPingEvent, isRegisterEvent, resolveDaemonEntryPath };
|