@hot-updater/aws 0.35.11 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +64 -4
- package/dist/index.mjs +64 -4
- package/dist/lambda/index.cjs +887 -2815
- package/package.json +8 -8
package/dist/lambda/index.cjs
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create
|
|
4
|
-
var __defProp
|
|
5
|
-
var __getOwnPropDesc
|
|
6
|
-
var __getOwnPropNames
|
|
7
|
-
var __getProtoOf
|
|
8
|
-
var __hasOwnProp
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
11
|
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
13
|
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
20
|
value: mod,
|
|
22
21
|
enumerable: true
|
|
23
22
|
}) : target, mod));
|
|
24
23
|
//#endregion
|
|
25
24
|
let node_crypto = require("node:crypto");
|
|
26
|
-
node_crypto = __toESM
|
|
25
|
+
node_crypto = __toESM(node_crypto);
|
|
27
26
|
let _aws_sdk_client_cloudfront = require("@aws-sdk/client-cloudfront");
|
|
28
27
|
let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
|
|
29
28
|
let fs_promises = require("fs/promises");
|
|
30
|
-
fs_promises = __toESM
|
|
29
|
+
fs_promises = __toESM(fs_promises);
|
|
31
30
|
let path = require("path");
|
|
32
|
-
path = __toESM
|
|
31
|
+
path = __toESM(path);
|
|
33
32
|
let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
|
|
34
33
|
let _aws_sdk_s3_request_presigner = require("@aws-sdk/s3-request-presigner");
|
|
35
34
|
let _aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
|
|
36
35
|
let _aws_sdk_cloudfront_signer = require("@aws-sdk/cloudfront-signer");
|
|
37
36
|
//#endregion
|
|
38
37
|
//#region ../../packages/server/dist/version.mjs
|
|
39
|
-
const HOT_UPDATER_SERVER_VERSION = "0.
|
|
38
|
+
const HOT_UPDATER_SERVER_VERSION = "0.36.0";
|
|
40
39
|
//#endregion
|
|
41
40
|
//#region ../../packages/server/dist/internalRouter.mjs
|
|
42
41
|
const normalizePath = (path) => {
|
|
@@ -89,1387 +88,350 @@ function findRoute(router, method, path) {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
//#endregion
|
|
92
|
-
//#region ../../node_modules/.pnpm/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
|
|
123
|
-
var require_re$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
124
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants$1();
|
|
125
|
-
const debug = require_debug$1();
|
|
126
|
-
exports = module.exports = {};
|
|
127
|
-
const re = exports.re = [];
|
|
128
|
-
const safeRe = exports.safeRe = [];
|
|
129
|
-
const src = exports.src = [];
|
|
130
|
-
const safeSrc = exports.safeSrc = [];
|
|
131
|
-
const t = exports.t = {};
|
|
132
|
-
let R = 0;
|
|
133
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
134
|
-
const safeRegexReplacements = [
|
|
135
|
-
["\\s", 1],
|
|
136
|
-
["\\d", MAX_LENGTH],
|
|
137
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
91
|
+
//#region ../../node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.js
|
|
92
|
+
const LETTER_DASH_NUMBER$1 = "[a-zA-Z0-9-]";
|
|
93
|
+
const NUMERIC_IDENTIFIER$1 = String.raw`0|[1-9]\d*`;
|
|
94
|
+
const NUMERIC_IDENTIFIER_LOOSE$1 = String.raw`\d+`;
|
|
95
|
+
const NON_NUMERIC_IDENTIFIER$1 = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER$1}*`;
|
|
96
|
+
const MAIN_VERSION$1 = String.raw`(${NUMERIC_IDENTIFIER$1})\.(${NUMERIC_IDENTIFIER$1})\.(${NUMERIC_IDENTIFIER$1})`;
|
|
97
|
+
const MAIN_VERSION_LOOSE$1 = String.raw`(${NUMERIC_IDENTIFIER_LOOSE$1})\.(${NUMERIC_IDENTIFIER_LOOSE$1})\.(${NUMERIC_IDENTIFIER_LOOSE$1})`;
|
|
98
|
+
const PRERELEASE_IDENTIFIER$1 = `(?:${NON_NUMERIC_IDENTIFIER$1}|${NUMERIC_IDENTIFIER$1})`;
|
|
99
|
+
const PRERELEASE_IDENTIFIER_LOOSE$1 = `(?:${NON_NUMERIC_IDENTIFIER$1}|${NUMERIC_IDENTIFIER_LOOSE$1})`;
|
|
100
|
+
const PRERELEASE$1 = String.raw`(?:-(${PRERELEASE_IDENTIFIER$1}(?:\.${PRERELEASE_IDENTIFIER$1})*))`;
|
|
101
|
+
const PRERELEASE_LOOSE$1 = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE$1}(?:\.${PRERELEASE_IDENTIFIER_LOOSE$1})*))`;
|
|
102
|
+
const BUILD_IDENTIFIER$1 = `${LETTER_DASH_NUMBER$1}+`;
|
|
103
|
+
const BUILD$1 = String.raw`(?:\+(${BUILD_IDENTIFIER$1}(?:\.${BUILD_IDENTIFIER$1})*))`;
|
|
104
|
+
const FULL_PLAIN$1 = `v?${MAIN_VERSION$1}${PRERELEASE$1}?${BUILD$1}?`;
|
|
105
|
+
const LOOSE_PLAIN$1 = String.raw`[v=\s]*${MAIN_VERSION_LOOSE$1}${PRERELEASE_LOOSE$1}?${BUILD$1}?`;
|
|
106
|
+
const GREATER_LESS_THAN$1 = "((?:<|>)?=?)";
|
|
107
|
+
const XRANGE_IDENTIFIER$1 = String.raw`${NUMERIC_IDENTIFIER$1}|x|X|\*`;
|
|
108
|
+
const XRANGE_IDENTIFIER_LOOSE$1 = String.raw`${NUMERIC_IDENTIFIER_LOOSE$1}|x|X|\*`;
|
|
109
|
+
const XRANGE_PLAIN$1 = String.raw`[v=\s]*(${XRANGE_IDENTIFIER$1})(?:\.(${XRANGE_IDENTIFIER$1})(?:\.(${XRANGE_IDENTIFIER$1})(?:${PRERELEASE$1})?${BUILD$1}?)?)?`;
|
|
110
|
+
const XRANGE_PLAIN_LOOSE$1 = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE$1})(?:\.(${XRANGE_IDENTIFIER_LOOSE$1})(?:\.(${XRANGE_IDENTIFIER_LOOSE$1})(?:${PRERELEASE_LOOSE$1})?${BUILD$1}?)?)?`;
|
|
111
|
+
const LONE_TILDE$1 = "(?:~>?)";
|
|
112
|
+
const LONE_CARET$1 = String.raw`(?:\^)`;
|
|
113
|
+
const COERCE_PLAIN$1 = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
114
|
+
const COERCE$1 = String.raw`${COERCE_PLAIN$1}(?:$|[^\d])`;
|
|
115
|
+
const COERCE_FULL$1 = String.raw`${COERCE_PLAIN$1}(?:${PRERELEASE$1})?(?:${BUILD$1})?(?:$|[^\d])`;
|
|
116
|
+
function makeSafeRegexSource$1(source) {
|
|
117
|
+
const replacements = [
|
|
118
|
+
[String.raw`\s`, 1],
|
|
119
|
+
[String.raw`\d`, 256],
|
|
120
|
+
[LETTER_DASH_NUMBER$1, 250]
|
|
138
121
|
];
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
194
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
195
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
196
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
197
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
198
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
199
|
-
}));
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
|
|
202
|
-
var require_parse_options$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
203
|
-
const looseOption = Object.freeze({ loose: true });
|
|
204
|
-
const emptyOpts = Object.freeze({});
|
|
205
|
-
const parseOptions = (options) => {
|
|
206
|
-
if (!options) return emptyOpts;
|
|
207
|
-
if (typeof options !== "object") return looseOption;
|
|
208
|
-
return options;
|
|
209
|
-
};
|
|
210
|
-
module.exports = parseOptions;
|
|
211
|
-
}));
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
|
|
214
|
-
var require_identifiers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
215
|
-
const numeric = /^[0-9]+$/;
|
|
216
|
-
const compareIdentifiers = (a, b) => {
|
|
217
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
218
|
-
const anum = numeric.test(a);
|
|
219
|
-
const bnum = numeric.test(b);
|
|
220
|
-
if (anum && bnum) {
|
|
221
|
-
a = +a;
|
|
222
|
-
b = +b;
|
|
223
|
-
}
|
|
224
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
225
|
-
};
|
|
226
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
227
|
-
module.exports = {
|
|
228
|
-
compareIdentifiers,
|
|
229
|
-
rcompareIdentifiers
|
|
230
|
-
};
|
|
231
|
-
}));
|
|
232
|
-
//#endregion
|
|
233
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
|
|
234
|
-
var require_semver$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
235
|
-
const debug = require_debug$1();
|
|
236
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants$1();
|
|
237
|
-
const { safeRe: re, t } = require_re$1();
|
|
238
|
-
const parseOptions = require_parse_options$1();
|
|
239
|
-
const { compareIdentifiers } = require_identifiers$1();
|
|
240
|
-
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
241
|
-
const identifiers = identifier.split(".");
|
|
242
|
-
if (identifiers.length > prerelease.length) return false;
|
|
243
|
-
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
244
|
-
return true;
|
|
245
|
-
};
|
|
246
|
-
module.exports = class SemVer {
|
|
247
|
-
constructor(version, options) {
|
|
248
|
-
options = parseOptions(options);
|
|
249
|
-
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
250
|
-
else version = version.version;
|
|
251
|
-
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
252
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
253
|
-
debug("SemVer", version, options);
|
|
254
|
-
this.options = options;
|
|
255
|
-
this.loose = !!options.loose;
|
|
256
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
257
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
258
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
259
|
-
this.raw = version;
|
|
260
|
-
this.major = +m[1];
|
|
261
|
-
this.minor = +m[2];
|
|
262
|
-
this.patch = +m[3];
|
|
263
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
264
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
265
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
266
|
-
if (!m[4]) this.prerelease = [];
|
|
267
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
268
|
-
if (/^[0-9]+$/.test(id)) {
|
|
269
|
-
const num = +id;
|
|
270
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
271
|
-
}
|
|
272
|
-
return id;
|
|
273
|
-
});
|
|
274
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
275
|
-
this.format();
|
|
276
|
-
}
|
|
277
|
-
format() {
|
|
278
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
279
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
280
|
-
return this.version;
|
|
281
|
-
}
|
|
282
|
-
toString() {
|
|
283
|
-
return this.version;
|
|
284
|
-
}
|
|
285
|
-
compare(other) {
|
|
286
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
287
|
-
if (!(other instanceof SemVer)) {
|
|
288
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
289
|
-
other = new SemVer(other, this.options);
|
|
290
|
-
}
|
|
291
|
-
if (other.version === this.version) return 0;
|
|
292
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
293
|
-
}
|
|
294
|
-
compareMain(other) {
|
|
295
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
296
|
-
if (this.major < other.major) return -1;
|
|
297
|
-
if (this.major > other.major) return 1;
|
|
298
|
-
if (this.minor < other.minor) return -1;
|
|
299
|
-
if (this.minor > other.minor) return 1;
|
|
300
|
-
if (this.patch < other.patch) return -1;
|
|
301
|
-
if (this.patch > other.patch) return 1;
|
|
302
|
-
return 0;
|
|
303
|
-
}
|
|
304
|
-
comparePre(other) {
|
|
305
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
306
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
307
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
308
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
309
|
-
let i = 0;
|
|
310
|
-
do {
|
|
311
|
-
const a = this.prerelease[i];
|
|
312
|
-
const b = other.prerelease[i];
|
|
313
|
-
debug("prerelease compare", i, a, b);
|
|
314
|
-
if (a === void 0 && b === void 0) return 0;
|
|
315
|
-
else if (b === void 0) return 1;
|
|
316
|
-
else if (a === void 0) return -1;
|
|
317
|
-
else if (a === b) continue;
|
|
318
|
-
else return compareIdentifiers(a, b);
|
|
319
|
-
} while (++i);
|
|
320
|
-
}
|
|
321
|
-
compareBuild(other) {
|
|
322
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
323
|
-
let i = 0;
|
|
324
|
-
do {
|
|
325
|
-
const a = this.build[i];
|
|
326
|
-
const b = other.build[i];
|
|
327
|
-
debug("build compare", i, a, b);
|
|
328
|
-
if (a === void 0 && b === void 0) return 0;
|
|
329
|
-
else if (b === void 0) return 1;
|
|
330
|
-
else if (a === void 0) return -1;
|
|
331
|
-
else if (a === b) continue;
|
|
332
|
-
else return compareIdentifiers(a, b);
|
|
333
|
-
} while (++i);
|
|
334
|
-
}
|
|
335
|
-
inc(release, identifier, identifierBase) {
|
|
336
|
-
if (release.startsWith("pre")) {
|
|
337
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
338
|
-
if (identifier) {
|
|
339
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
340
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
switch (release) {
|
|
344
|
-
case "premajor":
|
|
345
|
-
this.prerelease.length = 0;
|
|
346
|
-
this.patch = 0;
|
|
347
|
-
this.minor = 0;
|
|
348
|
-
this.major++;
|
|
349
|
-
this.inc("pre", identifier, identifierBase);
|
|
350
|
-
break;
|
|
351
|
-
case "preminor":
|
|
352
|
-
this.prerelease.length = 0;
|
|
353
|
-
this.patch = 0;
|
|
354
|
-
this.minor++;
|
|
355
|
-
this.inc("pre", identifier, identifierBase);
|
|
356
|
-
break;
|
|
357
|
-
case "prepatch":
|
|
358
|
-
this.prerelease.length = 0;
|
|
359
|
-
this.inc("patch", identifier, identifierBase);
|
|
360
|
-
this.inc("pre", identifier, identifierBase);
|
|
361
|
-
break;
|
|
362
|
-
case "prerelease":
|
|
363
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
364
|
-
this.inc("pre", identifier, identifierBase);
|
|
365
|
-
break;
|
|
366
|
-
case "release":
|
|
367
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
368
|
-
this.prerelease.length = 0;
|
|
369
|
-
break;
|
|
370
|
-
case "major":
|
|
371
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
372
|
-
this.minor = 0;
|
|
373
|
-
this.patch = 0;
|
|
374
|
-
this.prerelease = [];
|
|
375
|
-
break;
|
|
376
|
-
case "minor":
|
|
377
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
378
|
-
this.patch = 0;
|
|
379
|
-
this.prerelease = [];
|
|
380
|
-
break;
|
|
381
|
-
case "patch":
|
|
382
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
383
|
-
this.prerelease = [];
|
|
384
|
-
break;
|
|
385
|
-
case "pre": {
|
|
386
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
387
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
388
|
-
else {
|
|
389
|
-
let i = this.prerelease.length;
|
|
390
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
391
|
-
this.prerelease[i]++;
|
|
392
|
-
i = -2;
|
|
393
|
-
}
|
|
394
|
-
if (i === -1) {
|
|
395
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
396
|
-
this.prerelease.push(base);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
if (identifier) {
|
|
400
|
-
let prerelease = [identifier, base];
|
|
401
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
402
|
-
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
403
|
-
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
404
|
-
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
405
|
-
} else this.prerelease = prerelease;
|
|
406
|
-
}
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
410
|
-
}
|
|
411
|
-
this.raw = this.format();
|
|
412
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
413
|
-
return this;
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
}));
|
|
417
|
-
//#endregion
|
|
418
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
|
|
419
|
-
var require_parse$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
420
|
-
const SemVer = require_semver$2();
|
|
421
|
-
const parse = (version, options, throwErrors = false) => {
|
|
422
|
-
if (version instanceof SemVer) return version;
|
|
423
|
-
try {
|
|
424
|
-
return new SemVer(version, options);
|
|
425
|
-
} catch (er) {
|
|
426
|
-
if (!throwErrors) return null;
|
|
427
|
-
throw er;
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
module.exports = parse;
|
|
431
|
-
}));
|
|
432
|
-
//#endregion
|
|
433
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
|
|
434
|
-
var require_valid$3 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
435
|
-
const parse = require_parse$1();
|
|
436
|
-
const valid = (version, options) => {
|
|
437
|
-
const v = parse(version, options);
|
|
438
|
-
return v ? v.version : null;
|
|
439
|
-
};
|
|
440
|
-
module.exports = valid;
|
|
441
|
-
}));
|
|
442
|
-
//#endregion
|
|
443
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
|
|
444
|
-
var require_clean$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
445
|
-
const parse = require_parse$1();
|
|
446
|
-
const clean = (version, options) => {
|
|
447
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
448
|
-
return s ? s.version : null;
|
|
449
|
-
};
|
|
450
|
-
module.exports = clean;
|
|
451
|
-
}));
|
|
452
|
-
//#endregion
|
|
453
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
|
|
454
|
-
var require_inc$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
455
|
-
const SemVer = require_semver$2();
|
|
456
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
457
|
-
if (typeof options === "string") {
|
|
458
|
-
identifierBase = identifier;
|
|
459
|
-
identifier = options;
|
|
460
|
-
options = void 0;
|
|
461
|
-
}
|
|
462
|
-
try {
|
|
463
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
464
|
-
} catch (er) {
|
|
465
|
-
return null;
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
module.exports = inc;
|
|
469
|
-
}));
|
|
470
|
-
//#endregion
|
|
471
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
|
|
472
|
-
var require_diff$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
473
|
-
const parse = require_parse$1();
|
|
474
|
-
const diff = (version1, version2) => {
|
|
475
|
-
const v1 = parse(version1, null, true);
|
|
476
|
-
const v2 = parse(version2, null, true);
|
|
477
|
-
const comparison = v1.compare(v2);
|
|
478
|
-
if (comparison === 0) return null;
|
|
479
|
-
const v1Higher = comparison > 0;
|
|
480
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
481
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
482
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
483
|
-
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
484
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
485
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
486
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
487
|
-
return "patch";
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
const prefix = highHasPre ? "pre" : "";
|
|
491
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
492
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
493
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
494
|
-
return "prerelease";
|
|
495
|
-
};
|
|
496
|
-
module.exports = diff;
|
|
497
|
-
}));
|
|
498
|
-
//#endregion
|
|
499
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
|
|
500
|
-
var require_major$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
501
|
-
const SemVer = require_semver$2();
|
|
502
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
503
|
-
module.exports = major;
|
|
504
|
-
}));
|
|
505
|
-
//#endregion
|
|
506
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
|
|
507
|
-
var require_minor$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
508
|
-
const SemVer = require_semver$2();
|
|
509
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
510
|
-
module.exports = minor;
|
|
511
|
-
}));
|
|
512
|
-
//#endregion
|
|
513
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
|
|
514
|
-
var require_patch$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
515
|
-
const SemVer = require_semver$2();
|
|
516
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
517
|
-
module.exports = patch;
|
|
518
|
-
}));
|
|
519
|
-
//#endregion
|
|
520
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
|
|
521
|
-
var require_prerelease$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
522
|
-
const parse = require_parse$1();
|
|
523
|
-
const prerelease = (version, options) => {
|
|
524
|
-
const parsed = parse(version, options);
|
|
525
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
526
|
-
};
|
|
527
|
-
module.exports = prerelease;
|
|
528
|
-
}));
|
|
529
|
-
//#endregion
|
|
530
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
|
|
531
|
-
var require_compare$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
532
|
-
const SemVer = require_semver$2();
|
|
533
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
534
|
-
module.exports = compare;
|
|
535
|
-
}));
|
|
536
|
-
//#endregion
|
|
537
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
|
|
538
|
-
var require_rcompare$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
539
|
-
const compare = require_compare$1();
|
|
540
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
541
|
-
module.exports = rcompare;
|
|
542
|
-
}));
|
|
543
|
-
//#endregion
|
|
544
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
|
|
545
|
-
var require_compare_loose$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
546
|
-
const compare = require_compare$1();
|
|
547
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
548
|
-
module.exports = compareLoose;
|
|
549
|
-
}));
|
|
550
|
-
//#endregion
|
|
551
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
|
|
552
|
-
var require_compare_build$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
553
|
-
const SemVer = require_semver$2();
|
|
554
|
-
const compareBuild = (a, b, loose) => {
|
|
555
|
-
const versionA = new SemVer(a, loose);
|
|
556
|
-
const versionB = new SemVer(b, loose);
|
|
557
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
558
|
-
};
|
|
559
|
-
module.exports = compareBuild;
|
|
560
|
-
}));
|
|
561
|
-
//#endregion
|
|
562
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
|
|
563
|
-
var require_sort$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
564
|
-
const compareBuild = require_compare_build$1();
|
|
565
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
566
|
-
module.exports = sort;
|
|
567
|
-
}));
|
|
568
|
-
//#endregion
|
|
569
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
|
|
570
|
-
var require_rsort$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
571
|
-
const compareBuild = require_compare_build$1();
|
|
572
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
573
|
-
module.exports = rsort;
|
|
574
|
-
}));
|
|
575
|
-
//#endregion
|
|
576
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
|
|
577
|
-
var require_gt$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
578
|
-
const compare = require_compare$1();
|
|
579
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
580
|
-
module.exports = gt;
|
|
581
|
-
}));
|
|
582
|
-
//#endregion
|
|
583
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
|
|
584
|
-
var require_lt$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
585
|
-
const compare = require_compare$1();
|
|
586
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
587
|
-
module.exports = lt;
|
|
588
|
-
}));
|
|
589
|
-
//#endregion
|
|
590
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
|
|
591
|
-
var require_eq$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
592
|
-
const compare = require_compare$1();
|
|
593
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
594
|
-
module.exports = eq;
|
|
595
|
-
}));
|
|
596
|
-
//#endregion
|
|
597
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
|
|
598
|
-
var require_neq$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
599
|
-
const compare = require_compare$1();
|
|
600
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
601
|
-
module.exports = neq;
|
|
602
|
-
}));
|
|
603
|
-
//#endregion
|
|
604
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
|
|
605
|
-
var require_gte$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
606
|
-
const compare = require_compare$1();
|
|
607
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
608
|
-
module.exports = gte;
|
|
609
|
-
}));
|
|
610
|
-
//#endregion
|
|
611
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
|
|
612
|
-
var require_lte$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
613
|
-
const compare = require_compare$1();
|
|
614
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
615
|
-
module.exports = lte;
|
|
616
|
-
}));
|
|
617
|
-
//#endregion
|
|
618
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
|
|
619
|
-
var require_cmp$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
620
|
-
const eq = require_eq$1();
|
|
621
|
-
const neq = require_neq$1();
|
|
622
|
-
const gt = require_gt$1();
|
|
623
|
-
const gte = require_gte$1();
|
|
624
|
-
const lt = require_lt$1();
|
|
625
|
-
const lte = require_lte$1();
|
|
626
|
-
const cmp = (a, op, b, loose) => {
|
|
627
|
-
switch (op) {
|
|
628
|
-
case "===":
|
|
629
|
-
if (typeof a === "object") a = a.version;
|
|
630
|
-
if (typeof b === "object") b = b.version;
|
|
631
|
-
return a === b;
|
|
632
|
-
case "!==":
|
|
633
|
-
if (typeof a === "object") a = a.version;
|
|
634
|
-
if (typeof b === "object") b = b.version;
|
|
635
|
-
return a !== b;
|
|
636
|
-
case "":
|
|
637
|
-
case "=":
|
|
638
|
-
case "==": return eq(a, b, loose);
|
|
639
|
-
case "!=": return neq(a, b, loose);
|
|
640
|
-
case ">": return gt(a, b, loose);
|
|
641
|
-
case ">=": return gte(a, b, loose);
|
|
642
|
-
case "<": return lt(a, b, loose);
|
|
643
|
-
case "<=": return lte(a, b, loose);
|
|
644
|
-
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
module.exports = cmp;
|
|
648
|
-
}));
|
|
649
|
-
//#endregion
|
|
650
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
|
|
651
|
-
var require_coerce$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
652
|
-
const SemVer = require_semver$2();
|
|
653
|
-
const parse = require_parse$1();
|
|
654
|
-
const { safeRe: re, t } = require_re$1();
|
|
655
|
-
const coerce = (version, options) => {
|
|
656
|
-
if (version instanceof SemVer) return version;
|
|
657
|
-
if (typeof version === "number") version = String(version);
|
|
658
|
-
if (typeof version !== "string") return null;
|
|
659
|
-
options = options || {};
|
|
660
|
-
let match = null;
|
|
661
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
662
|
-
else {
|
|
663
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
664
|
-
let next;
|
|
665
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
666
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
667
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
668
|
-
}
|
|
669
|
-
coerceRtlRegex.lastIndex = -1;
|
|
670
|
-
}
|
|
671
|
-
if (match === null) return null;
|
|
672
|
-
const major = match[2];
|
|
673
|
-
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
674
|
-
};
|
|
675
|
-
module.exports = coerce;
|
|
676
|
-
}));
|
|
677
|
-
//#endregion
|
|
678
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
|
|
679
|
-
var require_truncate$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
680
|
-
const parse = require_parse$1();
|
|
681
|
-
const constants = require_constants$1();
|
|
682
|
-
const SemVer = require_semver$2();
|
|
683
|
-
const truncate = (version, truncation, options) => {
|
|
684
|
-
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
685
|
-
const clonedVersion = cloneInputVersion(version, options);
|
|
686
|
-
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
687
|
-
};
|
|
688
|
-
const cloneInputVersion = (version, options) => {
|
|
689
|
-
return parse(version instanceof SemVer ? version.version : version, options);
|
|
690
|
-
};
|
|
691
|
-
const doTruncation = (version, truncation) => {
|
|
692
|
-
if (isPrerelease(truncation)) return version.version;
|
|
693
|
-
version.prerelease = [];
|
|
694
|
-
switch (truncation) {
|
|
695
|
-
case "major":
|
|
696
|
-
version.minor = 0;
|
|
697
|
-
version.patch = 0;
|
|
698
|
-
break;
|
|
699
|
-
case "minor":
|
|
700
|
-
version.patch = 0;
|
|
701
|
-
break;
|
|
702
|
-
}
|
|
703
|
-
return version.format();
|
|
704
|
-
};
|
|
705
|
-
const isPrerelease = (type) => {
|
|
706
|
-
return type.startsWith("pre");
|
|
122
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
123
|
+
return source;
|
|
124
|
+
}
|
|
125
|
+
function safeRegex$1(source, flags) {
|
|
126
|
+
return new RegExp(makeSafeRegexSource$1(source), flags);
|
|
127
|
+
}
|
|
128
|
+
const NUMERIC$1$1 = /^\d+$/;
|
|
129
|
+
function compareIdentifiers$1(left, right) {
|
|
130
|
+
if (typeof left === "number" && typeof right === "number") return left === right ? 0 : left < right ? -1 : 1;
|
|
131
|
+
const leftNumeric = NUMERIC$1$1.test(String(left));
|
|
132
|
+
const rightNumeric = NUMERIC$1$1.test(String(right));
|
|
133
|
+
const normalizedLeft = leftNumeric ? Number(left) : left;
|
|
134
|
+
const normalizedRight = rightNumeric ? Number(right) : right;
|
|
135
|
+
return normalizedLeft === normalizedRight ? 0 : leftNumeric && !rightNumeric ? -1 : rightNumeric && !leftNumeric ? 1 : normalizedLeft < normalizedRight ? -1 : 1;
|
|
136
|
+
}
|
|
137
|
+
const FULL$1 = safeRegex$1(`^${FULL_PLAIN$1}$`);
|
|
138
|
+
const LOOSE$1 = safeRegex$1(`^${LOOSE_PLAIN$1}$`);
|
|
139
|
+
safeRegex$1(`^${PRERELEASE$1}$`);
|
|
140
|
+
safeRegex$1(`^${PRERELEASE_LOOSE$1}$`);
|
|
141
|
+
const COERCE_EXACT$1 = safeRegex$1(COERCE$1);
|
|
142
|
+
const COERCE_FULL_EXACT$1 = safeRegex$1(COERCE_FULL$1);
|
|
143
|
+
const NUMERIC$2 = /^\d+$/;
|
|
144
|
+
function formatComparableVersion$1(version) {
|
|
145
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
146
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
147
|
+
}
|
|
148
|
+
function formatFullVersion$1(version) {
|
|
149
|
+
const comparable = formatComparableVersion$1(version);
|
|
150
|
+
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
151
|
+
}
|
|
152
|
+
function parse$1(version, options = {}) {
|
|
153
|
+
if (typeof version !== "string") return version;
|
|
154
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
155
|
+
const match = version.trim().match(options.loose ? LOOSE$1 : FULL$1);
|
|
156
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
157
|
+
const major = Number(match[1]);
|
|
158
|
+
const minor = Number(match[2]);
|
|
159
|
+
const patch = Number(match[3]);
|
|
160
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
161
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
162
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
163
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
164
|
+
if (NUMERIC$2.test(identifier)) {
|
|
165
|
+
const numeric = Number(identifier);
|
|
166
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
167
|
+
}
|
|
168
|
+
return identifier;
|
|
169
|
+
}) : void 0;
|
|
170
|
+
return {
|
|
171
|
+
build: match[5]?.split("."),
|
|
172
|
+
major,
|
|
173
|
+
minor,
|
|
174
|
+
patch,
|
|
175
|
+
prerelease
|
|
707
176
|
};
|
|
708
|
-
|
|
709
|
-
})
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
177
|
+
}
|
|
178
|
+
function tryParse$1(version, options = {}) {
|
|
179
|
+
try {
|
|
180
|
+
return parse$1(version, options);
|
|
181
|
+
} catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function compareMainParsed$1(left, right) {
|
|
186
|
+
return left.major === right.major ? left.minor === right.minor ? left.patch === right.patch ? 0 : left.patch < right.patch ? -1 : 1 : left.minor < right.minor ? -1 : 1 : left.major < right.major ? -1 : 1;
|
|
187
|
+
}
|
|
188
|
+
function comparePrereleaseParsed$1(left, right) {
|
|
189
|
+
const leftPrerelease = left.prerelease;
|
|
190
|
+
const rightPrerelease = right.prerelease;
|
|
191
|
+
if (leftPrerelease?.length && !rightPrerelease?.length) return -1;
|
|
192
|
+
if (!leftPrerelease?.length && rightPrerelease?.length) return 1;
|
|
193
|
+
if (!leftPrerelease?.length && !rightPrerelease?.length) return 0;
|
|
194
|
+
for (let index = 0;; index++) {
|
|
195
|
+
const leftIdentifier = leftPrerelease?.[index];
|
|
196
|
+
const rightIdentifier = rightPrerelease?.[index];
|
|
197
|
+
if (leftIdentifier === void 0 && rightIdentifier === void 0) return 0;
|
|
198
|
+
if (rightIdentifier === void 0) return 1;
|
|
199
|
+
if (leftIdentifier === void 0) return -1;
|
|
200
|
+
if (leftIdentifier !== rightIdentifier) return compareIdentifiers$1(leftIdentifier, rightIdentifier);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function compareParsed$1(left, right) {
|
|
204
|
+
return compareMainParsed$1(left, right) || comparePrereleaseParsed$1(left, right);
|
|
205
|
+
}
|
|
206
|
+
function coerceParsedVersion$1(value, options = {}) {
|
|
207
|
+
if (typeof value === "object") return value;
|
|
208
|
+
const input = typeof value === "number" ? String(value) : value;
|
|
209
|
+
if (typeof input !== "string") return null;
|
|
210
|
+
let match = null;
|
|
211
|
+
if (options.rtl) {
|
|
212
|
+
const expression = safeRegex$1(options.includePrerelease ? COERCE_FULL$1 : COERCE$1, "g");
|
|
213
|
+
let next;
|
|
214
|
+
while ((next = expression.exec(input)) && (!match || match.index + match[0].length !== input.length)) {
|
|
215
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
216
|
+
expression.lastIndex = next.index + next[1].length + next[2].length;
|
|
217
|
+
}
|
|
218
|
+
} else match = (options.includePrerelease ? COERCE_FULL_EXACT$1 : COERCE_EXACT$1).exec(input);
|
|
219
|
+
if (!match) return null;
|
|
220
|
+
const major = match[2];
|
|
221
|
+
return tryParse$1(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
222
|
+
}
|
|
223
|
+
const STRICT_COMPARATOR$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*(${FULL_PLAIN$1})$|^$`);
|
|
224
|
+
const LOOSE_COMPARATOR$1$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*(${LOOSE_PLAIN$1})$|^$`);
|
|
225
|
+
function parseComparator$1(comparator, options = {}) {
|
|
226
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
227
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1$1 : STRICT_COMPARATOR$1);
|
|
228
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
229
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
230
|
+
const version = match[2] ? parse$1(match[2], options) : null;
|
|
231
|
+
return {
|
|
232
|
+
operator,
|
|
233
|
+
options,
|
|
234
|
+
value: version ? `${operator}${formatComparableVersion$1(version)}` : "",
|
|
235
|
+
version
|
|
740
236
|
};
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
version = new SemVer(version, this.options);
|
|
845
|
-
} catch (er) {
|
|
846
|
-
return false;
|
|
237
|
+
}
|
|
238
|
+
function testParsedComparator$1(comparator, version) {
|
|
239
|
+
if (!comparator.version) return true;
|
|
240
|
+
const comparison = compareParsed$1(version, comparator.version);
|
|
241
|
+
switch (comparator.operator) {
|
|
242
|
+
case "": return comparison === 0;
|
|
243
|
+
case ">": return comparison > 0;
|
|
244
|
+
case ">=": return comparison >= 0;
|
|
245
|
+
case "<": return comparison < 0;
|
|
246
|
+
case "<=": return comparison <= 0;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function comparatorAllowsPrerelease$1(comparator, version) {
|
|
250
|
+
const allowed = comparator.version;
|
|
251
|
+
return allowed !== null && !!allowed.prerelease?.length && allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch;
|
|
252
|
+
}
|
|
253
|
+
function testComparatorSet$1(set, version, options) {
|
|
254
|
+
if (set.some((comparator) => !testParsedComparator$1(comparator, version))) return false;
|
|
255
|
+
return !version.prerelease?.length || !!options.includePrerelease || set.some((comparator) => comparatorAllowsPrerelease$1(comparator, version));
|
|
256
|
+
}
|
|
257
|
+
function compare(left, right, options = {}) {
|
|
258
|
+
return compareParsed$1(parse$1(left, options), parse$1(right, options));
|
|
259
|
+
}
|
|
260
|
+
function isGreaterOrEqual(left, right, options = {}) {
|
|
261
|
+
return compare(left, right, options) >= 0;
|
|
262
|
+
}
|
|
263
|
+
const BUILD_STRIP$1 = new RegExp(BUILD$1, "g");
|
|
264
|
+
const BUILD_SAFE$1 = safeRegex$1(BUILD$1);
|
|
265
|
+
const STRICT_HYPHEN$1 = safeRegex$1(String.raw`^\s*(${XRANGE_PLAIN$1})\s+-\s+(${XRANGE_PLAIN$1})\s*$`);
|
|
266
|
+
const LOOSE_HYPHEN$1 = safeRegex$1(String.raw`^\s*(${XRANGE_PLAIN_LOOSE$1})\s+-\s+(${XRANGE_PLAIN_LOOSE$1})\s*$`);
|
|
267
|
+
const COMPARATOR_TRIM$1 = safeRegex$1(String.raw`(\s*)${GREATER_LESS_THAN$1}\s*(${LOOSE_PLAIN$1}|${XRANGE_PLAIN$1})`, "g");
|
|
268
|
+
const TILDE_TRIM$1 = safeRegex$1(String.raw`(\s*)${LONE_TILDE$1}\s+`, "g");
|
|
269
|
+
const CARET_TRIM$1 = safeRegex$1(String.raw`(\s*)${LONE_CARET$1}\s+`, "g");
|
|
270
|
+
const STRICT_TILDE$1 = safeRegex$1(`^${LONE_TILDE$1}${XRANGE_PLAIN$1}$`);
|
|
271
|
+
const LOOSE_TILDE$1 = safeRegex$1(`^${LONE_TILDE$1}${XRANGE_PLAIN_LOOSE$1}$`);
|
|
272
|
+
const STRICT_CARET$1 = safeRegex$1(`^${LONE_CARET$1}${XRANGE_PLAIN$1}$`);
|
|
273
|
+
const LOOSE_CARET$1 = safeRegex$1(`^${LONE_CARET$1}${XRANGE_PLAIN_LOOSE$1}$`);
|
|
274
|
+
const STRICT_XRANGE$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*${XRANGE_PLAIN$1}$`);
|
|
275
|
+
const LOOSE_XRANGE$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*${XRANGE_PLAIN_LOOSE$1}$`);
|
|
276
|
+
const STAR$1 = safeRegex$1(String.raw`(<|>)?=?\s*\*`);
|
|
277
|
+
const GTE_ZERO$1 = /^\s*>=\s*0\.0\.0\s*$/;
|
|
278
|
+
const GTE_ZERO_PRERELEASE$1 = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
279
|
+
const LOOSE_COMPARATOR$2 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*(${LOOSE_PLAIN$1})$|^$`);
|
|
280
|
+
function isWildcard$1(value) {
|
|
281
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
282
|
+
}
|
|
283
|
+
function hasInvalidWildcardOrder$1(major, minor, patch) {
|
|
284
|
+
return isWildcard$1(major) && !isWildcard$1(minor) || isWildcard$1(minor) && Boolean(patch) && !isWildcard$1(patch);
|
|
285
|
+
}
|
|
286
|
+
function replaceTilde$1(comparator, options) {
|
|
287
|
+
const expression = options.loose ? LOOSE_TILDE$1 : STRICT_TILDE$1;
|
|
288
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
289
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
290
|
+
if (isWildcard$1(major)) return "";
|
|
291
|
+
if (isWildcard$1(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
292
|
+
if (isWildcard$1(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
293
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function replaceTildes$1(comparator, options) {
|
|
297
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde$1(part, options)).join(" ");
|
|
298
|
+
}
|
|
299
|
+
function replaceCaret$1(comparator, options) {
|
|
300
|
+
const expression = options.loose ? LOOSE_CARET$1 : STRICT_CARET$1;
|
|
301
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
302
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
303
|
+
if (isWildcard$1(major)) return "";
|
|
304
|
+
if (isWildcard$1(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
305
|
+
if (isWildcard$1(patch)) return major === "0" ? `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
306
|
+
if (prerelease) return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch}-${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
307
|
+
return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function replaceCarets$1(comparator, options) {
|
|
311
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret$1(part, options)).join(" ");
|
|
312
|
+
}
|
|
313
|
+
function replaceXRange$1(comparator, options) {
|
|
314
|
+
const expression = options.loose ? LOOSE_XRANGE$1 : STRICT_XRANGE$1;
|
|
315
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
316
|
+
let operator = rawOperator;
|
|
317
|
+
let major = rawMajor;
|
|
318
|
+
let minor = rawMinor;
|
|
319
|
+
let patch = rawPatch;
|
|
320
|
+
if (hasInvalidWildcardOrder$1(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
321
|
+
const wildcardMajor = isWildcard$1(major);
|
|
322
|
+
const wildcardMinor = wildcardMajor || isWildcard$1(minor);
|
|
323
|
+
const wildcardPatch = wildcardMinor || isWildcard$1(patch);
|
|
324
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
325
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
326
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
327
|
+
if (operator && wildcardPatch) {
|
|
328
|
+
if (wildcardMinor) minor = 0;
|
|
329
|
+
patch = 0;
|
|
330
|
+
if (operator === ">") {
|
|
331
|
+
operator = ">=";
|
|
332
|
+
if (wildcardMinor) {
|
|
333
|
+
major = Number(major) + 1;
|
|
334
|
+
minor = 0;
|
|
335
|
+
} else minor = Number(minor) + 1;
|
|
336
|
+
} else if (operator === "<=") {
|
|
337
|
+
operator = "<";
|
|
338
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
339
|
+
else minor = Number(minor) + 1;
|
|
847
340
|
}
|
|
848
|
-
|
|
849
|
-
return
|
|
341
|
+
if (operator === "<") prerelease = "-0";
|
|
342
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
850
343
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
let
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
const parseComparator = (comp, options) => {
|
|
875
|
-
comp = comp.replace(re[t.BUILD], "");
|
|
876
|
-
debug("comp", comp, options);
|
|
877
|
-
comp = replaceCarets(comp, options);
|
|
878
|
-
debug("caret", comp);
|
|
879
|
-
comp = replaceTildes(comp, options);
|
|
880
|
-
debug("tildes", comp);
|
|
881
|
-
comp = replaceXRanges(comp, options);
|
|
882
|
-
debug("xrange", comp);
|
|
883
|
-
comp = replaceStars(comp, options);
|
|
884
|
-
debug("stars", comp);
|
|
885
|
-
return comp;
|
|
886
|
-
};
|
|
887
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
888
|
-
const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
889
|
-
const replaceTildes = (comp, options) => {
|
|
890
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
891
|
-
};
|
|
892
|
-
const replaceTilde = (comp, options) => {
|
|
893
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
894
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
895
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
896
|
-
let ret;
|
|
897
|
-
if (isX(M)) ret = "";
|
|
898
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
899
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
900
|
-
else if (pr) {
|
|
901
|
-
debug("replaceTilde pr", pr);
|
|
902
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
903
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
904
|
-
debug("tilde return", ret);
|
|
905
|
-
return ret;
|
|
906
|
-
});
|
|
907
|
-
};
|
|
908
|
-
const replaceCarets = (comp, options) => {
|
|
909
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
910
|
-
};
|
|
911
|
-
const replaceCaret = (comp, options) => {
|
|
912
|
-
debug("caret", comp, options);
|
|
913
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
914
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
915
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
916
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
917
|
-
let ret;
|
|
918
|
-
if (isX(M)) ret = "";
|
|
919
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
920
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
921
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
922
|
-
else if (pr) {
|
|
923
|
-
debug("replaceCaret pr", pr);
|
|
924
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
925
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
926
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
927
|
-
} else {
|
|
928
|
-
debug("no pr");
|
|
929
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
930
|
-
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
931
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
932
|
-
}
|
|
933
|
-
debug("caret return", ret);
|
|
934
|
-
return ret;
|
|
935
|
-
});
|
|
936
|
-
};
|
|
937
|
-
const replaceXRanges = (comp, options) => {
|
|
938
|
-
debug("replaceXRanges", comp, options);
|
|
939
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
940
|
-
};
|
|
941
|
-
const replaceXRange = (comp, options) => {
|
|
942
|
-
comp = comp.trim();
|
|
943
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
944
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
945
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
946
|
-
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
947
|
-
const xM = isX(M);
|
|
948
|
-
const xm = xM || isX(m);
|
|
949
|
-
const xp = xm || isX(p);
|
|
950
|
-
const anyX = xp;
|
|
951
|
-
if (gtlt === "=" && anyX) gtlt = "";
|
|
952
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
953
|
-
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
954
|
-
else ret = "*";
|
|
955
|
-
else if (gtlt && anyX) {
|
|
956
|
-
if (xm) m = 0;
|
|
957
|
-
p = 0;
|
|
958
|
-
if (gtlt === ">") {
|
|
959
|
-
gtlt = ">=";
|
|
960
|
-
if (xm) {
|
|
961
|
-
M = +M + 1;
|
|
962
|
-
m = 0;
|
|
963
|
-
p = 0;
|
|
964
|
-
} else {
|
|
965
|
-
m = +m + 1;
|
|
966
|
-
p = 0;
|
|
967
|
-
}
|
|
968
|
-
} else if (gtlt === "<=") {
|
|
969
|
-
gtlt = "<";
|
|
970
|
-
if (xm) M = +M + 1;
|
|
971
|
-
else m = +m + 1;
|
|
972
|
-
}
|
|
973
|
-
if (gtlt === "<") pr = "-0";
|
|
974
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
975
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
976
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
977
|
-
debug("xRange return", ret);
|
|
978
|
-
return ret;
|
|
979
|
-
});
|
|
980
|
-
};
|
|
981
|
-
const replaceStars = (comp, options) => {
|
|
982
|
-
debug("replaceStars", comp, options);
|
|
983
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
984
|
-
};
|
|
985
|
-
const replaceGTE0 = (comp, options) => {
|
|
986
|
-
debug("replaceGTE0", comp, options);
|
|
987
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
988
|
-
};
|
|
989
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
990
|
-
if (isX(fM)) from = "";
|
|
991
|
-
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
992
|
-
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
993
|
-
else if (fpr) from = `>=${from}`;
|
|
994
|
-
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
995
|
-
if (isX(tM)) to = "";
|
|
996
|
-
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
997
|
-
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
998
|
-
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
999
|
-
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
344
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
345
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
346
|
+
return match;
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function replaceXRanges$1(comparator, options) {
|
|
350
|
+
return comparator.split(/\s+/).map((part) => replaceXRange$1(part, options)).join(" ");
|
|
351
|
+
}
|
|
352
|
+
function replaceHyphenRange$1(range, options) {
|
|
353
|
+
const expression = options.loose ? LOOSE_HYPHEN$1 : STRICT_HYPHEN$1;
|
|
354
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
355
|
+
let from = rawFrom;
|
|
356
|
+
let to = rawTo;
|
|
357
|
+
if (isWildcard$1(fromMajor)) from = "";
|
|
358
|
+
else if (isWildcard$1(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
359
|
+
else if (isWildcard$1(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
360
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
361
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
362
|
+
if (isWildcard$1(toMajor)) to = "";
|
|
363
|
+
else if (isWildcard$1(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
364
|
+
else if (isWildcard$1(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
365
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
366
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
1000
367
|
else to = `<=${to}`;
|
|
1001
368
|
return `${from} ${to}`.trim();
|
|
1002
|
-
};
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
})
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
1032
|
-
debug("comparator", comp, options);
|
|
1033
|
-
this.options = options;
|
|
1034
|
-
this.loose = !!options.loose;
|
|
1035
|
-
this.parse(comp);
|
|
1036
|
-
if (this.semver === ANY) this.value = "";
|
|
1037
|
-
else this.value = this.operator + this.semver.version;
|
|
1038
|
-
debug("comp", this);
|
|
1039
|
-
}
|
|
1040
|
-
parse(comp) {
|
|
1041
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1042
|
-
const m = comp.match(r);
|
|
1043
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1044
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1045
|
-
if (this.operator === "=") this.operator = "";
|
|
1046
|
-
if (!m[2]) this.semver = ANY;
|
|
1047
|
-
else this.semver = new SemVer(m[2], this.options.loose);
|
|
1048
|
-
}
|
|
1049
|
-
toString() {
|
|
1050
|
-
return this.value;
|
|
1051
|
-
}
|
|
1052
|
-
test(version) {
|
|
1053
|
-
debug("Comparator.test", version, this.options.loose);
|
|
1054
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
1055
|
-
if (typeof version === "string") try {
|
|
1056
|
-
version = new SemVer(version, this.options);
|
|
1057
|
-
} catch (er) {
|
|
1058
|
-
return false;
|
|
1059
|
-
}
|
|
1060
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
1061
|
-
}
|
|
1062
|
-
intersects(comp, options) {
|
|
1063
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
1064
|
-
if (this.operator === "") {
|
|
1065
|
-
if (this.value === "") return true;
|
|
1066
|
-
return new Range(comp.value, options).test(this.value);
|
|
1067
|
-
} else if (comp.operator === "") {
|
|
1068
|
-
if (comp.value === "") return true;
|
|
1069
|
-
return new Range(this.value, options).test(comp.semver);
|
|
1070
|
-
}
|
|
1071
|
-
options = parseOptions(options);
|
|
1072
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1073
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1074
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1075
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1076
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1077
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1078
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1079
|
-
return false;
|
|
1080
|
-
}
|
|
1081
|
-
};
|
|
1082
|
-
const parseOptions = require_parse_options$1();
|
|
1083
|
-
const { safeRe: re, t } = require_re$1();
|
|
1084
|
-
const cmp = require_cmp$1();
|
|
1085
|
-
const debug = require_debug$1();
|
|
1086
|
-
const SemVer = require_semver$2();
|
|
1087
|
-
const Range = require_range$1();
|
|
1088
|
-
}));
|
|
1089
|
-
//#endregion
|
|
1090
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
|
|
1091
|
-
var require_satisfies$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1092
|
-
const Range = require_range$1();
|
|
1093
|
-
const satisfies = (version, range, options) => {
|
|
1094
|
-
try {
|
|
1095
|
-
range = new Range(range, options);
|
|
1096
|
-
} catch (er) {
|
|
1097
|
-
return false;
|
|
1098
|
-
}
|
|
1099
|
-
return range.test(version);
|
|
1100
|
-
};
|
|
1101
|
-
module.exports = satisfies;
|
|
1102
|
-
}));
|
|
1103
|
-
//#endregion
|
|
1104
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
|
|
1105
|
-
var require_to_comparators$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1106
|
-
const Range = require_range$1();
|
|
1107
|
-
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1108
|
-
module.exports = toComparators;
|
|
1109
|
-
}));
|
|
1110
|
-
//#endregion
|
|
1111
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
|
|
1112
|
-
var require_max_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1113
|
-
const SemVer = require_semver$2();
|
|
1114
|
-
const Range = require_range$1();
|
|
1115
|
-
const maxSatisfying = (versions, range, options) => {
|
|
1116
|
-
let max = null;
|
|
1117
|
-
let maxSV = null;
|
|
1118
|
-
let rangeObj = null;
|
|
1119
|
-
try {
|
|
1120
|
-
rangeObj = new Range(range, options);
|
|
1121
|
-
} catch (er) {
|
|
1122
|
-
return null;
|
|
1123
|
-
}
|
|
1124
|
-
versions.forEach((v) => {
|
|
1125
|
-
if (rangeObj.test(v)) {
|
|
1126
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
1127
|
-
max = v;
|
|
1128
|
-
maxSV = new SemVer(max, options);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
return max;
|
|
1133
|
-
};
|
|
1134
|
-
module.exports = maxSatisfying;
|
|
1135
|
-
}));
|
|
1136
|
-
//#endregion
|
|
1137
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
|
|
1138
|
-
var require_min_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1139
|
-
const SemVer = require_semver$2();
|
|
1140
|
-
const Range = require_range$1();
|
|
1141
|
-
const minSatisfying = (versions, range, options) => {
|
|
1142
|
-
let min = null;
|
|
1143
|
-
let minSV = null;
|
|
1144
|
-
let rangeObj = null;
|
|
1145
|
-
try {
|
|
1146
|
-
rangeObj = new Range(range, options);
|
|
1147
|
-
} catch (er) {
|
|
1148
|
-
return null;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function expandComparator$1(comparator, options) {
|
|
372
|
+
return replaceXRanges$1(replaceTildes$1(replaceCarets$1(comparator.replace(BUILD_SAFE$1, ""), options), options), options).trim().replace(STAR$1, "");
|
|
373
|
+
}
|
|
374
|
+
function parseSimpleRange$1(input, options) {
|
|
375
|
+
let parts = replaceHyphenRange$1(input.replace(BUILD_STRIP$1, ""), options).replace(COMPARATOR_TRIM$1, "$1$2$3").replace(TILDE_TRIM$1, "$1~").replace(CARET_TRIM$1, "$1^").split(" ").map((part) => expandComparator$1(part, options)).join(" ").split(/\s+/).map((part) => part.trim().replace(options.includePrerelease ? GTE_ZERO_PRERELEASE$1 : GTE_ZERO$1, ""));
|
|
376
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR$2.test(part));
|
|
377
|
+
const unique = /* @__PURE__ */ new Map();
|
|
378
|
+
for (const comparator of parts.map((part) => parseComparator$1(part, options))) {
|
|
379
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
380
|
+
unique.set(comparator.value, comparator);
|
|
381
|
+
}
|
|
382
|
+
if (unique.size > 1) unique.delete("");
|
|
383
|
+
return [...unique.values()];
|
|
384
|
+
}
|
|
385
|
+
function parseRange$1(range, options = {}) {
|
|
386
|
+
if (typeof range !== "string") return range;
|
|
387
|
+
const parsedOptions = { ...options };
|
|
388
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
389
|
+
let sets = raw.split("||").map((part) => parseSimpleRange$1(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
390
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
391
|
+
if (sets.length > 1) {
|
|
392
|
+
const first = sets[0];
|
|
393
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
394
|
+
if (!sets.length) sets = [first];
|
|
395
|
+
else if (sets.length > 1) {
|
|
396
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
397
|
+
if (any) sets = [any];
|
|
1149
398
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1157
|
-
});
|
|
1158
|
-
return min;
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
402
|
+
options: parsedOptions,
|
|
403
|
+
raw,
|
|
404
|
+
sets
|
|
1159
405
|
};
|
|
1160
|
-
|
|
1161
|
-
})
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
const SemVer = require_semver$2();
|
|
1166
|
-
const Range = require_range$1();
|
|
1167
|
-
const gt = require_gt$1();
|
|
1168
|
-
const minVersion = (range, loose) => {
|
|
1169
|
-
range = new Range(range, loose);
|
|
1170
|
-
let minver = new SemVer("0.0.0");
|
|
1171
|
-
if (range.test(minver)) return minver;
|
|
1172
|
-
minver = new SemVer("0.0.0-0");
|
|
1173
|
-
if (range.test(minver)) return minver;
|
|
1174
|
-
minver = null;
|
|
1175
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
1176
|
-
const comparators = range.set[i];
|
|
1177
|
-
let setMin = null;
|
|
1178
|
-
comparators.forEach((comparator) => {
|
|
1179
|
-
const compver = new SemVer(comparator.semver.version);
|
|
1180
|
-
switch (comparator.operator) {
|
|
1181
|
-
case ">":
|
|
1182
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
1183
|
-
else compver.prerelease.push(0);
|
|
1184
|
-
compver.raw = compver.format();
|
|
1185
|
-
case "":
|
|
1186
|
-
case ">=":
|
|
1187
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1188
|
-
break;
|
|
1189
|
-
case "<":
|
|
1190
|
-
case "<=": break;
|
|
1191
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1192
|
-
}
|
|
1193
|
-
});
|
|
1194
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1195
|
-
}
|
|
1196
|
-
if (minver && range.test(minver)) return minver;
|
|
406
|
+
}
|
|
407
|
+
function tryParseRange$1(range, options = {}) {
|
|
408
|
+
try {
|
|
409
|
+
return parseRange$1(range, options);
|
|
410
|
+
} catch {
|
|
1197
411
|
return null;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
const { ANY } = Comparator;
|
|
1220
|
-
const Range = require_range$1();
|
|
1221
|
-
const satisfies = require_satisfies$1();
|
|
1222
|
-
const gt = require_gt$1();
|
|
1223
|
-
const lt = require_lt$1();
|
|
1224
|
-
const lte = require_lte$1();
|
|
1225
|
-
const gte = require_gte$1();
|
|
1226
|
-
const outside = (version, range, hilo, options) => {
|
|
1227
|
-
version = new SemVer(version, options);
|
|
1228
|
-
range = new Range(range, options);
|
|
1229
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1230
|
-
switch (hilo) {
|
|
1231
|
-
case ">":
|
|
1232
|
-
gtfn = gt;
|
|
1233
|
-
ltefn = lte;
|
|
1234
|
-
ltfn = lt;
|
|
1235
|
-
comp = ">";
|
|
1236
|
-
ecomp = ">=";
|
|
1237
|
-
break;
|
|
1238
|
-
case "<":
|
|
1239
|
-
gtfn = lt;
|
|
1240
|
-
ltefn = gte;
|
|
1241
|
-
ltfn = gt;
|
|
1242
|
-
comp = "<";
|
|
1243
|
-
ecomp = "<=";
|
|
1244
|
-
break;
|
|
1245
|
-
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1246
|
-
}
|
|
1247
|
-
if (satisfies(version, range, options)) return false;
|
|
1248
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
1249
|
-
const comparators = range.set[i];
|
|
1250
|
-
let high = null;
|
|
1251
|
-
let low = null;
|
|
1252
|
-
comparators.forEach((comparator) => {
|
|
1253
|
-
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
1254
|
-
high = high || comparator;
|
|
1255
|
-
low = low || comparator;
|
|
1256
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1257
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1258
|
-
});
|
|
1259
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1260
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1261
|
-
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1262
|
-
}
|
|
1263
|
-
return true;
|
|
1264
|
-
};
|
|
1265
|
-
module.exports = outside;
|
|
1266
|
-
}));
|
|
1267
|
-
//#endregion
|
|
1268
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
|
|
1269
|
-
var require_gtr$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1270
|
-
const outside = require_outside$1();
|
|
1271
|
-
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1272
|
-
module.exports = gtr;
|
|
1273
|
-
}));
|
|
1274
|
-
//#endregion
|
|
1275
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
|
|
1276
|
-
var require_ltr$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1277
|
-
const outside = require_outside$1();
|
|
1278
|
-
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1279
|
-
module.exports = ltr;
|
|
1280
|
-
}));
|
|
1281
|
-
//#endregion
|
|
1282
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
|
|
1283
|
-
var require_intersects$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1284
|
-
const Range = require_range$1();
|
|
1285
|
-
const intersects = (r1, r2, options) => {
|
|
1286
|
-
r1 = new Range(r1, options);
|
|
1287
|
-
r2 = new Range(r2, options);
|
|
1288
|
-
return r1.intersects(r2, options);
|
|
1289
|
-
};
|
|
1290
|
-
module.exports = intersects;
|
|
1291
|
-
}));
|
|
1292
|
-
//#endregion
|
|
1293
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
|
|
1294
|
-
var require_simplify$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1295
|
-
const satisfies = require_satisfies$1();
|
|
1296
|
-
const compare = require_compare$1();
|
|
1297
|
-
module.exports = (versions, range, options) => {
|
|
1298
|
-
const set = [];
|
|
1299
|
-
let first = null;
|
|
1300
|
-
let prev = null;
|
|
1301
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1302
|
-
for (const version of v) if (satisfies(version, range, options)) {
|
|
1303
|
-
prev = version;
|
|
1304
|
-
if (!first) first = version;
|
|
1305
|
-
} else {
|
|
1306
|
-
if (prev) set.push([first, prev]);
|
|
1307
|
-
prev = null;
|
|
1308
|
-
first = null;
|
|
1309
|
-
}
|
|
1310
|
-
if (first) set.push([first, null]);
|
|
1311
|
-
const ranges = [];
|
|
1312
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
1313
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
1314
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
1315
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
1316
|
-
else ranges.push(`${min} - ${max}`);
|
|
1317
|
-
const simplified = ranges.join(" || ");
|
|
1318
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1319
|
-
return simplified.length < original.length ? simplified : range;
|
|
1320
|
-
};
|
|
1321
|
-
}));
|
|
1322
|
-
//#endregion
|
|
1323
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
|
|
1324
|
-
var require_subset$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1325
|
-
const Range = require_range$1();
|
|
1326
|
-
const Comparator = require_comparator$1();
|
|
1327
|
-
const { ANY } = Comparator;
|
|
1328
|
-
const satisfies = require_satisfies$1();
|
|
1329
|
-
const compare = require_compare$1();
|
|
1330
|
-
const subset = (sub, dom, options = {}) => {
|
|
1331
|
-
if (sub === dom) return true;
|
|
1332
|
-
sub = new Range(sub, options);
|
|
1333
|
-
dom = new Range(dom, options);
|
|
1334
|
-
let sawNonNull = false;
|
|
1335
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
1336
|
-
for (const simpleDom of dom.set) {
|
|
1337
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1338
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
1339
|
-
if (isSub) continue OUTER;
|
|
1340
|
-
}
|
|
1341
|
-
if (sawNonNull) return false;
|
|
1342
|
-
}
|
|
1343
|
-
return true;
|
|
1344
|
-
};
|
|
1345
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1346
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1347
|
-
const simpleSubset = (sub, dom, options) => {
|
|
1348
|
-
if (sub === dom) return true;
|
|
1349
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
1350
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
1351
|
-
else sub = minimumVersion;
|
|
1352
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1353
|
-
else dom = minimumVersion;
|
|
1354
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
1355
|
-
let gt, lt;
|
|
1356
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
1357
|
-
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
1358
|
-
else eqSet.add(c.semver);
|
|
1359
|
-
if (eqSet.size > 1) return null;
|
|
1360
|
-
let gtltComp;
|
|
1361
|
-
if (gt && lt) {
|
|
1362
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1363
|
-
if (gtltComp > 0) return null;
|
|
1364
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
1365
|
-
}
|
|
1366
|
-
for (const eq of eqSet) {
|
|
1367
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1368
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1369
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
1370
|
-
return true;
|
|
1371
|
-
}
|
|
1372
|
-
let higher, lower;
|
|
1373
|
-
let hasDomLT, hasDomGT;
|
|
1374
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1375
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1376
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1377
|
-
for (const c of dom) {
|
|
1378
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1379
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1380
|
-
if (gt) {
|
|
1381
|
-
if (needDomGTPre) {
|
|
1382
|
-
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;
|
|
1383
|
-
}
|
|
1384
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
1385
|
-
higher = higherGT(gt, c, options);
|
|
1386
|
-
if (higher === c && higher !== gt) return false;
|
|
1387
|
-
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
1388
|
-
}
|
|
1389
|
-
if (lt) {
|
|
1390
|
-
if (needDomLTPre) {
|
|
1391
|
-
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;
|
|
1392
|
-
}
|
|
1393
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
1394
|
-
lower = lowerLT(lt, c, options);
|
|
1395
|
-
if (lower === c && lower !== lt) return false;
|
|
1396
|
-
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
1397
|
-
}
|
|
1398
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1399
|
-
}
|
|
1400
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
1401
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
1402
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
1403
|
-
return true;
|
|
1404
|
-
};
|
|
1405
|
-
const higherGT = (a, b, options) => {
|
|
1406
|
-
if (!a) return b;
|
|
1407
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1408
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1409
|
-
};
|
|
1410
|
-
const lowerLT = (a, b, options) => {
|
|
1411
|
-
if (!a) return b;
|
|
1412
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1413
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1414
|
-
};
|
|
1415
|
-
module.exports = subset;
|
|
1416
|
-
}));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
function testParsedRange$1(range, version) {
|
|
415
|
+
return range.sets.some((set) => testComparatorSet$1(set, version, range.options));
|
|
416
|
+
}
|
|
417
|
+
function testRangeVersion$1(range, version) {
|
|
418
|
+
const parsed = tryParse$1(version, range.options);
|
|
419
|
+
return parsed ? testParsedRange$1(range, parsed) : false;
|
|
420
|
+
}
|
|
421
|
+
function satisfies$1(version, range, options = {}) {
|
|
422
|
+
const parsed = tryParseRange$1(range, options);
|
|
423
|
+
return parsed ? testRangeVersion$1(parsed, version) : false;
|
|
424
|
+
}
|
|
425
|
+
function normalize(version, options = {}) {
|
|
426
|
+
const parsed = tryParse$1(version, options);
|
|
427
|
+
return parsed ? formatComparableVersion$1(parsed) : null;
|
|
428
|
+
}
|
|
429
|
+
function coerce$1(value, options = {}) {
|
|
430
|
+
const parsed = coerceParsedVersion$1(value, options);
|
|
431
|
+
return parsed ? formatFullVersion$1(parsed) : null;
|
|
432
|
+
}
|
|
1417
433
|
//#endregion
|
|
1418
434
|
//#region ../../packages/server/dist/handler.mjs
|
|
1419
|
-
var import_semver$1 = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1420
|
-
const internalRe = require_re$1();
|
|
1421
|
-
const constants = require_constants$1();
|
|
1422
|
-
const SemVer = require_semver$2();
|
|
1423
|
-
const identifiers = require_identifiers$1();
|
|
1424
|
-
module.exports = {
|
|
1425
|
-
parse: require_parse$1(),
|
|
1426
|
-
valid: require_valid$3(),
|
|
1427
|
-
clean: require_clean$1(),
|
|
1428
|
-
inc: require_inc$1(),
|
|
1429
|
-
diff: require_diff$1(),
|
|
1430
|
-
major: require_major$1(),
|
|
1431
|
-
minor: require_minor$1(),
|
|
1432
|
-
patch: require_patch$1(),
|
|
1433
|
-
prerelease: require_prerelease$1(),
|
|
1434
|
-
compare: require_compare$1(),
|
|
1435
|
-
rcompare: require_rcompare$1(),
|
|
1436
|
-
compareLoose: require_compare_loose$1(),
|
|
1437
|
-
compareBuild: require_compare_build$1(),
|
|
1438
|
-
sort: require_sort$1(),
|
|
1439
|
-
rsort: require_rsort$1(),
|
|
1440
|
-
gt: require_gt$1(),
|
|
1441
|
-
lt: require_lt$1(),
|
|
1442
|
-
eq: require_eq$1(),
|
|
1443
|
-
neq: require_neq$1(),
|
|
1444
|
-
gte: require_gte$1(),
|
|
1445
|
-
lte: require_lte$1(),
|
|
1446
|
-
cmp: require_cmp$1(),
|
|
1447
|
-
coerce: require_coerce$1(),
|
|
1448
|
-
truncate: require_truncate$1(),
|
|
1449
|
-
Comparator: require_comparator$1(),
|
|
1450
|
-
Range: require_range$1(),
|
|
1451
|
-
satisfies: require_satisfies$1(),
|
|
1452
|
-
toComparators: require_to_comparators$1(),
|
|
1453
|
-
maxSatisfying: require_max_satisfying$1(),
|
|
1454
|
-
minSatisfying: require_min_satisfying$1(),
|
|
1455
|
-
minVersion: require_min_version$1(),
|
|
1456
|
-
validRange: require_valid$2(),
|
|
1457
|
-
outside: require_outside$1(),
|
|
1458
|
-
gtr: require_gtr$1(),
|
|
1459
|
-
ltr: require_ltr$1(),
|
|
1460
|
-
intersects: require_intersects$1(),
|
|
1461
|
-
simplifyRange: require_simplify$1(),
|
|
1462
|
-
subset: require_subset$1(),
|
|
1463
|
-
SemVer,
|
|
1464
|
-
re: internalRe.re,
|
|
1465
|
-
src: internalRe.src,
|
|
1466
|
-
tokens: internalRe.t,
|
|
1467
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1468
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1469
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1470
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1471
|
-
};
|
|
1472
|
-
})))(), 1);
|
|
1473
435
|
var HandlerBadRequestError = class extends Error {
|
|
1474
436
|
constructor(message) {
|
|
1475
437
|
super(message);
|
|
@@ -1483,8 +445,8 @@ const MAX_BUNDLE_LIST_LIMIT = 100;
|
|
|
1483
445
|
const supportsExplicitNoUpdateResponse = (request) => {
|
|
1484
446
|
const sdkVersion = request.headers.get(SDK_VERSION_HEADER)?.trim();
|
|
1485
447
|
if (!sdkVersion) return false;
|
|
1486
|
-
const normalizedSdkVersion =
|
|
1487
|
-
return normalizedSdkVersion !== null &&
|
|
448
|
+
const normalizedSdkVersion = normalize(sdkVersion);
|
|
449
|
+
return normalizedSdkVersion !== null && isGreaterOrEqual(normalizedSdkVersion, EXPLICIT_NO_UPDATE_MIN_SDK_VERSION);
|
|
1488
450
|
};
|
|
1489
451
|
const serializeUpdateInfo = (updateInfo, request) => {
|
|
1490
452
|
if (updateInfo) return JSON.stringify(updateInfo);
|
|
@@ -3378,6 +2340,8 @@ const getContentAddressedAssetStoragePath = ({ assetPath, fileHash }) => {
|
|
|
3378
2340
|
const getLegacyManifestAssetStoragePath = ({ assetPath }) => assetPath;
|
|
3379
2341
|
//#endregion
|
|
3380
2342
|
//#region ../plugin-core/dist/assetStorageLayout.mjs
|
|
2343
|
+
const isBrotliManifestAssetPath = (assetPath) => /(^|\/)index\.[^/]+\.bundle$/.test(assetPath.replace(/\\/g, "/"));
|
|
2344
|
+
const getManifestAssetDownloadPath = (assetPath) => isBrotliManifestAssetPath(assetPath) ? `${assetPath}.br` : assetPath;
|
|
3381
2345
|
const createStorageUriWithRelativePath = ({ baseStorageUri, relativePath }) => {
|
|
3382
2346
|
const storageUrl = new URL(baseStorageUri);
|
|
3383
2347
|
storageUrl.pathname = `${storageUrl.pathname.replace(/\/+$/, "")}/${relativePath.replace(/\\/g, "/").split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
@@ -4087,1422 +3051,442 @@ function createDatabasePlugin(options) {
|
|
|
4087
3051
|
return directGetUpdateInfo(args, context);
|
|
4088
3052
|
};
|
|
4089
3053
|
Object.defineProperty(plugin, "getUpdateInfo", {
|
|
4090
|
-
configurable: true,
|
|
4091
|
-
enumerable: true,
|
|
4092
|
-
value: wrappedGetUpdateInfo
|
|
4093
|
-
});
|
|
4094
|
-
return wrappedGetUpdateInfo;
|
|
4095
|
-
}
|
|
4096
|
-
});
|
|
4097
|
-
return plugin;
|
|
4098
|
-
};
|
|
4099
|
-
};
|
|
4100
|
-
}
|
|
4101
|
-
//#endregion
|
|
4102
|
-
//#region ../plugin-core/dist/semverSatisfies.mjs
|
|
4103
|
-
const semverSatisfies$1 = (targetAppVersion, currentVersion) => {
|
|
4104
|
-
const currentCoerce = import_semver$1.default.coerce(currentVersion);
|
|
4105
|
-
if (!currentCoerce) return false;
|
|
4106
|
-
return import_semver$1.default.satisfies(currentCoerce.version, targetAppVersion);
|
|
4107
|
-
};
|
|
4108
|
-
//#endregion
|
|
4109
|
-
//#region ../plugin-core/dist/filterCompatibleAppVersions.mjs
|
|
4110
|
-
/**
|
|
4111
|
-
* Filters target app versions that are compatible with the current app version.
|
|
4112
|
-
* Returns only versions that are compatible with the current version according to semver rules.
|
|
4113
|
-
*
|
|
4114
|
-
* @param targetAppVersionList - List of target app versions to filter
|
|
4115
|
-
* @param currentVersion - Current app version
|
|
4116
|
-
* @returns Array of target app versions compatible with the current version
|
|
4117
|
-
*/
|
|
4118
|
-
const filterCompatibleAppVersions = (targetAppVersionList, currentVersion) => {
|
|
4119
|
-
return targetAppVersionList.filter((version) => semverSatisfies$1(version, currentVersion)).sort((a, b) => b.localeCompare(a));
|
|
4120
|
-
};
|
|
4121
|
-
//#endregion
|
|
4122
|
-
//#region ../plugin-core/dist/paginateBundles.mjs
|
|
4123
|
-
function paginateBundles({ bundles, limit, offset, cursor, orderBy }) {
|
|
4124
|
-
const sortedBundles = sortBundles$1(bundles, orderBy);
|
|
4125
|
-
const direction = orderBy?.direction ?? "desc";
|
|
4126
|
-
const total = sortedBundles.length;
|
|
4127
|
-
if (offset !== void 0) {
|
|
4128
|
-
const normalizedOffset = Math.max(0, offset);
|
|
4129
|
-
const data = limit > 0 ? sortedBundles.slice(normalizedOffset, normalizedOffset + limit) : sortedBundles.slice(normalizedOffset);
|
|
4130
|
-
const pagination = calculatePagination(total, {
|
|
4131
|
-
limit,
|
|
4132
|
-
offset: normalizedOffset
|
|
4133
|
-
});
|
|
4134
|
-
const nextCursor = data.length > 0 && normalizedOffset + data.length < total ? data.at(-1)?.id : void 0;
|
|
4135
|
-
const previousCursor = data.length > 0 && normalizedOffset > 0 ? data[0]?.id : void 0;
|
|
4136
|
-
return {
|
|
4137
|
-
data,
|
|
4138
|
-
pagination: {
|
|
4139
|
-
...pagination,
|
|
4140
|
-
...nextCursor ? { nextCursor } : {},
|
|
4141
|
-
...previousCursor ? { previousCursor } : {}
|
|
4142
|
-
}
|
|
4143
|
-
};
|
|
4144
|
-
}
|
|
4145
|
-
let data;
|
|
4146
|
-
if (cursor?.after) {
|
|
4147
|
-
const candidates = sortedBundles.filter((bundle) => direction === "desc" ? bundle.id.localeCompare(cursor.after) < 0 : bundle.id.localeCompare(cursor.after) > 0);
|
|
4148
|
-
data = limit > 0 ? candidates.slice(0, limit) : candidates;
|
|
4149
|
-
} else if (cursor?.before) {
|
|
4150
|
-
const candidates = sortedBundles.filter((bundle) => direction === "desc" ? bundle.id.localeCompare(cursor.before) > 0 : bundle.id.localeCompare(cursor.before) < 0);
|
|
4151
|
-
data = limit > 0 ? candidates.slice(Math.max(0, candidates.length - limit)) : candidates;
|
|
4152
|
-
} else data = limit > 0 ? sortedBundles.slice(0, limit) : sortedBundles;
|
|
4153
|
-
const startIndex = data.length > 0 ? sortedBundles.findIndex((bundle) => bundle.id === data[0].id) : cursor?.after ? total : 0;
|
|
4154
|
-
const pagination = calculatePagination(total, {
|
|
4155
|
-
limit,
|
|
4156
|
-
offset: startIndex
|
|
4157
|
-
});
|
|
4158
|
-
const nextCursor = data.length > 0 && startIndex + data.length < total ? data.at(-1)?.id : void 0;
|
|
4159
|
-
const previousCursor = data.length > 0 && startIndex > 0 ? data[0]?.id : void 0;
|
|
4160
|
-
return {
|
|
4161
|
-
data,
|
|
4162
|
-
pagination: {
|
|
4163
|
-
...pagination,
|
|
4164
|
-
...nextCursor ? { nextCursor } : {},
|
|
4165
|
-
...previousCursor ? { previousCursor } : {},
|
|
4166
|
-
...data.length === 0 && cursor?.after ? { previousCursor: cursor.after } : {},
|
|
4167
|
-
...data.length === 0 && cursor?.before ? { nextCursor: cursor.before } : {}
|
|
4168
|
-
}
|
|
4169
|
-
};
|
|
4170
|
-
}
|
|
4171
|
-
//#endregion
|
|
4172
|
-
//#region ../plugin-core/dist/requestUpdateBundleState.mjs
|
|
4173
|
-
const toBundleSeeds = (seeds) => seeds.filter((seed) => !!seed);
|
|
4174
|
-
const seedRequestUpdateBundles = (context, seeds) => {
|
|
4175
|
-
const unitOfWork = getRequestBundleUnitOfWork(context);
|
|
4176
|
-
if (!unitOfWork) return;
|
|
4177
|
-
const nextSeeds = toBundleSeeds(seeds);
|
|
4178
|
-
if (nextSeeds.length === 0) return;
|
|
4179
|
-
unitOfWork.seed(nextSeeds);
|
|
4180
|
-
};
|
|
4181
|
-
const createRequestUpdateBundleResolver = (context) => {
|
|
4182
|
-
const unitOfWork = getRequestBundleUnitOfWork(context) ?? new BundleUnitOfWork();
|
|
4183
|
-
return {
|
|
4184
|
-
hasSeededBundles: () => unitOfWork.hasSeeds(),
|
|
4185
|
-
peek: (bundleId) => unitOfWork.peek(bundleId),
|
|
4186
|
-
getById: (bundleId, loadBundleById) => unitOfWork.getById(bundleId, loadBundleById)
|
|
4187
|
-
};
|
|
4188
|
-
};
|
|
4189
|
-
//#endregion
|
|
4190
|
-
//#region ../js/dist/index.mjs
|
|
4191
|
-
var __create = Object.create;
|
|
4192
|
-
var __defProp = Object.defineProperty;
|
|
4193
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4194
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4195
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4196
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4197
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
4198
|
-
var __copyProps = (to, from, except, desc) => {
|
|
4199
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
4200
|
-
key = keys[i];
|
|
4201
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
4202
|
-
get: ((k) => from[k]).bind(null, key),
|
|
4203
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
4204
|
-
});
|
|
4205
|
-
}
|
|
4206
|
-
return to;
|
|
4207
|
-
};
|
|
4208
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
4209
|
-
value: mod,
|
|
4210
|
-
enumerable: true
|
|
4211
|
-
}) : target, mod));
|
|
4212
|
-
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4213
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
4214
|
-
const MAX_LENGTH = 256;
|
|
4215
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
4216
|
-
module.exports = {
|
|
4217
|
-
MAX_LENGTH,
|
|
4218
|
-
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
4219
|
-
MAX_SAFE_BUILD_LENGTH: MAX_LENGTH - 6,
|
|
4220
|
-
MAX_SAFE_INTEGER,
|
|
4221
|
-
RELEASE_TYPES: [
|
|
4222
|
-
"major",
|
|
4223
|
-
"premajor",
|
|
4224
|
-
"minor",
|
|
4225
|
-
"preminor",
|
|
4226
|
-
"patch",
|
|
4227
|
-
"prepatch",
|
|
4228
|
-
"prerelease"
|
|
4229
|
-
],
|
|
4230
|
-
SEMVER_SPEC_VERSION,
|
|
4231
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
4232
|
-
FLAG_LOOSE: 2
|
|
4233
|
-
};
|
|
4234
|
-
}));
|
|
4235
|
-
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4236
|
-
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
4237
|
-
}));
|
|
4238
|
-
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4239
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
4240
|
-
const debug = require_debug();
|
|
4241
|
-
exports = module.exports = {};
|
|
4242
|
-
const re = exports.re = [];
|
|
4243
|
-
const safeRe = exports.safeRe = [];
|
|
4244
|
-
const src = exports.src = [];
|
|
4245
|
-
const safeSrc = exports.safeSrc = [];
|
|
4246
|
-
const t = exports.t = {};
|
|
4247
|
-
let R = 0;
|
|
4248
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
4249
|
-
const safeRegexReplacements = [
|
|
4250
|
-
["\\s", 1],
|
|
4251
|
-
["\\d", MAX_LENGTH],
|
|
4252
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
4253
|
-
];
|
|
4254
|
-
const makeSafeRegex = (value) => {
|
|
4255
|
-
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
4256
|
-
return value;
|
|
4257
|
-
};
|
|
4258
|
-
const createToken = (name, value, isGlobal) => {
|
|
4259
|
-
const safe = makeSafeRegex(value);
|
|
4260
|
-
const index = R++;
|
|
4261
|
-
debug(name, index, value);
|
|
4262
|
-
t[name] = index;
|
|
4263
|
-
src[index] = value;
|
|
4264
|
-
safeSrc[index] = safe;
|
|
4265
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
4266
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
4267
|
-
};
|
|
4268
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
4269
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
4270
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
4271
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
4272
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
4273
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
4274
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
4275
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
4276
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
4277
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
4278
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
4279
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
4280
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
4281
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
4282
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
4283
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
4284
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
4285
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
4286
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
4287
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
4288
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
4289
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
4290
|
-
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
4291
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
4292
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
4293
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
4294
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
4295
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
4296
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
4297
|
-
exports.tildeTrimReplace = "$1~";
|
|
4298
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
4299
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
4300
|
-
createToken("LONECARET", "(?:\\^)");
|
|
4301
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
4302
|
-
exports.caretTrimReplace = "$1^";
|
|
4303
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
4304
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
4305
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
4306
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
4307
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
4308
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
4309
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
4310
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
4311
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
4312
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
4313
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
4314
|
-
}));
|
|
4315
|
-
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4316
|
-
const looseOption = Object.freeze({ loose: true });
|
|
4317
|
-
const emptyOpts = Object.freeze({});
|
|
4318
|
-
const parseOptions = (options) => {
|
|
4319
|
-
if (!options) return emptyOpts;
|
|
4320
|
-
if (typeof options !== "object") return looseOption;
|
|
4321
|
-
return options;
|
|
4322
|
-
};
|
|
4323
|
-
module.exports = parseOptions;
|
|
4324
|
-
}));
|
|
4325
|
-
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4326
|
-
const numeric = /^[0-9]+$/;
|
|
4327
|
-
const compareIdentifiers = (a, b) => {
|
|
4328
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
4329
|
-
const anum = numeric.test(a);
|
|
4330
|
-
const bnum = numeric.test(b);
|
|
4331
|
-
if (anum && bnum) {
|
|
4332
|
-
a = +a;
|
|
4333
|
-
b = +b;
|
|
4334
|
-
}
|
|
4335
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
4336
|
-
};
|
|
4337
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
4338
|
-
module.exports = {
|
|
4339
|
-
compareIdentifiers,
|
|
4340
|
-
rcompareIdentifiers
|
|
4341
|
-
};
|
|
4342
|
-
}));
|
|
4343
|
-
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4344
|
-
const debug = require_debug();
|
|
4345
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
4346
|
-
const { safeRe: re, t } = require_re();
|
|
4347
|
-
const parseOptions = require_parse_options();
|
|
4348
|
-
const { compareIdentifiers } = require_identifiers();
|
|
4349
|
-
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
4350
|
-
const identifiers = identifier.split(".");
|
|
4351
|
-
if (identifiers.length > prerelease.length) return false;
|
|
4352
|
-
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
4353
|
-
return true;
|
|
4354
|
-
};
|
|
4355
|
-
module.exports = class SemVer {
|
|
4356
|
-
constructor(version, options) {
|
|
4357
|
-
options = parseOptions(options);
|
|
4358
|
-
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
4359
|
-
else version = version.version;
|
|
4360
|
-
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
4361
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
4362
|
-
debug("SemVer", version, options);
|
|
4363
|
-
this.options = options;
|
|
4364
|
-
this.loose = !!options.loose;
|
|
4365
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
4366
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
4367
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
4368
|
-
this.raw = version;
|
|
4369
|
-
this.major = +m[1];
|
|
4370
|
-
this.minor = +m[2];
|
|
4371
|
-
this.patch = +m[3];
|
|
4372
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
4373
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
4374
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
4375
|
-
if (!m[4]) this.prerelease = [];
|
|
4376
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
4377
|
-
if (/^[0-9]+$/.test(id)) {
|
|
4378
|
-
const num = +id;
|
|
4379
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
4380
|
-
}
|
|
4381
|
-
return id;
|
|
4382
|
-
});
|
|
4383
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
4384
|
-
this.format();
|
|
4385
|
-
}
|
|
4386
|
-
format() {
|
|
4387
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
4388
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
4389
|
-
return this.version;
|
|
4390
|
-
}
|
|
4391
|
-
toString() {
|
|
4392
|
-
return this.version;
|
|
4393
|
-
}
|
|
4394
|
-
compare(other) {
|
|
4395
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
4396
|
-
if (!(other instanceof SemVer)) {
|
|
4397
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
4398
|
-
other = new SemVer(other, this.options);
|
|
4399
|
-
}
|
|
4400
|
-
if (other.version === this.version) return 0;
|
|
4401
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
4402
|
-
}
|
|
4403
|
-
compareMain(other) {
|
|
4404
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
4405
|
-
if (this.major < other.major) return -1;
|
|
4406
|
-
if (this.major > other.major) return 1;
|
|
4407
|
-
if (this.minor < other.minor) return -1;
|
|
4408
|
-
if (this.minor > other.minor) return 1;
|
|
4409
|
-
if (this.patch < other.patch) return -1;
|
|
4410
|
-
if (this.patch > other.patch) return 1;
|
|
4411
|
-
return 0;
|
|
4412
|
-
}
|
|
4413
|
-
comparePre(other) {
|
|
4414
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
4415
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
4416
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
4417
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
4418
|
-
let i = 0;
|
|
4419
|
-
do {
|
|
4420
|
-
const a = this.prerelease[i];
|
|
4421
|
-
const b = other.prerelease[i];
|
|
4422
|
-
debug("prerelease compare", i, a, b);
|
|
4423
|
-
if (a === void 0 && b === void 0) return 0;
|
|
4424
|
-
else if (b === void 0) return 1;
|
|
4425
|
-
else if (a === void 0) return -1;
|
|
4426
|
-
else if (a === b) continue;
|
|
4427
|
-
else return compareIdentifiers(a, b);
|
|
4428
|
-
} while (++i);
|
|
4429
|
-
}
|
|
4430
|
-
compareBuild(other) {
|
|
4431
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
4432
|
-
let i = 0;
|
|
4433
|
-
do {
|
|
4434
|
-
const a = this.build[i];
|
|
4435
|
-
const b = other.build[i];
|
|
4436
|
-
debug("build compare", i, a, b);
|
|
4437
|
-
if (a === void 0 && b === void 0) return 0;
|
|
4438
|
-
else if (b === void 0) return 1;
|
|
4439
|
-
else if (a === void 0) return -1;
|
|
4440
|
-
else if (a === b) continue;
|
|
4441
|
-
else return compareIdentifiers(a, b);
|
|
4442
|
-
} while (++i);
|
|
4443
|
-
}
|
|
4444
|
-
inc(release, identifier, identifierBase) {
|
|
4445
|
-
if (release.startsWith("pre")) {
|
|
4446
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
4447
|
-
if (identifier) {
|
|
4448
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
4449
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
4450
|
-
}
|
|
4451
|
-
}
|
|
4452
|
-
switch (release) {
|
|
4453
|
-
case "premajor":
|
|
4454
|
-
this.prerelease.length = 0;
|
|
4455
|
-
this.patch = 0;
|
|
4456
|
-
this.minor = 0;
|
|
4457
|
-
this.major++;
|
|
4458
|
-
this.inc("pre", identifier, identifierBase);
|
|
4459
|
-
break;
|
|
4460
|
-
case "preminor":
|
|
4461
|
-
this.prerelease.length = 0;
|
|
4462
|
-
this.patch = 0;
|
|
4463
|
-
this.minor++;
|
|
4464
|
-
this.inc("pre", identifier, identifierBase);
|
|
4465
|
-
break;
|
|
4466
|
-
case "prepatch":
|
|
4467
|
-
this.prerelease.length = 0;
|
|
4468
|
-
this.inc("patch", identifier, identifierBase);
|
|
4469
|
-
this.inc("pre", identifier, identifierBase);
|
|
4470
|
-
break;
|
|
4471
|
-
case "prerelease":
|
|
4472
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
4473
|
-
this.inc("pre", identifier, identifierBase);
|
|
4474
|
-
break;
|
|
4475
|
-
case "release":
|
|
4476
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
4477
|
-
this.prerelease.length = 0;
|
|
4478
|
-
break;
|
|
4479
|
-
case "major":
|
|
4480
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
4481
|
-
this.minor = 0;
|
|
4482
|
-
this.patch = 0;
|
|
4483
|
-
this.prerelease = [];
|
|
4484
|
-
break;
|
|
4485
|
-
case "minor":
|
|
4486
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
4487
|
-
this.patch = 0;
|
|
4488
|
-
this.prerelease = [];
|
|
4489
|
-
break;
|
|
4490
|
-
case "patch":
|
|
4491
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
4492
|
-
this.prerelease = [];
|
|
4493
|
-
break;
|
|
4494
|
-
case "pre": {
|
|
4495
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
4496
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
4497
|
-
else {
|
|
4498
|
-
let i = this.prerelease.length;
|
|
4499
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
4500
|
-
this.prerelease[i]++;
|
|
4501
|
-
i = -2;
|
|
4502
|
-
}
|
|
4503
|
-
if (i === -1) {
|
|
4504
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
4505
|
-
this.prerelease.push(base);
|
|
4506
|
-
}
|
|
4507
|
-
}
|
|
4508
|
-
if (identifier) {
|
|
4509
|
-
let prerelease = [identifier, base];
|
|
4510
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
4511
|
-
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
4512
|
-
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
4513
|
-
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
4514
|
-
} else this.prerelease = prerelease;
|
|
4515
|
-
}
|
|
4516
|
-
break;
|
|
4517
|
-
}
|
|
4518
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
4519
|
-
}
|
|
4520
|
-
this.raw = this.format();
|
|
4521
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
4522
|
-
return this;
|
|
4523
|
-
}
|
|
4524
|
-
};
|
|
4525
|
-
}));
|
|
4526
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4527
|
-
const SemVer = require_semver$1();
|
|
4528
|
-
const parse = (version, options, throwErrors = false) => {
|
|
4529
|
-
if (version instanceof SemVer) return version;
|
|
4530
|
-
try {
|
|
4531
|
-
return new SemVer(version, options);
|
|
4532
|
-
} catch (er) {
|
|
4533
|
-
if (!throwErrors) return null;
|
|
4534
|
-
throw er;
|
|
4535
|
-
}
|
|
4536
|
-
};
|
|
4537
|
-
module.exports = parse;
|
|
4538
|
-
}));
|
|
4539
|
-
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4540
|
-
const parse = require_parse();
|
|
4541
|
-
const valid = (version, options) => {
|
|
4542
|
-
const v = parse(version, options);
|
|
4543
|
-
return v ? v.version : null;
|
|
4544
|
-
};
|
|
4545
|
-
module.exports = valid;
|
|
4546
|
-
}));
|
|
4547
|
-
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4548
|
-
const parse = require_parse();
|
|
4549
|
-
const clean = (version, options) => {
|
|
4550
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
4551
|
-
return s ? s.version : null;
|
|
4552
|
-
};
|
|
4553
|
-
module.exports = clean;
|
|
4554
|
-
}));
|
|
4555
|
-
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4556
|
-
const SemVer = require_semver$1();
|
|
4557
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
4558
|
-
if (typeof options === "string") {
|
|
4559
|
-
identifierBase = identifier;
|
|
4560
|
-
identifier = options;
|
|
4561
|
-
options = void 0;
|
|
4562
|
-
}
|
|
4563
|
-
try {
|
|
4564
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
4565
|
-
} catch (er) {
|
|
4566
|
-
return null;
|
|
4567
|
-
}
|
|
4568
|
-
};
|
|
4569
|
-
module.exports = inc;
|
|
4570
|
-
}));
|
|
4571
|
-
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4572
|
-
const parse = require_parse();
|
|
4573
|
-
const diff = (version1, version2) => {
|
|
4574
|
-
const v1 = parse(version1, null, true);
|
|
4575
|
-
const v2 = parse(version2, null, true);
|
|
4576
|
-
const comparison = v1.compare(v2);
|
|
4577
|
-
if (comparison === 0) return null;
|
|
4578
|
-
const v1Higher = comparison > 0;
|
|
4579
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
4580
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
4581
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
4582
|
-
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
4583
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
4584
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
4585
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
4586
|
-
return "patch";
|
|
4587
|
-
}
|
|
4588
|
-
}
|
|
4589
|
-
const prefix = highHasPre ? "pre" : "";
|
|
4590
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
4591
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
4592
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
4593
|
-
return "prerelease";
|
|
4594
|
-
};
|
|
4595
|
-
module.exports = diff;
|
|
4596
|
-
}));
|
|
4597
|
-
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4598
|
-
const SemVer = require_semver$1();
|
|
4599
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
4600
|
-
module.exports = major;
|
|
4601
|
-
}));
|
|
4602
|
-
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4603
|
-
const SemVer = require_semver$1();
|
|
4604
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
4605
|
-
module.exports = minor;
|
|
4606
|
-
}));
|
|
4607
|
-
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4608
|
-
const SemVer = require_semver$1();
|
|
4609
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
4610
|
-
module.exports = patch;
|
|
4611
|
-
}));
|
|
4612
|
-
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4613
|
-
const parse = require_parse();
|
|
4614
|
-
const prerelease = (version, options) => {
|
|
4615
|
-
const parsed = parse(version, options);
|
|
4616
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
4617
|
-
};
|
|
4618
|
-
module.exports = prerelease;
|
|
4619
|
-
}));
|
|
4620
|
-
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4621
|
-
const SemVer = require_semver$1();
|
|
4622
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
4623
|
-
module.exports = compare;
|
|
4624
|
-
}));
|
|
4625
|
-
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4626
|
-
const compare = require_compare();
|
|
4627
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
4628
|
-
module.exports = rcompare;
|
|
4629
|
-
}));
|
|
4630
|
-
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4631
|
-
const compare = require_compare();
|
|
4632
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
4633
|
-
module.exports = compareLoose;
|
|
4634
|
-
}));
|
|
4635
|
-
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4636
|
-
const SemVer = require_semver$1();
|
|
4637
|
-
const compareBuild = (a, b, loose) => {
|
|
4638
|
-
const versionA = new SemVer(a, loose);
|
|
4639
|
-
const versionB = new SemVer(b, loose);
|
|
4640
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
4641
|
-
};
|
|
4642
|
-
module.exports = compareBuild;
|
|
4643
|
-
}));
|
|
4644
|
-
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4645
|
-
const compareBuild = require_compare_build();
|
|
4646
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
4647
|
-
module.exports = sort;
|
|
4648
|
-
}));
|
|
4649
|
-
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4650
|
-
const compareBuild = require_compare_build();
|
|
4651
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
4652
|
-
module.exports = rsort;
|
|
4653
|
-
}));
|
|
4654
|
-
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4655
|
-
const compare = require_compare();
|
|
4656
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
4657
|
-
module.exports = gt;
|
|
4658
|
-
}));
|
|
4659
|
-
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4660
|
-
const compare = require_compare();
|
|
4661
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
4662
|
-
module.exports = lt;
|
|
4663
|
-
}));
|
|
4664
|
-
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4665
|
-
const compare = require_compare();
|
|
4666
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
4667
|
-
module.exports = eq;
|
|
4668
|
-
}));
|
|
4669
|
-
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4670
|
-
const compare = require_compare();
|
|
4671
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
4672
|
-
module.exports = neq;
|
|
4673
|
-
}));
|
|
4674
|
-
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4675
|
-
const compare = require_compare();
|
|
4676
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
4677
|
-
module.exports = gte;
|
|
4678
|
-
}));
|
|
4679
|
-
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4680
|
-
const compare = require_compare();
|
|
4681
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
4682
|
-
module.exports = lte;
|
|
4683
|
-
}));
|
|
4684
|
-
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4685
|
-
const eq = require_eq();
|
|
4686
|
-
const neq = require_neq();
|
|
4687
|
-
const gt = require_gt();
|
|
4688
|
-
const gte = require_gte();
|
|
4689
|
-
const lt = require_lt();
|
|
4690
|
-
const lte = require_lte();
|
|
4691
|
-
const cmp = (a, op, b, loose) => {
|
|
4692
|
-
switch (op) {
|
|
4693
|
-
case "===":
|
|
4694
|
-
if (typeof a === "object") a = a.version;
|
|
4695
|
-
if (typeof b === "object") b = b.version;
|
|
4696
|
-
return a === b;
|
|
4697
|
-
case "!==":
|
|
4698
|
-
if (typeof a === "object") a = a.version;
|
|
4699
|
-
if (typeof b === "object") b = b.version;
|
|
4700
|
-
return a !== b;
|
|
4701
|
-
case "":
|
|
4702
|
-
case "=":
|
|
4703
|
-
case "==": return eq(a, b, loose);
|
|
4704
|
-
case "!=": return neq(a, b, loose);
|
|
4705
|
-
case ">": return gt(a, b, loose);
|
|
4706
|
-
case ">=": return gte(a, b, loose);
|
|
4707
|
-
case "<": return lt(a, b, loose);
|
|
4708
|
-
case "<=": return lte(a, b, loose);
|
|
4709
|
-
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
4710
|
-
}
|
|
4711
|
-
};
|
|
4712
|
-
module.exports = cmp;
|
|
4713
|
-
}));
|
|
4714
|
-
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4715
|
-
const SemVer = require_semver$1();
|
|
4716
|
-
const parse = require_parse();
|
|
4717
|
-
const { safeRe: re, t } = require_re();
|
|
4718
|
-
const coerce = (version, options) => {
|
|
4719
|
-
if (version instanceof SemVer) return version;
|
|
4720
|
-
if (typeof version === "number") version = String(version);
|
|
4721
|
-
if (typeof version !== "string") return null;
|
|
4722
|
-
options = options || {};
|
|
4723
|
-
let match = null;
|
|
4724
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
4725
|
-
else {
|
|
4726
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
4727
|
-
let next;
|
|
4728
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
4729
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
4730
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
4731
|
-
}
|
|
4732
|
-
coerceRtlRegex.lastIndex = -1;
|
|
4733
|
-
}
|
|
4734
|
-
if (match === null) return null;
|
|
4735
|
-
const major = match[2];
|
|
4736
|
-
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
4737
|
-
};
|
|
4738
|
-
module.exports = coerce;
|
|
4739
|
-
}));
|
|
4740
|
-
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4741
|
-
const parse = require_parse();
|
|
4742
|
-
const constants = require_constants();
|
|
4743
|
-
const SemVer = require_semver$1();
|
|
4744
|
-
const truncate = (version, truncation, options) => {
|
|
4745
|
-
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
4746
|
-
const clonedVersion = cloneInputVersion(version, options);
|
|
4747
|
-
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
4748
|
-
};
|
|
4749
|
-
const cloneInputVersion = (version, options) => {
|
|
4750
|
-
return parse(version instanceof SemVer ? version.version : version, options);
|
|
4751
|
-
};
|
|
4752
|
-
const doTruncation = (version, truncation) => {
|
|
4753
|
-
if (isPrerelease(truncation)) return version.version;
|
|
4754
|
-
version.prerelease = [];
|
|
4755
|
-
switch (truncation) {
|
|
4756
|
-
case "major":
|
|
4757
|
-
version.minor = 0;
|
|
4758
|
-
version.patch = 0;
|
|
4759
|
-
break;
|
|
4760
|
-
case "minor":
|
|
4761
|
-
version.patch = 0;
|
|
4762
|
-
break;
|
|
4763
|
-
}
|
|
4764
|
-
return version.format();
|
|
4765
|
-
};
|
|
4766
|
-
const isPrerelease = (type) => {
|
|
4767
|
-
return type.startsWith("pre");
|
|
4768
|
-
};
|
|
4769
|
-
module.exports = truncate;
|
|
4770
|
-
}));
|
|
4771
|
-
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4772
|
-
var LRUCache = class {
|
|
4773
|
-
constructor() {
|
|
4774
|
-
this.max = 1e3;
|
|
4775
|
-
this.map = /* @__PURE__ */ new Map();
|
|
4776
|
-
}
|
|
4777
|
-
get(key) {
|
|
4778
|
-
const value = this.map.get(key);
|
|
4779
|
-
if (value === void 0) return;
|
|
4780
|
-
else {
|
|
4781
|
-
this.map.delete(key);
|
|
4782
|
-
this.map.set(key, value);
|
|
4783
|
-
return value;
|
|
4784
|
-
}
|
|
4785
|
-
}
|
|
4786
|
-
delete(key) {
|
|
4787
|
-
return this.map.delete(key);
|
|
4788
|
-
}
|
|
4789
|
-
set(key, value) {
|
|
4790
|
-
if (!this.delete(key) && value !== void 0) {
|
|
4791
|
-
if (this.map.size >= this.max) {
|
|
4792
|
-
const firstKey = this.map.keys().next().value;
|
|
4793
|
-
this.delete(firstKey);
|
|
4794
|
-
}
|
|
4795
|
-
this.map.set(key, value);
|
|
4796
|
-
}
|
|
4797
|
-
return this;
|
|
4798
|
-
}
|
|
4799
|
-
};
|
|
4800
|
-
module.exports = LRUCache;
|
|
4801
|
-
}));
|
|
4802
|
-
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4803
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
4804
|
-
module.exports = class Range {
|
|
4805
|
-
constructor(range, options) {
|
|
4806
|
-
options = parseOptions(options);
|
|
4807
|
-
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
4808
|
-
else return new Range(range.raw, options);
|
|
4809
|
-
if (range instanceof Comparator) {
|
|
4810
|
-
this.raw = range.value;
|
|
4811
|
-
this.set = [[range]];
|
|
4812
|
-
this.formatted = void 0;
|
|
4813
|
-
return this;
|
|
4814
|
-
}
|
|
4815
|
-
this.options = options;
|
|
4816
|
-
this.loose = !!options.loose;
|
|
4817
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
4818
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
4819
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
4820
|
-
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
4821
|
-
if (this.set.length > 1) {
|
|
4822
|
-
const first = this.set[0];
|
|
4823
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
4824
|
-
if (this.set.length === 0) this.set = [first];
|
|
4825
|
-
else if (this.set.length > 1) {
|
|
4826
|
-
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
4827
|
-
this.set = [c];
|
|
4828
|
-
break;
|
|
4829
|
-
}
|
|
4830
|
-
}
|
|
4831
|
-
}
|
|
4832
|
-
this.formatted = void 0;
|
|
4833
|
-
}
|
|
4834
|
-
get range() {
|
|
4835
|
-
if (this.formatted === void 0) {
|
|
4836
|
-
this.formatted = "";
|
|
4837
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
4838
|
-
if (i > 0) this.formatted += "||";
|
|
4839
|
-
const comps = this.set[i];
|
|
4840
|
-
for (let k = 0; k < comps.length; k++) {
|
|
4841
|
-
if (k > 0) this.formatted += " ";
|
|
4842
|
-
this.formatted += comps[k].toString().trim();
|
|
4843
|
-
}
|
|
4844
|
-
}
|
|
4845
|
-
}
|
|
4846
|
-
return this.formatted;
|
|
4847
|
-
}
|
|
4848
|
-
format() {
|
|
4849
|
-
return this.range;
|
|
4850
|
-
}
|
|
4851
|
-
toString() {
|
|
4852
|
-
return this.range;
|
|
4853
|
-
}
|
|
4854
|
-
parseRange(range) {
|
|
4855
|
-
range = range.replace(BUILDSTRIPRE, "");
|
|
4856
|
-
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
4857
|
-
const cached = cache.get(memoKey);
|
|
4858
|
-
if (cached) return cached;
|
|
4859
|
-
const loose = this.options.loose;
|
|
4860
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
4861
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
4862
|
-
debug("hyphen replace", range);
|
|
4863
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
4864
|
-
debug("comparator trim", range);
|
|
4865
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
4866
|
-
debug("tilde trim", range);
|
|
4867
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
4868
|
-
debug("caret trim", range);
|
|
4869
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
4870
|
-
if (loose) rangeList = rangeList.filter((comp) => {
|
|
4871
|
-
debug("loose invalid filter", comp, this.options);
|
|
4872
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
4873
|
-
});
|
|
4874
|
-
debug("range list", rangeList);
|
|
4875
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
4876
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
4877
|
-
for (const comp of comparators) {
|
|
4878
|
-
if (isNullSet(comp)) return [comp];
|
|
4879
|
-
rangeMap.set(comp.value, comp);
|
|
4880
|
-
}
|
|
4881
|
-
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
4882
|
-
const result = [...rangeMap.values()];
|
|
4883
|
-
cache.set(memoKey, result);
|
|
4884
|
-
return result;
|
|
4885
|
-
}
|
|
4886
|
-
intersects(range, options) {
|
|
4887
|
-
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
4888
|
-
return this.set.some((thisComparators) => {
|
|
4889
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
4890
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
4891
|
-
return rangeComparators.every((rangeComparator) => {
|
|
4892
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
4893
|
-
});
|
|
3054
|
+
configurable: true,
|
|
3055
|
+
enumerable: true,
|
|
3056
|
+
value: wrappedGetUpdateInfo
|
|
4894
3057
|
});
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
}
|
|
4898
|
-
test(version) {
|
|
4899
|
-
if (!version) return false;
|
|
4900
|
-
if (typeof version === "string") try {
|
|
4901
|
-
version = new SemVer(version, this.options);
|
|
4902
|
-
} catch (er) {
|
|
4903
|
-
return false;
|
|
4904
|
-
}
|
|
4905
|
-
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
4906
|
-
return false;
|
|
4907
|
-
}
|
|
4908
|
-
};
|
|
4909
|
-
const cache = new (require_lrucache())();
|
|
4910
|
-
const parseOptions = require_parse_options();
|
|
4911
|
-
const Comparator = require_comparator();
|
|
4912
|
-
const debug = require_debug();
|
|
4913
|
-
const SemVer = require_semver$1();
|
|
4914
|
-
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
4915
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
4916
|
-
const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
4917
|
-
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
4918
|
-
const isAny = (c) => c.value === "";
|
|
4919
|
-
const isSatisfiable = (comparators, options) => {
|
|
4920
|
-
let result = true;
|
|
4921
|
-
const remainingComparators = comparators.slice();
|
|
4922
|
-
let testComparator = remainingComparators.pop();
|
|
4923
|
-
while (result && remainingComparators.length) {
|
|
4924
|
-
result = remainingComparators.every((otherComparator) => {
|
|
4925
|
-
return testComparator.intersects(otherComparator, options);
|
|
3058
|
+
return wrappedGetUpdateInfo;
|
|
3059
|
+
}
|
|
4926
3060
|
});
|
|
4927
|
-
|
|
4928
|
-
}
|
|
4929
|
-
return result;
|
|
4930
|
-
};
|
|
4931
|
-
const parseComparator = (comp, options) => {
|
|
4932
|
-
comp = comp.replace(re[t.BUILD], "");
|
|
4933
|
-
debug("comp", comp, options);
|
|
4934
|
-
comp = replaceCarets(comp, options);
|
|
4935
|
-
debug("caret", comp);
|
|
4936
|
-
comp = replaceTildes(comp, options);
|
|
4937
|
-
debug("tildes", comp);
|
|
4938
|
-
comp = replaceXRanges(comp, options);
|
|
4939
|
-
debug("xrange", comp);
|
|
4940
|
-
comp = replaceStars(comp, options);
|
|
4941
|
-
debug("stars", comp);
|
|
4942
|
-
return comp;
|
|
4943
|
-
};
|
|
4944
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
4945
|
-
const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
4946
|
-
const replaceTildes = (comp, options) => {
|
|
4947
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
4948
|
-
};
|
|
4949
|
-
const replaceTilde = (comp, options) => {
|
|
4950
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
4951
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
4952
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
4953
|
-
let ret;
|
|
4954
|
-
if (isX(M)) ret = "";
|
|
4955
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
4956
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
4957
|
-
else if (pr) {
|
|
4958
|
-
debug("replaceTilde pr", pr);
|
|
4959
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
4960
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
4961
|
-
debug("tilde return", ret);
|
|
4962
|
-
return ret;
|
|
4963
|
-
});
|
|
4964
|
-
};
|
|
4965
|
-
const replaceCarets = (comp, options) => {
|
|
4966
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
4967
|
-
};
|
|
4968
|
-
const replaceCaret = (comp, options) => {
|
|
4969
|
-
debug("caret", comp, options);
|
|
4970
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
4971
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
4972
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
4973
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
4974
|
-
let ret;
|
|
4975
|
-
if (isX(M)) ret = "";
|
|
4976
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
4977
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
4978
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
4979
|
-
else if (pr) {
|
|
4980
|
-
debug("replaceCaret pr", pr);
|
|
4981
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
4982
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
4983
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
4984
|
-
} else {
|
|
4985
|
-
debug("no pr");
|
|
4986
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
4987
|
-
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
4988
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
4989
|
-
}
|
|
4990
|
-
debug("caret return", ret);
|
|
4991
|
-
return ret;
|
|
4992
|
-
});
|
|
4993
|
-
};
|
|
4994
|
-
const replaceXRanges = (comp, options) => {
|
|
4995
|
-
debug("replaceXRanges", comp, options);
|
|
4996
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
3061
|
+
return plugin;
|
|
3062
|
+
};
|
|
4997
3063
|
};
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
5032
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
5033
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
5034
|
-
debug("xRange return", ret);
|
|
5035
|
-
return ret;
|
|
3064
|
+
}
|
|
3065
|
+
//#endregion
|
|
3066
|
+
//#region ../plugin-core/dist/semverSatisfies.mjs
|
|
3067
|
+
const semverSatisfies$1 = (targetAppVersion, currentVersion) => {
|
|
3068
|
+
const currentCoerce = coerce$1(currentVersion);
|
|
3069
|
+
if (!currentCoerce) return false;
|
|
3070
|
+
return satisfies$1(currentCoerce, targetAppVersion);
|
|
3071
|
+
};
|
|
3072
|
+
//#endregion
|
|
3073
|
+
//#region ../plugin-core/dist/filterCompatibleAppVersions.mjs
|
|
3074
|
+
/**
|
|
3075
|
+
* Filters target app versions that are compatible with the current app version.
|
|
3076
|
+
* Returns only versions that are compatible with the current version according to semver rules.
|
|
3077
|
+
*
|
|
3078
|
+
* @param targetAppVersionList - List of target app versions to filter
|
|
3079
|
+
* @param currentVersion - Current app version
|
|
3080
|
+
* @returns Array of target app versions compatible with the current version
|
|
3081
|
+
*/
|
|
3082
|
+
const filterCompatibleAppVersions = (targetAppVersionList, currentVersion) => {
|
|
3083
|
+
return targetAppVersionList.filter((version) => semverSatisfies$1(version, currentVersion)).sort((a, b) => b.localeCompare(a));
|
|
3084
|
+
};
|
|
3085
|
+
//#endregion
|
|
3086
|
+
//#region ../plugin-core/dist/paginateBundles.mjs
|
|
3087
|
+
function paginateBundles({ bundles, limit, offset, cursor, orderBy }) {
|
|
3088
|
+
const sortedBundles = sortBundles$1(bundles, orderBy);
|
|
3089
|
+
const direction = orderBy?.direction ?? "desc";
|
|
3090
|
+
const total = sortedBundles.length;
|
|
3091
|
+
if (offset !== void 0) {
|
|
3092
|
+
const normalizedOffset = Math.max(0, offset);
|
|
3093
|
+
const data = limit > 0 ? sortedBundles.slice(normalizedOffset, normalizedOffset + limit) : sortedBundles.slice(normalizedOffset);
|
|
3094
|
+
const pagination = calculatePagination(total, {
|
|
3095
|
+
limit,
|
|
3096
|
+
offset: normalizedOffset
|
|
5036
3097
|
});
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
};
|
|
5046
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
5047
|
-
if (isX(fM)) from = "";
|
|
5048
|
-
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
5049
|
-
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
5050
|
-
else if (fpr) from = `>=${from}`;
|
|
5051
|
-
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
5052
|
-
if (isX(tM)) to = "";
|
|
5053
|
-
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
5054
|
-
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
5055
|
-
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
5056
|
-
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
5057
|
-
else to = `<=${to}`;
|
|
5058
|
-
return `${from} ${to}`.trim();
|
|
5059
|
-
};
|
|
5060
|
-
const testSet = (set, version, options) => {
|
|
5061
|
-
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
5062
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
|
5063
|
-
for (let i = 0; i < set.length; i++) {
|
|
5064
|
-
debug(set[i].semver);
|
|
5065
|
-
if (set[i].semver === Comparator.ANY) continue;
|
|
5066
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
5067
|
-
const allowed = set[i].semver;
|
|
5068
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
5069
|
-
}
|
|
5070
|
-
}
|
|
5071
|
-
return false;
|
|
5072
|
-
}
|
|
5073
|
-
return true;
|
|
5074
|
-
};
|
|
5075
|
-
}));
|
|
5076
|
-
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5077
|
-
const ANY = Symbol("SemVer ANY");
|
|
5078
|
-
module.exports = class Comparator {
|
|
5079
|
-
static get ANY() {
|
|
5080
|
-
return ANY;
|
|
5081
|
-
}
|
|
5082
|
-
constructor(comp, options) {
|
|
5083
|
-
options = parseOptions(options);
|
|
5084
|
-
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
5085
|
-
else comp = comp.value;
|
|
5086
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
5087
|
-
debug("comparator", comp, options);
|
|
5088
|
-
this.options = options;
|
|
5089
|
-
this.loose = !!options.loose;
|
|
5090
|
-
this.parse(comp);
|
|
5091
|
-
if (this.semver === ANY) this.value = "";
|
|
5092
|
-
else this.value = this.operator + this.semver.version;
|
|
5093
|
-
debug("comp", this);
|
|
5094
|
-
}
|
|
5095
|
-
parse(comp) {
|
|
5096
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
5097
|
-
const m = comp.match(r);
|
|
5098
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
5099
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
5100
|
-
if (this.operator === "=") this.operator = "";
|
|
5101
|
-
if (!m[2]) this.semver = ANY;
|
|
5102
|
-
else this.semver = new SemVer(m[2], this.options.loose);
|
|
5103
|
-
}
|
|
5104
|
-
toString() {
|
|
5105
|
-
return this.value;
|
|
5106
|
-
}
|
|
5107
|
-
test(version) {
|
|
5108
|
-
debug("Comparator.test", version, this.options.loose);
|
|
5109
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
5110
|
-
if (typeof version === "string") try {
|
|
5111
|
-
version = new SemVer(version, this.options);
|
|
5112
|
-
} catch (er) {
|
|
5113
|
-
return false;
|
|
5114
|
-
}
|
|
5115
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
5116
|
-
}
|
|
5117
|
-
intersects(comp, options) {
|
|
5118
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
5119
|
-
if (this.operator === "") {
|
|
5120
|
-
if (this.value === "") return true;
|
|
5121
|
-
return new Range(comp.value, options).test(this.value);
|
|
5122
|
-
} else if (comp.operator === "") {
|
|
5123
|
-
if (comp.value === "") return true;
|
|
5124
|
-
return new Range(this.value, options).test(comp.semver);
|
|
3098
|
+
const nextCursor = data.length > 0 && normalizedOffset + data.length < total ? data.at(-1)?.id : void 0;
|
|
3099
|
+
const previousCursor = data.length > 0 && normalizedOffset > 0 ? data[0]?.id : void 0;
|
|
3100
|
+
return {
|
|
3101
|
+
data,
|
|
3102
|
+
pagination: {
|
|
3103
|
+
...pagination,
|
|
3104
|
+
...nextCursor ? { nextCursor } : {},
|
|
3105
|
+
...previousCursor ? { previousCursor } : {}
|
|
5125
3106
|
}
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
const
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
const
|
|
5142
|
-
const
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
3107
|
+
};
|
|
3108
|
+
}
|
|
3109
|
+
let data;
|
|
3110
|
+
if (cursor?.after) {
|
|
3111
|
+
const candidates = sortedBundles.filter((bundle) => direction === "desc" ? bundle.id.localeCompare(cursor.after) < 0 : bundle.id.localeCompare(cursor.after) > 0);
|
|
3112
|
+
data = limit > 0 ? candidates.slice(0, limit) : candidates;
|
|
3113
|
+
} else if (cursor?.before) {
|
|
3114
|
+
const candidates = sortedBundles.filter((bundle) => direction === "desc" ? bundle.id.localeCompare(cursor.before) > 0 : bundle.id.localeCompare(cursor.before) < 0);
|
|
3115
|
+
data = limit > 0 ? candidates.slice(Math.max(0, candidates.length - limit)) : candidates;
|
|
3116
|
+
} else data = limit > 0 ? sortedBundles.slice(0, limit) : sortedBundles;
|
|
3117
|
+
const startIndex = data.length > 0 ? sortedBundles.findIndex((bundle) => bundle.id === data[0].id) : cursor?.after ? total : 0;
|
|
3118
|
+
const pagination = calculatePagination(total, {
|
|
3119
|
+
limit,
|
|
3120
|
+
offset: startIndex
|
|
3121
|
+
});
|
|
3122
|
+
const nextCursor = data.length > 0 && startIndex + data.length < total ? data.at(-1)?.id : void 0;
|
|
3123
|
+
const previousCursor = data.length > 0 && startIndex > 0 ? data[0]?.id : void 0;
|
|
3124
|
+
return {
|
|
3125
|
+
data,
|
|
3126
|
+
pagination: {
|
|
3127
|
+
...pagination,
|
|
3128
|
+
...nextCursor ? { nextCursor } : {},
|
|
3129
|
+
...previousCursor ? { previousCursor } : {},
|
|
3130
|
+
...data.length === 0 && cursor?.after ? { previousCursor: cursor.after } : {},
|
|
3131
|
+
...data.length === 0 && cursor?.before ? { nextCursor: cursor.before } : {}
|
|
5151
3132
|
}
|
|
5152
|
-
return range.test(version);
|
|
5153
3133
|
};
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
return null;
|
|
5172
|
-
}
|
|
5173
|
-
versions.forEach((v) => {
|
|
5174
|
-
if (rangeObj.test(v)) {
|
|
5175
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
5176
|
-
max = v;
|
|
5177
|
-
maxSV = new SemVer(max, options);
|
|
5178
|
-
}
|
|
5179
|
-
}
|
|
5180
|
-
});
|
|
5181
|
-
return max;
|
|
3134
|
+
}
|
|
3135
|
+
//#endregion
|
|
3136
|
+
//#region ../plugin-core/dist/requestUpdateBundleState.mjs
|
|
3137
|
+
const toBundleSeeds = (seeds) => seeds.filter((seed) => !!seed);
|
|
3138
|
+
const seedRequestUpdateBundles = (context, seeds) => {
|
|
3139
|
+
const unitOfWork = getRequestBundleUnitOfWork(context);
|
|
3140
|
+
if (!unitOfWork) return;
|
|
3141
|
+
const nextSeeds = toBundleSeeds(seeds);
|
|
3142
|
+
if (nextSeeds.length === 0) return;
|
|
3143
|
+
unitOfWork.seed(nextSeeds);
|
|
3144
|
+
};
|
|
3145
|
+
const createRequestUpdateBundleResolver = (context) => {
|
|
3146
|
+
const unitOfWork = getRequestBundleUnitOfWork(context) ?? new BundleUnitOfWork();
|
|
3147
|
+
return {
|
|
3148
|
+
hasSeededBundles: () => unitOfWork.hasSeeds(),
|
|
3149
|
+
peek: (bundleId) => unitOfWork.peek(bundleId),
|
|
3150
|
+
getById: (bundleId, loadBundleById) => unitOfWork.getById(bundleId, loadBundleById)
|
|
5182
3151
|
};
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
3152
|
+
};
|
|
3153
|
+
//#endregion
|
|
3154
|
+
//#region ../js/dist/index.mjs
|
|
3155
|
+
const LETTER_DASH_NUMBER = "[a-zA-Z0-9-]";
|
|
3156
|
+
const NUMERIC_IDENTIFIER = String.raw`0|[1-9]\d*`;
|
|
3157
|
+
const NUMERIC_IDENTIFIER_LOOSE = String.raw`\d+`;
|
|
3158
|
+
const NON_NUMERIC_IDENTIFIER = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER}*`;
|
|
3159
|
+
const MAIN_VERSION = String.raw`(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})`;
|
|
3160
|
+
const MAIN_VERSION_LOOSE = String.raw`(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
3161
|
+
const PRERELEASE_IDENTIFIER = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER})`;
|
|
3162
|
+
const PRERELEASE_IDENTIFIER_LOOSE = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
3163
|
+
const PRERELEASE = String.raw`(?:-(${PRERELEASE_IDENTIFIER}(?:\.${PRERELEASE_IDENTIFIER})*))`;
|
|
3164
|
+
const PRERELEASE_LOOSE = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE}(?:\.${PRERELEASE_IDENTIFIER_LOOSE})*))`;
|
|
3165
|
+
const BUILD_IDENTIFIER = `${LETTER_DASH_NUMBER}+`;
|
|
3166
|
+
const BUILD = String.raw`(?:\+(${BUILD_IDENTIFIER}(?:\.${BUILD_IDENTIFIER})*))`;
|
|
3167
|
+
const FULL_PLAIN = `v?${MAIN_VERSION}${PRERELEASE}?${BUILD}?`;
|
|
3168
|
+
const LOOSE_PLAIN = String.raw`[v=\s]*${MAIN_VERSION_LOOSE}${PRERELEASE_LOOSE}?${BUILD}?`;
|
|
3169
|
+
const GREATER_LESS_THAN = "((?:<|>)?=?)";
|
|
3170
|
+
const XRANGE_IDENTIFIER = String.raw`${NUMERIC_IDENTIFIER}|x|X|\*`;
|
|
3171
|
+
const XRANGE_IDENTIFIER_LOOSE = String.raw`${NUMERIC_IDENTIFIER_LOOSE}|x|X|\*`;
|
|
3172
|
+
const XRANGE_PLAIN = String.raw`[v=\s]*(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:${PRERELEASE})?${BUILD}?)?)?`;
|
|
3173
|
+
const XRANGE_PLAIN_LOOSE = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:${PRERELEASE_LOOSE})?${BUILD}?)?)?`;
|
|
3174
|
+
const LONE_TILDE = "(?:~>?)";
|
|
3175
|
+
const LONE_CARET = String.raw`(?:\^)`;
|
|
3176
|
+
const COERCE_PLAIN = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
3177
|
+
const COERCE = String.raw`${COERCE_PLAIN}(?:$|[^\d])`;
|
|
3178
|
+
const COERCE_FULL = String.raw`${COERCE_PLAIN}(?:${PRERELEASE})?(?:${BUILD})?(?:$|[^\d])`;
|
|
3179
|
+
function makeSafeRegexSource(source) {
|
|
3180
|
+
const replacements = [
|
|
3181
|
+
[String.raw`\s`, 1],
|
|
3182
|
+
[String.raw`\d`, 256],
|
|
3183
|
+
[LETTER_DASH_NUMBER, 250]
|
|
3184
|
+
];
|
|
3185
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
3186
|
+
return source;
|
|
3187
|
+
}
|
|
3188
|
+
function safeRegex(source, flags) {
|
|
3189
|
+
return new RegExp(makeSafeRegexSource(source), flags);
|
|
3190
|
+
}
|
|
3191
|
+
const NUMERIC$1 = /^\d+$/;
|
|
3192
|
+
function compareIdentifiers(left, right) {
|
|
3193
|
+
if (typeof left === "number" && typeof right === "number") return left === right ? 0 : left < right ? -1 : 1;
|
|
3194
|
+
const leftNumeric = NUMERIC$1.test(String(left));
|
|
3195
|
+
const rightNumeric = NUMERIC$1.test(String(right));
|
|
3196
|
+
const normalizedLeft = leftNumeric ? Number(left) : left;
|
|
3197
|
+
const normalizedRight = rightNumeric ? Number(right) : right;
|
|
3198
|
+
return normalizedLeft === normalizedRight ? 0 : leftNumeric && !rightNumeric ? -1 : rightNumeric && !leftNumeric ? 1 : normalizedLeft < normalizedRight ? -1 : 1;
|
|
3199
|
+
}
|
|
3200
|
+
const FULL = safeRegex(`^${FULL_PLAIN}$`);
|
|
3201
|
+
const LOOSE = safeRegex(`^${LOOSE_PLAIN}$`);
|
|
3202
|
+
safeRegex(`^${PRERELEASE}$`);
|
|
3203
|
+
safeRegex(`^${PRERELEASE_LOOSE}$`);
|
|
3204
|
+
const COERCE_EXACT = safeRegex(COERCE);
|
|
3205
|
+
const COERCE_FULL_EXACT = safeRegex(COERCE_FULL);
|
|
3206
|
+
const NUMERIC = /^\d+$/;
|
|
3207
|
+
function formatComparableVersion(version) {
|
|
3208
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
3209
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
3210
|
+
}
|
|
3211
|
+
function formatFullVersion(version) {
|
|
3212
|
+
const comparable = formatComparableVersion(version);
|
|
3213
|
+
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
3214
|
+
}
|
|
3215
|
+
function parse(version, options = {}) {
|
|
3216
|
+
if (typeof version !== "string") return version;
|
|
3217
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
3218
|
+
const match = version.trim().match(options.loose ? LOOSE : FULL);
|
|
3219
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
3220
|
+
const major = Number(match[1]);
|
|
3221
|
+
const minor = Number(match[2]);
|
|
3222
|
+
const patch = Number(match[3]);
|
|
3223
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
3224
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
3225
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
3226
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
3227
|
+
if (NUMERIC.test(identifier)) {
|
|
3228
|
+
const numeric = Number(identifier);
|
|
3229
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
3230
|
+
}
|
|
3231
|
+
return identifier;
|
|
3232
|
+
}) : void 0;
|
|
3233
|
+
return {
|
|
3234
|
+
build: match[5]?.split("."),
|
|
3235
|
+
major,
|
|
3236
|
+
minor,
|
|
3237
|
+
patch,
|
|
3238
|
+
prerelease
|
|
5206
3239
|
};
|
|
5207
|
-
|
|
5208
|
-
})
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
const gt = require_gt();
|
|
5213
|
-
const minVersion = (range, loose) => {
|
|
5214
|
-
range = new Range(range, loose);
|
|
5215
|
-
let minver = new SemVer("0.0.0");
|
|
5216
|
-
if (range.test(minver)) return minver;
|
|
5217
|
-
minver = new SemVer("0.0.0-0");
|
|
5218
|
-
if (range.test(minver)) return minver;
|
|
5219
|
-
minver = null;
|
|
5220
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
5221
|
-
const comparators = range.set[i];
|
|
5222
|
-
let setMin = null;
|
|
5223
|
-
comparators.forEach((comparator) => {
|
|
5224
|
-
const compver = new SemVer(comparator.semver.version);
|
|
5225
|
-
switch (comparator.operator) {
|
|
5226
|
-
case ">":
|
|
5227
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
5228
|
-
else compver.prerelease.push(0);
|
|
5229
|
-
compver.raw = compver.format();
|
|
5230
|
-
case "":
|
|
5231
|
-
case ">=":
|
|
5232
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
5233
|
-
break;
|
|
5234
|
-
case "<":
|
|
5235
|
-
case "<=": break;
|
|
5236
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
5237
|
-
}
|
|
5238
|
-
});
|
|
5239
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
5240
|
-
}
|
|
5241
|
-
if (minver && range.test(minver)) return minver;
|
|
3240
|
+
}
|
|
3241
|
+
function tryParse(version, options = {}) {
|
|
3242
|
+
try {
|
|
3243
|
+
return parse(version, options);
|
|
3244
|
+
} catch {
|
|
5242
3245
|
return null;
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
function compareMainParsed(left, right) {
|
|
3249
|
+
return left.major === right.major ? left.minor === right.minor ? left.patch === right.patch ? 0 : left.patch < right.patch ? -1 : 1 : left.minor < right.minor ? -1 : 1 : left.major < right.major ? -1 : 1;
|
|
3250
|
+
}
|
|
3251
|
+
function comparePrereleaseParsed(left, right) {
|
|
3252
|
+
const leftPrerelease = left.prerelease;
|
|
3253
|
+
const rightPrerelease = right.prerelease;
|
|
3254
|
+
if (leftPrerelease?.length && !rightPrerelease?.length) return -1;
|
|
3255
|
+
if (!leftPrerelease?.length && rightPrerelease?.length) return 1;
|
|
3256
|
+
if (!leftPrerelease?.length && !rightPrerelease?.length) return 0;
|
|
3257
|
+
for (let index = 0;; index++) {
|
|
3258
|
+
const leftIdentifier = leftPrerelease?.[index];
|
|
3259
|
+
const rightIdentifier = rightPrerelease?.[index];
|
|
3260
|
+
if (leftIdentifier === void 0 && rightIdentifier === void 0) return 0;
|
|
3261
|
+
if (rightIdentifier === void 0) return 1;
|
|
3262
|
+
if (leftIdentifier === void 0) return -1;
|
|
3263
|
+
if (leftIdentifier !== rightIdentifier) return compareIdentifiers(leftIdentifier, rightIdentifier);
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
function compareParsed(left, right) {
|
|
3267
|
+
return compareMainParsed(left, right) || comparePrereleaseParsed(left, right);
|
|
3268
|
+
}
|
|
3269
|
+
function coerceParsedVersion(value, options = {}) {
|
|
3270
|
+
if (typeof value === "object") return value;
|
|
3271
|
+
const input = typeof value === "number" ? String(value) : value;
|
|
3272
|
+
if (typeof input !== "string") return null;
|
|
3273
|
+
let match = null;
|
|
3274
|
+
if (options.rtl) {
|
|
3275
|
+
const expression = safeRegex(options.includePrerelease ? COERCE_FULL : COERCE, "g");
|
|
3276
|
+
let next;
|
|
3277
|
+
while ((next = expression.exec(input)) && (!match || match.index + match[0].length !== input.length)) {
|
|
3278
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
3279
|
+
expression.lastIndex = next.index + next[1].length + next[2].length;
|
|
3280
|
+
}
|
|
3281
|
+
} else match = (options.includePrerelease ? COERCE_FULL_EXACT : COERCE_EXACT).exec(input);
|
|
3282
|
+
if (!match) return null;
|
|
3283
|
+
const major = match[2];
|
|
3284
|
+
return tryParse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
3285
|
+
}
|
|
3286
|
+
const STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
3287
|
+
const LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
3288
|
+
function parseComparator(comparator, options = {}) {
|
|
3289
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
3290
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1 : STRICT_COMPARATOR);
|
|
3291
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
3292
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
3293
|
+
const version = match[2] ? parse(match[2], options) : null;
|
|
3294
|
+
return {
|
|
3295
|
+
operator,
|
|
3296
|
+
options,
|
|
3297
|
+
value: version ? `${operator}${formatComparableVersion(version)}` : "",
|
|
3298
|
+
version
|
|
5243
3299
|
};
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
const
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
}
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
return
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
}))
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
const
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
if (
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
first = null;
|
|
5342
|
-
}
|
|
5343
|
-
if (first) set.push([first, null]);
|
|
5344
|
-
const ranges = [];
|
|
5345
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
5346
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
5347
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
5348
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
5349
|
-
else ranges.push(`${min} - ${max}`);
|
|
5350
|
-
const simplified = ranges.join(" || ");
|
|
5351
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
5352
|
-
return simplified.length < original.length ? simplified : range;
|
|
5353
|
-
};
|
|
5354
|
-
}));
|
|
5355
|
-
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5356
|
-
const Range = require_range();
|
|
5357
|
-
const Comparator = require_comparator();
|
|
5358
|
-
const { ANY } = Comparator;
|
|
5359
|
-
const satisfies = require_satisfies();
|
|
5360
|
-
const compare = require_compare();
|
|
5361
|
-
const subset = (sub, dom, options = {}) => {
|
|
5362
|
-
if (sub === dom) return true;
|
|
5363
|
-
sub = new Range(sub, options);
|
|
5364
|
-
dom = new Range(dom, options);
|
|
5365
|
-
let sawNonNull = false;
|
|
5366
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
5367
|
-
for (const simpleDom of dom.set) {
|
|
5368
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
5369
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
5370
|
-
if (isSub) continue OUTER;
|
|
3300
|
+
}
|
|
3301
|
+
function testParsedComparator(comparator, version) {
|
|
3302
|
+
if (!comparator.version) return true;
|
|
3303
|
+
const comparison = compareParsed(version, comparator.version);
|
|
3304
|
+
switch (comparator.operator) {
|
|
3305
|
+
case "": return comparison === 0;
|
|
3306
|
+
case ">": return comparison > 0;
|
|
3307
|
+
case ">=": return comparison >= 0;
|
|
3308
|
+
case "<": return comparison < 0;
|
|
3309
|
+
case "<=": return comparison <= 0;
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
function comparatorAllowsPrerelease(comparator, version) {
|
|
3313
|
+
const allowed = comparator.version;
|
|
3314
|
+
return allowed !== null && !!allowed.prerelease?.length && allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch;
|
|
3315
|
+
}
|
|
3316
|
+
function testComparatorSet(set, version, options) {
|
|
3317
|
+
if (set.some((comparator) => !testParsedComparator(comparator, version))) return false;
|
|
3318
|
+
return !version.prerelease?.length || !!options.includePrerelease || set.some((comparator) => comparatorAllowsPrerelease(comparator, version));
|
|
3319
|
+
}
|
|
3320
|
+
const BUILD_STRIP = new RegExp(BUILD, "g");
|
|
3321
|
+
const BUILD_SAFE = safeRegex(BUILD);
|
|
3322
|
+
const STRICT_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN})\s+-\s+(${XRANGE_PLAIN})\s*$`);
|
|
3323
|
+
const LOOSE_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN_LOOSE})\s+-\s+(${XRANGE_PLAIN_LOOSE})\s*$`);
|
|
3324
|
+
const COMPARATOR_TRIM = safeRegex(String.raw`(\s*)${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN}|${XRANGE_PLAIN})`, "g");
|
|
3325
|
+
const TILDE_TRIM = safeRegex(String.raw`(\s*)${LONE_TILDE}\s+`, "g");
|
|
3326
|
+
const CARET_TRIM = safeRegex(String.raw`(\s*)${LONE_CARET}\s+`, "g");
|
|
3327
|
+
const STRICT_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN}$`);
|
|
3328
|
+
const LOOSE_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN_LOOSE}$`);
|
|
3329
|
+
const STRICT_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN}$`);
|
|
3330
|
+
const LOOSE_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN_LOOSE}$`);
|
|
3331
|
+
const STRICT_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN}$`);
|
|
3332
|
+
const LOOSE_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN_LOOSE}$`);
|
|
3333
|
+
const STAR = safeRegex(String.raw`(<|>)?=?\s*\*`);
|
|
3334
|
+
const GTE_ZERO = /^\s*>=\s*0\.0\.0\s*$/;
|
|
3335
|
+
const GTE_ZERO_PRERELEASE = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
3336
|
+
const LOOSE_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
3337
|
+
function isWildcard(value) {
|
|
3338
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
3339
|
+
}
|
|
3340
|
+
function hasInvalidWildcardOrder(major, minor, patch) {
|
|
3341
|
+
return isWildcard(major) && !isWildcard(minor) || isWildcard(minor) && Boolean(patch) && !isWildcard(patch);
|
|
3342
|
+
}
|
|
3343
|
+
function replaceTilde(comparator, options) {
|
|
3344
|
+
const expression = options.loose ? LOOSE_TILDE : STRICT_TILDE;
|
|
3345
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
3346
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
3347
|
+
if (isWildcard(major)) return "";
|
|
3348
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3349
|
+
if (isWildcard(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
3350
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
3351
|
+
});
|
|
3352
|
+
}
|
|
3353
|
+
function replaceTildes(comparator, options) {
|
|
3354
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde(part, options)).join(" ");
|
|
3355
|
+
}
|
|
3356
|
+
function replaceCaret(comparator, options) {
|
|
3357
|
+
const expression = options.loose ? LOOSE_CARET : STRICT_CARET;
|
|
3358
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
3359
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
3360
|
+
if (isWildcard(major)) return "";
|
|
3361
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3362
|
+
if (isWildcard(patch)) return major === "0" ? `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3363
|
+
if (prerelease) return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch}-${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
3364
|
+
return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
3365
|
+
});
|
|
3366
|
+
}
|
|
3367
|
+
function replaceCarets(comparator, options) {
|
|
3368
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret(part, options)).join(" ");
|
|
3369
|
+
}
|
|
3370
|
+
function replaceXRange(comparator, options) {
|
|
3371
|
+
const expression = options.loose ? LOOSE_XRANGE : STRICT_XRANGE;
|
|
3372
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
3373
|
+
let operator = rawOperator;
|
|
3374
|
+
let major = rawMajor;
|
|
3375
|
+
let minor = rawMinor;
|
|
3376
|
+
let patch = rawPatch;
|
|
3377
|
+
if (hasInvalidWildcardOrder(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
3378
|
+
const wildcardMajor = isWildcard(major);
|
|
3379
|
+
const wildcardMinor = wildcardMajor || isWildcard(minor);
|
|
3380
|
+
const wildcardPatch = wildcardMinor || isWildcard(patch);
|
|
3381
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
3382
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
3383
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
3384
|
+
if (operator && wildcardPatch) {
|
|
3385
|
+
if (wildcardMinor) minor = 0;
|
|
3386
|
+
patch = 0;
|
|
3387
|
+
if (operator === ">") {
|
|
3388
|
+
operator = ">=";
|
|
3389
|
+
if (wildcardMinor) {
|
|
3390
|
+
major = Number(major) + 1;
|
|
3391
|
+
minor = 0;
|
|
3392
|
+
} else minor = Number(minor) + 1;
|
|
3393
|
+
} else if (operator === "<=") {
|
|
3394
|
+
operator = "<";
|
|
3395
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
3396
|
+
else minor = Number(minor) + 1;
|
|
5371
3397
|
}
|
|
5372
|
-
if (
|
|
5373
|
-
|
|
5374
|
-
return true;
|
|
5375
|
-
};
|
|
5376
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
5377
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
5378
|
-
const simpleSubset = (sub, dom, options) => {
|
|
5379
|
-
if (sub === dom) return true;
|
|
5380
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
5381
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
5382
|
-
else sub = minimumVersion;
|
|
5383
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
5384
|
-
else dom = minimumVersion;
|
|
5385
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
5386
|
-
let gt, lt;
|
|
5387
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
5388
|
-
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
5389
|
-
else eqSet.add(c.semver);
|
|
5390
|
-
if (eqSet.size > 1) return null;
|
|
5391
|
-
let gtltComp;
|
|
5392
|
-
if (gt && lt) {
|
|
5393
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
5394
|
-
if (gtltComp > 0) return null;
|
|
5395
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
5396
|
-
}
|
|
5397
|
-
for (const eq of eqSet) {
|
|
5398
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
5399
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
5400
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
5401
|
-
return true;
|
|
3398
|
+
if (operator === "<") prerelease = "-0";
|
|
3399
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
5402
3400
|
}
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
3401
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
3402
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
3403
|
+
return match;
|
|
3404
|
+
});
|
|
3405
|
+
}
|
|
3406
|
+
function replaceXRanges(comparator, options) {
|
|
3407
|
+
return comparator.split(/\s+/).map((part) => replaceXRange(part, options)).join(" ");
|
|
3408
|
+
}
|
|
3409
|
+
function replaceHyphenRange(range, options) {
|
|
3410
|
+
const expression = options.loose ? LOOSE_HYPHEN : STRICT_HYPHEN;
|
|
3411
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
3412
|
+
let from = rawFrom;
|
|
3413
|
+
let to = rawTo;
|
|
3414
|
+
if (isWildcard(fromMajor)) from = "";
|
|
3415
|
+
else if (isWildcard(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
3416
|
+
else if (isWildcard(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
3417
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
3418
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
3419
|
+
if (isWildcard(toMajor)) to = "";
|
|
3420
|
+
else if (isWildcard(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
3421
|
+
else if (isWildcard(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
3422
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
3423
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
3424
|
+
else to = `<=${to}`;
|
|
3425
|
+
return `${from} ${to}`.trim();
|
|
3426
|
+
});
|
|
3427
|
+
}
|
|
3428
|
+
function expandComparator(comparator, options) {
|
|
3429
|
+
return replaceXRanges(replaceTildes(replaceCarets(comparator.replace(BUILD_SAFE, ""), options), options), options).trim().replace(STAR, "");
|
|
3430
|
+
}
|
|
3431
|
+
function parseSimpleRange(input, options) {
|
|
3432
|
+
let parts = replaceHyphenRange(input.replace(BUILD_STRIP, ""), options).replace(COMPARATOR_TRIM, "$1$2$3").replace(TILDE_TRIM, "$1~").replace(CARET_TRIM, "$1^").split(" ").map((part) => expandComparator(part, options)).join(" ").split(/\s+/).map((part) => part.trim().replace(options.includePrerelease ? GTE_ZERO_PRERELEASE : GTE_ZERO, ""));
|
|
3433
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR.test(part));
|
|
3434
|
+
const unique = /* @__PURE__ */ new Map();
|
|
3435
|
+
for (const comparator of parts.map((part) => parseComparator(part, options))) {
|
|
3436
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
3437
|
+
unique.set(comparator.value, comparator);
|
|
3438
|
+
}
|
|
3439
|
+
if (unique.size > 1) unique.delete("");
|
|
3440
|
+
return [...unique.values()];
|
|
3441
|
+
}
|
|
3442
|
+
function parseRange(range, options = {}) {
|
|
3443
|
+
if (typeof range !== "string") return range;
|
|
3444
|
+
const parsedOptions = { ...options };
|
|
3445
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
3446
|
+
let sets = raw.split("||").map((part) => parseSimpleRange(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
3447
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
3448
|
+
if (sets.length > 1) {
|
|
3449
|
+
const first = sets[0];
|
|
3450
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
3451
|
+
if (!sets.length) sets = [first];
|
|
3452
|
+
else if (sets.length > 1) {
|
|
3453
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
3454
|
+
if (any) sets = [any];
|
|
5430
3455
|
}
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
if (!a) return b;
|
|
5438
|
-
const comp = compare(a.semver, b.semver, options);
|
|
5439
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
5440
|
-
};
|
|
5441
|
-
const lowerLT = (a, b, options) => {
|
|
5442
|
-
if (!a) return b;
|
|
5443
|
-
const comp = compare(a.semver, b.semver, options);
|
|
5444
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
5445
|
-
};
|
|
5446
|
-
module.exports = subset;
|
|
5447
|
-
}));
|
|
5448
|
-
var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5449
|
-
const internalRe = require_re();
|
|
5450
|
-
const constants = require_constants();
|
|
5451
|
-
const SemVer = require_semver$1();
|
|
5452
|
-
const identifiers = require_identifiers();
|
|
5453
|
-
module.exports = {
|
|
5454
|
-
parse: require_parse(),
|
|
5455
|
-
valid: require_valid$1(),
|
|
5456
|
-
clean: require_clean(),
|
|
5457
|
-
inc: require_inc(),
|
|
5458
|
-
diff: require_diff(),
|
|
5459
|
-
major: require_major(),
|
|
5460
|
-
minor: require_minor(),
|
|
5461
|
-
patch: require_patch(),
|
|
5462
|
-
prerelease: require_prerelease(),
|
|
5463
|
-
compare: require_compare(),
|
|
5464
|
-
rcompare: require_rcompare(),
|
|
5465
|
-
compareLoose: require_compare_loose(),
|
|
5466
|
-
compareBuild: require_compare_build(),
|
|
5467
|
-
sort: require_sort(),
|
|
5468
|
-
rsort: require_rsort(),
|
|
5469
|
-
gt: require_gt(),
|
|
5470
|
-
lt: require_lt(),
|
|
5471
|
-
eq: require_eq(),
|
|
5472
|
-
neq: require_neq(),
|
|
5473
|
-
gte: require_gte(),
|
|
5474
|
-
lte: require_lte(),
|
|
5475
|
-
cmp: require_cmp(),
|
|
5476
|
-
coerce: require_coerce(),
|
|
5477
|
-
truncate: require_truncate(),
|
|
5478
|
-
Comparator: require_comparator(),
|
|
5479
|
-
Range: require_range(),
|
|
5480
|
-
satisfies: require_satisfies(),
|
|
5481
|
-
toComparators: require_to_comparators(),
|
|
5482
|
-
maxSatisfying: require_max_satisfying(),
|
|
5483
|
-
minSatisfying: require_min_satisfying(),
|
|
5484
|
-
minVersion: require_min_version(),
|
|
5485
|
-
validRange: require_valid(),
|
|
5486
|
-
outside: require_outside(),
|
|
5487
|
-
gtr: require_gtr(),
|
|
5488
|
-
ltr: require_ltr(),
|
|
5489
|
-
intersects: require_intersects(),
|
|
5490
|
-
simplifyRange: require_simplify(),
|
|
5491
|
-
subset: require_subset(),
|
|
5492
|
-
SemVer,
|
|
5493
|
-
re: internalRe.re,
|
|
5494
|
-
src: internalRe.src,
|
|
5495
|
-
tokens: internalRe.t,
|
|
5496
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
5497
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
5498
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
5499
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
3456
|
+
}
|
|
3457
|
+
return {
|
|
3458
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
3459
|
+
options: parsedOptions,
|
|
3460
|
+
raw,
|
|
3461
|
+
sets
|
|
5500
3462
|
};
|
|
5501
|
-
}
|
|
3463
|
+
}
|
|
3464
|
+
function tryParseRange(range, options = {}) {
|
|
3465
|
+
try {
|
|
3466
|
+
return parseRange(range, options);
|
|
3467
|
+
} catch {
|
|
3468
|
+
return null;
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
function testParsedRange(range, version) {
|
|
3472
|
+
return range.sets.some((set) => testComparatorSet(set, version, range.options));
|
|
3473
|
+
}
|
|
3474
|
+
function testRangeVersion(range, version) {
|
|
3475
|
+
const parsed = tryParse(version, range.options);
|
|
3476
|
+
return parsed ? testParsedRange(range, parsed) : false;
|
|
3477
|
+
}
|
|
3478
|
+
function satisfies(version, range, options = {}) {
|
|
3479
|
+
const parsed = tryParseRange(range, options);
|
|
3480
|
+
return parsed ? testRangeVersion(parsed, version) : false;
|
|
3481
|
+
}
|
|
3482
|
+
function coerce(value, options = {}) {
|
|
3483
|
+
const parsed = coerceParsedVersion(value, options);
|
|
3484
|
+
return parsed ? formatFullVersion(parsed) : null;
|
|
3485
|
+
}
|
|
5502
3486
|
const semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
5503
|
-
const currentCoerce =
|
|
3487
|
+
const currentCoerce = coerce(currentVersion);
|
|
5504
3488
|
if (!currentCoerce) return false;
|
|
5505
|
-
return
|
|
3489
|
+
return satisfies(currentCoerce, targetAppVersion);
|
|
5506
3490
|
};
|
|
5507
3491
|
const INIT_BUNDLE_ROLLBACK_UPDATE_INFO$1 = {
|
|
5508
3492
|
message: null,
|
|
@@ -5645,7 +3629,7 @@ function isExactVersion(version) {
|
|
|
5645
3629
|
if (!version) return false;
|
|
5646
3630
|
const normalized = normalizeTargetAppVersion(version);
|
|
5647
3631
|
if (!normalized) return false;
|
|
5648
|
-
return
|
|
3632
|
+
return normalize(normalized) !== null;
|
|
5649
3633
|
}
|
|
5650
3634
|
/**
|
|
5651
3635
|
* Get all normalized semver versions for a version string.
|
|
@@ -5658,12 +3642,13 @@ function isExactVersion(version) {
|
|
|
5658
3642
|
*/
|
|
5659
3643
|
function getSemverNormalizedVersions(version) {
|
|
5660
3644
|
const normalized = normalizeTargetAppVersion(version) || version;
|
|
5661
|
-
const coerced =
|
|
3645
|
+
const coerced = coerce$1(normalized);
|
|
5662
3646
|
if (!coerced) return [normalized];
|
|
3647
|
+
const { major, minor, patch } = parse$1(coerced);
|
|
5663
3648
|
const versions = /* @__PURE__ */ new Set();
|
|
5664
|
-
versions.add(coerced
|
|
5665
|
-
if (
|
|
5666
|
-
if (
|
|
3649
|
+
versions.add(coerced);
|
|
3650
|
+
if (patch === 0) versions.add(`${major}.${minor}`);
|
|
3651
|
+
if (minor === 0 && patch === 0) versions.add(`${major}`);
|
|
5667
3652
|
return Array.from(versions);
|
|
5668
3653
|
}
|
|
5669
3654
|
function resolveStorageTarget({ targetAppVersion, fingerprintHash }) {
|
|
@@ -5698,10 +3683,17 @@ function addTargetVersionRemoval(mutations, bundle) {
|
|
|
5698
3683
|
getTargetVersionMutation(mutations, bundle).removals.add(targetAppVersion);
|
|
5699
3684
|
}
|
|
5700
3685
|
function getManagementListPrefixes(where) {
|
|
3686
|
+
if (where?.channel && where.platform && typeof where.targetAppVersion === "string") {
|
|
3687
|
+
const targetAppVersion = normalizeTargetAppVersion(where.targetAppVersion);
|
|
3688
|
+
if (targetAppVersion) return [`${where.channel}/${where.platform}/${targetAppVersion}/`];
|
|
3689
|
+
}
|
|
5701
3690
|
if (where?.channel && where.platform) return [`${where.channel}/${where.platform}/`];
|
|
5702
3691
|
if (where?.channel) return [`${where.channel}/`];
|
|
5703
3692
|
return [""];
|
|
5704
3693
|
}
|
|
3694
|
+
function getChannelFromUpdateJsonKey(key) {
|
|
3695
|
+
return key.match(/^([^/]+)\/(?:ios|android)\/[^/]+\/update\.json$/)?.[1] ?? null;
|
|
3696
|
+
}
|
|
5705
3697
|
const DEFAULT_DESC_ORDER = {
|
|
5706
3698
|
field: "id",
|
|
5707
3699
|
direction: "desc"
|
|
@@ -5718,7 +3710,7 @@ function sortManagedBundles(bundles, orderBy = DEFAULT_DESC_ORDER) {
|
|
|
5718
3710
|
*/
|
|
5719
3711
|
const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
5720
3712
|
return (config, hooks) => {
|
|
5721
|
-
const { listObjects, loadObject, uploadObject, deleteObject, shouldSkipLoadObjectError, invalidatePaths, apiBasePath } = factory(config);
|
|
3713
|
+
const { listObjects, loadObject, uploadObject, deleteObject, shouldSkipLoadObjectError, validateChannel, invalidatePaths, apiBasePath } = factory(config);
|
|
5722
3714
|
const bundlesMap = /* @__PURE__ */ new Map();
|
|
5723
3715
|
const pendingBundlesMap = /* @__PURE__ */ new Map();
|
|
5724
3716
|
const locallyDeletedBundleIds = /* @__PURE__ */ new Set();
|
|
@@ -5854,10 +3846,12 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
5854
3846
|
});
|
|
5855
3847
|
},
|
|
5856
3848
|
async getChannels() {
|
|
5857
|
-
|
|
3849
|
+
const channels = (await listObjects("")).map(getChannelFromUpdateJsonKey).filter((channel) => channel !== null);
|
|
3850
|
+
return [...new Set(channels)].sort();
|
|
5858
3851
|
},
|
|
5859
3852
|
async commitBundle({ changedSets }) {
|
|
5860
3853
|
if (changedSets.length === 0) return;
|
|
3854
|
+
for (const { operation, data } of changedSets) if (operation === "insert" || operation === "update" && data.channel !== void 0) validateChannel?.(data.channel);
|
|
5861
3855
|
const changedBundlesByKey = {};
|
|
5862
3856
|
const removalsByKey = {};
|
|
5863
3857
|
const targetVersionRemovalsByKey = {};
|
|
@@ -6020,21 +4014,39 @@ const createProfiledStoragePlugin = ({ createProfiles, name, profileShape, suppo
|
|
|
6020
4014
|
return runtime;
|
|
6021
4015
|
};
|
|
6022
4016
|
const profiles = {};
|
|
6023
|
-
if (profileShape?.node)
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
4017
|
+
if (profileShape?.node) {
|
|
4018
|
+
const nodeProfile = {
|
|
4019
|
+
async delete(storageUri) {
|
|
4020
|
+
return requireNodeProfile().delete(storageUri);
|
|
4021
|
+
},
|
|
4022
|
+
async downloadFile(storageUri, filePath) {
|
|
4023
|
+
return requireNodeProfile().downloadFile(storageUri, filePath);
|
|
4024
|
+
},
|
|
4025
|
+
async exists(storageUri) {
|
|
4026
|
+
return requireNodeProfile().exists(storageUri);
|
|
4027
|
+
},
|
|
4028
|
+
async upload(key, filePath) {
|
|
4029
|
+
return requireNodeProfile().upload(key, filePath);
|
|
4030
|
+
}
|
|
4031
|
+
};
|
|
4032
|
+
Object.defineProperties(nodeProfile, {
|
|
4033
|
+
deleteObjects: {
|
|
4034
|
+
enumerable: true,
|
|
4035
|
+
get: () => {
|
|
4036
|
+
const deleteObjects = requireNodeProfile().deleteObjects;
|
|
4037
|
+
return deleteObjects ? (keys) => deleteObjects(keys) : void 0;
|
|
4038
|
+
}
|
|
4039
|
+
},
|
|
4040
|
+
listObjects: {
|
|
4041
|
+
enumerable: true,
|
|
4042
|
+
get: () => {
|
|
4043
|
+
const listObjects = requireNodeProfile().listObjects;
|
|
4044
|
+
return listObjects ? (prefix) => listObjects(prefix) : void 0;
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
});
|
|
4048
|
+
profiles.node = nodeProfile;
|
|
4049
|
+
} else if (profileShape?.node !== false) Object.defineProperty(profiles, "node", {
|
|
6038
4050
|
enumerable: true,
|
|
6039
4051
|
get: getNodeProfile
|
|
6040
4052
|
});
|
|
@@ -6115,7 +4127,6 @@ function assertRuntimeStoragePlugin(plugin) {
|
|
|
6115
4127
|
//#endregion
|
|
6116
4128
|
//#region ../../packages/server/dist/db/updateArtifacts.mjs
|
|
6117
4129
|
const HBC_ASSET_PATH_RE = /\.bundle$/;
|
|
6118
|
-
const BR_COMPRESSED_ASSET_PATH_RE = /(^|\/)index\.[^/]+\.bundle$/;
|
|
6119
4130
|
const resolveUniqueHbcAssetPath = (manifest) => {
|
|
6120
4131
|
const candidates = Object.keys(manifest.assets).sort((left, right) => left.localeCompare(right)).filter((candidate) => HBC_ASSET_PATH_RE.test(candidate));
|
|
6121
4132
|
return candidates.length === 1 ? candidates[0] : null;
|
|
@@ -6157,10 +4168,11 @@ async function resolveChangedAssets({ assetBaseStorageUri, currentManifest, curr
|
|
|
6157
4168
|
});
|
|
6158
4169
|
const changedEntries = await Promise.all(Object.entries(targetManifest.assets).map(async ([assetPath, asset]) => {
|
|
6159
4170
|
if ((currentManifest?.assets[assetPath])?.fileHash === asset.fileHash) return null;
|
|
6160
|
-
const
|
|
4171
|
+
const downloadPath = getManifestAssetDownloadPath(assetPath);
|
|
4172
|
+
const usesBrotliAsset = downloadPath !== assetPath;
|
|
6161
4173
|
const storageUri = resolveManifestAssetStorageUri({
|
|
6162
4174
|
assetBaseStorageUri,
|
|
6163
|
-
assetPath:
|
|
4175
|
+
assetPath: downloadPath,
|
|
6164
4176
|
fileHash: asset.fileHash
|
|
6165
4177
|
});
|
|
6166
4178
|
const patch = patchDescriptor?.assetPath === assetPath ? patchDescriptor.patch : null;
|
|
@@ -8545,9 +6557,17 @@ function isPlatformDirectoryPrefix(prefix) {
|
|
|
8545
6557
|
const lastSegment = getLastDirectorySegment(prefix);
|
|
8546
6558
|
return lastSegment === "ios" || lastSegment === "android";
|
|
8547
6559
|
}
|
|
6560
|
+
function isLegacyBundleStorageDirectoryPrefix(prefix) {
|
|
6561
|
+
const lastSegment = getLastDirectorySegment(prefix);
|
|
6562
|
+
return lastSegment !== void 0 && /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(lastSegment);
|
|
6563
|
+
}
|
|
8548
6564
|
function isUpdateJsonKey(key) {
|
|
8549
6565
|
return key.endsWith(`${S3_DIRECTORY_DELIMITER}update.json`);
|
|
8550
6566
|
}
|
|
6567
|
+
function isUuidChannelUpdateJsonKey(key, rootPrefix, uuidChannels) {
|
|
6568
|
+
const [channel, platform, target, fileName, ...rest] = getRelativeDirectoryPrefix(key, rootPrefix).split(S3_DIRECTORY_DELIMITER);
|
|
6569
|
+
return channel !== void 0 && uuidChannels.has(channel) && (platform === "ios" || platform === "android") && target !== void 0 && target.length > 0 && fileName === "update.json" && rest.length === 0;
|
|
6570
|
+
}
|
|
8551
6571
|
async function mapWithConcurrency(items, concurrency, mapper) {
|
|
8552
6572
|
const results = [];
|
|
8553
6573
|
let nextIndex = 0;
|
|
@@ -8602,7 +6622,7 @@ async function uploadJsonToS3(client, bucket, key, data) {
|
|
|
8602
6622
|
}
|
|
8603
6623
|
async function listObjectsInS3(client, bucketName, prefix, rootPrefix = "") {
|
|
8604
6624
|
const normalizedRootPrefix = normalizeDirectoryPrefix(rootPrefix);
|
|
8605
|
-
const listPrefix = async (currentPrefix) => {
|
|
6625
|
+
const listPrefix = async (currentPrefix, delimiter = S3_DIRECTORY_DELIMITER) => {
|
|
8606
6626
|
let continuationToken;
|
|
8607
6627
|
const keys = [];
|
|
8608
6628
|
const commonPrefixes = /* @__PURE__ */ new Set();
|
|
@@ -8610,7 +6630,7 @@ async function listObjectsInS3(client, bucketName, prefix, rootPrefix = "") {
|
|
|
8610
6630
|
const response = await client.send(new _aws_sdk_client_s3.ListObjectsV2Command({
|
|
8611
6631
|
Bucket: bucketName,
|
|
8612
6632
|
Prefix: currentPrefix,
|
|
8613
|
-
Delimiter:
|
|
6633
|
+
Delimiter: delimiter ?? void 0,
|
|
8614
6634
|
ContinuationToken: continuationToken
|
|
8615
6635
|
}));
|
|
8616
6636
|
const found = (response.Contents ?? []).map((item) => item.Key).filter((key) => !!key);
|
|
@@ -8627,7 +6647,12 @@ async function listObjectsInS3(client, bucketName, prefix, rootPrefix = "") {
|
|
|
8627
6647
|
const { commonPrefixes, keys } = await listPrefix(currentPrefix);
|
|
8628
6648
|
const depth = getDirectoryDepth(currentPrefix, normalizedRootPrefix);
|
|
8629
6649
|
if (depth >= 2) return [...keys.filter(isUpdateJsonKey), ...commonPrefixes.map((commonPrefix) => `${commonPrefix}update.json`)];
|
|
8630
|
-
|
|
6650
|
+
const uuidPrefixes = depth === 0 ? commonPrefixes.filter(isLegacyBundleStorageDirectoryPrefix) : [];
|
|
6651
|
+
const uuidPrefixSet = new Set(uuidPrefixes);
|
|
6652
|
+
const nestedKeys = await mapWithConcurrency(depth === 0 ? commonPrefixes.filter((commonPrefix) => !uuidPrefixSet.has(commonPrefix)) : depth === 1 ? commonPrefixes.filter(isPlatformDirectoryPrefix) : commonPrefixes, S3_LIST_OBJECTS_CONCURRENCY, (nextPrefix) => collectUpdateJsonKeys(nextPrefix));
|
|
6653
|
+
const uuidChannels = new Set(uuidPrefixes.map(getLastDirectorySegment).filter((segment) => !!segment));
|
|
6654
|
+
const uuidChannelKeys = (await mapWithConcurrency(Array.from(new Set(Array.from(uuidChannels, (channel) => `${normalizedRootPrefix}${channel[0]}`))), S3_LIST_OBJECTS_CONCURRENCY, async (scanPrefix) => (await listPrefix(scanPrefix, null)).keys)).flat().filter((key) => isUuidChannelUpdateJsonKey(key, normalizedRootPrefix, uuidChannels));
|
|
6655
|
+
return [...nestedKeys.flat(), ...uuidChannelKeys];
|
|
8631
6656
|
};
|
|
8632
6657
|
const normalizedPrefix = normalizeDirectoryPrefix(prefix);
|
|
8633
6658
|
return Array.from(new Set(await collectUpdateJsonKeys(normalizedPrefix)));
|
|
@@ -8712,9 +6737,56 @@ const s3Storage = createUniversalStoragePlugin({
|
|
|
8712
6737
|
factory: (config) => {
|
|
8713
6738
|
const { bucketName, ...s3Config } = config;
|
|
8714
6739
|
const client = new _aws_sdk_client_s3.S3Client(applyS3RuntimeAwsConfig(s3Config));
|
|
8715
|
-
const
|
|
6740
|
+
const normalizedBasePath = config.basePath?.replace(/^\/+|\/+$/g, "") ?? "";
|
|
6741
|
+
const getStorageKey = createStorageKeyBuilder(normalizedBasePath);
|
|
6742
|
+
const getListPrefix = (prefix = "") => {
|
|
6743
|
+
const value = [normalizedBasePath, prefix.replace(/^\/+|\/+$/g, "")].filter(Boolean).join("/");
|
|
6744
|
+
return value ? `${value}/` : "";
|
|
6745
|
+
};
|
|
6746
|
+
const getRelativeKey = (key) => {
|
|
6747
|
+
if (!normalizedBasePath) return key;
|
|
6748
|
+
const basePrefix = `${normalizedBasePath}/`;
|
|
6749
|
+
return key.startsWith(basePrefix) ? key.slice(basePrefix.length) : key;
|
|
6750
|
+
};
|
|
8716
6751
|
return {
|
|
8717
6752
|
node: {
|
|
6753
|
+
async listObjects(prefix) {
|
|
6754
|
+
const objects = [];
|
|
6755
|
+
let continuationToken;
|
|
6756
|
+
do {
|
|
6757
|
+
const response = await client.send(new _aws_sdk_client_s3.ListObjectsV2Command({
|
|
6758
|
+
Bucket: bucketName,
|
|
6759
|
+
ContinuationToken: continuationToken,
|
|
6760
|
+
Prefix: getListPrefix(prefix)
|
|
6761
|
+
}));
|
|
6762
|
+
for (const object of response.Contents ?? []) {
|
|
6763
|
+
if (!object.Key) continue;
|
|
6764
|
+
objects.push({
|
|
6765
|
+
key: getRelativeKey(object.Key),
|
|
6766
|
+
lastModifiedAt: object.LastModified,
|
|
6767
|
+
size: object.Size ?? 0,
|
|
6768
|
+
storageUri: `s3://${bucketName}/${object.Key}`
|
|
6769
|
+
});
|
|
6770
|
+
}
|
|
6771
|
+
continuationToken = response.NextContinuationToken;
|
|
6772
|
+
} while (continuationToken);
|
|
6773
|
+
return objects;
|
|
6774
|
+
},
|
|
6775
|
+
async deleteObjects(relativeKeys) {
|
|
6776
|
+
const keys = relativeKeys.map((key) => getStorageKey(key));
|
|
6777
|
+
for (let offset = 0; offset < keys.length; offset += 1e3) {
|
|
6778
|
+
const batch = keys.slice(offset, offset + 1e3);
|
|
6779
|
+
if (batch.length === 0) continue;
|
|
6780
|
+
const response = await client.send(new _aws_sdk_client_s3.DeleteObjectsCommand({
|
|
6781
|
+
Bucket: bucketName,
|
|
6782
|
+
Delete: {
|
|
6783
|
+
Objects: batch.map((Key) => ({ Key })),
|
|
6784
|
+
Quiet: true
|
|
6785
|
+
}
|
|
6786
|
+
}));
|
|
6787
|
+
if (response.Errors && response.Errors.length > 0) throw new Error(`Failed to delete ${response.Errors.length} S3 object(s).`);
|
|
6788
|
+
}
|
|
6789
|
+
},
|
|
8718
6790
|
async delete(storageUri) {
|
|
8719
6791
|
const { bucket, key } = parseStorageUri(storageUri, "s3");
|
|
8720
6792
|
if (bucket !== bucketName) throw new Error(`Bucket name mismatch: expected "${bucketName}", but found "${bucket}".`);
|