hot-updater 0.35.11 → 0.35.12
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.mjs +448 -1398
- package/package.json +16 -17
package/dist/index.mjs
CHANGED
|
@@ -3065,807 +3065,435 @@ const { program: program$1, createCommand, createArgument, createOption, Command
|
|
|
3065
3065
|
exports.createArgument = (name, description) => new commander.Argument(name, description);
|
|
3066
3066
|
})))(), 1)).default;
|
|
3067
3067
|
//#endregion
|
|
3068
|
-
//#region ../../node_modules/.pnpm/
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
module.exports = LRUCache;
|
|
3099
|
-
}));
|
|
3100
|
-
//#endregion
|
|
3101
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
|
|
3102
|
-
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3103
|
-
const looseOption = Object.freeze({ loose: true });
|
|
3104
|
-
const emptyOpts = Object.freeze({});
|
|
3105
|
-
const parseOptions = (options) => {
|
|
3106
|
-
if (!options) return emptyOpts;
|
|
3107
|
-
if (typeof options !== "object") return looseOption;
|
|
3108
|
-
return options;
|
|
3109
|
-
};
|
|
3110
|
-
module.exports = parseOptions;
|
|
3111
|
-
}));
|
|
3112
|
-
//#endregion
|
|
3113
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js
|
|
3114
|
-
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3115
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
3116
|
-
const MAX_LENGTH = 256;
|
|
3117
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
3118
|
-
module.exports = {
|
|
3119
|
-
MAX_LENGTH,
|
|
3120
|
-
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
3121
|
-
MAX_SAFE_BUILD_LENGTH: MAX_LENGTH - 6,
|
|
3122
|
-
MAX_SAFE_INTEGER,
|
|
3123
|
-
RELEASE_TYPES: [
|
|
3124
|
-
"major",
|
|
3125
|
-
"premajor",
|
|
3126
|
-
"minor",
|
|
3127
|
-
"preminor",
|
|
3128
|
-
"patch",
|
|
3129
|
-
"prepatch",
|
|
3130
|
-
"prerelease"
|
|
3131
|
-
],
|
|
3132
|
-
SEMVER_SPEC_VERSION,
|
|
3133
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
3134
|
-
FLAG_LOOSE: 2
|
|
3135
|
-
};
|
|
3136
|
-
}));
|
|
3137
|
-
//#endregion
|
|
3138
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js
|
|
3139
|
-
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3140
|
-
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
3141
|
-
}));
|
|
3142
|
-
//#endregion
|
|
3143
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
|
|
3144
|
-
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3145
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants$1();
|
|
3146
|
-
const debug = require_debug();
|
|
3147
|
-
exports = module.exports = {};
|
|
3148
|
-
const re = exports.re = [];
|
|
3149
|
-
const safeRe = exports.safeRe = [];
|
|
3150
|
-
const src = exports.src = [];
|
|
3151
|
-
const safeSrc = exports.safeSrc = [];
|
|
3152
|
-
const t = exports.t = {};
|
|
3153
|
-
let R = 0;
|
|
3154
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
3155
|
-
const safeRegexReplacements = [
|
|
3156
|
-
["\\s", 1],
|
|
3157
|
-
["\\d", MAX_LENGTH],
|
|
3158
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
3068
|
+
//#region ../../node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.js
|
|
3069
|
+
const LETTER_DASH_NUMBER = "[a-zA-Z0-9-]";
|
|
3070
|
+
const NUMERIC_IDENTIFIER = String.raw`0|[1-9]\d*`;
|
|
3071
|
+
const NUMERIC_IDENTIFIER_LOOSE = String.raw`\d+`;
|
|
3072
|
+
const NON_NUMERIC_IDENTIFIER = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER}*`;
|
|
3073
|
+
const MAIN_VERSION = String.raw`(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})`;
|
|
3074
|
+
const MAIN_VERSION_LOOSE = String.raw`(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
3075
|
+
const PRERELEASE_IDENTIFIER = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER})`;
|
|
3076
|
+
const PRERELEASE_IDENTIFIER_LOOSE = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
3077
|
+
const PRERELEASE = String.raw`(?:-(${PRERELEASE_IDENTIFIER}(?:\.${PRERELEASE_IDENTIFIER})*))`;
|
|
3078
|
+
const PRERELEASE_LOOSE = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE}(?:\.${PRERELEASE_IDENTIFIER_LOOSE})*))`;
|
|
3079
|
+
const BUILD_IDENTIFIER = `${LETTER_DASH_NUMBER}+`;
|
|
3080
|
+
const BUILD = String.raw`(?:\+(${BUILD_IDENTIFIER}(?:\.${BUILD_IDENTIFIER})*))`;
|
|
3081
|
+
const FULL_PLAIN = `v?${MAIN_VERSION}${PRERELEASE}?${BUILD}?`;
|
|
3082
|
+
const LOOSE_PLAIN = String.raw`[v=\s]*${MAIN_VERSION_LOOSE}${PRERELEASE_LOOSE}?${BUILD}?`;
|
|
3083
|
+
const GREATER_LESS_THAN = "((?:<|>)?=?)";
|
|
3084
|
+
const XRANGE_IDENTIFIER = String.raw`${NUMERIC_IDENTIFIER}|x|X|\*`;
|
|
3085
|
+
const XRANGE_IDENTIFIER_LOOSE = String.raw`${NUMERIC_IDENTIFIER_LOOSE}|x|X|\*`;
|
|
3086
|
+
const XRANGE_PLAIN = String.raw`[v=\s]*(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:${PRERELEASE})?${BUILD}?)?)?`;
|
|
3087
|
+
const XRANGE_PLAIN_LOOSE = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:${PRERELEASE_LOOSE})?${BUILD}?)?)?`;
|
|
3088
|
+
const LONE_TILDE = "(?:~>?)";
|
|
3089
|
+
const LONE_CARET = String.raw`(?:\^)`;
|
|
3090
|
+
const COERCE_PLAIN = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
3091
|
+
const COERCE = String.raw`${COERCE_PLAIN}(?:$|[^\d])`;
|
|
3092
|
+
const COERCE_FULL = String.raw`${COERCE_PLAIN}(?:${PRERELEASE})?(?:${BUILD})?(?:$|[^\d])`;
|
|
3093
|
+
function makeSafeRegexSource(source) {
|
|
3094
|
+
const replacements = [
|
|
3095
|
+
[String.raw`\s`, 1],
|
|
3096
|
+
[String.raw`\d`, 256],
|
|
3097
|
+
[LETTER_DASH_NUMBER, 250]
|
|
3159
3098
|
];
|
|
3160
|
-
const
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
3215
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
3216
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
3217
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
3218
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
3219
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
3220
|
-
}));
|
|
3221
|
-
//#endregion
|
|
3222
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
|
|
3223
|
-
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3224
|
-
const numeric = /^[0-9]+$/;
|
|
3225
|
-
const compareIdentifiers = (a, b) => {
|
|
3226
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
3227
|
-
const anum = numeric.test(a);
|
|
3228
|
-
const bnum = numeric.test(b);
|
|
3229
|
-
if (anum && bnum) {
|
|
3230
|
-
a = +a;
|
|
3231
|
-
b = +b;
|
|
3232
|
-
}
|
|
3233
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
3234
|
-
};
|
|
3235
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
3236
|
-
module.exports = {
|
|
3237
|
-
compareIdentifiers,
|
|
3238
|
-
rcompareIdentifiers
|
|
3239
|
-
};
|
|
3240
|
-
}));
|
|
3241
|
-
//#endregion
|
|
3242
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
|
|
3243
|
-
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3244
|
-
const debug = require_debug();
|
|
3245
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants$1();
|
|
3246
|
-
const { safeRe: re, t } = require_re();
|
|
3247
|
-
const parseOptions = require_parse_options();
|
|
3248
|
-
const { compareIdentifiers } = require_identifiers();
|
|
3249
|
-
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
3250
|
-
const identifiers = identifier.split(".");
|
|
3251
|
-
if (identifiers.length > prerelease.length) return false;
|
|
3252
|
-
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
3253
|
-
return true;
|
|
3254
|
-
};
|
|
3255
|
-
module.exports = class SemVer {
|
|
3256
|
-
constructor(version, options) {
|
|
3257
|
-
options = parseOptions(options);
|
|
3258
|
-
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
3259
|
-
else version = version.version;
|
|
3260
|
-
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
3261
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
3262
|
-
debug("SemVer", version, options);
|
|
3263
|
-
this.options = options;
|
|
3264
|
-
this.loose = !!options.loose;
|
|
3265
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
3266
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
3267
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
3268
|
-
this.raw = version;
|
|
3269
|
-
this.major = +m[1];
|
|
3270
|
-
this.minor = +m[2];
|
|
3271
|
-
this.patch = +m[3];
|
|
3272
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
3273
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
3274
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
3275
|
-
if (!m[4]) this.prerelease = [];
|
|
3276
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
3277
|
-
if (/^[0-9]+$/.test(id)) {
|
|
3278
|
-
const num = +id;
|
|
3279
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
3280
|
-
}
|
|
3281
|
-
return id;
|
|
3282
|
-
});
|
|
3283
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
3284
|
-
this.format();
|
|
3285
|
-
}
|
|
3286
|
-
format() {
|
|
3287
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
3288
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
3289
|
-
return this.version;
|
|
3290
|
-
}
|
|
3291
|
-
toString() {
|
|
3292
|
-
return this.version;
|
|
3293
|
-
}
|
|
3294
|
-
compare(other) {
|
|
3295
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
3296
|
-
if (!(other instanceof SemVer)) {
|
|
3297
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
3298
|
-
other = new SemVer(other, this.options);
|
|
3299
|
-
}
|
|
3300
|
-
if (other.version === this.version) return 0;
|
|
3301
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
3302
|
-
}
|
|
3303
|
-
compareMain(other) {
|
|
3304
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
3305
|
-
if (this.major < other.major) return -1;
|
|
3306
|
-
if (this.major > other.major) return 1;
|
|
3307
|
-
if (this.minor < other.minor) return -1;
|
|
3308
|
-
if (this.minor > other.minor) return 1;
|
|
3309
|
-
if (this.patch < other.patch) return -1;
|
|
3310
|
-
if (this.patch > other.patch) return 1;
|
|
3311
|
-
return 0;
|
|
3312
|
-
}
|
|
3313
|
-
comparePre(other) {
|
|
3314
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
3315
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
3316
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
3317
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
3318
|
-
let i = 0;
|
|
3319
|
-
do {
|
|
3320
|
-
const a = this.prerelease[i];
|
|
3321
|
-
const b = other.prerelease[i];
|
|
3322
|
-
debug("prerelease compare", i, a, b);
|
|
3323
|
-
if (a === void 0 && b === void 0) return 0;
|
|
3324
|
-
else if (b === void 0) return 1;
|
|
3325
|
-
else if (a === void 0) return -1;
|
|
3326
|
-
else if (a === b) continue;
|
|
3327
|
-
else return compareIdentifiers(a, b);
|
|
3328
|
-
} while (++i);
|
|
3329
|
-
}
|
|
3330
|
-
compareBuild(other) {
|
|
3331
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
3332
|
-
let i = 0;
|
|
3333
|
-
do {
|
|
3334
|
-
const a = this.build[i];
|
|
3335
|
-
const b = other.build[i];
|
|
3336
|
-
debug("build compare", i, a, b);
|
|
3337
|
-
if (a === void 0 && b === void 0) return 0;
|
|
3338
|
-
else if (b === void 0) return 1;
|
|
3339
|
-
else if (a === void 0) return -1;
|
|
3340
|
-
else if (a === b) continue;
|
|
3341
|
-
else return compareIdentifiers(a, b);
|
|
3342
|
-
} while (++i);
|
|
3343
|
-
}
|
|
3344
|
-
inc(release, identifier, identifierBase) {
|
|
3345
|
-
if (release.startsWith("pre")) {
|
|
3346
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
3347
|
-
if (identifier) {
|
|
3348
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
3349
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
3350
|
-
}
|
|
3351
|
-
}
|
|
3352
|
-
switch (release) {
|
|
3353
|
-
case "premajor":
|
|
3354
|
-
this.prerelease.length = 0;
|
|
3355
|
-
this.patch = 0;
|
|
3356
|
-
this.minor = 0;
|
|
3357
|
-
this.major++;
|
|
3358
|
-
this.inc("pre", identifier, identifierBase);
|
|
3359
|
-
break;
|
|
3360
|
-
case "preminor":
|
|
3361
|
-
this.prerelease.length = 0;
|
|
3362
|
-
this.patch = 0;
|
|
3363
|
-
this.minor++;
|
|
3364
|
-
this.inc("pre", identifier, identifierBase);
|
|
3365
|
-
break;
|
|
3366
|
-
case "prepatch":
|
|
3367
|
-
this.prerelease.length = 0;
|
|
3368
|
-
this.inc("patch", identifier, identifierBase);
|
|
3369
|
-
this.inc("pre", identifier, identifierBase);
|
|
3370
|
-
break;
|
|
3371
|
-
case "prerelease":
|
|
3372
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
3373
|
-
this.inc("pre", identifier, identifierBase);
|
|
3374
|
-
break;
|
|
3375
|
-
case "release":
|
|
3376
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
3377
|
-
this.prerelease.length = 0;
|
|
3378
|
-
break;
|
|
3379
|
-
case "major":
|
|
3380
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
3381
|
-
this.minor = 0;
|
|
3382
|
-
this.patch = 0;
|
|
3383
|
-
this.prerelease = [];
|
|
3384
|
-
break;
|
|
3385
|
-
case "minor":
|
|
3386
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
3387
|
-
this.patch = 0;
|
|
3388
|
-
this.prerelease = [];
|
|
3389
|
-
break;
|
|
3390
|
-
case "patch":
|
|
3391
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
3392
|
-
this.prerelease = [];
|
|
3393
|
-
break;
|
|
3394
|
-
case "pre": {
|
|
3395
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
3396
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
3397
|
-
else {
|
|
3398
|
-
let i = this.prerelease.length;
|
|
3399
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
3400
|
-
this.prerelease[i]++;
|
|
3401
|
-
i = -2;
|
|
3402
|
-
}
|
|
3403
|
-
if (i === -1) {
|
|
3404
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
3405
|
-
this.prerelease.push(base);
|
|
3406
|
-
}
|
|
3407
|
-
}
|
|
3408
|
-
if (identifier) {
|
|
3409
|
-
let prerelease = [identifier, base];
|
|
3410
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
3411
|
-
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
3412
|
-
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
3413
|
-
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
3414
|
-
} else this.prerelease = prerelease;
|
|
3415
|
-
}
|
|
3416
|
-
break;
|
|
3417
|
-
}
|
|
3418
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
3419
|
-
}
|
|
3420
|
-
this.raw = this.format();
|
|
3421
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
3422
|
-
return this;
|
|
3423
|
-
}
|
|
3424
|
-
};
|
|
3425
|
-
}));
|
|
3426
|
-
//#endregion
|
|
3427
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
|
|
3428
|
-
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3429
|
-
const SemVer = require_semver$1();
|
|
3430
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
3431
|
-
module.exports = compare;
|
|
3432
|
-
}));
|
|
3433
|
-
//#endregion
|
|
3434
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
|
|
3435
|
-
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3436
|
-
const compare = require_compare();
|
|
3437
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
3438
|
-
module.exports = eq;
|
|
3439
|
-
}));
|
|
3440
|
-
//#endregion
|
|
3441
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
|
|
3442
|
-
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3443
|
-
const compare = require_compare();
|
|
3444
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
3445
|
-
module.exports = neq;
|
|
3446
|
-
}));
|
|
3447
|
-
//#endregion
|
|
3448
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
|
|
3449
|
-
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3450
|
-
const compare = require_compare();
|
|
3451
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
3452
|
-
module.exports = gt;
|
|
3453
|
-
}));
|
|
3454
|
-
//#endregion
|
|
3455
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
|
|
3456
|
-
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3457
|
-
const compare = require_compare();
|
|
3458
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
3459
|
-
module.exports = gte;
|
|
3460
|
-
}));
|
|
3461
|
-
//#endregion
|
|
3462
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
|
|
3463
|
-
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3464
|
-
const compare = require_compare();
|
|
3465
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
3466
|
-
module.exports = lt;
|
|
3467
|
-
}));
|
|
3468
|
-
//#endregion
|
|
3469
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
|
|
3470
|
-
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3471
|
-
const compare = require_compare();
|
|
3472
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
3473
|
-
module.exports = lte;
|
|
3474
|
-
}));
|
|
3475
|
-
//#endregion
|
|
3476
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
|
|
3477
|
-
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3478
|
-
const eq = require_eq();
|
|
3479
|
-
const neq = require_neq();
|
|
3480
|
-
const gt = require_gt();
|
|
3481
|
-
const gte = require_gte();
|
|
3482
|
-
const lt = require_lt();
|
|
3483
|
-
const lte = require_lte();
|
|
3484
|
-
const cmp = (a, op, b, loose) => {
|
|
3485
|
-
switch (op) {
|
|
3486
|
-
case "===":
|
|
3487
|
-
if (typeof a === "object") a = a.version;
|
|
3488
|
-
if (typeof b === "object") b = b.version;
|
|
3489
|
-
return a === b;
|
|
3490
|
-
case "!==":
|
|
3491
|
-
if (typeof a === "object") a = a.version;
|
|
3492
|
-
if (typeof b === "object") b = b.version;
|
|
3493
|
-
return a !== b;
|
|
3494
|
-
case "":
|
|
3495
|
-
case "=":
|
|
3496
|
-
case "==": return eq(a, b, loose);
|
|
3497
|
-
case "!=": return neq(a, b, loose);
|
|
3498
|
-
case ">": return gt(a, b, loose);
|
|
3499
|
-
case ">=": return gte(a, b, loose);
|
|
3500
|
-
case "<": return lt(a, b, loose);
|
|
3501
|
-
case "<=": return lte(a, b, loose);
|
|
3502
|
-
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
3503
|
-
}
|
|
3504
|
-
};
|
|
3505
|
-
module.exports = cmp;
|
|
3506
|
-
}));
|
|
3507
|
-
//#endregion
|
|
3508
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js
|
|
3509
|
-
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3510
|
-
const ANY = Symbol("SemVer ANY");
|
|
3511
|
-
module.exports = class Comparator {
|
|
3512
|
-
static get ANY() {
|
|
3513
|
-
return ANY;
|
|
3514
|
-
}
|
|
3515
|
-
constructor(comp, options) {
|
|
3516
|
-
options = parseOptions(options);
|
|
3517
|
-
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
3518
|
-
else comp = comp.value;
|
|
3519
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
3520
|
-
debug("comparator", comp, options);
|
|
3521
|
-
this.options = options;
|
|
3522
|
-
this.loose = !!options.loose;
|
|
3523
|
-
this.parse(comp);
|
|
3524
|
-
if (this.semver === ANY) this.value = "";
|
|
3525
|
-
else this.value = this.operator + this.semver.version;
|
|
3526
|
-
debug("comp", this);
|
|
3527
|
-
}
|
|
3528
|
-
parse(comp) {
|
|
3529
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
3530
|
-
const m = comp.match(r);
|
|
3531
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
3532
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
3533
|
-
if (this.operator === "=") this.operator = "";
|
|
3534
|
-
if (!m[2]) this.semver = ANY;
|
|
3535
|
-
else this.semver = new SemVer(m[2], this.options.loose);
|
|
3536
|
-
}
|
|
3537
|
-
toString() {
|
|
3538
|
-
return this.value;
|
|
3539
|
-
}
|
|
3540
|
-
test(version) {
|
|
3541
|
-
debug("Comparator.test", version, this.options.loose);
|
|
3542
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
3543
|
-
if (typeof version === "string") try {
|
|
3544
|
-
version = new SemVer(version, this.options);
|
|
3545
|
-
} catch (er) {
|
|
3546
|
-
return false;
|
|
3547
|
-
}
|
|
3548
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
3549
|
-
}
|
|
3550
|
-
intersects(comp, options) {
|
|
3551
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
3552
|
-
if (this.operator === "") {
|
|
3553
|
-
if (this.value === "") return true;
|
|
3554
|
-
return new Range(comp.value, options).test(this.value);
|
|
3555
|
-
} else if (comp.operator === "") {
|
|
3556
|
-
if (comp.value === "") return true;
|
|
3557
|
-
return new Range(this.value, options).test(comp.semver);
|
|
3558
|
-
}
|
|
3559
|
-
options = parseOptions(options);
|
|
3560
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
3561
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
3562
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
3563
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
3564
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
3565
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
3566
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
3567
|
-
return false;
|
|
3568
|
-
}
|
|
3569
|
-
};
|
|
3570
|
-
const parseOptions = require_parse_options();
|
|
3571
|
-
const { safeRe: re, t } = require_re();
|
|
3572
|
-
const cmp = require_cmp();
|
|
3573
|
-
const debug = require_debug();
|
|
3574
|
-
const SemVer = require_semver$1();
|
|
3575
|
-
const Range = require_range();
|
|
3576
|
-
}));
|
|
3577
|
-
//#endregion
|
|
3578
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js
|
|
3579
|
-
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3580
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
3581
|
-
module.exports = class Range {
|
|
3582
|
-
constructor(range, options) {
|
|
3583
|
-
options = parseOptions(options);
|
|
3584
|
-
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
3585
|
-
else return new Range(range.raw, options);
|
|
3586
|
-
if (range instanceof Comparator) {
|
|
3587
|
-
this.raw = range.value;
|
|
3588
|
-
this.set = [[range]];
|
|
3589
|
-
this.formatted = void 0;
|
|
3590
|
-
return this;
|
|
3591
|
-
}
|
|
3592
|
-
this.options = options;
|
|
3593
|
-
this.loose = !!options.loose;
|
|
3594
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
3595
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
3596
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
3597
|
-
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
3598
|
-
if (this.set.length > 1) {
|
|
3599
|
-
const first = this.set[0];
|
|
3600
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
3601
|
-
if (this.set.length === 0) this.set = [first];
|
|
3602
|
-
else if (this.set.length > 1) {
|
|
3603
|
-
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
3604
|
-
this.set = [c];
|
|
3605
|
-
break;
|
|
3606
|
-
}
|
|
3607
|
-
}
|
|
3608
|
-
}
|
|
3609
|
-
this.formatted = void 0;
|
|
3610
|
-
}
|
|
3611
|
-
get range() {
|
|
3612
|
-
if (this.formatted === void 0) {
|
|
3613
|
-
this.formatted = "";
|
|
3614
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
3615
|
-
if (i > 0) this.formatted += "||";
|
|
3616
|
-
const comps = this.set[i];
|
|
3617
|
-
for (let k = 0; k < comps.length; k++) {
|
|
3618
|
-
if (k > 0) this.formatted += " ";
|
|
3619
|
-
this.formatted += comps[k].toString().trim();
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3622
|
-
}
|
|
3623
|
-
return this.formatted;
|
|
3624
|
-
}
|
|
3625
|
-
format() {
|
|
3626
|
-
return this.range;
|
|
3627
|
-
}
|
|
3628
|
-
toString() {
|
|
3629
|
-
return this.range;
|
|
3630
|
-
}
|
|
3631
|
-
parseRange(range) {
|
|
3632
|
-
range = range.replace(BUILDSTRIPRE, "");
|
|
3633
|
-
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
3634
|
-
const cached = cache.get(memoKey);
|
|
3635
|
-
if (cached) return cached;
|
|
3636
|
-
const loose = this.options.loose;
|
|
3637
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
3638
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
3639
|
-
debug("hyphen replace", range);
|
|
3640
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
3641
|
-
debug("comparator trim", range);
|
|
3642
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
3643
|
-
debug("tilde trim", range);
|
|
3644
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
3645
|
-
debug("caret trim", range);
|
|
3646
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
3647
|
-
if (loose) rangeList = rangeList.filter((comp) => {
|
|
3648
|
-
debug("loose invalid filter", comp, this.options);
|
|
3649
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
3650
|
-
});
|
|
3651
|
-
debug("range list", rangeList);
|
|
3652
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
3653
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
3654
|
-
for (const comp of comparators) {
|
|
3655
|
-
if (isNullSet(comp)) return [comp];
|
|
3656
|
-
rangeMap.set(comp.value, comp);
|
|
3657
|
-
}
|
|
3658
|
-
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
3659
|
-
const result = [...rangeMap.values()];
|
|
3660
|
-
cache.set(memoKey, result);
|
|
3661
|
-
return result;
|
|
3662
|
-
}
|
|
3663
|
-
intersects(range, options) {
|
|
3664
|
-
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
3665
|
-
return this.set.some((thisComparators) => {
|
|
3666
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
3667
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
3668
|
-
return rangeComparators.every((rangeComparator) => {
|
|
3669
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
3670
|
-
});
|
|
3671
|
-
});
|
|
3672
|
-
});
|
|
3673
|
-
});
|
|
3674
|
-
}
|
|
3675
|
-
test(version) {
|
|
3676
|
-
if (!version) return false;
|
|
3677
|
-
if (typeof version === "string") try {
|
|
3678
|
-
version = new SemVer(version, this.options);
|
|
3679
|
-
} catch (er) {
|
|
3680
|
-
return false;
|
|
3681
|
-
}
|
|
3682
|
-
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
3683
|
-
return false;
|
|
3684
|
-
}
|
|
3685
|
-
};
|
|
3686
|
-
const cache = new (require_lrucache())();
|
|
3687
|
-
const parseOptions = require_parse_options();
|
|
3688
|
-
const Comparator = require_comparator();
|
|
3689
|
-
const debug = require_debug();
|
|
3690
|
-
const SemVer = require_semver$1();
|
|
3691
|
-
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
3692
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants$1();
|
|
3693
|
-
const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
3694
|
-
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
3695
|
-
const isAny = (c) => c.value === "";
|
|
3696
|
-
const isSatisfiable = (comparators, options) => {
|
|
3697
|
-
let result = true;
|
|
3698
|
-
const remainingComparators = comparators.slice();
|
|
3699
|
-
let testComparator = remainingComparators.pop();
|
|
3700
|
-
while (result && remainingComparators.length) {
|
|
3701
|
-
result = remainingComparators.every((otherComparator) => {
|
|
3702
|
-
return testComparator.intersects(otherComparator, options);
|
|
3703
|
-
});
|
|
3704
|
-
testComparator = remainingComparators.pop();
|
|
3705
|
-
}
|
|
3706
|
-
return result;
|
|
3707
|
-
};
|
|
3708
|
-
const parseComparator = (comp, options) => {
|
|
3709
|
-
comp = comp.replace(re[t.BUILD], "");
|
|
3710
|
-
debug("comp", comp, options);
|
|
3711
|
-
comp = replaceCarets(comp, options);
|
|
3712
|
-
debug("caret", comp);
|
|
3713
|
-
comp = replaceTildes(comp, options);
|
|
3714
|
-
debug("tildes", comp);
|
|
3715
|
-
comp = replaceXRanges(comp, options);
|
|
3716
|
-
debug("xrange", comp);
|
|
3717
|
-
comp = replaceStars(comp, options);
|
|
3718
|
-
debug("stars", comp);
|
|
3719
|
-
return comp;
|
|
3720
|
-
};
|
|
3721
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
3722
|
-
const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
3723
|
-
const replaceTildes = (comp, options) => {
|
|
3724
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
3725
|
-
};
|
|
3726
|
-
const replaceTilde = (comp, options) => {
|
|
3727
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
3728
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
3729
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
3730
|
-
let ret;
|
|
3731
|
-
if (isX(M)) ret = "";
|
|
3732
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
3733
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
3734
|
-
else if (pr) {
|
|
3735
|
-
debug("replaceTilde pr", pr);
|
|
3736
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
3737
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
3738
|
-
debug("tilde return", ret);
|
|
3739
|
-
return ret;
|
|
3740
|
-
});
|
|
3741
|
-
};
|
|
3742
|
-
const replaceCarets = (comp, options) => {
|
|
3743
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
3744
|
-
};
|
|
3745
|
-
const replaceCaret = (comp, options) => {
|
|
3746
|
-
debug("caret", comp, options);
|
|
3747
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
3748
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
3749
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
3750
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
3751
|
-
let ret;
|
|
3752
|
-
if (isX(M)) ret = "";
|
|
3753
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
3754
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
3755
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
3756
|
-
else if (pr) {
|
|
3757
|
-
debug("replaceCaret pr", pr);
|
|
3758
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
3759
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
3760
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
3761
|
-
} else {
|
|
3762
|
-
debug("no pr");
|
|
3763
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
3764
|
-
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
3765
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
3766
|
-
}
|
|
3767
|
-
debug("caret return", ret);
|
|
3768
|
-
return ret;
|
|
3769
|
-
});
|
|
3770
|
-
};
|
|
3771
|
-
const replaceXRanges = (comp, options) => {
|
|
3772
|
-
debug("replaceXRanges", comp, options);
|
|
3773
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
3774
|
-
};
|
|
3775
|
-
const replaceXRange = (comp, options) => {
|
|
3776
|
-
comp = comp.trim();
|
|
3777
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
3778
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
3779
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
3780
|
-
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
3781
|
-
const xM = isX(M);
|
|
3782
|
-
const xm = xM || isX(m);
|
|
3783
|
-
const xp = xm || isX(p);
|
|
3784
|
-
const anyX = xp;
|
|
3785
|
-
if (gtlt === "=" && anyX) gtlt = "";
|
|
3786
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
3787
|
-
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
3788
|
-
else ret = "*";
|
|
3789
|
-
else if (gtlt && anyX) {
|
|
3790
|
-
if (xm) m = 0;
|
|
3791
|
-
p = 0;
|
|
3792
|
-
if (gtlt === ">") {
|
|
3793
|
-
gtlt = ">=";
|
|
3794
|
-
if (xm) {
|
|
3795
|
-
M = +M + 1;
|
|
3796
|
-
m = 0;
|
|
3797
|
-
p = 0;
|
|
3798
|
-
} else {
|
|
3799
|
-
m = +m + 1;
|
|
3800
|
-
p = 0;
|
|
3801
|
-
}
|
|
3802
|
-
} else if (gtlt === "<=") {
|
|
3803
|
-
gtlt = "<";
|
|
3804
|
-
if (xm) M = +M + 1;
|
|
3805
|
-
else m = +m + 1;
|
|
3806
|
-
}
|
|
3807
|
-
if (gtlt === "<") pr = "-0";
|
|
3808
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
3809
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
3810
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
3811
|
-
debug("xRange return", ret);
|
|
3812
|
-
return ret;
|
|
3813
|
-
});
|
|
3814
|
-
};
|
|
3815
|
-
const replaceStars = (comp, options) => {
|
|
3816
|
-
debug("replaceStars", comp, options);
|
|
3817
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
3099
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
3100
|
+
return source;
|
|
3101
|
+
}
|
|
3102
|
+
function safeRegex(source, flags) {
|
|
3103
|
+
return new RegExp(makeSafeRegexSource(source), flags);
|
|
3104
|
+
}
|
|
3105
|
+
const NUMERIC$1 = /^\d+$/;
|
|
3106
|
+
function compareIdentifiers(left, right) {
|
|
3107
|
+
if (typeof left === "number" && typeof right === "number") return left === right ? 0 : left < right ? -1 : 1;
|
|
3108
|
+
const leftNumeric = NUMERIC$1.test(String(left));
|
|
3109
|
+
const rightNumeric = NUMERIC$1.test(String(right));
|
|
3110
|
+
const normalizedLeft = leftNumeric ? Number(left) : left;
|
|
3111
|
+
const normalizedRight = rightNumeric ? Number(right) : right;
|
|
3112
|
+
return normalizedLeft === normalizedRight ? 0 : leftNumeric && !rightNumeric ? -1 : rightNumeric && !leftNumeric ? 1 : normalizedLeft < normalizedRight ? -1 : 1;
|
|
3113
|
+
}
|
|
3114
|
+
const FULL = safeRegex(`^${FULL_PLAIN}$`);
|
|
3115
|
+
const LOOSE = safeRegex(`^${LOOSE_PLAIN}$`);
|
|
3116
|
+
safeRegex(`^${PRERELEASE}$`);
|
|
3117
|
+
safeRegex(`^${PRERELEASE_LOOSE}$`);
|
|
3118
|
+
const COERCE_EXACT = safeRegex(COERCE);
|
|
3119
|
+
const COERCE_FULL_EXACT = safeRegex(COERCE_FULL);
|
|
3120
|
+
const NUMERIC = /^\d+$/;
|
|
3121
|
+
function formatComparableVersion(version) {
|
|
3122
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
3123
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
3124
|
+
}
|
|
3125
|
+
function formatFullVersion(version) {
|
|
3126
|
+
const comparable = formatComparableVersion(version);
|
|
3127
|
+
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
3128
|
+
}
|
|
3129
|
+
function parse(version, options = {}) {
|
|
3130
|
+
if (typeof version !== "string") return version;
|
|
3131
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
3132
|
+
const match = version.trim().match(options.loose ? LOOSE : FULL);
|
|
3133
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
3134
|
+
const major = Number(match[1]);
|
|
3135
|
+
const minor = Number(match[2]);
|
|
3136
|
+
const patch = Number(match[3]);
|
|
3137
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
3138
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
3139
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
3140
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
3141
|
+
if (NUMERIC.test(identifier)) {
|
|
3142
|
+
const numeric = Number(identifier);
|
|
3143
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
3144
|
+
}
|
|
3145
|
+
return identifier;
|
|
3146
|
+
}) : void 0;
|
|
3147
|
+
return {
|
|
3148
|
+
build: match[5]?.split("."),
|
|
3149
|
+
major,
|
|
3150
|
+
minor,
|
|
3151
|
+
patch,
|
|
3152
|
+
prerelease
|
|
3818
3153
|
};
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3154
|
+
}
|
|
3155
|
+
function tryParse(version, options = {}) {
|
|
3156
|
+
try {
|
|
3157
|
+
return parse(version, options);
|
|
3158
|
+
} catch {
|
|
3159
|
+
return null;
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
function compareMainParsed(left, right) {
|
|
3163
|
+
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;
|
|
3164
|
+
}
|
|
3165
|
+
function comparePrereleaseParsed(left, right) {
|
|
3166
|
+
const leftPrerelease = left.prerelease;
|
|
3167
|
+
const rightPrerelease = right.prerelease;
|
|
3168
|
+
if (leftPrerelease?.length && !rightPrerelease?.length) return -1;
|
|
3169
|
+
if (!leftPrerelease?.length && rightPrerelease?.length) return 1;
|
|
3170
|
+
if (!leftPrerelease?.length && !rightPrerelease?.length) return 0;
|
|
3171
|
+
for (let index = 0;; index++) {
|
|
3172
|
+
const leftIdentifier = leftPrerelease?.[index];
|
|
3173
|
+
const rightIdentifier = rightPrerelease?.[index];
|
|
3174
|
+
if (leftIdentifier === void 0 && rightIdentifier === void 0) return 0;
|
|
3175
|
+
if (rightIdentifier === void 0) return 1;
|
|
3176
|
+
if (leftIdentifier === void 0) return -1;
|
|
3177
|
+
if (leftIdentifier !== rightIdentifier) return compareIdentifiers(leftIdentifier, rightIdentifier);
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
function compareParsed(left, right) {
|
|
3181
|
+
return compareMainParsed(left, right) || comparePrereleaseParsed(left, right);
|
|
3182
|
+
}
|
|
3183
|
+
function coerceParsedVersion(value, options = {}) {
|
|
3184
|
+
if (typeof value === "object") return value;
|
|
3185
|
+
const input = typeof value === "number" ? String(value) : value;
|
|
3186
|
+
if (typeof input !== "string") return null;
|
|
3187
|
+
let match = null;
|
|
3188
|
+
if (options.rtl) {
|
|
3189
|
+
const expression = safeRegex(options.includePrerelease ? COERCE_FULL : COERCE, "g");
|
|
3190
|
+
let next;
|
|
3191
|
+
while ((next = expression.exec(input)) && (!match || match.index + match[0].length !== input.length)) {
|
|
3192
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
3193
|
+
expression.lastIndex = next.index + next[1].length + next[2].length;
|
|
3194
|
+
}
|
|
3195
|
+
} else match = (options.includePrerelease ? COERCE_FULL_EXACT : COERCE_EXACT).exec(input);
|
|
3196
|
+
if (!match) return null;
|
|
3197
|
+
const major = match[2];
|
|
3198
|
+
return tryParse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
3199
|
+
}
|
|
3200
|
+
const STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
3201
|
+
const LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
3202
|
+
function parseComparator(comparator, options = {}) {
|
|
3203
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
3204
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1 : STRICT_COMPARATOR);
|
|
3205
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
3206
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
3207
|
+
const version = match[2] ? parse(match[2], options) : null;
|
|
3208
|
+
return {
|
|
3209
|
+
operator,
|
|
3210
|
+
options,
|
|
3211
|
+
value: version ? `${operator}${formatComparableVersion(version)}` : "",
|
|
3212
|
+
version
|
|
3822
3213
|
};
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3214
|
+
}
|
|
3215
|
+
function testParsedComparator(comparator, version) {
|
|
3216
|
+
if (!comparator.version) return true;
|
|
3217
|
+
const comparison = compareParsed(version, comparator.version);
|
|
3218
|
+
switch (comparator.operator) {
|
|
3219
|
+
case "": return comparison === 0;
|
|
3220
|
+
case ">": return comparison > 0;
|
|
3221
|
+
case ">=": return comparison >= 0;
|
|
3222
|
+
case "<": return comparison < 0;
|
|
3223
|
+
case "<=": return comparison <= 0;
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
function comparatorAllowsPrerelease(comparator, version) {
|
|
3227
|
+
const allowed = comparator.version;
|
|
3228
|
+
return allowed !== null && !!allowed.prerelease?.length && allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch;
|
|
3229
|
+
}
|
|
3230
|
+
function testComparatorSet(set, version, options) {
|
|
3231
|
+
if (set.some((comparator) => !testParsedComparator(comparator, version))) return false;
|
|
3232
|
+
return !version.prerelease?.length || !!options.includePrerelease || set.some((comparator) => comparatorAllowsPrerelease(comparator, version));
|
|
3233
|
+
}
|
|
3234
|
+
function parsedComparatorsIntersect(left, right, options = {}) {
|
|
3235
|
+
if (!left.version || !right.version) return true;
|
|
3236
|
+
if (left.operator === "") return testComparatorSet([right], left.version, options);
|
|
3237
|
+
if (right.operator === "") return testComparatorSet([left], right.version, options);
|
|
3238
|
+
if (options.includePrerelease && (left.value === "<0.0.0-0" || right.value === "<0.0.0-0")) return false;
|
|
3239
|
+
if (!options.includePrerelease && (left.value.startsWith("<0.0.0") || right.value.startsWith("<0.0.0"))) return false;
|
|
3240
|
+
if (left.operator.startsWith(">") && right.operator.startsWith(">")) return true;
|
|
3241
|
+
if (left.operator.startsWith("<") && right.operator.startsWith("<")) return true;
|
|
3242
|
+
const comparison = compareParsed(left.version, right.version);
|
|
3243
|
+
if (comparison === 0 && left.operator.includes("=") && right.operator.includes("=")) return true;
|
|
3244
|
+
if (comparison < 0 && left.operator.startsWith(">") && right.operator.startsWith("<")) return true;
|
|
3245
|
+
return comparison > 0 && left.operator.startsWith("<") && right.operator.startsWith(">");
|
|
3246
|
+
}
|
|
3247
|
+
function compare(left, right, options = {}) {
|
|
3248
|
+
return compareParsed(parse(left, options), parse(right, options));
|
|
3249
|
+
}
|
|
3250
|
+
function isLess(left, right, options = {}) {
|
|
3251
|
+
return compare(left, right, options) < 0;
|
|
3252
|
+
}
|
|
3253
|
+
function isLessOrEqual(left, right, options = {}) {
|
|
3254
|
+
return compare(left, right, options) <= 0;
|
|
3255
|
+
}
|
|
3256
|
+
const BUILD_STRIP = new RegExp(BUILD, "g");
|
|
3257
|
+
const BUILD_SAFE = safeRegex(BUILD);
|
|
3258
|
+
const STRICT_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN})\s+-\s+(${XRANGE_PLAIN})\s*$`);
|
|
3259
|
+
const LOOSE_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN_LOOSE})\s+-\s+(${XRANGE_PLAIN_LOOSE})\s*$`);
|
|
3260
|
+
const COMPARATOR_TRIM = safeRegex(String.raw`(\s*)${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN}|${XRANGE_PLAIN})`, "g");
|
|
3261
|
+
const TILDE_TRIM = safeRegex(String.raw`(\s*)${LONE_TILDE}\s+`, "g");
|
|
3262
|
+
const CARET_TRIM = safeRegex(String.raw`(\s*)${LONE_CARET}\s+`, "g");
|
|
3263
|
+
const STRICT_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN}$`);
|
|
3264
|
+
const LOOSE_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN_LOOSE}$`);
|
|
3265
|
+
const STRICT_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN}$`);
|
|
3266
|
+
const LOOSE_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN_LOOSE}$`);
|
|
3267
|
+
const STRICT_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN}$`);
|
|
3268
|
+
const LOOSE_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN_LOOSE}$`);
|
|
3269
|
+
const STAR = safeRegex(String.raw`(<|>)?=?\s*\*`);
|
|
3270
|
+
const GTE_ZERO = /^\s*>=\s*0\.0\.0\s*$/;
|
|
3271
|
+
const GTE_ZERO_PRERELEASE = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
3272
|
+
const LOOSE_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
3273
|
+
function isWildcard(value) {
|
|
3274
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
3275
|
+
}
|
|
3276
|
+
function hasInvalidWildcardOrder(major, minor, patch) {
|
|
3277
|
+
return isWildcard(major) && !isWildcard(minor) || isWildcard(minor) && Boolean(patch) && !isWildcard(patch);
|
|
3278
|
+
}
|
|
3279
|
+
function replaceTilde(comparator, options) {
|
|
3280
|
+
const expression = options.loose ? LOOSE_TILDE : STRICT_TILDE;
|
|
3281
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
3282
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
3283
|
+
if (isWildcard(major)) return "";
|
|
3284
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3285
|
+
if (isWildcard(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
3286
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
3287
|
+
});
|
|
3288
|
+
}
|
|
3289
|
+
function replaceTildes(comparator, options) {
|
|
3290
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde(part, options)).join(" ");
|
|
3291
|
+
}
|
|
3292
|
+
function replaceCaret(comparator, options) {
|
|
3293
|
+
const expression = options.loose ? LOOSE_CARET : STRICT_CARET;
|
|
3294
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
3295
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
3296
|
+
if (isWildcard(major)) return "";
|
|
3297
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3298
|
+
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`;
|
|
3299
|
+
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`;
|
|
3300
|
+
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`;
|
|
3301
|
+
});
|
|
3302
|
+
}
|
|
3303
|
+
function replaceCarets(comparator, options) {
|
|
3304
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret(part, options)).join(" ");
|
|
3305
|
+
}
|
|
3306
|
+
function replaceXRange(comparator, options) {
|
|
3307
|
+
const expression = options.loose ? LOOSE_XRANGE : STRICT_XRANGE;
|
|
3308
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
3309
|
+
let operator = rawOperator;
|
|
3310
|
+
let major = rawMajor;
|
|
3311
|
+
let minor = rawMinor;
|
|
3312
|
+
let patch = rawPatch;
|
|
3313
|
+
if (hasInvalidWildcardOrder(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
3314
|
+
const wildcardMajor = isWildcard(major);
|
|
3315
|
+
const wildcardMinor = wildcardMajor || isWildcard(minor);
|
|
3316
|
+
const wildcardPatch = wildcardMinor || isWildcard(patch);
|
|
3317
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
3318
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
3319
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
3320
|
+
if (operator && wildcardPatch) {
|
|
3321
|
+
if (wildcardMinor) minor = 0;
|
|
3322
|
+
patch = 0;
|
|
3323
|
+
if (operator === ">") {
|
|
3324
|
+
operator = ">=";
|
|
3325
|
+
if (wildcardMinor) {
|
|
3326
|
+
major = Number(major) + 1;
|
|
3327
|
+
minor = 0;
|
|
3328
|
+
} else minor = Number(minor) + 1;
|
|
3329
|
+
} else if (operator === "<=") {
|
|
3330
|
+
operator = "<";
|
|
3331
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
3332
|
+
else minor = Number(minor) + 1;
|
|
3333
|
+
}
|
|
3334
|
+
if (operator === "<") prerelease = "-0";
|
|
3335
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
3336
|
+
}
|
|
3337
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
3338
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
3339
|
+
return match;
|
|
3340
|
+
});
|
|
3341
|
+
}
|
|
3342
|
+
function replaceXRanges(comparator, options) {
|
|
3343
|
+
return comparator.split(/\s+/).map((part) => replaceXRange(part, options)).join(" ");
|
|
3344
|
+
}
|
|
3345
|
+
function replaceHyphenRange(range, options) {
|
|
3346
|
+
const expression = options.loose ? LOOSE_HYPHEN : STRICT_HYPHEN;
|
|
3347
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
3348
|
+
let from = rawFrom;
|
|
3349
|
+
let to = rawTo;
|
|
3350
|
+
if (isWildcard(fromMajor)) from = "";
|
|
3351
|
+
else if (isWildcard(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
3352
|
+
else if (isWildcard(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
3353
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
3354
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
3355
|
+
if (isWildcard(toMajor)) to = "";
|
|
3356
|
+
else if (isWildcard(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
3357
|
+
else if (isWildcard(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
3358
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
3359
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
3834
3360
|
else to = `<=${to}`;
|
|
3835
3361
|
return `${from} ${to}`.trim();
|
|
3836
|
-
};
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
})
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3362
|
+
});
|
|
3363
|
+
}
|
|
3364
|
+
function expandComparator(comparator, options) {
|
|
3365
|
+
return replaceXRanges(replaceTildes(replaceCarets(comparator.replace(BUILD_SAFE, ""), options), options), options).trim().replace(STAR, "");
|
|
3366
|
+
}
|
|
3367
|
+
function parseSimpleRange(input, options) {
|
|
3368
|
+
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, ""));
|
|
3369
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR.test(part));
|
|
3370
|
+
const unique = /* @__PURE__ */ new Map();
|
|
3371
|
+
for (const comparator of parts.map((part) => parseComparator(part, options))) {
|
|
3372
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
3373
|
+
unique.set(comparator.value, comparator);
|
|
3374
|
+
}
|
|
3375
|
+
if (unique.size > 1) unique.delete("");
|
|
3376
|
+
return [...unique.values()];
|
|
3377
|
+
}
|
|
3378
|
+
function parseRange(range, options = {}) {
|
|
3379
|
+
if (typeof range !== "string") return range;
|
|
3380
|
+
const parsedOptions = { ...options };
|
|
3381
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
3382
|
+
let sets = raw.split("||").map((part) => parseSimpleRange(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
3383
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
3384
|
+
if (sets.length > 1) {
|
|
3385
|
+
const first = sets[0];
|
|
3386
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
3387
|
+
if (!sets.length) sets = [first];
|
|
3388
|
+
else if (sets.length > 1) {
|
|
3389
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
3390
|
+
if (any) sets = [any];
|
|
3862
3391
|
}
|
|
3392
|
+
}
|
|
3393
|
+
return {
|
|
3394
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
3395
|
+
options: parsedOptions,
|
|
3396
|
+
raw,
|
|
3397
|
+
sets
|
|
3863
3398
|
};
|
|
3864
|
-
|
|
3865
|
-
})
|
|
3399
|
+
}
|
|
3400
|
+
function tryParseRange(range, options = {}) {
|
|
3401
|
+
try {
|
|
3402
|
+
return parseRange(range, options);
|
|
3403
|
+
} catch {
|
|
3404
|
+
return null;
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
function testParsedRange(range, version) {
|
|
3408
|
+
return range.sets.some((set) => testComparatorSet(set, version, range.options));
|
|
3409
|
+
}
|
|
3410
|
+
function testRangeVersion(range, version) {
|
|
3411
|
+
const parsed = tryParse(version, range.options);
|
|
3412
|
+
return parsed ? testParsedRange(range, parsed) : false;
|
|
3413
|
+
}
|
|
3414
|
+
function exactVersion(set) {
|
|
3415
|
+
for (const comparator of set) if (comparator.operator === "" && comparator.version) return comparator.version;
|
|
3416
|
+
return null;
|
|
3417
|
+
}
|
|
3418
|
+
function isSatisfiable(comparators, options) {
|
|
3419
|
+
const exact = exactVersion(comparators);
|
|
3420
|
+
if (exact) return testComparatorSet(comparators, exact, options);
|
|
3421
|
+
const remaining = [...comparators];
|
|
3422
|
+
let current = remaining.pop();
|
|
3423
|
+
while (current && remaining.length) {
|
|
3424
|
+
if (remaining.some((other) => !parsedComparatorsIntersect(current, other, options))) return false;
|
|
3425
|
+
current = remaining.pop();
|
|
3426
|
+
}
|
|
3427
|
+
return true;
|
|
3428
|
+
}
|
|
3429
|
+
function setsIntersect(left, right, options) {
|
|
3430
|
+
const leftExact = exactVersion(left);
|
|
3431
|
+
if (leftExact) return testComparatorSet(right, leftExact, options);
|
|
3432
|
+
const rightExact = exactVersion(right);
|
|
3433
|
+
if (rightExact) return testComparatorSet(left, rightExact, options);
|
|
3434
|
+
return left.every((leftComparator) => right.every((rightComparator) => parsedComparatorsIntersect(leftComparator, rightComparator, options)));
|
|
3435
|
+
}
|
|
3436
|
+
function parsedRangesIntersect(left, right, options = {}) {
|
|
3437
|
+
return left.sets.some((leftSet) => isSatisfiable(leftSet, options) && right.sets.some((rightSet) => isSatisfiable(rightSet, options) && setsIntersect(leftSet, rightSet, options)));
|
|
3438
|
+
}
|
|
3439
|
+
function normalizeRange(range, options = {}) {
|
|
3440
|
+
const parsed = tryParseRange(range, options);
|
|
3441
|
+
return parsed ? parsed.normalized || "*" : null;
|
|
3442
|
+
}
|
|
3443
|
+
function satisfies(version, range, options = {}) {
|
|
3444
|
+
const parsed = tryParseRange(range, options);
|
|
3445
|
+
return parsed ? testRangeVersion(parsed, version) : false;
|
|
3446
|
+
}
|
|
3447
|
+
function nextVersionAfter(version) {
|
|
3448
|
+
const { prerelease } = version;
|
|
3449
|
+
return parse(formatComparableVersion(prerelease?.length ? {
|
|
3450
|
+
major: version.major,
|
|
3451
|
+
minor: version.minor,
|
|
3452
|
+
patch: version.patch,
|
|
3453
|
+
prerelease: [...prerelease, 0]
|
|
3454
|
+
} : {
|
|
3455
|
+
major: version.major,
|
|
3456
|
+
minor: version.minor,
|
|
3457
|
+
patch: version.patch + 1
|
|
3458
|
+
}));
|
|
3459
|
+
}
|
|
3460
|
+
function findMinimumForRange(range, options = {}) {
|
|
3461
|
+
const parsedRange = parseRange(range, options);
|
|
3462
|
+
const zero = parse("0.0.0");
|
|
3463
|
+
if (testParsedRange(parsedRange, zero)) return formatComparableVersion(zero);
|
|
3464
|
+
const zeroPrerelease = parse("0.0.0-0");
|
|
3465
|
+
if (testParsedRange(parsedRange, zeroPrerelease)) return formatComparableVersion(zeroPrerelease);
|
|
3466
|
+
let minimum = null;
|
|
3467
|
+
for (const set of parsedRange.sets) {
|
|
3468
|
+
let setMinimum = null;
|
|
3469
|
+
for (const comparator of set) {
|
|
3470
|
+
if (!comparator.version) continue;
|
|
3471
|
+
const candidate = comparator.operator === ">" ? nextVersionAfter(comparator.version) : comparator.operator === "" || comparator.operator === ">=" ? comparator.version : null;
|
|
3472
|
+
if (candidate && (!setMinimum || compareParsed(candidate, setMinimum) > 0)) setMinimum = candidate;
|
|
3473
|
+
}
|
|
3474
|
+
if (setMinimum && (!minimum || compareParsed(minimum, setMinimum) > 0)) minimum = setMinimum;
|
|
3475
|
+
}
|
|
3476
|
+
return minimum && testParsedRange(parsedRange, minimum) ? formatComparableVersion(minimum) : null;
|
|
3477
|
+
}
|
|
3478
|
+
function rangesIntersect(left, right, options = {}) {
|
|
3479
|
+
const parsedLeft = parseRange(left, options);
|
|
3480
|
+
const parsedRight = parseRange(right, options);
|
|
3481
|
+
return parsedRangesIntersect(parsedLeft, parsedRight, {
|
|
3482
|
+
...parsedLeft.options,
|
|
3483
|
+
...parsedRight.options,
|
|
3484
|
+
...options
|
|
3485
|
+
});
|
|
3486
|
+
}
|
|
3487
|
+
function normalize(version, options = {}) {
|
|
3488
|
+
const parsed = tryParse(version, options);
|
|
3489
|
+
return parsed ? formatComparableVersion(parsed) : null;
|
|
3490
|
+
}
|
|
3491
|
+
function coerce(value, options = {}) {
|
|
3492
|
+
const parsed = coerceParsedVersion(value, options);
|
|
3493
|
+
return parsed ? formatFullVersion(parsed) : null;
|
|
3494
|
+
}
|
|
3866
3495
|
//#endregion
|
|
3867
3496
|
//#region src/commandOptions/index.ts
|
|
3868
|
-
var import_valid = /* @__PURE__ */ __toESM(require_valid$1(), 1);
|
|
3869
3497
|
const PLATFORMS = ["ios", "android"];
|
|
3870
3498
|
const platformCommandOption = new Option("-p, --platform <platform>", "specify the platform").choices(["ios", "android"]);
|
|
3871
3499
|
const interactiveCommandOption = new Option("-i, --interactive", "interactive mode").default(false);
|
|
@@ -3939,7 +3567,7 @@ const getAndroidVersion = async ({ parser, validateWithSemver = false }) => {
|
|
|
3939
3567
|
for (const parserKey of parsers) {
|
|
3940
3568
|
const parsedVersion = await AndroidVersionParsers[parserKey]();
|
|
3941
3569
|
if (!parsedVersion) continue;
|
|
3942
|
-
if (validateWithSemver && !(
|
|
3570
|
+
if (validateWithSemver && !normalizeRange(parsedVersion)) continue;
|
|
3943
3571
|
return parsedVersion;
|
|
3944
3572
|
}
|
|
3945
3573
|
return null;
|
|
@@ -13296,7 +12924,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13296
12924
|
}));
|
|
13297
12925
|
//#endregion
|
|
13298
12926
|
//#region ../../node_modules/.pnpm/@expo+plist@0.0.18/node_modules/@expo/plist/build/parse.js
|
|
13299
|
-
var require_parse$
|
|
12927
|
+
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13300
12928
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
13301
12929
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
13302
12930
|
};
|
|
@@ -13424,7 +13052,7 @@ var require_build$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13424
13052
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13425
13053
|
const build_1 = require_build$2();
|
|
13426
13054
|
exports.default = {
|
|
13427
|
-
parse: require_parse$
|
|
13055
|
+
parse: require_parse$1().parse,
|
|
13428
13056
|
build: build_1.build
|
|
13429
13057
|
};
|
|
13430
13058
|
}));
|
|
@@ -19298,7 +18926,7 @@ const getIOSVersion = async ({ parser, validateWithSemver = false }) => {
|
|
|
19298
18926
|
for (const parserKey of parsers) {
|
|
19299
18927
|
const parsedVersion = await IOSVersionParsers[parserKey]();
|
|
19300
18928
|
if (!parsedVersion) continue;
|
|
19301
|
-
if (validateWithSemver && !(
|
|
18929
|
+
if (validateWithSemver && !normalizeRange(parsedVersion)) continue;
|
|
19302
18930
|
return parsedVersion;
|
|
19303
18931
|
}
|
|
19304
18932
|
return null;
|
|
@@ -20369,7 +19997,7 @@ var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
20369
19997
|
}));
|
|
20370
19998
|
//#endregion
|
|
20371
19999
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
20372
|
-
var require_parse
|
|
20000
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
20373
20001
|
const path$2 = __require("path");
|
|
20374
20002
|
const resolveCommand = require_resolveCommand();
|
|
20375
20003
|
const escape = require_escape();
|
|
@@ -20471,7 +20099,7 @@ var require_enoent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
20471
20099
|
//#region ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
20472
20100
|
var import_cross_spawn = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
20473
20101
|
const cp = __require("child_process");
|
|
20474
|
-
const parse = require_parse
|
|
20102
|
+
const parse = require_parse();
|
|
20475
20103
|
const enoent = require_enoent();
|
|
20476
20104
|
function spawn(command, args, options) {
|
|
20477
20105
|
const parsed = parse(command, args, options);
|
|
@@ -26216,19 +25844,7 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
|
26216
25844
|
defineLazyProperty(apps, "browser", () => "browser");
|
|
26217
25845
|
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
26218
25846
|
//#endregion
|
|
26219
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
|
|
26220
|
-
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
26221
|
-
const Range = require_range();
|
|
26222
|
-
const intersects = (r1, r2, options) => {
|
|
26223
|
-
r1 = new Range(r1, options);
|
|
26224
|
-
r2 = new Range(r2, options);
|
|
26225
|
-
return r1.intersects(r2, options);
|
|
26226
|
-
};
|
|
26227
|
-
module.exports = intersects;
|
|
26228
|
-
}));
|
|
26229
|
-
//#endregion
|
|
26230
25847
|
//#region src/prompts/getPlatform.ts
|
|
26231
|
-
var import_intersects = /* @__PURE__ */ __toESM(require_intersects(), 1);
|
|
26232
25848
|
const getPlatform = async (message) => {
|
|
26233
25849
|
return await p.select({
|
|
26234
25850
|
message,
|
|
@@ -26553,7 +26169,7 @@ const getDefaultTargetAppVersion = async (platform) => {
|
|
|
26553
26169
|
break;
|
|
26554
26170
|
}
|
|
26555
26171
|
if (!version) return null;
|
|
26556
|
-
if (!(/^\d+\.\d+$/.test(version) || (
|
|
26172
|
+
if (!(/^\d+\.\d+$/.test(version) || normalizeRange(version))) return null;
|
|
26557
26173
|
if (version.split(".").length - 1 === 1) version = `${version}.x`;
|
|
26558
26174
|
return version;
|
|
26559
26175
|
};
|
|
@@ -26589,10 +26205,10 @@ const formatUploadProgress = (completed, total, skipped = 0) => {
|
|
|
26589
26205
|
return `Uploading ${total === 0 ? 100 : Math.round(completed / total * 100)}% (${completed}/${total}${skipped > 0 ? `, skipped ${skipped}` : ""})`;
|
|
26590
26206
|
};
|
|
26591
26207
|
const areTargetAppVersionsPatchCompatible = (a, b) => {
|
|
26592
|
-
const aRange = (
|
|
26593
|
-
const bRange = (
|
|
26208
|
+
const aRange = normalizeRange(a);
|
|
26209
|
+
const bRange = normalizeRange(b);
|
|
26594
26210
|
if (!aRange || !bRange) return false;
|
|
26595
|
-
return (
|
|
26211
|
+
return rangesIntersect(aRange, bRange);
|
|
26596
26212
|
};
|
|
26597
26213
|
const getPatchBaseBundles = async ({ bundleId, channel, databasePlugin, maxBaseBundles, platform, target }) => {
|
|
26598
26214
|
const baseWhere = {
|
|
@@ -26756,7 +26372,7 @@ const getMultiPlatformDeploymentContext = async ({ channel, options, platforms,
|
|
|
26756
26372
|
`Rollout: ${rolloutPercentage}%`
|
|
26757
26373
|
];
|
|
26758
26374
|
if (config.updateStrategy === "fingerprint") lines.push("Fingerprint: per-platform");
|
|
26759
|
-
else if (options.targetAppVersion) lines.push(`Target app version: ${(
|
|
26375
|
+
else if (options.targetAppVersion) lines.push(`Target app version: ${normalizeRange(options.targetAppVersion)}`);
|
|
26760
26376
|
return lines.join("\n");
|
|
26761
26377
|
};
|
|
26762
26378
|
const deployPlatform = async ({ options, platform, platformIndex, platformCount }) => {
|
|
@@ -26838,7 +26454,7 @@ const deployPlatform = async ({ options, platform, platformIndex, platformCount
|
|
|
26838
26454
|
placeholder: defaultTargetAppVersion ?? "1.0.0",
|
|
26839
26455
|
initialValue: defaultTargetAppVersion ?? "1.0.0",
|
|
26840
26456
|
validate: (value) => {
|
|
26841
|
-
if (!
|
|
26457
|
+
if (!value || !normalizeRange(value)) return "Invalid semver format (e.g. 1.0.0, 1.x.x)";
|
|
26842
26458
|
}
|
|
26843
26459
|
}) : defaultTargetAppVersion);
|
|
26844
26460
|
if (p.isCancel(targetAppVersion)) return null;
|
|
@@ -26872,7 +26488,7 @@ const deployPlatform = async ({ options, platform, platformIndex, platformCount
|
|
|
26872
26488
|
`Platform: ${platformName}`,
|
|
26873
26489
|
`Channel: ${channel}`,
|
|
26874
26490
|
`Rollout: ${rolloutPercentage}%`,
|
|
26875
|
-
config.updateStrategy === "fingerprint" ? `Fingerprint: ${target.fingerprintHash}` : `Target app version: ${
|
|
26491
|
+
config.updateStrategy === "fingerprint" ? `Fingerprint: ${target.fingerprintHash}` : `Target app version: ${target.appVersion && normalizeRange(target.appVersion)}`
|
|
26876
26492
|
].join("\n");
|
|
26877
26493
|
const deploymentTitle = multiPlatform ? `Deployment (${platformName} ${platformIndex + 1}/${platformCount})` : "Deployment";
|
|
26878
26494
|
if (multiPlatform) p.log.step(`${deploymentTitle} • ${channel}`);
|
|
@@ -28318,577 +27934,7 @@ const handleSetChannel = async (channel) => {
|
|
|
28318
27934
|
p.log.warn("Rebuild native app after changing channel.");
|
|
28319
27935
|
};
|
|
28320
27936
|
//#endregion
|
|
28321
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
|
|
28322
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28323
|
-
const SemVer = require_semver$1();
|
|
28324
|
-
const parse = (version, options, throwErrors = false) => {
|
|
28325
|
-
if (version instanceof SemVer) return version;
|
|
28326
|
-
try {
|
|
28327
|
-
return new SemVer(version, options);
|
|
28328
|
-
} catch (er) {
|
|
28329
|
-
if (!throwErrors) return null;
|
|
28330
|
-
throw er;
|
|
28331
|
-
}
|
|
28332
|
-
};
|
|
28333
|
-
module.exports = parse;
|
|
28334
|
-
}));
|
|
28335
|
-
//#endregion
|
|
28336
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
|
|
28337
|
-
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28338
|
-
const parse = require_parse();
|
|
28339
|
-
const valid = (version, options) => {
|
|
28340
|
-
const v = parse(version, options);
|
|
28341
|
-
return v ? v.version : null;
|
|
28342
|
-
};
|
|
28343
|
-
module.exports = valid;
|
|
28344
|
-
}));
|
|
28345
|
-
//#endregion
|
|
28346
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
|
|
28347
|
-
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28348
|
-
const parse = require_parse();
|
|
28349
|
-
const clean = (version, options) => {
|
|
28350
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
28351
|
-
return s ? s.version : null;
|
|
28352
|
-
};
|
|
28353
|
-
module.exports = clean;
|
|
28354
|
-
}));
|
|
28355
|
-
//#endregion
|
|
28356
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
|
|
28357
|
-
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28358
|
-
const SemVer = require_semver$1();
|
|
28359
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
28360
|
-
if (typeof options === "string") {
|
|
28361
|
-
identifierBase = identifier;
|
|
28362
|
-
identifier = options;
|
|
28363
|
-
options = void 0;
|
|
28364
|
-
}
|
|
28365
|
-
try {
|
|
28366
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
28367
|
-
} catch (er) {
|
|
28368
|
-
return null;
|
|
28369
|
-
}
|
|
28370
|
-
};
|
|
28371
|
-
module.exports = inc;
|
|
28372
|
-
}));
|
|
28373
|
-
//#endregion
|
|
28374
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
|
|
28375
|
-
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28376
|
-
const parse = require_parse();
|
|
28377
|
-
const diff = (version1, version2) => {
|
|
28378
|
-
const v1 = parse(version1, null, true);
|
|
28379
|
-
const v2 = parse(version2, null, true);
|
|
28380
|
-
const comparison = v1.compare(v2);
|
|
28381
|
-
if (comparison === 0) return null;
|
|
28382
|
-
const v1Higher = comparison > 0;
|
|
28383
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
28384
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
28385
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
28386
|
-
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
28387
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
28388
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
28389
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
28390
|
-
return "patch";
|
|
28391
|
-
}
|
|
28392
|
-
}
|
|
28393
|
-
const prefix = highHasPre ? "pre" : "";
|
|
28394
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
28395
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
28396
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
28397
|
-
return "prerelease";
|
|
28398
|
-
};
|
|
28399
|
-
module.exports = diff;
|
|
28400
|
-
}));
|
|
28401
|
-
//#endregion
|
|
28402
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
|
|
28403
|
-
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28404
|
-
const SemVer = require_semver$1();
|
|
28405
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
28406
|
-
module.exports = major;
|
|
28407
|
-
}));
|
|
28408
|
-
//#endregion
|
|
28409
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
|
|
28410
|
-
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28411
|
-
const SemVer = require_semver$1();
|
|
28412
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
28413
|
-
module.exports = minor;
|
|
28414
|
-
}));
|
|
28415
|
-
//#endregion
|
|
28416
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
|
|
28417
|
-
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28418
|
-
const SemVer = require_semver$1();
|
|
28419
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
28420
|
-
module.exports = patch;
|
|
28421
|
-
}));
|
|
28422
|
-
//#endregion
|
|
28423
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
|
|
28424
|
-
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28425
|
-
const parse = require_parse();
|
|
28426
|
-
const prerelease = (version, options) => {
|
|
28427
|
-
const parsed = parse(version, options);
|
|
28428
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
28429
|
-
};
|
|
28430
|
-
module.exports = prerelease;
|
|
28431
|
-
}));
|
|
28432
|
-
//#endregion
|
|
28433
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
|
|
28434
|
-
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28435
|
-
const compare = require_compare();
|
|
28436
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
28437
|
-
module.exports = rcompare;
|
|
28438
|
-
}));
|
|
28439
|
-
//#endregion
|
|
28440
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
|
|
28441
|
-
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28442
|
-
const compare = require_compare();
|
|
28443
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
28444
|
-
module.exports = compareLoose;
|
|
28445
|
-
}));
|
|
28446
|
-
//#endregion
|
|
28447
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
|
|
28448
|
-
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28449
|
-
const SemVer = require_semver$1();
|
|
28450
|
-
const compareBuild = (a, b, loose) => {
|
|
28451
|
-
const versionA = new SemVer(a, loose);
|
|
28452
|
-
const versionB = new SemVer(b, loose);
|
|
28453
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
28454
|
-
};
|
|
28455
|
-
module.exports = compareBuild;
|
|
28456
|
-
}));
|
|
28457
|
-
//#endregion
|
|
28458
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
|
|
28459
|
-
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28460
|
-
const compareBuild = require_compare_build();
|
|
28461
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
28462
|
-
module.exports = sort;
|
|
28463
|
-
}));
|
|
28464
|
-
//#endregion
|
|
28465
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
|
|
28466
|
-
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28467
|
-
const compareBuild = require_compare_build();
|
|
28468
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
28469
|
-
module.exports = rsort;
|
|
28470
|
-
}));
|
|
28471
|
-
//#endregion
|
|
28472
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
|
|
28473
|
-
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28474
|
-
const SemVer = require_semver$1();
|
|
28475
|
-
const parse = require_parse();
|
|
28476
|
-
const { safeRe: re, t } = require_re();
|
|
28477
|
-
const coerce = (version, options) => {
|
|
28478
|
-
if (version instanceof SemVer) return version;
|
|
28479
|
-
if (typeof version === "number") version = String(version);
|
|
28480
|
-
if (typeof version !== "string") return null;
|
|
28481
|
-
options = options || {};
|
|
28482
|
-
let match = null;
|
|
28483
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
28484
|
-
else {
|
|
28485
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
28486
|
-
let next;
|
|
28487
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
28488
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
28489
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
28490
|
-
}
|
|
28491
|
-
coerceRtlRegex.lastIndex = -1;
|
|
28492
|
-
}
|
|
28493
|
-
if (match === null) return null;
|
|
28494
|
-
const major = match[2];
|
|
28495
|
-
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
28496
|
-
};
|
|
28497
|
-
module.exports = coerce;
|
|
28498
|
-
}));
|
|
28499
|
-
//#endregion
|
|
28500
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
|
|
28501
|
-
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28502
|
-
const parse = require_parse();
|
|
28503
|
-
const constants = require_constants$1();
|
|
28504
|
-
const SemVer = require_semver$1();
|
|
28505
|
-
const truncate = (version, truncation, options) => {
|
|
28506
|
-
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
28507
|
-
const clonedVersion = cloneInputVersion(version, options);
|
|
28508
|
-
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
28509
|
-
};
|
|
28510
|
-
const cloneInputVersion = (version, options) => {
|
|
28511
|
-
return parse(version instanceof SemVer ? version.version : version, options);
|
|
28512
|
-
};
|
|
28513
|
-
const doTruncation = (version, truncation) => {
|
|
28514
|
-
if (isPrerelease(truncation)) return version.version;
|
|
28515
|
-
version.prerelease = [];
|
|
28516
|
-
switch (truncation) {
|
|
28517
|
-
case "major":
|
|
28518
|
-
version.minor = 0;
|
|
28519
|
-
version.patch = 0;
|
|
28520
|
-
break;
|
|
28521
|
-
case "minor":
|
|
28522
|
-
version.patch = 0;
|
|
28523
|
-
break;
|
|
28524
|
-
}
|
|
28525
|
-
return version.format();
|
|
28526
|
-
};
|
|
28527
|
-
const isPrerelease = (type) => {
|
|
28528
|
-
return type.startsWith("pre");
|
|
28529
|
-
};
|
|
28530
|
-
module.exports = truncate;
|
|
28531
|
-
}));
|
|
28532
|
-
//#endregion
|
|
28533
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
|
|
28534
|
-
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28535
|
-
const Range = require_range();
|
|
28536
|
-
const satisfies = (version, range, options) => {
|
|
28537
|
-
try {
|
|
28538
|
-
range = new Range(range, options);
|
|
28539
|
-
} catch (er) {
|
|
28540
|
-
return false;
|
|
28541
|
-
}
|
|
28542
|
-
return range.test(version);
|
|
28543
|
-
};
|
|
28544
|
-
module.exports = satisfies;
|
|
28545
|
-
}));
|
|
28546
|
-
//#endregion
|
|
28547
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
|
|
28548
|
-
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28549
|
-
const Range = require_range();
|
|
28550
|
-
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
28551
|
-
module.exports = toComparators;
|
|
28552
|
-
}));
|
|
28553
|
-
//#endregion
|
|
28554
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
|
|
28555
|
-
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28556
|
-
const SemVer = require_semver$1();
|
|
28557
|
-
const Range = require_range();
|
|
28558
|
-
const maxSatisfying = (versions, range, options) => {
|
|
28559
|
-
let max = null;
|
|
28560
|
-
let maxSV = null;
|
|
28561
|
-
let rangeObj = null;
|
|
28562
|
-
try {
|
|
28563
|
-
rangeObj = new Range(range, options);
|
|
28564
|
-
} catch (er) {
|
|
28565
|
-
return null;
|
|
28566
|
-
}
|
|
28567
|
-
versions.forEach((v) => {
|
|
28568
|
-
if (rangeObj.test(v)) {
|
|
28569
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
28570
|
-
max = v;
|
|
28571
|
-
maxSV = new SemVer(max, options);
|
|
28572
|
-
}
|
|
28573
|
-
}
|
|
28574
|
-
});
|
|
28575
|
-
return max;
|
|
28576
|
-
};
|
|
28577
|
-
module.exports = maxSatisfying;
|
|
28578
|
-
}));
|
|
28579
|
-
//#endregion
|
|
28580
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
|
|
28581
|
-
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28582
|
-
const SemVer = require_semver$1();
|
|
28583
|
-
const Range = require_range();
|
|
28584
|
-
const minSatisfying = (versions, range, options) => {
|
|
28585
|
-
let min = null;
|
|
28586
|
-
let minSV = null;
|
|
28587
|
-
let rangeObj = null;
|
|
28588
|
-
try {
|
|
28589
|
-
rangeObj = new Range(range, options);
|
|
28590
|
-
} catch (er) {
|
|
28591
|
-
return null;
|
|
28592
|
-
}
|
|
28593
|
-
versions.forEach((v) => {
|
|
28594
|
-
if (rangeObj.test(v)) {
|
|
28595
|
-
if (!min || minSV.compare(v) === 1) {
|
|
28596
|
-
min = v;
|
|
28597
|
-
minSV = new SemVer(min, options);
|
|
28598
|
-
}
|
|
28599
|
-
}
|
|
28600
|
-
});
|
|
28601
|
-
return min;
|
|
28602
|
-
};
|
|
28603
|
-
module.exports = minSatisfying;
|
|
28604
|
-
}));
|
|
28605
|
-
//#endregion
|
|
28606
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js
|
|
28607
|
-
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28608
|
-
const SemVer = require_semver$1();
|
|
28609
|
-
const Range = require_range();
|
|
28610
|
-
const gt = require_gt();
|
|
28611
|
-
const minVersion = (range, loose) => {
|
|
28612
|
-
range = new Range(range, loose);
|
|
28613
|
-
let minver = new SemVer("0.0.0");
|
|
28614
|
-
if (range.test(minver)) return minver;
|
|
28615
|
-
minver = new SemVer("0.0.0-0");
|
|
28616
|
-
if (range.test(minver)) return minver;
|
|
28617
|
-
minver = null;
|
|
28618
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
28619
|
-
const comparators = range.set[i];
|
|
28620
|
-
let setMin = null;
|
|
28621
|
-
comparators.forEach((comparator) => {
|
|
28622
|
-
const compver = new SemVer(comparator.semver.version);
|
|
28623
|
-
switch (comparator.operator) {
|
|
28624
|
-
case ">":
|
|
28625
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
28626
|
-
else compver.prerelease.push(0);
|
|
28627
|
-
compver.raw = compver.format();
|
|
28628
|
-
case "":
|
|
28629
|
-
case ">=":
|
|
28630
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
28631
|
-
break;
|
|
28632
|
-
case "<":
|
|
28633
|
-
case "<=": break;
|
|
28634
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
28635
|
-
}
|
|
28636
|
-
});
|
|
28637
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
28638
|
-
}
|
|
28639
|
-
if (minver && range.test(minver)) return minver;
|
|
28640
|
-
return null;
|
|
28641
|
-
};
|
|
28642
|
-
module.exports = minVersion;
|
|
28643
|
-
}));
|
|
28644
|
-
//#endregion
|
|
28645
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js
|
|
28646
|
-
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28647
|
-
const SemVer = require_semver$1();
|
|
28648
|
-
const Comparator = require_comparator();
|
|
28649
|
-
const { ANY } = Comparator;
|
|
28650
|
-
const Range = require_range();
|
|
28651
|
-
const satisfies = require_satisfies();
|
|
28652
|
-
const gt = require_gt();
|
|
28653
|
-
const lt = require_lt();
|
|
28654
|
-
const lte = require_lte();
|
|
28655
|
-
const gte = require_gte();
|
|
28656
|
-
const outside = (version, range, hilo, options) => {
|
|
28657
|
-
version = new SemVer(version, options);
|
|
28658
|
-
range = new Range(range, options);
|
|
28659
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
28660
|
-
switch (hilo) {
|
|
28661
|
-
case ">":
|
|
28662
|
-
gtfn = gt;
|
|
28663
|
-
ltefn = lte;
|
|
28664
|
-
ltfn = lt;
|
|
28665
|
-
comp = ">";
|
|
28666
|
-
ecomp = ">=";
|
|
28667
|
-
break;
|
|
28668
|
-
case "<":
|
|
28669
|
-
gtfn = lt;
|
|
28670
|
-
ltefn = gte;
|
|
28671
|
-
ltfn = gt;
|
|
28672
|
-
comp = "<";
|
|
28673
|
-
ecomp = "<=";
|
|
28674
|
-
break;
|
|
28675
|
-
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
28676
|
-
}
|
|
28677
|
-
if (satisfies(version, range, options)) return false;
|
|
28678
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
28679
|
-
const comparators = range.set[i];
|
|
28680
|
-
let high = null;
|
|
28681
|
-
let low = null;
|
|
28682
|
-
comparators.forEach((comparator) => {
|
|
28683
|
-
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
28684
|
-
high = high || comparator;
|
|
28685
|
-
low = low || comparator;
|
|
28686
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
28687
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
28688
|
-
});
|
|
28689
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
28690
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
28691
|
-
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
28692
|
-
}
|
|
28693
|
-
return true;
|
|
28694
|
-
};
|
|
28695
|
-
module.exports = outside;
|
|
28696
|
-
}));
|
|
28697
|
-
//#endregion
|
|
28698
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
|
|
28699
|
-
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28700
|
-
const outside = require_outside();
|
|
28701
|
-
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
28702
|
-
module.exports = gtr;
|
|
28703
|
-
}));
|
|
28704
|
-
//#endregion
|
|
28705
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
|
|
28706
|
-
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28707
|
-
const outside = require_outside();
|
|
28708
|
-
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
28709
|
-
module.exports = ltr;
|
|
28710
|
-
}));
|
|
28711
|
-
//#endregion
|
|
28712
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
|
|
28713
|
-
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28714
|
-
const satisfies = require_satisfies();
|
|
28715
|
-
const compare = require_compare();
|
|
28716
|
-
module.exports = (versions, range, options) => {
|
|
28717
|
-
const set = [];
|
|
28718
|
-
let first = null;
|
|
28719
|
-
let prev = null;
|
|
28720
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
28721
|
-
for (const version of v) if (satisfies(version, range, options)) {
|
|
28722
|
-
prev = version;
|
|
28723
|
-
if (!first) first = version;
|
|
28724
|
-
} else {
|
|
28725
|
-
if (prev) set.push([first, prev]);
|
|
28726
|
-
prev = null;
|
|
28727
|
-
first = null;
|
|
28728
|
-
}
|
|
28729
|
-
if (first) set.push([first, null]);
|
|
28730
|
-
const ranges = [];
|
|
28731
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
28732
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
28733
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
28734
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
28735
|
-
else ranges.push(`${min} - ${max}`);
|
|
28736
|
-
const simplified = ranges.join(" || ");
|
|
28737
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
28738
|
-
return simplified.length < original.length ? simplified : range;
|
|
28739
|
-
};
|
|
28740
|
-
}));
|
|
28741
|
-
//#endregion
|
|
28742
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
|
|
28743
|
-
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28744
|
-
const Range = require_range();
|
|
28745
|
-
const Comparator = require_comparator();
|
|
28746
|
-
const { ANY } = Comparator;
|
|
28747
|
-
const satisfies = require_satisfies();
|
|
28748
|
-
const compare = require_compare();
|
|
28749
|
-
const subset = (sub, dom, options = {}) => {
|
|
28750
|
-
if (sub === dom) return true;
|
|
28751
|
-
sub = new Range(sub, options);
|
|
28752
|
-
dom = new Range(dom, options);
|
|
28753
|
-
let sawNonNull = false;
|
|
28754
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
28755
|
-
for (const simpleDom of dom.set) {
|
|
28756
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
28757
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
28758
|
-
if (isSub) continue OUTER;
|
|
28759
|
-
}
|
|
28760
|
-
if (sawNonNull) return false;
|
|
28761
|
-
}
|
|
28762
|
-
return true;
|
|
28763
|
-
};
|
|
28764
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
28765
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
28766
|
-
const simpleSubset = (sub, dom, options) => {
|
|
28767
|
-
if (sub === dom) return true;
|
|
28768
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
28769
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
28770
|
-
else sub = minimumVersion;
|
|
28771
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
28772
|
-
else dom = minimumVersion;
|
|
28773
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
28774
|
-
let gt, lt;
|
|
28775
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
28776
|
-
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
28777
|
-
else eqSet.add(c.semver);
|
|
28778
|
-
if (eqSet.size > 1) return null;
|
|
28779
|
-
let gtltComp;
|
|
28780
|
-
if (gt && lt) {
|
|
28781
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
28782
|
-
if (gtltComp > 0) return null;
|
|
28783
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
28784
|
-
}
|
|
28785
|
-
for (const eq of eqSet) {
|
|
28786
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
28787
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
28788
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
28789
|
-
return true;
|
|
28790
|
-
}
|
|
28791
|
-
let higher, lower;
|
|
28792
|
-
let hasDomLT, hasDomGT;
|
|
28793
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
28794
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
28795
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
28796
|
-
for (const c of dom) {
|
|
28797
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
28798
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
28799
|
-
if (gt) {
|
|
28800
|
-
if (needDomGTPre) {
|
|
28801
|
-
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;
|
|
28802
|
-
}
|
|
28803
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
28804
|
-
higher = higherGT(gt, c, options);
|
|
28805
|
-
if (higher === c && higher !== gt) return false;
|
|
28806
|
-
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
28807
|
-
}
|
|
28808
|
-
if (lt) {
|
|
28809
|
-
if (needDomLTPre) {
|
|
28810
|
-
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;
|
|
28811
|
-
}
|
|
28812
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
28813
|
-
lower = lowerLT(lt, c, options);
|
|
28814
|
-
if (lower === c && lower !== lt) return false;
|
|
28815
|
-
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
28816
|
-
}
|
|
28817
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
28818
|
-
}
|
|
28819
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
28820
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
28821
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
28822
|
-
return true;
|
|
28823
|
-
};
|
|
28824
|
-
const higherGT = (a, b, options) => {
|
|
28825
|
-
if (!a) return b;
|
|
28826
|
-
const comp = compare(a.semver, b.semver, options);
|
|
28827
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
28828
|
-
};
|
|
28829
|
-
const lowerLT = (a, b, options) => {
|
|
28830
|
-
if (!a) return b;
|
|
28831
|
-
const comp = compare(a.semver, b.semver, options);
|
|
28832
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
28833
|
-
};
|
|
28834
|
-
module.exports = subset;
|
|
28835
|
-
}));
|
|
28836
|
-
//#endregion
|
|
28837
27937
|
//#region src/commands/doctorInfrastructureTargets.ts
|
|
28838
|
-
var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28839
|
-
const internalRe = require_re();
|
|
28840
|
-
const constants = require_constants$1();
|
|
28841
|
-
const SemVer = require_semver$1();
|
|
28842
|
-
const identifiers = require_identifiers();
|
|
28843
|
-
module.exports = {
|
|
28844
|
-
parse: require_parse(),
|
|
28845
|
-
valid: require_valid(),
|
|
28846
|
-
clean: require_clean(),
|
|
28847
|
-
inc: require_inc(),
|
|
28848
|
-
diff: require_diff(),
|
|
28849
|
-
major: require_major(),
|
|
28850
|
-
minor: require_minor(),
|
|
28851
|
-
patch: require_patch(),
|
|
28852
|
-
prerelease: require_prerelease(),
|
|
28853
|
-
compare: require_compare(),
|
|
28854
|
-
rcompare: require_rcompare(),
|
|
28855
|
-
compareLoose: require_compare_loose(),
|
|
28856
|
-
compareBuild: require_compare_build(),
|
|
28857
|
-
sort: require_sort(),
|
|
28858
|
-
rsort: require_rsort(),
|
|
28859
|
-
gt: require_gt(),
|
|
28860
|
-
lt: require_lt(),
|
|
28861
|
-
eq: require_eq(),
|
|
28862
|
-
neq: require_neq(),
|
|
28863
|
-
gte: require_gte(),
|
|
28864
|
-
lte: require_lte(),
|
|
28865
|
-
cmp: require_cmp(),
|
|
28866
|
-
coerce: require_coerce(),
|
|
28867
|
-
truncate: require_truncate(),
|
|
28868
|
-
Comparator: require_comparator(),
|
|
28869
|
-
Range: require_range(),
|
|
28870
|
-
satisfies: require_satisfies(),
|
|
28871
|
-
toComparators: require_to_comparators(),
|
|
28872
|
-
maxSatisfying: require_max_satisfying(),
|
|
28873
|
-
minSatisfying: require_min_satisfying(),
|
|
28874
|
-
minVersion: require_min_version(),
|
|
28875
|
-
validRange: require_valid$1(),
|
|
28876
|
-
outside: require_outside(),
|
|
28877
|
-
gtr: require_gtr(),
|
|
28878
|
-
ltr: require_ltr(),
|
|
28879
|
-
intersects: require_intersects(),
|
|
28880
|
-
simplifyRange: require_simplify(),
|
|
28881
|
-
subset: require_subset(),
|
|
28882
|
-
SemVer,
|
|
28883
|
-
re: internalRe.re,
|
|
28884
|
-
src: internalRe.src,
|
|
28885
|
-
tokens: internalRe.t,
|
|
28886
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
28887
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
28888
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
28889
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
28890
|
-
};
|
|
28891
|
-
})))(), 1);
|
|
28892
27938
|
const UPDATE_TARGETS = [
|
|
28893
27939
|
{
|
|
28894
27940
|
version: "0.13.0",
|
|
@@ -28936,10 +27982,10 @@ const getLatestKnownTargetVersion = () => {
|
|
|
28936
27982
|
}).version;
|
|
28937
27983
|
};
|
|
28938
27984
|
const getRequiredTarget = ({ hotUpdaterVersion, targets }) => {
|
|
28939
|
-
const current =
|
|
27985
|
+
const current = coerce(hotUpdaterVersion);
|
|
28940
27986
|
if (!current) return null;
|
|
28941
27987
|
let requiredTarget = null;
|
|
28942
|
-
for (const target of targets) if (
|
|
27988
|
+
for (const target of targets) if (isLessOrEqual(target.version, current)) requiredTarget = target;
|
|
28943
27989
|
return requiredTarget ?? getTargetAt({
|
|
28944
27990
|
index: 0,
|
|
28945
27991
|
label: "UPDATE_TARGETS",
|
|
@@ -28964,10 +28010,10 @@ function getRequiredUpdateTarget(hotUpdaterVersion = getLatestKnownTargetVersion
|
|
|
28964
28010
|
});
|
|
28965
28011
|
}
|
|
28966
28012
|
function isInfrastructureUpdateRequired({ serverVersion, requiredVersion = getRequiredInfrastructureVersion() }) {
|
|
28967
|
-
const normalizedServerVersion =
|
|
28968
|
-
const normalizedRequiredVersion =
|
|
28013
|
+
const normalizedServerVersion = normalize(serverVersion);
|
|
28014
|
+
const normalizedRequiredVersion = normalize(requiredVersion);
|
|
28969
28015
|
if (!normalizedServerVersion || !normalizedRequiredVersion) throw new Error("Invalid infrastructure version");
|
|
28970
|
-
return
|
|
28016
|
+
return isLess(normalizedServerVersion, normalizedRequiredVersion);
|
|
28971
28017
|
}
|
|
28972
28018
|
//#endregion
|
|
28973
28019
|
//#region src/commands/doctorInfrastructure.ts
|
|
@@ -29053,12 +28099,16 @@ const REMOVE_PUBLIC_KEY_COMMANDS = ["npx hot-updater keys remove"];
|
|
|
29053
28099
|
*/
|
|
29054
28100
|
function areVersionsCompatible(versionA, versionB) {
|
|
29055
28101
|
if (versionA === versionB) return true;
|
|
29056
|
-
const
|
|
29057
|
-
const
|
|
29058
|
-
|
|
28102
|
+
const normalizedRangeA = normalizeRange(versionA);
|
|
28103
|
+
const normalizedRangeB = normalizeRange(versionB);
|
|
28104
|
+
const comparableVersionA = normalizedRangeA ? findMinimumForRange(normalizedRangeA) : null;
|
|
28105
|
+
const comparableVersionB = normalizedRangeB ? findMinimumForRange(normalizedRangeB) : null;
|
|
28106
|
+
const parsedVersionA = comparableVersionA ? parse(comparableVersionA) : null;
|
|
28107
|
+
const parsedVersionB = comparableVersionB ? parse(comparableVersionB) : null;
|
|
28108
|
+
if (parsedVersionA && parsedVersionB && (parsedVersionA.prerelease?.length ?? 0) === 0 && (parsedVersionB.prerelease?.length ?? 0) === 0 && parsedVersionA.major === parsedVersionB.major && parsedVersionA.minor === parsedVersionB.minor) return true;
|
|
29059
28109
|
const options = { includePrerelease: true };
|
|
29060
|
-
if (
|
|
29061
|
-
if (
|
|
28110
|
+
if (normalize(versionA) && normalizedRangeB && satisfies(versionA, normalizedRangeB, options)) return true;
|
|
28111
|
+
if (normalize(versionB) && normalizedRangeA && satisfies(versionB, normalizedRangeA, options)) return true;
|
|
29062
28112
|
return false;
|
|
29063
28113
|
}
|
|
29064
28114
|
const toRelativePath = (cwd, filePath) => path.relative(cwd, filePath);
|
|
@@ -51501,7 +50551,7 @@ keysCommand.command("generate").description("Generate RSA key pair for code sign
|
|
|
51501
50551
|
keysCommand.command("export-public").description("Export public key for native configuration").option("-i, --input <path>", "path to private key file (default: from config signing.privateKeyPath in hot-updater.config.ts)").option("-p, --print-only", "only print the public key without writing to native files").option("-y, --yes", "skip confirmation prompt when writing to native files").action(keysExportPublic);
|
|
51502
50552
|
keysCommand.command("remove").description("Remove public keys from native configuration files").option("-y, --yes", "skip confirmation prompt").action(keysRemove);
|
|
51503
50553
|
program.command("deploy").description("deploy a new version").addOption(platformCommandOption).addOption(new Option("-t, --target-app-version <targetAppVersion>", "specify the target app version (semver format e.g. 1.0.0, 1.x.x)").argParser((value) => {
|
|
51504
|
-
if (!(
|
|
50554
|
+
if (!normalizeRange(value)) {
|
|
51505
50555
|
p.log.error("Invalid semver format (e.g. 1.0.0, 1.x.x)");
|
|
51506
50556
|
process.exit(1);
|
|
51507
50557
|
}
|