uloop-cli 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.bundle.cjs +2091 -65
- package/dist/cli.bundle.cjs.map +4 -4
- package/package.json +4 -2
- package/src/default-tools.json +1 -1
- package/src/execute-tool.ts +52 -1
- package/src/skills/skills-command.ts +103 -36
- package/src/skills/skills-manager.ts +41 -30
- package/src/skills/target-config.ts +34 -0
- package/src/version.ts +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -3452,6 +3452,1936 @@ var require_commander = __commonJS({
|
|
|
3452
3452
|
}
|
|
3453
3453
|
});
|
|
3454
3454
|
|
|
3455
|
+
// node_modules/semver/internal/constants.js
|
|
3456
|
+
var require_constants = __commonJS({
|
|
3457
|
+
"node_modules/semver/internal/constants.js"(exports2, module2) {
|
|
3458
|
+
"use strict";
|
|
3459
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
3460
|
+
var MAX_LENGTH = 256;
|
|
3461
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3462
|
+
9007199254740991;
|
|
3463
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
3464
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
3465
|
+
var RELEASE_TYPES = [
|
|
3466
|
+
"major",
|
|
3467
|
+
"premajor",
|
|
3468
|
+
"minor",
|
|
3469
|
+
"preminor",
|
|
3470
|
+
"patch",
|
|
3471
|
+
"prepatch",
|
|
3472
|
+
"prerelease"
|
|
3473
|
+
];
|
|
3474
|
+
module2.exports = {
|
|
3475
|
+
MAX_LENGTH,
|
|
3476
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
3477
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
3478
|
+
MAX_SAFE_INTEGER,
|
|
3479
|
+
RELEASE_TYPES,
|
|
3480
|
+
SEMVER_SPEC_VERSION,
|
|
3481
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
3482
|
+
FLAG_LOOSE: 2
|
|
3483
|
+
};
|
|
3484
|
+
}
|
|
3485
|
+
});
|
|
3486
|
+
|
|
3487
|
+
// node_modules/semver/internal/debug.js
|
|
3488
|
+
var require_debug = __commonJS({
|
|
3489
|
+
"node_modules/semver/internal/debug.js"(exports2, module2) {
|
|
3490
|
+
"use strict";
|
|
3491
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
3492
|
+
};
|
|
3493
|
+
module2.exports = debug;
|
|
3494
|
+
}
|
|
3495
|
+
});
|
|
3496
|
+
|
|
3497
|
+
// node_modules/semver/internal/re.js
|
|
3498
|
+
var require_re = __commonJS({
|
|
3499
|
+
"node_modules/semver/internal/re.js"(exports2, module2) {
|
|
3500
|
+
"use strict";
|
|
3501
|
+
var {
|
|
3502
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
3503
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
3504
|
+
MAX_LENGTH
|
|
3505
|
+
} = require_constants();
|
|
3506
|
+
var debug = require_debug();
|
|
3507
|
+
exports2 = module2.exports = {};
|
|
3508
|
+
var re = exports2.re = [];
|
|
3509
|
+
var safeRe = exports2.safeRe = [];
|
|
3510
|
+
var src = exports2.src = [];
|
|
3511
|
+
var safeSrc = exports2.safeSrc = [];
|
|
3512
|
+
var t = exports2.t = {};
|
|
3513
|
+
var R = 0;
|
|
3514
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
3515
|
+
var safeRegexReplacements = [
|
|
3516
|
+
["\\s", 1],
|
|
3517
|
+
["\\d", MAX_LENGTH],
|
|
3518
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
3519
|
+
];
|
|
3520
|
+
var makeSafeRegex = (value) => {
|
|
3521
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
3522
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
3523
|
+
}
|
|
3524
|
+
return value;
|
|
3525
|
+
};
|
|
3526
|
+
var createToken = (name, value, isGlobal) => {
|
|
3527
|
+
const safe = makeSafeRegex(value);
|
|
3528
|
+
const index = R++;
|
|
3529
|
+
debug(name, index, value);
|
|
3530
|
+
t[name] = index;
|
|
3531
|
+
src[index] = value;
|
|
3532
|
+
safeSrc[index] = safe;
|
|
3533
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
3534
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
3535
|
+
};
|
|
3536
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
3537
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
3538
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
3539
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
3540
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
3541
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
3542
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
3543
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
3544
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
3545
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
3546
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
3547
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
3548
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
3549
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
3550
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
3551
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
3552
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
3553
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
3554
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
3555
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
3556
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
3557
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
3558
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
3559
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
3560
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
3561
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
3562
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
3563
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
3564
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
3565
|
+
exports2.tildeTrimReplace = "$1~";
|
|
3566
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
3567
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
3568
|
+
createToken("LONECARET", "(?:\\^)");
|
|
3569
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
3570
|
+
exports2.caretTrimReplace = "$1^";
|
|
3571
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
3572
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
3573
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
3574
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
3575
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
3576
|
+
exports2.comparatorTrimReplace = "$1$2$3";
|
|
3577
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
3578
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
3579
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
3580
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
3581
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
3582
|
+
}
|
|
3583
|
+
});
|
|
3584
|
+
|
|
3585
|
+
// node_modules/semver/internal/parse-options.js
|
|
3586
|
+
var require_parse_options = __commonJS({
|
|
3587
|
+
"node_modules/semver/internal/parse-options.js"(exports2, module2) {
|
|
3588
|
+
"use strict";
|
|
3589
|
+
var looseOption = Object.freeze({ loose: true });
|
|
3590
|
+
var emptyOpts = Object.freeze({});
|
|
3591
|
+
var parseOptions = (options) => {
|
|
3592
|
+
if (!options) {
|
|
3593
|
+
return emptyOpts;
|
|
3594
|
+
}
|
|
3595
|
+
if (typeof options !== "object") {
|
|
3596
|
+
return looseOption;
|
|
3597
|
+
}
|
|
3598
|
+
return options;
|
|
3599
|
+
};
|
|
3600
|
+
module2.exports = parseOptions;
|
|
3601
|
+
}
|
|
3602
|
+
});
|
|
3603
|
+
|
|
3604
|
+
// node_modules/semver/internal/identifiers.js
|
|
3605
|
+
var require_identifiers = __commonJS({
|
|
3606
|
+
"node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
3607
|
+
"use strict";
|
|
3608
|
+
var numeric = /^[0-9]+$/;
|
|
3609
|
+
var compareIdentifiers = (a, b) => {
|
|
3610
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
3611
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
3612
|
+
}
|
|
3613
|
+
const anum = numeric.test(a);
|
|
3614
|
+
const bnum = numeric.test(b);
|
|
3615
|
+
if (anum && bnum) {
|
|
3616
|
+
a = +a;
|
|
3617
|
+
b = +b;
|
|
3618
|
+
}
|
|
3619
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
3620
|
+
};
|
|
3621
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
3622
|
+
module2.exports = {
|
|
3623
|
+
compareIdentifiers,
|
|
3624
|
+
rcompareIdentifiers
|
|
3625
|
+
};
|
|
3626
|
+
}
|
|
3627
|
+
});
|
|
3628
|
+
|
|
3629
|
+
// node_modules/semver/classes/semver.js
|
|
3630
|
+
var require_semver = __commonJS({
|
|
3631
|
+
"node_modules/semver/classes/semver.js"(exports2, module2) {
|
|
3632
|
+
"use strict";
|
|
3633
|
+
var debug = require_debug();
|
|
3634
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
3635
|
+
var { safeRe: re, t } = require_re();
|
|
3636
|
+
var parseOptions = require_parse_options();
|
|
3637
|
+
var { compareIdentifiers } = require_identifiers();
|
|
3638
|
+
var SemVer = class _SemVer {
|
|
3639
|
+
constructor(version, options) {
|
|
3640
|
+
options = parseOptions(options);
|
|
3641
|
+
if (version instanceof _SemVer) {
|
|
3642
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
3643
|
+
return version;
|
|
3644
|
+
} else {
|
|
3645
|
+
version = version.version;
|
|
3646
|
+
}
|
|
3647
|
+
} else if (typeof version !== "string") {
|
|
3648
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
3649
|
+
}
|
|
3650
|
+
if (version.length > MAX_LENGTH) {
|
|
3651
|
+
throw new TypeError(
|
|
3652
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
3653
|
+
);
|
|
3654
|
+
}
|
|
3655
|
+
debug("SemVer", version, options);
|
|
3656
|
+
this.options = options;
|
|
3657
|
+
this.loose = !!options.loose;
|
|
3658
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
3659
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
3660
|
+
if (!m) {
|
|
3661
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
3662
|
+
}
|
|
3663
|
+
this.raw = version;
|
|
3664
|
+
this.major = +m[1];
|
|
3665
|
+
this.minor = +m[2];
|
|
3666
|
+
this.patch = +m[3];
|
|
3667
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
3668
|
+
throw new TypeError("Invalid major version");
|
|
3669
|
+
}
|
|
3670
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
3671
|
+
throw new TypeError("Invalid minor version");
|
|
3672
|
+
}
|
|
3673
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
3674
|
+
throw new TypeError("Invalid patch version");
|
|
3675
|
+
}
|
|
3676
|
+
if (!m[4]) {
|
|
3677
|
+
this.prerelease = [];
|
|
3678
|
+
} else {
|
|
3679
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
3680
|
+
if (/^[0-9]+$/.test(id)) {
|
|
3681
|
+
const num = +id;
|
|
3682
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
3683
|
+
return num;
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
return id;
|
|
3687
|
+
});
|
|
3688
|
+
}
|
|
3689
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
3690
|
+
this.format();
|
|
3691
|
+
}
|
|
3692
|
+
format() {
|
|
3693
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
3694
|
+
if (this.prerelease.length) {
|
|
3695
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
3696
|
+
}
|
|
3697
|
+
return this.version;
|
|
3698
|
+
}
|
|
3699
|
+
toString() {
|
|
3700
|
+
return this.version;
|
|
3701
|
+
}
|
|
3702
|
+
compare(other) {
|
|
3703
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
3704
|
+
if (!(other instanceof _SemVer)) {
|
|
3705
|
+
if (typeof other === "string" && other === this.version) {
|
|
3706
|
+
return 0;
|
|
3707
|
+
}
|
|
3708
|
+
other = new _SemVer(other, this.options);
|
|
3709
|
+
}
|
|
3710
|
+
if (other.version === this.version) {
|
|
3711
|
+
return 0;
|
|
3712
|
+
}
|
|
3713
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
3714
|
+
}
|
|
3715
|
+
compareMain(other) {
|
|
3716
|
+
if (!(other instanceof _SemVer)) {
|
|
3717
|
+
other = new _SemVer(other, this.options);
|
|
3718
|
+
}
|
|
3719
|
+
if (this.major < other.major) {
|
|
3720
|
+
return -1;
|
|
3721
|
+
}
|
|
3722
|
+
if (this.major > other.major) {
|
|
3723
|
+
return 1;
|
|
3724
|
+
}
|
|
3725
|
+
if (this.minor < other.minor) {
|
|
3726
|
+
return -1;
|
|
3727
|
+
}
|
|
3728
|
+
if (this.minor > other.minor) {
|
|
3729
|
+
return 1;
|
|
3730
|
+
}
|
|
3731
|
+
if (this.patch < other.patch) {
|
|
3732
|
+
return -1;
|
|
3733
|
+
}
|
|
3734
|
+
if (this.patch > other.patch) {
|
|
3735
|
+
return 1;
|
|
3736
|
+
}
|
|
3737
|
+
return 0;
|
|
3738
|
+
}
|
|
3739
|
+
comparePre(other) {
|
|
3740
|
+
if (!(other instanceof _SemVer)) {
|
|
3741
|
+
other = new _SemVer(other, this.options);
|
|
3742
|
+
}
|
|
3743
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
3744
|
+
return -1;
|
|
3745
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
3746
|
+
return 1;
|
|
3747
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
3748
|
+
return 0;
|
|
3749
|
+
}
|
|
3750
|
+
let i = 0;
|
|
3751
|
+
do {
|
|
3752
|
+
const a = this.prerelease[i];
|
|
3753
|
+
const b = other.prerelease[i];
|
|
3754
|
+
debug("prerelease compare", i, a, b);
|
|
3755
|
+
if (a === void 0 && b === void 0) {
|
|
3756
|
+
return 0;
|
|
3757
|
+
} else if (b === void 0) {
|
|
3758
|
+
return 1;
|
|
3759
|
+
} else if (a === void 0) {
|
|
3760
|
+
return -1;
|
|
3761
|
+
} else if (a === b) {
|
|
3762
|
+
continue;
|
|
3763
|
+
} else {
|
|
3764
|
+
return compareIdentifiers(a, b);
|
|
3765
|
+
}
|
|
3766
|
+
} while (++i);
|
|
3767
|
+
}
|
|
3768
|
+
compareBuild(other) {
|
|
3769
|
+
if (!(other instanceof _SemVer)) {
|
|
3770
|
+
other = new _SemVer(other, this.options);
|
|
3771
|
+
}
|
|
3772
|
+
let i = 0;
|
|
3773
|
+
do {
|
|
3774
|
+
const a = this.build[i];
|
|
3775
|
+
const b = other.build[i];
|
|
3776
|
+
debug("build compare", i, a, b);
|
|
3777
|
+
if (a === void 0 && b === void 0) {
|
|
3778
|
+
return 0;
|
|
3779
|
+
} else if (b === void 0) {
|
|
3780
|
+
return 1;
|
|
3781
|
+
} else if (a === void 0) {
|
|
3782
|
+
return -1;
|
|
3783
|
+
} else if (a === b) {
|
|
3784
|
+
continue;
|
|
3785
|
+
} else {
|
|
3786
|
+
return compareIdentifiers(a, b);
|
|
3787
|
+
}
|
|
3788
|
+
} while (++i);
|
|
3789
|
+
}
|
|
3790
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
3791
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
3792
|
+
inc(release, identifier, identifierBase) {
|
|
3793
|
+
if (release.startsWith("pre")) {
|
|
3794
|
+
if (!identifier && identifierBase === false) {
|
|
3795
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
3796
|
+
}
|
|
3797
|
+
if (identifier) {
|
|
3798
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
3799
|
+
if (!match || match[1] !== identifier) {
|
|
3800
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
switch (release) {
|
|
3805
|
+
case "premajor":
|
|
3806
|
+
this.prerelease.length = 0;
|
|
3807
|
+
this.patch = 0;
|
|
3808
|
+
this.minor = 0;
|
|
3809
|
+
this.major++;
|
|
3810
|
+
this.inc("pre", identifier, identifierBase);
|
|
3811
|
+
break;
|
|
3812
|
+
case "preminor":
|
|
3813
|
+
this.prerelease.length = 0;
|
|
3814
|
+
this.patch = 0;
|
|
3815
|
+
this.minor++;
|
|
3816
|
+
this.inc("pre", identifier, identifierBase);
|
|
3817
|
+
break;
|
|
3818
|
+
case "prepatch":
|
|
3819
|
+
this.prerelease.length = 0;
|
|
3820
|
+
this.inc("patch", identifier, identifierBase);
|
|
3821
|
+
this.inc("pre", identifier, identifierBase);
|
|
3822
|
+
break;
|
|
3823
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
3824
|
+
// prepatch.
|
|
3825
|
+
case "prerelease":
|
|
3826
|
+
if (this.prerelease.length === 0) {
|
|
3827
|
+
this.inc("patch", identifier, identifierBase);
|
|
3828
|
+
}
|
|
3829
|
+
this.inc("pre", identifier, identifierBase);
|
|
3830
|
+
break;
|
|
3831
|
+
case "release":
|
|
3832
|
+
if (this.prerelease.length === 0) {
|
|
3833
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
3834
|
+
}
|
|
3835
|
+
this.prerelease.length = 0;
|
|
3836
|
+
break;
|
|
3837
|
+
case "major":
|
|
3838
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
3839
|
+
this.major++;
|
|
3840
|
+
}
|
|
3841
|
+
this.minor = 0;
|
|
3842
|
+
this.patch = 0;
|
|
3843
|
+
this.prerelease = [];
|
|
3844
|
+
break;
|
|
3845
|
+
case "minor":
|
|
3846
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
3847
|
+
this.minor++;
|
|
3848
|
+
}
|
|
3849
|
+
this.patch = 0;
|
|
3850
|
+
this.prerelease = [];
|
|
3851
|
+
break;
|
|
3852
|
+
case "patch":
|
|
3853
|
+
if (this.prerelease.length === 0) {
|
|
3854
|
+
this.patch++;
|
|
3855
|
+
}
|
|
3856
|
+
this.prerelease = [];
|
|
3857
|
+
break;
|
|
3858
|
+
// This probably shouldn't be used publicly.
|
|
3859
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
3860
|
+
case "pre": {
|
|
3861
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
3862
|
+
if (this.prerelease.length === 0) {
|
|
3863
|
+
this.prerelease = [base];
|
|
3864
|
+
} else {
|
|
3865
|
+
let i = this.prerelease.length;
|
|
3866
|
+
while (--i >= 0) {
|
|
3867
|
+
if (typeof this.prerelease[i] === "number") {
|
|
3868
|
+
this.prerelease[i]++;
|
|
3869
|
+
i = -2;
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
if (i === -1) {
|
|
3873
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
3874
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
3875
|
+
}
|
|
3876
|
+
this.prerelease.push(base);
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
if (identifier) {
|
|
3880
|
+
let prerelease = [identifier, base];
|
|
3881
|
+
if (identifierBase === false) {
|
|
3882
|
+
prerelease = [identifier];
|
|
3883
|
+
}
|
|
3884
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
3885
|
+
if (isNaN(this.prerelease[1])) {
|
|
3886
|
+
this.prerelease = prerelease;
|
|
3887
|
+
}
|
|
3888
|
+
} else {
|
|
3889
|
+
this.prerelease = prerelease;
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
break;
|
|
3893
|
+
}
|
|
3894
|
+
default:
|
|
3895
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
3896
|
+
}
|
|
3897
|
+
this.raw = this.format();
|
|
3898
|
+
if (this.build.length) {
|
|
3899
|
+
this.raw += `+${this.build.join(".")}`;
|
|
3900
|
+
}
|
|
3901
|
+
return this;
|
|
3902
|
+
}
|
|
3903
|
+
};
|
|
3904
|
+
module2.exports = SemVer;
|
|
3905
|
+
}
|
|
3906
|
+
});
|
|
3907
|
+
|
|
3908
|
+
// node_modules/semver/functions/parse.js
|
|
3909
|
+
var require_parse = __commonJS({
|
|
3910
|
+
"node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
3911
|
+
"use strict";
|
|
3912
|
+
var SemVer = require_semver();
|
|
3913
|
+
var parse = (version, options, throwErrors = false) => {
|
|
3914
|
+
if (version instanceof SemVer) {
|
|
3915
|
+
return version;
|
|
3916
|
+
}
|
|
3917
|
+
try {
|
|
3918
|
+
return new SemVer(version, options);
|
|
3919
|
+
} catch (er) {
|
|
3920
|
+
if (!throwErrors) {
|
|
3921
|
+
return null;
|
|
3922
|
+
}
|
|
3923
|
+
throw er;
|
|
3924
|
+
}
|
|
3925
|
+
};
|
|
3926
|
+
module2.exports = parse;
|
|
3927
|
+
}
|
|
3928
|
+
});
|
|
3929
|
+
|
|
3930
|
+
// node_modules/semver/functions/valid.js
|
|
3931
|
+
var require_valid = __commonJS({
|
|
3932
|
+
"node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
3933
|
+
"use strict";
|
|
3934
|
+
var parse = require_parse();
|
|
3935
|
+
var valid2 = (version, options) => {
|
|
3936
|
+
const v = parse(version, options);
|
|
3937
|
+
return v ? v.version : null;
|
|
3938
|
+
};
|
|
3939
|
+
module2.exports = valid2;
|
|
3940
|
+
}
|
|
3941
|
+
});
|
|
3942
|
+
|
|
3943
|
+
// node_modules/semver/functions/clean.js
|
|
3944
|
+
var require_clean = __commonJS({
|
|
3945
|
+
"node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
3946
|
+
"use strict";
|
|
3947
|
+
var parse = require_parse();
|
|
3948
|
+
var clean = (version, options) => {
|
|
3949
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
3950
|
+
return s ? s.version : null;
|
|
3951
|
+
};
|
|
3952
|
+
module2.exports = clean;
|
|
3953
|
+
}
|
|
3954
|
+
});
|
|
3955
|
+
|
|
3956
|
+
// node_modules/semver/functions/inc.js
|
|
3957
|
+
var require_inc = __commonJS({
|
|
3958
|
+
"node_modules/semver/functions/inc.js"(exports2, module2) {
|
|
3959
|
+
"use strict";
|
|
3960
|
+
var SemVer = require_semver();
|
|
3961
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
3962
|
+
if (typeof options === "string") {
|
|
3963
|
+
identifierBase = identifier;
|
|
3964
|
+
identifier = options;
|
|
3965
|
+
options = void 0;
|
|
3966
|
+
}
|
|
3967
|
+
try {
|
|
3968
|
+
return new SemVer(
|
|
3969
|
+
version instanceof SemVer ? version.version : version,
|
|
3970
|
+
options
|
|
3971
|
+
).inc(release, identifier, identifierBase).version;
|
|
3972
|
+
} catch (er) {
|
|
3973
|
+
return null;
|
|
3974
|
+
}
|
|
3975
|
+
};
|
|
3976
|
+
module2.exports = inc;
|
|
3977
|
+
}
|
|
3978
|
+
});
|
|
3979
|
+
|
|
3980
|
+
// node_modules/semver/functions/diff.js
|
|
3981
|
+
var require_diff = __commonJS({
|
|
3982
|
+
"node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
3983
|
+
"use strict";
|
|
3984
|
+
var parse = require_parse();
|
|
3985
|
+
var diff = (version1, version2) => {
|
|
3986
|
+
const v1 = parse(version1, null, true);
|
|
3987
|
+
const v2 = parse(version2, null, true);
|
|
3988
|
+
const comparison = v1.compare(v2);
|
|
3989
|
+
if (comparison === 0) {
|
|
3990
|
+
return null;
|
|
3991
|
+
}
|
|
3992
|
+
const v1Higher = comparison > 0;
|
|
3993
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
3994
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
3995
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
3996
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
3997
|
+
if (lowHasPre && !highHasPre) {
|
|
3998
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
3999
|
+
return "major";
|
|
4000
|
+
}
|
|
4001
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
4002
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
4003
|
+
return "minor";
|
|
4004
|
+
}
|
|
4005
|
+
return "patch";
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
4008
|
+
const prefix = highHasPre ? "pre" : "";
|
|
4009
|
+
if (v1.major !== v2.major) {
|
|
4010
|
+
return prefix + "major";
|
|
4011
|
+
}
|
|
4012
|
+
if (v1.minor !== v2.minor) {
|
|
4013
|
+
return prefix + "minor";
|
|
4014
|
+
}
|
|
4015
|
+
if (v1.patch !== v2.patch) {
|
|
4016
|
+
return prefix + "patch";
|
|
4017
|
+
}
|
|
4018
|
+
return "prerelease";
|
|
4019
|
+
};
|
|
4020
|
+
module2.exports = diff;
|
|
4021
|
+
}
|
|
4022
|
+
});
|
|
4023
|
+
|
|
4024
|
+
// node_modules/semver/functions/major.js
|
|
4025
|
+
var require_major = __commonJS({
|
|
4026
|
+
"node_modules/semver/functions/major.js"(exports2, module2) {
|
|
4027
|
+
"use strict";
|
|
4028
|
+
var SemVer = require_semver();
|
|
4029
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
4030
|
+
module2.exports = major;
|
|
4031
|
+
}
|
|
4032
|
+
});
|
|
4033
|
+
|
|
4034
|
+
// node_modules/semver/functions/minor.js
|
|
4035
|
+
var require_minor = __commonJS({
|
|
4036
|
+
"node_modules/semver/functions/minor.js"(exports2, module2) {
|
|
4037
|
+
"use strict";
|
|
4038
|
+
var SemVer = require_semver();
|
|
4039
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
4040
|
+
module2.exports = minor;
|
|
4041
|
+
}
|
|
4042
|
+
});
|
|
4043
|
+
|
|
4044
|
+
// node_modules/semver/functions/patch.js
|
|
4045
|
+
var require_patch = __commonJS({
|
|
4046
|
+
"node_modules/semver/functions/patch.js"(exports2, module2) {
|
|
4047
|
+
"use strict";
|
|
4048
|
+
var SemVer = require_semver();
|
|
4049
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
4050
|
+
module2.exports = patch;
|
|
4051
|
+
}
|
|
4052
|
+
});
|
|
4053
|
+
|
|
4054
|
+
// node_modules/semver/functions/prerelease.js
|
|
4055
|
+
var require_prerelease = __commonJS({
|
|
4056
|
+
"node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
4057
|
+
"use strict";
|
|
4058
|
+
var parse = require_parse();
|
|
4059
|
+
var prerelease = (version, options) => {
|
|
4060
|
+
const parsed = parse(version, options);
|
|
4061
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
4062
|
+
};
|
|
4063
|
+
module2.exports = prerelease;
|
|
4064
|
+
}
|
|
4065
|
+
});
|
|
4066
|
+
|
|
4067
|
+
// node_modules/semver/functions/compare.js
|
|
4068
|
+
var require_compare = __commonJS({
|
|
4069
|
+
"node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
4070
|
+
"use strict";
|
|
4071
|
+
var SemVer = require_semver();
|
|
4072
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
4073
|
+
module2.exports = compare;
|
|
4074
|
+
}
|
|
4075
|
+
});
|
|
4076
|
+
|
|
4077
|
+
// node_modules/semver/functions/rcompare.js
|
|
4078
|
+
var require_rcompare = __commonJS({
|
|
4079
|
+
"node_modules/semver/functions/rcompare.js"(exports2, module2) {
|
|
4080
|
+
"use strict";
|
|
4081
|
+
var compare = require_compare();
|
|
4082
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
4083
|
+
module2.exports = rcompare;
|
|
4084
|
+
}
|
|
4085
|
+
});
|
|
4086
|
+
|
|
4087
|
+
// node_modules/semver/functions/compare-loose.js
|
|
4088
|
+
var require_compare_loose = __commonJS({
|
|
4089
|
+
"node_modules/semver/functions/compare-loose.js"(exports2, module2) {
|
|
4090
|
+
"use strict";
|
|
4091
|
+
var compare = require_compare();
|
|
4092
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
4093
|
+
module2.exports = compareLoose;
|
|
4094
|
+
}
|
|
4095
|
+
});
|
|
4096
|
+
|
|
4097
|
+
// node_modules/semver/functions/compare-build.js
|
|
4098
|
+
var require_compare_build = __commonJS({
|
|
4099
|
+
"node_modules/semver/functions/compare-build.js"(exports2, module2) {
|
|
4100
|
+
"use strict";
|
|
4101
|
+
var SemVer = require_semver();
|
|
4102
|
+
var compareBuild = (a, b, loose) => {
|
|
4103
|
+
const versionA = new SemVer(a, loose);
|
|
4104
|
+
const versionB = new SemVer(b, loose);
|
|
4105
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
4106
|
+
};
|
|
4107
|
+
module2.exports = compareBuild;
|
|
4108
|
+
}
|
|
4109
|
+
});
|
|
4110
|
+
|
|
4111
|
+
// node_modules/semver/functions/sort.js
|
|
4112
|
+
var require_sort = __commonJS({
|
|
4113
|
+
"node_modules/semver/functions/sort.js"(exports2, module2) {
|
|
4114
|
+
"use strict";
|
|
4115
|
+
var compareBuild = require_compare_build();
|
|
4116
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
4117
|
+
module2.exports = sort;
|
|
4118
|
+
}
|
|
4119
|
+
});
|
|
4120
|
+
|
|
4121
|
+
// node_modules/semver/functions/rsort.js
|
|
4122
|
+
var require_rsort = __commonJS({
|
|
4123
|
+
"node_modules/semver/functions/rsort.js"(exports2, module2) {
|
|
4124
|
+
"use strict";
|
|
4125
|
+
var compareBuild = require_compare_build();
|
|
4126
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
4127
|
+
module2.exports = rsort;
|
|
4128
|
+
}
|
|
4129
|
+
});
|
|
4130
|
+
|
|
4131
|
+
// node_modules/semver/functions/gt.js
|
|
4132
|
+
var require_gt = __commonJS({
|
|
4133
|
+
"node_modules/semver/functions/gt.js"(exports2, module2) {
|
|
4134
|
+
"use strict";
|
|
4135
|
+
var compare = require_compare();
|
|
4136
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
4137
|
+
module2.exports = gt;
|
|
4138
|
+
}
|
|
4139
|
+
});
|
|
4140
|
+
|
|
4141
|
+
// node_modules/semver/functions/lt.js
|
|
4142
|
+
var require_lt = __commonJS({
|
|
4143
|
+
"node_modules/semver/functions/lt.js"(exports2, module2) {
|
|
4144
|
+
"use strict";
|
|
4145
|
+
var compare = require_compare();
|
|
4146
|
+
var lt2 = (a, b, loose) => compare(a, b, loose) < 0;
|
|
4147
|
+
module2.exports = lt2;
|
|
4148
|
+
}
|
|
4149
|
+
});
|
|
4150
|
+
|
|
4151
|
+
// node_modules/semver/functions/eq.js
|
|
4152
|
+
var require_eq = __commonJS({
|
|
4153
|
+
"node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
4154
|
+
"use strict";
|
|
4155
|
+
var compare = require_compare();
|
|
4156
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
4157
|
+
module2.exports = eq;
|
|
4158
|
+
}
|
|
4159
|
+
});
|
|
4160
|
+
|
|
4161
|
+
// node_modules/semver/functions/neq.js
|
|
4162
|
+
var require_neq = __commonJS({
|
|
4163
|
+
"node_modules/semver/functions/neq.js"(exports2, module2) {
|
|
4164
|
+
"use strict";
|
|
4165
|
+
var compare = require_compare();
|
|
4166
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
4167
|
+
module2.exports = neq;
|
|
4168
|
+
}
|
|
4169
|
+
});
|
|
4170
|
+
|
|
4171
|
+
// node_modules/semver/functions/gte.js
|
|
4172
|
+
var require_gte = __commonJS({
|
|
4173
|
+
"node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
4174
|
+
"use strict";
|
|
4175
|
+
var compare = require_compare();
|
|
4176
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
4177
|
+
module2.exports = gte;
|
|
4178
|
+
}
|
|
4179
|
+
});
|
|
4180
|
+
|
|
4181
|
+
// node_modules/semver/functions/lte.js
|
|
4182
|
+
var require_lte = __commonJS({
|
|
4183
|
+
"node_modules/semver/functions/lte.js"(exports2, module2) {
|
|
4184
|
+
"use strict";
|
|
4185
|
+
var compare = require_compare();
|
|
4186
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
4187
|
+
module2.exports = lte;
|
|
4188
|
+
}
|
|
4189
|
+
});
|
|
4190
|
+
|
|
4191
|
+
// node_modules/semver/functions/cmp.js
|
|
4192
|
+
var require_cmp = __commonJS({
|
|
4193
|
+
"node_modules/semver/functions/cmp.js"(exports2, module2) {
|
|
4194
|
+
"use strict";
|
|
4195
|
+
var eq = require_eq();
|
|
4196
|
+
var neq = require_neq();
|
|
4197
|
+
var gt = require_gt();
|
|
4198
|
+
var gte = require_gte();
|
|
4199
|
+
var lt2 = require_lt();
|
|
4200
|
+
var lte = require_lte();
|
|
4201
|
+
var cmp = (a, op, b, loose) => {
|
|
4202
|
+
switch (op) {
|
|
4203
|
+
case "===":
|
|
4204
|
+
if (typeof a === "object") {
|
|
4205
|
+
a = a.version;
|
|
4206
|
+
}
|
|
4207
|
+
if (typeof b === "object") {
|
|
4208
|
+
b = b.version;
|
|
4209
|
+
}
|
|
4210
|
+
return a === b;
|
|
4211
|
+
case "!==":
|
|
4212
|
+
if (typeof a === "object") {
|
|
4213
|
+
a = a.version;
|
|
4214
|
+
}
|
|
4215
|
+
if (typeof b === "object") {
|
|
4216
|
+
b = b.version;
|
|
4217
|
+
}
|
|
4218
|
+
return a !== b;
|
|
4219
|
+
case "":
|
|
4220
|
+
case "=":
|
|
4221
|
+
case "==":
|
|
4222
|
+
return eq(a, b, loose);
|
|
4223
|
+
case "!=":
|
|
4224
|
+
return neq(a, b, loose);
|
|
4225
|
+
case ">":
|
|
4226
|
+
return gt(a, b, loose);
|
|
4227
|
+
case ">=":
|
|
4228
|
+
return gte(a, b, loose);
|
|
4229
|
+
case "<":
|
|
4230
|
+
return lt2(a, b, loose);
|
|
4231
|
+
case "<=":
|
|
4232
|
+
return lte(a, b, loose);
|
|
4233
|
+
default:
|
|
4234
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
4235
|
+
}
|
|
4236
|
+
};
|
|
4237
|
+
module2.exports = cmp;
|
|
4238
|
+
}
|
|
4239
|
+
});
|
|
4240
|
+
|
|
4241
|
+
// node_modules/semver/functions/coerce.js
|
|
4242
|
+
var require_coerce = __commonJS({
|
|
4243
|
+
"node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
4244
|
+
"use strict";
|
|
4245
|
+
var SemVer = require_semver();
|
|
4246
|
+
var parse = require_parse();
|
|
4247
|
+
var { safeRe: re, t } = require_re();
|
|
4248
|
+
var coerce = (version, options) => {
|
|
4249
|
+
if (version instanceof SemVer) {
|
|
4250
|
+
return version;
|
|
4251
|
+
}
|
|
4252
|
+
if (typeof version === "number") {
|
|
4253
|
+
version = String(version);
|
|
4254
|
+
}
|
|
4255
|
+
if (typeof version !== "string") {
|
|
4256
|
+
return null;
|
|
4257
|
+
}
|
|
4258
|
+
options = options || {};
|
|
4259
|
+
let match = null;
|
|
4260
|
+
if (!options.rtl) {
|
|
4261
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
4262
|
+
} else {
|
|
4263
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
4264
|
+
let next;
|
|
4265
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
4266
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
4267
|
+
match = next;
|
|
4268
|
+
}
|
|
4269
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
4270
|
+
}
|
|
4271
|
+
coerceRtlRegex.lastIndex = -1;
|
|
4272
|
+
}
|
|
4273
|
+
if (match === null) {
|
|
4274
|
+
return null;
|
|
4275
|
+
}
|
|
4276
|
+
const major = match[2];
|
|
4277
|
+
const minor = match[3] || "0";
|
|
4278
|
+
const patch = match[4] || "0";
|
|
4279
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
4280
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
4281
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
4282
|
+
};
|
|
4283
|
+
module2.exports = coerce;
|
|
4284
|
+
}
|
|
4285
|
+
});
|
|
4286
|
+
|
|
4287
|
+
// node_modules/semver/internal/lrucache.js
|
|
4288
|
+
var require_lrucache = __commonJS({
|
|
4289
|
+
"node_modules/semver/internal/lrucache.js"(exports2, module2) {
|
|
4290
|
+
"use strict";
|
|
4291
|
+
var LRUCache = class {
|
|
4292
|
+
constructor() {
|
|
4293
|
+
this.max = 1e3;
|
|
4294
|
+
this.map = /* @__PURE__ */ new Map();
|
|
4295
|
+
}
|
|
4296
|
+
get(key) {
|
|
4297
|
+
const value = this.map.get(key);
|
|
4298
|
+
if (value === void 0) {
|
|
4299
|
+
return void 0;
|
|
4300
|
+
} else {
|
|
4301
|
+
this.map.delete(key);
|
|
4302
|
+
this.map.set(key, value);
|
|
4303
|
+
return value;
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
delete(key) {
|
|
4307
|
+
return this.map.delete(key);
|
|
4308
|
+
}
|
|
4309
|
+
set(key, value) {
|
|
4310
|
+
const deleted = this.delete(key);
|
|
4311
|
+
if (!deleted && value !== void 0) {
|
|
4312
|
+
if (this.map.size >= this.max) {
|
|
4313
|
+
const firstKey = this.map.keys().next().value;
|
|
4314
|
+
this.delete(firstKey);
|
|
4315
|
+
}
|
|
4316
|
+
this.map.set(key, value);
|
|
4317
|
+
}
|
|
4318
|
+
return this;
|
|
4319
|
+
}
|
|
4320
|
+
};
|
|
4321
|
+
module2.exports = LRUCache;
|
|
4322
|
+
}
|
|
4323
|
+
});
|
|
4324
|
+
|
|
4325
|
+
// node_modules/semver/classes/range.js
|
|
4326
|
+
var require_range = __commonJS({
|
|
4327
|
+
"node_modules/semver/classes/range.js"(exports2, module2) {
|
|
4328
|
+
"use strict";
|
|
4329
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
4330
|
+
var Range = class _Range {
|
|
4331
|
+
constructor(range, options) {
|
|
4332
|
+
options = parseOptions(options);
|
|
4333
|
+
if (range instanceof _Range) {
|
|
4334
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
4335
|
+
return range;
|
|
4336
|
+
} else {
|
|
4337
|
+
return new _Range(range.raw, options);
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
if (range instanceof Comparator) {
|
|
4341
|
+
this.raw = range.value;
|
|
4342
|
+
this.set = [[range]];
|
|
4343
|
+
this.formatted = void 0;
|
|
4344
|
+
return this;
|
|
4345
|
+
}
|
|
4346
|
+
this.options = options;
|
|
4347
|
+
this.loose = !!options.loose;
|
|
4348
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
4349
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
4350
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
4351
|
+
if (!this.set.length) {
|
|
4352
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
4353
|
+
}
|
|
4354
|
+
if (this.set.length > 1) {
|
|
4355
|
+
const first = this.set[0];
|
|
4356
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
4357
|
+
if (this.set.length === 0) {
|
|
4358
|
+
this.set = [first];
|
|
4359
|
+
} else if (this.set.length > 1) {
|
|
4360
|
+
for (const c of this.set) {
|
|
4361
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
4362
|
+
this.set = [c];
|
|
4363
|
+
break;
|
|
4364
|
+
}
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4368
|
+
this.formatted = void 0;
|
|
4369
|
+
}
|
|
4370
|
+
get range() {
|
|
4371
|
+
if (this.formatted === void 0) {
|
|
4372
|
+
this.formatted = "";
|
|
4373
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
4374
|
+
if (i > 0) {
|
|
4375
|
+
this.formatted += "||";
|
|
4376
|
+
}
|
|
4377
|
+
const comps = this.set[i];
|
|
4378
|
+
for (let k = 0; k < comps.length; k++) {
|
|
4379
|
+
if (k > 0) {
|
|
4380
|
+
this.formatted += " ";
|
|
4381
|
+
}
|
|
4382
|
+
this.formatted += comps[k].toString().trim();
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
return this.formatted;
|
|
4387
|
+
}
|
|
4388
|
+
format() {
|
|
4389
|
+
return this.range;
|
|
4390
|
+
}
|
|
4391
|
+
toString() {
|
|
4392
|
+
return this.range;
|
|
4393
|
+
}
|
|
4394
|
+
parseRange(range) {
|
|
4395
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
4396
|
+
const memoKey = memoOpts + ":" + range;
|
|
4397
|
+
const cached = cache.get(memoKey);
|
|
4398
|
+
if (cached) {
|
|
4399
|
+
return cached;
|
|
4400
|
+
}
|
|
4401
|
+
const loose = this.options.loose;
|
|
4402
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
4403
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
4404
|
+
debug("hyphen replace", range);
|
|
4405
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
4406
|
+
debug("comparator trim", range);
|
|
4407
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
4408
|
+
debug("tilde trim", range);
|
|
4409
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
4410
|
+
debug("caret trim", range);
|
|
4411
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
4412
|
+
if (loose) {
|
|
4413
|
+
rangeList = rangeList.filter((comp) => {
|
|
4414
|
+
debug("loose invalid filter", comp, this.options);
|
|
4415
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
4416
|
+
});
|
|
4417
|
+
}
|
|
4418
|
+
debug("range list", rangeList);
|
|
4419
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
4420
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
4421
|
+
for (const comp of comparators) {
|
|
4422
|
+
if (isNullSet(comp)) {
|
|
4423
|
+
return [comp];
|
|
4424
|
+
}
|
|
4425
|
+
rangeMap.set(comp.value, comp);
|
|
4426
|
+
}
|
|
4427
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
4428
|
+
rangeMap.delete("");
|
|
4429
|
+
}
|
|
4430
|
+
const result = [...rangeMap.values()];
|
|
4431
|
+
cache.set(memoKey, result);
|
|
4432
|
+
return result;
|
|
4433
|
+
}
|
|
4434
|
+
intersects(range, options) {
|
|
4435
|
+
if (!(range instanceof _Range)) {
|
|
4436
|
+
throw new TypeError("a Range is required");
|
|
4437
|
+
}
|
|
4438
|
+
return this.set.some((thisComparators) => {
|
|
4439
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
4440
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
4441
|
+
return rangeComparators.every((rangeComparator) => {
|
|
4442
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
4443
|
+
});
|
|
4444
|
+
});
|
|
4445
|
+
});
|
|
4446
|
+
});
|
|
4447
|
+
}
|
|
4448
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
4449
|
+
test(version) {
|
|
4450
|
+
if (!version) {
|
|
4451
|
+
return false;
|
|
4452
|
+
}
|
|
4453
|
+
if (typeof version === "string") {
|
|
4454
|
+
try {
|
|
4455
|
+
version = new SemVer(version, this.options);
|
|
4456
|
+
} catch (er) {
|
|
4457
|
+
return false;
|
|
4458
|
+
}
|
|
4459
|
+
}
|
|
4460
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
4461
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
4462
|
+
return true;
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4465
|
+
return false;
|
|
4466
|
+
}
|
|
4467
|
+
};
|
|
4468
|
+
module2.exports = Range;
|
|
4469
|
+
var LRU = require_lrucache();
|
|
4470
|
+
var cache = new LRU();
|
|
4471
|
+
var parseOptions = require_parse_options();
|
|
4472
|
+
var Comparator = require_comparator();
|
|
4473
|
+
var debug = require_debug();
|
|
4474
|
+
var SemVer = require_semver();
|
|
4475
|
+
var {
|
|
4476
|
+
safeRe: re,
|
|
4477
|
+
t,
|
|
4478
|
+
comparatorTrimReplace,
|
|
4479
|
+
tildeTrimReplace,
|
|
4480
|
+
caretTrimReplace
|
|
4481
|
+
} = require_re();
|
|
4482
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
4483
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
4484
|
+
var isAny = (c) => c.value === "";
|
|
4485
|
+
var isSatisfiable = (comparators, options) => {
|
|
4486
|
+
let result = true;
|
|
4487
|
+
const remainingComparators = comparators.slice();
|
|
4488
|
+
let testComparator = remainingComparators.pop();
|
|
4489
|
+
while (result && remainingComparators.length) {
|
|
4490
|
+
result = remainingComparators.every((otherComparator) => {
|
|
4491
|
+
return testComparator.intersects(otherComparator, options);
|
|
4492
|
+
});
|
|
4493
|
+
testComparator = remainingComparators.pop();
|
|
4494
|
+
}
|
|
4495
|
+
return result;
|
|
4496
|
+
};
|
|
4497
|
+
var parseComparator = (comp, options) => {
|
|
4498
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
4499
|
+
debug("comp", comp, options);
|
|
4500
|
+
comp = replaceCarets(comp, options);
|
|
4501
|
+
debug("caret", comp);
|
|
4502
|
+
comp = replaceTildes(comp, options);
|
|
4503
|
+
debug("tildes", comp);
|
|
4504
|
+
comp = replaceXRanges(comp, options);
|
|
4505
|
+
debug("xrange", comp);
|
|
4506
|
+
comp = replaceStars(comp, options);
|
|
4507
|
+
debug("stars", comp);
|
|
4508
|
+
return comp;
|
|
4509
|
+
};
|
|
4510
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
4511
|
+
var replaceTildes = (comp, options) => {
|
|
4512
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
4513
|
+
};
|
|
4514
|
+
var replaceTilde = (comp, options) => {
|
|
4515
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
4516
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
4517
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
4518
|
+
let ret;
|
|
4519
|
+
if (isX(M)) {
|
|
4520
|
+
ret = "";
|
|
4521
|
+
} else if (isX(m)) {
|
|
4522
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
4523
|
+
} else if (isX(p)) {
|
|
4524
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
4525
|
+
} else if (pr) {
|
|
4526
|
+
debug("replaceTilde pr", pr);
|
|
4527
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
4528
|
+
} else {
|
|
4529
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
4530
|
+
}
|
|
4531
|
+
debug("tilde return", ret);
|
|
4532
|
+
return ret;
|
|
4533
|
+
});
|
|
4534
|
+
};
|
|
4535
|
+
var replaceCarets = (comp, options) => {
|
|
4536
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
4537
|
+
};
|
|
4538
|
+
var replaceCaret = (comp, options) => {
|
|
4539
|
+
debug("caret", comp, options);
|
|
4540
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
4541
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
4542
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
4543
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
4544
|
+
let ret;
|
|
4545
|
+
if (isX(M)) {
|
|
4546
|
+
ret = "";
|
|
4547
|
+
} else if (isX(m)) {
|
|
4548
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
4549
|
+
} else if (isX(p)) {
|
|
4550
|
+
if (M === "0") {
|
|
4551
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
4552
|
+
} else {
|
|
4553
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
4554
|
+
}
|
|
4555
|
+
} else if (pr) {
|
|
4556
|
+
debug("replaceCaret pr", pr);
|
|
4557
|
+
if (M === "0") {
|
|
4558
|
+
if (m === "0") {
|
|
4559
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
4560
|
+
} else {
|
|
4561
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
4562
|
+
}
|
|
4563
|
+
} else {
|
|
4564
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
4565
|
+
}
|
|
4566
|
+
} else {
|
|
4567
|
+
debug("no pr");
|
|
4568
|
+
if (M === "0") {
|
|
4569
|
+
if (m === "0") {
|
|
4570
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
4571
|
+
} else {
|
|
4572
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
4573
|
+
}
|
|
4574
|
+
} else {
|
|
4575
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
4576
|
+
}
|
|
4577
|
+
}
|
|
4578
|
+
debug("caret return", ret);
|
|
4579
|
+
return ret;
|
|
4580
|
+
});
|
|
4581
|
+
};
|
|
4582
|
+
var replaceXRanges = (comp, options) => {
|
|
4583
|
+
debug("replaceXRanges", comp, options);
|
|
4584
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
4585
|
+
};
|
|
4586
|
+
var replaceXRange = (comp, options) => {
|
|
4587
|
+
comp = comp.trim();
|
|
4588
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
4589
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
4590
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
4591
|
+
const xM = isX(M);
|
|
4592
|
+
const xm = xM || isX(m);
|
|
4593
|
+
const xp = xm || isX(p);
|
|
4594
|
+
const anyX = xp;
|
|
4595
|
+
if (gtlt === "=" && anyX) {
|
|
4596
|
+
gtlt = "";
|
|
4597
|
+
}
|
|
4598
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
4599
|
+
if (xM) {
|
|
4600
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
4601
|
+
ret = "<0.0.0-0";
|
|
4602
|
+
} else {
|
|
4603
|
+
ret = "*";
|
|
4604
|
+
}
|
|
4605
|
+
} else if (gtlt && anyX) {
|
|
4606
|
+
if (xm) {
|
|
4607
|
+
m = 0;
|
|
4608
|
+
}
|
|
4609
|
+
p = 0;
|
|
4610
|
+
if (gtlt === ">") {
|
|
4611
|
+
gtlt = ">=";
|
|
4612
|
+
if (xm) {
|
|
4613
|
+
M = +M + 1;
|
|
4614
|
+
m = 0;
|
|
4615
|
+
p = 0;
|
|
4616
|
+
} else {
|
|
4617
|
+
m = +m + 1;
|
|
4618
|
+
p = 0;
|
|
4619
|
+
}
|
|
4620
|
+
} else if (gtlt === "<=") {
|
|
4621
|
+
gtlt = "<";
|
|
4622
|
+
if (xm) {
|
|
4623
|
+
M = +M + 1;
|
|
4624
|
+
} else {
|
|
4625
|
+
m = +m + 1;
|
|
4626
|
+
}
|
|
4627
|
+
}
|
|
4628
|
+
if (gtlt === "<") {
|
|
4629
|
+
pr = "-0";
|
|
4630
|
+
}
|
|
4631
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
4632
|
+
} else if (xm) {
|
|
4633
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
4634
|
+
} else if (xp) {
|
|
4635
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
4636
|
+
}
|
|
4637
|
+
debug("xRange return", ret);
|
|
4638
|
+
return ret;
|
|
4639
|
+
});
|
|
4640
|
+
};
|
|
4641
|
+
var replaceStars = (comp, options) => {
|
|
4642
|
+
debug("replaceStars", comp, options);
|
|
4643
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
4644
|
+
};
|
|
4645
|
+
var replaceGTE0 = (comp, options) => {
|
|
4646
|
+
debug("replaceGTE0", comp, options);
|
|
4647
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
4648
|
+
};
|
|
4649
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
4650
|
+
if (isX(fM)) {
|
|
4651
|
+
from = "";
|
|
4652
|
+
} else if (isX(fm)) {
|
|
4653
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
4654
|
+
} else if (isX(fp)) {
|
|
4655
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
4656
|
+
} else if (fpr) {
|
|
4657
|
+
from = `>=${from}`;
|
|
4658
|
+
} else {
|
|
4659
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
4660
|
+
}
|
|
4661
|
+
if (isX(tM)) {
|
|
4662
|
+
to = "";
|
|
4663
|
+
} else if (isX(tm)) {
|
|
4664
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
4665
|
+
} else if (isX(tp)) {
|
|
4666
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
4667
|
+
} else if (tpr) {
|
|
4668
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
4669
|
+
} else if (incPr) {
|
|
4670
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
4671
|
+
} else {
|
|
4672
|
+
to = `<=${to}`;
|
|
4673
|
+
}
|
|
4674
|
+
return `${from} ${to}`.trim();
|
|
4675
|
+
};
|
|
4676
|
+
var testSet = (set, version, options) => {
|
|
4677
|
+
for (let i = 0; i < set.length; i++) {
|
|
4678
|
+
if (!set[i].test(version)) {
|
|
4679
|
+
return false;
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
4683
|
+
for (let i = 0; i < set.length; i++) {
|
|
4684
|
+
debug(set[i].semver);
|
|
4685
|
+
if (set[i].semver === Comparator.ANY) {
|
|
4686
|
+
continue;
|
|
4687
|
+
}
|
|
4688
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
4689
|
+
const allowed = set[i].semver;
|
|
4690
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
4691
|
+
return true;
|
|
4692
|
+
}
|
|
4693
|
+
}
|
|
4694
|
+
}
|
|
4695
|
+
return false;
|
|
4696
|
+
}
|
|
4697
|
+
return true;
|
|
4698
|
+
};
|
|
4699
|
+
}
|
|
4700
|
+
});
|
|
4701
|
+
|
|
4702
|
+
// node_modules/semver/classes/comparator.js
|
|
4703
|
+
var require_comparator = __commonJS({
|
|
4704
|
+
"node_modules/semver/classes/comparator.js"(exports2, module2) {
|
|
4705
|
+
"use strict";
|
|
4706
|
+
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
4707
|
+
var Comparator = class _Comparator {
|
|
4708
|
+
static get ANY() {
|
|
4709
|
+
return ANY;
|
|
4710
|
+
}
|
|
4711
|
+
constructor(comp, options) {
|
|
4712
|
+
options = parseOptions(options);
|
|
4713
|
+
if (comp instanceof _Comparator) {
|
|
4714
|
+
if (comp.loose === !!options.loose) {
|
|
4715
|
+
return comp;
|
|
4716
|
+
} else {
|
|
4717
|
+
comp = comp.value;
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
4721
|
+
debug("comparator", comp, options);
|
|
4722
|
+
this.options = options;
|
|
4723
|
+
this.loose = !!options.loose;
|
|
4724
|
+
this.parse(comp);
|
|
4725
|
+
if (this.semver === ANY) {
|
|
4726
|
+
this.value = "";
|
|
4727
|
+
} else {
|
|
4728
|
+
this.value = this.operator + this.semver.version;
|
|
4729
|
+
}
|
|
4730
|
+
debug("comp", this);
|
|
4731
|
+
}
|
|
4732
|
+
parse(comp) {
|
|
4733
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
4734
|
+
const m = comp.match(r);
|
|
4735
|
+
if (!m) {
|
|
4736
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
4737
|
+
}
|
|
4738
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
4739
|
+
if (this.operator === "=") {
|
|
4740
|
+
this.operator = "";
|
|
4741
|
+
}
|
|
4742
|
+
if (!m[2]) {
|
|
4743
|
+
this.semver = ANY;
|
|
4744
|
+
} else {
|
|
4745
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
toString() {
|
|
4749
|
+
return this.value;
|
|
4750
|
+
}
|
|
4751
|
+
test(version) {
|
|
4752
|
+
debug("Comparator.test", version, this.options.loose);
|
|
4753
|
+
if (this.semver === ANY || version === ANY) {
|
|
4754
|
+
return true;
|
|
4755
|
+
}
|
|
4756
|
+
if (typeof version === "string") {
|
|
4757
|
+
try {
|
|
4758
|
+
version = new SemVer(version, this.options);
|
|
4759
|
+
} catch (er) {
|
|
4760
|
+
return false;
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
4764
|
+
}
|
|
4765
|
+
intersects(comp, options) {
|
|
4766
|
+
if (!(comp instanceof _Comparator)) {
|
|
4767
|
+
throw new TypeError("a Comparator is required");
|
|
4768
|
+
}
|
|
4769
|
+
if (this.operator === "") {
|
|
4770
|
+
if (this.value === "") {
|
|
4771
|
+
return true;
|
|
4772
|
+
}
|
|
4773
|
+
return new Range(comp.value, options).test(this.value);
|
|
4774
|
+
} else if (comp.operator === "") {
|
|
4775
|
+
if (comp.value === "") {
|
|
4776
|
+
return true;
|
|
4777
|
+
}
|
|
4778
|
+
return new Range(this.value, options).test(comp.semver);
|
|
4779
|
+
}
|
|
4780
|
+
options = parseOptions(options);
|
|
4781
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
4782
|
+
return false;
|
|
4783
|
+
}
|
|
4784
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
4785
|
+
return false;
|
|
4786
|
+
}
|
|
4787
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
4788
|
+
return true;
|
|
4789
|
+
}
|
|
4790
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
4791
|
+
return true;
|
|
4792
|
+
}
|
|
4793
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
4794
|
+
return true;
|
|
4795
|
+
}
|
|
4796
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
4797
|
+
return true;
|
|
4798
|
+
}
|
|
4799
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
4800
|
+
return true;
|
|
4801
|
+
}
|
|
4802
|
+
return false;
|
|
4803
|
+
}
|
|
4804
|
+
};
|
|
4805
|
+
module2.exports = Comparator;
|
|
4806
|
+
var parseOptions = require_parse_options();
|
|
4807
|
+
var { safeRe: re, t } = require_re();
|
|
4808
|
+
var cmp = require_cmp();
|
|
4809
|
+
var debug = require_debug();
|
|
4810
|
+
var SemVer = require_semver();
|
|
4811
|
+
var Range = require_range();
|
|
4812
|
+
}
|
|
4813
|
+
});
|
|
4814
|
+
|
|
4815
|
+
// node_modules/semver/functions/satisfies.js
|
|
4816
|
+
var require_satisfies = __commonJS({
|
|
4817
|
+
"node_modules/semver/functions/satisfies.js"(exports2, module2) {
|
|
4818
|
+
"use strict";
|
|
4819
|
+
var Range = require_range();
|
|
4820
|
+
var satisfies = (version, range, options) => {
|
|
4821
|
+
try {
|
|
4822
|
+
range = new Range(range, options);
|
|
4823
|
+
} catch (er) {
|
|
4824
|
+
return false;
|
|
4825
|
+
}
|
|
4826
|
+
return range.test(version);
|
|
4827
|
+
};
|
|
4828
|
+
module2.exports = satisfies;
|
|
4829
|
+
}
|
|
4830
|
+
});
|
|
4831
|
+
|
|
4832
|
+
// node_modules/semver/ranges/to-comparators.js
|
|
4833
|
+
var require_to_comparators = __commonJS({
|
|
4834
|
+
"node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
|
|
4835
|
+
"use strict";
|
|
4836
|
+
var Range = require_range();
|
|
4837
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
4838
|
+
module2.exports = toComparators;
|
|
4839
|
+
}
|
|
4840
|
+
});
|
|
4841
|
+
|
|
4842
|
+
// node_modules/semver/ranges/max-satisfying.js
|
|
4843
|
+
var require_max_satisfying = __commonJS({
|
|
4844
|
+
"node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
|
|
4845
|
+
"use strict";
|
|
4846
|
+
var SemVer = require_semver();
|
|
4847
|
+
var Range = require_range();
|
|
4848
|
+
var maxSatisfying = (versions, range, options) => {
|
|
4849
|
+
let max = null;
|
|
4850
|
+
let maxSV = null;
|
|
4851
|
+
let rangeObj = null;
|
|
4852
|
+
try {
|
|
4853
|
+
rangeObj = new Range(range, options);
|
|
4854
|
+
} catch (er) {
|
|
4855
|
+
return null;
|
|
4856
|
+
}
|
|
4857
|
+
versions.forEach((v) => {
|
|
4858
|
+
if (rangeObj.test(v)) {
|
|
4859
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
4860
|
+
max = v;
|
|
4861
|
+
maxSV = new SemVer(max, options);
|
|
4862
|
+
}
|
|
4863
|
+
}
|
|
4864
|
+
});
|
|
4865
|
+
return max;
|
|
4866
|
+
};
|
|
4867
|
+
module2.exports = maxSatisfying;
|
|
4868
|
+
}
|
|
4869
|
+
});
|
|
4870
|
+
|
|
4871
|
+
// node_modules/semver/ranges/min-satisfying.js
|
|
4872
|
+
var require_min_satisfying = __commonJS({
|
|
4873
|
+
"node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
|
|
4874
|
+
"use strict";
|
|
4875
|
+
var SemVer = require_semver();
|
|
4876
|
+
var Range = require_range();
|
|
4877
|
+
var minSatisfying = (versions, range, options) => {
|
|
4878
|
+
let min = null;
|
|
4879
|
+
let minSV = null;
|
|
4880
|
+
let rangeObj = null;
|
|
4881
|
+
try {
|
|
4882
|
+
rangeObj = new Range(range, options);
|
|
4883
|
+
} catch (er) {
|
|
4884
|
+
return null;
|
|
4885
|
+
}
|
|
4886
|
+
versions.forEach((v) => {
|
|
4887
|
+
if (rangeObj.test(v)) {
|
|
4888
|
+
if (!min || minSV.compare(v) === 1) {
|
|
4889
|
+
min = v;
|
|
4890
|
+
minSV = new SemVer(min, options);
|
|
4891
|
+
}
|
|
4892
|
+
}
|
|
4893
|
+
});
|
|
4894
|
+
return min;
|
|
4895
|
+
};
|
|
4896
|
+
module2.exports = minSatisfying;
|
|
4897
|
+
}
|
|
4898
|
+
});
|
|
4899
|
+
|
|
4900
|
+
// node_modules/semver/ranges/min-version.js
|
|
4901
|
+
var require_min_version = __commonJS({
|
|
4902
|
+
"node_modules/semver/ranges/min-version.js"(exports2, module2) {
|
|
4903
|
+
"use strict";
|
|
4904
|
+
var SemVer = require_semver();
|
|
4905
|
+
var Range = require_range();
|
|
4906
|
+
var gt = require_gt();
|
|
4907
|
+
var minVersion = (range, loose) => {
|
|
4908
|
+
range = new Range(range, loose);
|
|
4909
|
+
let minver = new SemVer("0.0.0");
|
|
4910
|
+
if (range.test(minver)) {
|
|
4911
|
+
return minver;
|
|
4912
|
+
}
|
|
4913
|
+
minver = new SemVer("0.0.0-0");
|
|
4914
|
+
if (range.test(minver)) {
|
|
4915
|
+
return minver;
|
|
4916
|
+
}
|
|
4917
|
+
minver = null;
|
|
4918
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
4919
|
+
const comparators = range.set[i];
|
|
4920
|
+
let setMin = null;
|
|
4921
|
+
comparators.forEach((comparator) => {
|
|
4922
|
+
const compver = new SemVer(comparator.semver.version);
|
|
4923
|
+
switch (comparator.operator) {
|
|
4924
|
+
case ">":
|
|
4925
|
+
if (compver.prerelease.length === 0) {
|
|
4926
|
+
compver.patch++;
|
|
4927
|
+
} else {
|
|
4928
|
+
compver.prerelease.push(0);
|
|
4929
|
+
}
|
|
4930
|
+
compver.raw = compver.format();
|
|
4931
|
+
/* fallthrough */
|
|
4932
|
+
case "":
|
|
4933
|
+
case ">=":
|
|
4934
|
+
if (!setMin || gt(compver, setMin)) {
|
|
4935
|
+
setMin = compver;
|
|
4936
|
+
}
|
|
4937
|
+
break;
|
|
4938
|
+
case "<":
|
|
4939
|
+
case "<=":
|
|
4940
|
+
break;
|
|
4941
|
+
/* istanbul ignore next */
|
|
4942
|
+
default:
|
|
4943
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
4944
|
+
}
|
|
4945
|
+
});
|
|
4946
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
4947
|
+
minver = setMin;
|
|
4948
|
+
}
|
|
4949
|
+
}
|
|
4950
|
+
if (minver && range.test(minver)) {
|
|
4951
|
+
return minver;
|
|
4952
|
+
}
|
|
4953
|
+
return null;
|
|
4954
|
+
};
|
|
4955
|
+
module2.exports = minVersion;
|
|
4956
|
+
}
|
|
4957
|
+
});
|
|
4958
|
+
|
|
4959
|
+
// node_modules/semver/ranges/valid.js
|
|
4960
|
+
var require_valid2 = __commonJS({
|
|
4961
|
+
"node_modules/semver/ranges/valid.js"(exports2, module2) {
|
|
4962
|
+
"use strict";
|
|
4963
|
+
var Range = require_range();
|
|
4964
|
+
var validRange = (range, options) => {
|
|
4965
|
+
try {
|
|
4966
|
+
return new Range(range, options).range || "*";
|
|
4967
|
+
} catch (er) {
|
|
4968
|
+
return null;
|
|
4969
|
+
}
|
|
4970
|
+
};
|
|
4971
|
+
module2.exports = validRange;
|
|
4972
|
+
}
|
|
4973
|
+
});
|
|
4974
|
+
|
|
4975
|
+
// node_modules/semver/ranges/outside.js
|
|
4976
|
+
var require_outside = __commonJS({
|
|
4977
|
+
"node_modules/semver/ranges/outside.js"(exports2, module2) {
|
|
4978
|
+
"use strict";
|
|
4979
|
+
var SemVer = require_semver();
|
|
4980
|
+
var Comparator = require_comparator();
|
|
4981
|
+
var { ANY } = Comparator;
|
|
4982
|
+
var Range = require_range();
|
|
4983
|
+
var satisfies = require_satisfies();
|
|
4984
|
+
var gt = require_gt();
|
|
4985
|
+
var lt2 = require_lt();
|
|
4986
|
+
var lte = require_lte();
|
|
4987
|
+
var gte = require_gte();
|
|
4988
|
+
var outside = (version, range, hilo, options) => {
|
|
4989
|
+
version = new SemVer(version, options);
|
|
4990
|
+
range = new Range(range, options);
|
|
4991
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
4992
|
+
switch (hilo) {
|
|
4993
|
+
case ">":
|
|
4994
|
+
gtfn = gt;
|
|
4995
|
+
ltefn = lte;
|
|
4996
|
+
ltfn = lt2;
|
|
4997
|
+
comp = ">";
|
|
4998
|
+
ecomp = ">=";
|
|
4999
|
+
break;
|
|
5000
|
+
case "<":
|
|
5001
|
+
gtfn = lt2;
|
|
5002
|
+
ltefn = gte;
|
|
5003
|
+
ltfn = gt;
|
|
5004
|
+
comp = "<";
|
|
5005
|
+
ecomp = "<=";
|
|
5006
|
+
break;
|
|
5007
|
+
default:
|
|
5008
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
5009
|
+
}
|
|
5010
|
+
if (satisfies(version, range, options)) {
|
|
5011
|
+
return false;
|
|
5012
|
+
}
|
|
5013
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
5014
|
+
const comparators = range.set[i];
|
|
5015
|
+
let high = null;
|
|
5016
|
+
let low = null;
|
|
5017
|
+
comparators.forEach((comparator) => {
|
|
5018
|
+
if (comparator.semver === ANY) {
|
|
5019
|
+
comparator = new Comparator(">=0.0.0");
|
|
5020
|
+
}
|
|
5021
|
+
high = high || comparator;
|
|
5022
|
+
low = low || comparator;
|
|
5023
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
5024
|
+
high = comparator;
|
|
5025
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
5026
|
+
low = comparator;
|
|
5027
|
+
}
|
|
5028
|
+
});
|
|
5029
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
5030
|
+
return false;
|
|
5031
|
+
}
|
|
5032
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
5033
|
+
return false;
|
|
5034
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
5035
|
+
return false;
|
|
5036
|
+
}
|
|
5037
|
+
}
|
|
5038
|
+
return true;
|
|
5039
|
+
};
|
|
5040
|
+
module2.exports = outside;
|
|
5041
|
+
}
|
|
5042
|
+
});
|
|
5043
|
+
|
|
5044
|
+
// node_modules/semver/ranges/gtr.js
|
|
5045
|
+
var require_gtr = __commonJS({
|
|
5046
|
+
"node_modules/semver/ranges/gtr.js"(exports2, module2) {
|
|
5047
|
+
"use strict";
|
|
5048
|
+
var outside = require_outside();
|
|
5049
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
5050
|
+
module2.exports = gtr;
|
|
5051
|
+
}
|
|
5052
|
+
});
|
|
5053
|
+
|
|
5054
|
+
// node_modules/semver/ranges/ltr.js
|
|
5055
|
+
var require_ltr = __commonJS({
|
|
5056
|
+
"node_modules/semver/ranges/ltr.js"(exports2, module2) {
|
|
5057
|
+
"use strict";
|
|
5058
|
+
var outside = require_outside();
|
|
5059
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
5060
|
+
module2.exports = ltr;
|
|
5061
|
+
}
|
|
5062
|
+
});
|
|
5063
|
+
|
|
5064
|
+
// node_modules/semver/ranges/intersects.js
|
|
5065
|
+
var require_intersects = __commonJS({
|
|
5066
|
+
"node_modules/semver/ranges/intersects.js"(exports2, module2) {
|
|
5067
|
+
"use strict";
|
|
5068
|
+
var Range = require_range();
|
|
5069
|
+
var intersects = (r1, r2, options) => {
|
|
5070
|
+
r1 = new Range(r1, options);
|
|
5071
|
+
r2 = new Range(r2, options);
|
|
5072
|
+
return r1.intersects(r2, options);
|
|
5073
|
+
};
|
|
5074
|
+
module2.exports = intersects;
|
|
5075
|
+
}
|
|
5076
|
+
});
|
|
5077
|
+
|
|
5078
|
+
// node_modules/semver/ranges/simplify.js
|
|
5079
|
+
var require_simplify = __commonJS({
|
|
5080
|
+
"node_modules/semver/ranges/simplify.js"(exports2, module2) {
|
|
5081
|
+
"use strict";
|
|
5082
|
+
var satisfies = require_satisfies();
|
|
5083
|
+
var compare = require_compare();
|
|
5084
|
+
module2.exports = (versions, range, options) => {
|
|
5085
|
+
const set = [];
|
|
5086
|
+
let first = null;
|
|
5087
|
+
let prev = null;
|
|
5088
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
5089
|
+
for (const version of v) {
|
|
5090
|
+
const included = satisfies(version, range, options);
|
|
5091
|
+
if (included) {
|
|
5092
|
+
prev = version;
|
|
5093
|
+
if (!first) {
|
|
5094
|
+
first = version;
|
|
5095
|
+
}
|
|
5096
|
+
} else {
|
|
5097
|
+
if (prev) {
|
|
5098
|
+
set.push([first, prev]);
|
|
5099
|
+
}
|
|
5100
|
+
prev = null;
|
|
5101
|
+
first = null;
|
|
5102
|
+
}
|
|
5103
|
+
}
|
|
5104
|
+
if (first) {
|
|
5105
|
+
set.push([first, null]);
|
|
5106
|
+
}
|
|
5107
|
+
const ranges = [];
|
|
5108
|
+
for (const [min, max] of set) {
|
|
5109
|
+
if (min === max) {
|
|
5110
|
+
ranges.push(min);
|
|
5111
|
+
} else if (!max && min === v[0]) {
|
|
5112
|
+
ranges.push("*");
|
|
5113
|
+
} else if (!max) {
|
|
5114
|
+
ranges.push(`>=${min}`);
|
|
5115
|
+
} else if (min === v[0]) {
|
|
5116
|
+
ranges.push(`<=${max}`);
|
|
5117
|
+
} else {
|
|
5118
|
+
ranges.push(`${min} - ${max}`);
|
|
5119
|
+
}
|
|
5120
|
+
}
|
|
5121
|
+
const simplified = ranges.join(" || ");
|
|
5122
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
5123
|
+
return simplified.length < original.length ? simplified : range;
|
|
5124
|
+
};
|
|
5125
|
+
}
|
|
5126
|
+
});
|
|
5127
|
+
|
|
5128
|
+
// node_modules/semver/ranges/subset.js
|
|
5129
|
+
var require_subset = __commonJS({
|
|
5130
|
+
"node_modules/semver/ranges/subset.js"(exports2, module2) {
|
|
5131
|
+
"use strict";
|
|
5132
|
+
var Range = require_range();
|
|
5133
|
+
var Comparator = require_comparator();
|
|
5134
|
+
var { ANY } = Comparator;
|
|
5135
|
+
var satisfies = require_satisfies();
|
|
5136
|
+
var compare = require_compare();
|
|
5137
|
+
var subset = (sub, dom, options = {}) => {
|
|
5138
|
+
if (sub === dom) {
|
|
5139
|
+
return true;
|
|
5140
|
+
}
|
|
5141
|
+
sub = new Range(sub, options);
|
|
5142
|
+
dom = new Range(dom, options);
|
|
5143
|
+
let sawNonNull = false;
|
|
5144
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
5145
|
+
for (const simpleDom of dom.set) {
|
|
5146
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
5147
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
5148
|
+
if (isSub) {
|
|
5149
|
+
continue OUTER;
|
|
5150
|
+
}
|
|
5151
|
+
}
|
|
5152
|
+
if (sawNonNull) {
|
|
5153
|
+
return false;
|
|
5154
|
+
}
|
|
5155
|
+
}
|
|
5156
|
+
return true;
|
|
5157
|
+
};
|
|
5158
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
5159
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
5160
|
+
var simpleSubset = (sub, dom, options) => {
|
|
5161
|
+
if (sub === dom) {
|
|
5162
|
+
return true;
|
|
5163
|
+
}
|
|
5164
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
5165
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
5166
|
+
return true;
|
|
5167
|
+
} else if (options.includePrerelease) {
|
|
5168
|
+
sub = minimumVersionWithPreRelease;
|
|
5169
|
+
} else {
|
|
5170
|
+
sub = minimumVersion;
|
|
5171
|
+
}
|
|
5172
|
+
}
|
|
5173
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
5174
|
+
if (options.includePrerelease) {
|
|
5175
|
+
return true;
|
|
5176
|
+
} else {
|
|
5177
|
+
dom = minimumVersion;
|
|
5178
|
+
}
|
|
5179
|
+
}
|
|
5180
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
5181
|
+
let gt, lt2;
|
|
5182
|
+
for (const c of sub) {
|
|
5183
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
5184
|
+
gt = higherGT(gt, c, options);
|
|
5185
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
5186
|
+
lt2 = lowerLT(lt2, c, options);
|
|
5187
|
+
} else {
|
|
5188
|
+
eqSet.add(c.semver);
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
if (eqSet.size > 1) {
|
|
5192
|
+
return null;
|
|
5193
|
+
}
|
|
5194
|
+
let gtltComp;
|
|
5195
|
+
if (gt && lt2) {
|
|
5196
|
+
gtltComp = compare(gt.semver, lt2.semver, options);
|
|
5197
|
+
if (gtltComp > 0) {
|
|
5198
|
+
return null;
|
|
5199
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt2.operator !== "<=")) {
|
|
5200
|
+
return null;
|
|
5201
|
+
}
|
|
5202
|
+
}
|
|
5203
|
+
for (const eq of eqSet) {
|
|
5204
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
5205
|
+
return null;
|
|
5206
|
+
}
|
|
5207
|
+
if (lt2 && !satisfies(eq, String(lt2), options)) {
|
|
5208
|
+
return null;
|
|
5209
|
+
}
|
|
5210
|
+
for (const c of dom) {
|
|
5211
|
+
if (!satisfies(eq, String(c), options)) {
|
|
5212
|
+
return false;
|
|
5213
|
+
}
|
|
5214
|
+
}
|
|
5215
|
+
return true;
|
|
5216
|
+
}
|
|
5217
|
+
let higher, lower;
|
|
5218
|
+
let hasDomLT, hasDomGT;
|
|
5219
|
+
let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false;
|
|
5220
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
5221
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
5222
|
+
needDomLTPre = false;
|
|
5223
|
+
}
|
|
5224
|
+
for (const c of dom) {
|
|
5225
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
5226
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
5227
|
+
if (gt) {
|
|
5228
|
+
if (needDomGTPre) {
|
|
5229
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
5230
|
+
needDomGTPre = false;
|
|
5231
|
+
}
|
|
5232
|
+
}
|
|
5233
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
5234
|
+
higher = higherGT(gt, c, options);
|
|
5235
|
+
if (higher === c && higher !== gt) {
|
|
5236
|
+
return false;
|
|
5237
|
+
}
|
|
5238
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
5239
|
+
return false;
|
|
5240
|
+
}
|
|
5241
|
+
}
|
|
5242
|
+
if (lt2) {
|
|
5243
|
+
if (needDomLTPre) {
|
|
5244
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
5245
|
+
needDomLTPre = false;
|
|
5246
|
+
}
|
|
5247
|
+
}
|
|
5248
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
5249
|
+
lower = lowerLT(lt2, c, options);
|
|
5250
|
+
if (lower === c && lower !== lt2) {
|
|
5251
|
+
return false;
|
|
5252
|
+
}
|
|
5253
|
+
} else if (lt2.operator === "<=" && !satisfies(lt2.semver, String(c), options)) {
|
|
5254
|
+
return false;
|
|
5255
|
+
}
|
|
5256
|
+
}
|
|
5257
|
+
if (!c.operator && (lt2 || gt) && gtltComp !== 0) {
|
|
5258
|
+
return false;
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
if (gt && hasDomLT && !lt2 && gtltComp !== 0) {
|
|
5262
|
+
return false;
|
|
5263
|
+
}
|
|
5264
|
+
if (lt2 && hasDomGT && !gt && gtltComp !== 0) {
|
|
5265
|
+
return false;
|
|
5266
|
+
}
|
|
5267
|
+
if (needDomGTPre || needDomLTPre) {
|
|
5268
|
+
return false;
|
|
5269
|
+
}
|
|
5270
|
+
return true;
|
|
5271
|
+
};
|
|
5272
|
+
var higherGT = (a, b, options) => {
|
|
5273
|
+
if (!a) {
|
|
5274
|
+
return b;
|
|
5275
|
+
}
|
|
5276
|
+
const comp = compare(a.semver, b.semver, options);
|
|
5277
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
5278
|
+
};
|
|
5279
|
+
var lowerLT = (a, b, options) => {
|
|
5280
|
+
if (!a) {
|
|
5281
|
+
return b;
|
|
5282
|
+
}
|
|
5283
|
+
const comp = compare(a.semver, b.semver, options);
|
|
5284
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
5285
|
+
};
|
|
5286
|
+
module2.exports = subset;
|
|
5287
|
+
}
|
|
5288
|
+
});
|
|
5289
|
+
|
|
5290
|
+
// node_modules/semver/index.js
|
|
5291
|
+
var require_semver2 = __commonJS({
|
|
5292
|
+
"node_modules/semver/index.js"(exports2, module2) {
|
|
5293
|
+
"use strict";
|
|
5294
|
+
var internalRe = require_re();
|
|
5295
|
+
var constants = require_constants();
|
|
5296
|
+
var SemVer = require_semver();
|
|
5297
|
+
var identifiers = require_identifiers();
|
|
5298
|
+
var parse = require_parse();
|
|
5299
|
+
var valid2 = require_valid();
|
|
5300
|
+
var clean = require_clean();
|
|
5301
|
+
var inc = require_inc();
|
|
5302
|
+
var diff = require_diff();
|
|
5303
|
+
var major = require_major();
|
|
5304
|
+
var minor = require_minor();
|
|
5305
|
+
var patch = require_patch();
|
|
5306
|
+
var prerelease = require_prerelease();
|
|
5307
|
+
var compare = require_compare();
|
|
5308
|
+
var rcompare = require_rcompare();
|
|
5309
|
+
var compareLoose = require_compare_loose();
|
|
5310
|
+
var compareBuild = require_compare_build();
|
|
5311
|
+
var sort = require_sort();
|
|
5312
|
+
var rsort = require_rsort();
|
|
5313
|
+
var gt = require_gt();
|
|
5314
|
+
var lt2 = require_lt();
|
|
5315
|
+
var eq = require_eq();
|
|
5316
|
+
var neq = require_neq();
|
|
5317
|
+
var gte = require_gte();
|
|
5318
|
+
var lte = require_lte();
|
|
5319
|
+
var cmp = require_cmp();
|
|
5320
|
+
var coerce = require_coerce();
|
|
5321
|
+
var Comparator = require_comparator();
|
|
5322
|
+
var Range = require_range();
|
|
5323
|
+
var satisfies = require_satisfies();
|
|
5324
|
+
var toComparators = require_to_comparators();
|
|
5325
|
+
var maxSatisfying = require_max_satisfying();
|
|
5326
|
+
var minSatisfying = require_min_satisfying();
|
|
5327
|
+
var minVersion = require_min_version();
|
|
5328
|
+
var validRange = require_valid2();
|
|
5329
|
+
var outside = require_outside();
|
|
5330
|
+
var gtr = require_gtr();
|
|
5331
|
+
var ltr = require_ltr();
|
|
5332
|
+
var intersects = require_intersects();
|
|
5333
|
+
var simplifyRange = require_simplify();
|
|
5334
|
+
var subset = require_subset();
|
|
5335
|
+
module2.exports = {
|
|
5336
|
+
parse,
|
|
5337
|
+
valid: valid2,
|
|
5338
|
+
clean,
|
|
5339
|
+
inc,
|
|
5340
|
+
diff,
|
|
5341
|
+
major,
|
|
5342
|
+
minor,
|
|
5343
|
+
patch,
|
|
5344
|
+
prerelease,
|
|
5345
|
+
compare,
|
|
5346
|
+
rcompare,
|
|
5347
|
+
compareLoose,
|
|
5348
|
+
compareBuild,
|
|
5349
|
+
sort,
|
|
5350
|
+
rsort,
|
|
5351
|
+
gt,
|
|
5352
|
+
lt: lt2,
|
|
5353
|
+
eq,
|
|
5354
|
+
neq,
|
|
5355
|
+
gte,
|
|
5356
|
+
lte,
|
|
5357
|
+
cmp,
|
|
5358
|
+
coerce,
|
|
5359
|
+
Comparator,
|
|
5360
|
+
Range,
|
|
5361
|
+
satisfies,
|
|
5362
|
+
toComparators,
|
|
5363
|
+
maxSatisfying,
|
|
5364
|
+
minSatisfying,
|
|
5365
|
+
minVersion,
|
|
5366
|
+
validRange,
|
|
5367
|
+
outside,
|
|
5368
|
+
gtr,
|
|
5369
|
+
ltr,
|
|
5370
|
+
intersects,
|
|
5371
|
+
simplifyRange,
|
|
5372
|
+
subset,
|
|
5373
|
+
SemVer,
|
|
5374
|
+
re: internalRe.re,
|
|
5375
|
+
src: internalRe.src,
|
|
5376
|
+
tokens: internalRe.t,
|
|
5377
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
5378
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
5379
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
5380
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
5381
|
+
};
|
|
5382
|
+
}
|
|
5383
|
+
});
|
|
5384
|
+
|
|
3455
5385
|
// src/cli.ts
|
|
3456
5386
|
var import_fs5 = require("fs");
|
|
3457
5387
|
var import_path6 = require("path");
|
|
@@ -3479,6 +5409,7 @@ var {
|
|
|
3479
5409
|
var readline = __toESM(require("readline"), 1);
|
|
3480
5410
|
var import_fs3 = require("fs");
|
|
3481
5411
|
var import_path4 = require("path");
|
|
5412
|
+
var semver = __toESM(require_semver2(), 1);
|
|
3482
5413
|
|
|
3483
5414
|
// src/direct-unity-client.ts
|
|
3484
5415
|
var net = __toESM(require("net"), 1);
|
|
@@ -3690,7 +5621,7 @@ var import_path3 = require("path");
|
|
|
3690
5621
|
|
|
3691
5622
|
// src/default-tools.json
|
|
3692
5623
|
var default_tools_default = {
|
|
3693
|
-
version: "0.
|
|
5624
|
+
version: "0.46.0",
|
|
3694
5625
|
tools: [
|
|
3695
5626
|
{
|
|
3696
5627
|
name: "compile",
|
|
@@ -4087,7 +6018,7 @@ function getCacheFilePath() {
|
|
|
4087
6018
|
}
|
|
4088
6019
|
|
|
4089
6020
|
// src/version.ts
|
|
4090
|
-
var VERSION = "0.
|
|
6021
|
+
var VERSION = "0.46.0";
|
|
4091
6022
|
|
|
4092
6023
|
// src/spinner.ts
|
|
4093
6024
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -4159,6 +6090,32 @@ function isRetryableError(error) {
|
|
|
4159
6090
|
const message = error.message;
|
|
4160
6091
|
return message.includes("ECONNREFUSED") || message === "UNITY_NO_RESPONSE";
|
|
4161
6092
|
}
|
|
6093
|
+
function isVersionOlder(v1, v2) {
|
|
6094
|
+
const parsed1 = semver.valid(v1);
|
|
6095
|
+
const parsed2 = semver.valid(v2);
|
|
6096
|
+
if (parsed1 && parsed2) {
|
|
6097
|
+
return semver.lt(parsed1, parsed2);
|
|
6098
|
+
}
|
|
6099
|
+
return v1 < v2;
|
|
6100
|
+
}
|
|
6101
|
+
function printVersionWarning(cliVersion, serverVersion) {
|
|
6102
|
+
const isCliOlder = isVersionOlder(cliVersion, serverVersion);
|
|
6103
|
+
const updateCommand = isCliOlder ? `npm install -g uloop-cli@${serverVersion}` : `Update uLoopMCP package to ${cliVersion} via Unity Package Manager`;
|
|
6104
|
+
console.error("\x1B[33m\u26A0\uFE0F Version mismatch detected!\x1B[0m");
|
|
6105
|
+
console.error(` uloop-cli version: ${cliVersion}`);
|
|
6106
|
+
console.error(` uloop server version: ${serverVersion}`);
|
|
6107
|
+
console.error("");
|
|
6108
|
+
console.error(" This may cause unexpected behavior or errors.");
|
|
6109
|
+
console.error("");
|
|
6110
|
+
console.error(` ${isCliOlder ? "To update CLI:" : "To update server:"} ${updateCommand}`);
|
|
6111
|
+
console.error("");
|
|
6112
|
+
}
|
|
6113
|
+
function checkServerVersion(result) {
|
|
6114
|
+
const serverVersion = result["ULoopServerVersion"];
|
|
6115
|
+
if (serverVersion && serverVersion !== VERSION) {
|
|
6116
|
+
printVersionWarning(VERSION, serverVersion);
|
|
6117
|
+
}
|
|
6118
|
+
}
|
|
4162
6119
|
function checkUnityBusyState() {
|
|
4163
6120
|
const projectRoot = findUnityProjectRoot();
|
|
4164
6121
|
if (projectRoot === null) {
|
|
@@ -4202,6 +6159,7 @@ async function executeToolCommand(toolName, params, globalOptions) {
|
|
|
4202
6159
|
}
|
|
4203
6160
|
spinner.stop();
|
|
4204
6161
|
restoreStdin();
|
|
6162
|
+
checkServerVersion(result);
|
|
4205
6163
|
console.log(JSON.stringify(result, null, 2));
|
|
4206
6164
|
return;
|
|
4207
6165
|
} catch (error) {
|
|
@@ -4428,53 +6386,53 @@ var BUNDLED_SKILLS = [
|
|
|
4428
6386
|
];
|
|
4429
6387
|
|
|
4430
6388
|
// src/skills/skills-manager.ts
|
|
4431
|
-
function getGlobalSkillsDir() {
|
|
4432
|
-
return (0, import_path5.join)((0, import_os.homedir)(),
|
|
6389
|
+
function getGlobalSkillsDir(target) {
|
|
6390
|
+
return (0, import_path5.join)((0, import_os.homedir)(), target.projectDir, "skills");
|
|
4433
6391
|
}
|
|
4434
|
-
function getProjectSkillsDir() {
|
|
4435
|
-
return (0, import_path5.join)(process.cwd(),
|
|
6392
|
+
function getProjectSkillsDir(target) {
|
|
6393
|
+
return (0, import_path5.join)(process.cwd(), target.projectDir, "skills");
|
|
4436
6394
|
}
|
|
4437
|
-
function getSkillPath(skillDirName, global) {
|
|
4438
|
-
const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();
|
|
4439
|
-
return (0, import_path5.join)(baseDir, skillDirName,
|
|
6395
|
+
function getSkillPath(skillDirName, target, global) {
|
|
6396
|
+
const baseDir = global ? getGlobalSkillsDir(target) : getProjectSkillsDir(target);
|
|
6397
|
+
return (0, import_path5.join)(baseDir, skillDirName, target.skillFileName);
|
|
4440
6398
|
}
|
|
4441
|
-
function isSkillInstalled(skill, global) {
|
|
4442
|
-
const skillPath = getSkillPath(skill.dirName, global);
|
|
6399
|
+
function isSkillInstalled(skill, target, global) {
|
|
6400
|
+
const skillPath = getSkillPath(skill.dirName, target, global);
|
|
4443
6401
|
return (0, import_fs4.existsSync)(skillPath);
|
|
4444
6402
|
}
|
|
4445
|
-
function isSkillOutdated(skill, global) {
|
|
4446
|
-
const skillPath = getSkillPath(skill.dirName, global);
|
|
6403
|
+
function isSkillOutdated(skill, target, global) {
|
|
6404
|
+
const skillPath = getSkillPath(skill.dirName, target, global);
|
|
4447
6405
|
if (!(0, import_fs4.existsSync)(skillPath)) {
|
|
4448
6406
|
return false;
|
|
4449
6407
|
}
|
|
4450
6408
|
const installedContent = (0, import_fs4.readFileSync)(skillPath, "utf-8");
|
|
4451
6409
|
return installedContent !== skill.content;
|
|
4452
6410
|
}
|
|
4453
|
-
function getSkillStatus(skill, global) {
|
|
4454
|
-
if (!isSkillInstalled(skill, global)) {
|
|
6411
|
+
function getSkillStatus(skill, target, global) {
|
|
6412
|
+
if (!isSkillInstalled(skill, target, global)) {
|
|
4455
6413
|
return "not_installed";
|
|
4456
6414
|
}
|
|
4457
|
-
if (isSkillOutdated(skill, global)) {
|
|
6415
|
+
if (isSkillOutdated(skill, target, global)) {
|
|
4458
6416
|
return "outdated";
|
|
4459
6417
|
}
|
|
4460
6418
|
return "installed";
|
|
4461
6419
|
}
|
|
4462
|
-
function getAllSkillStatuses(global) {
|
|
6420
|
+
function getAllSkillStatuses(target, global) {
|
|
4463
6421
|
return BUNDLED_SKILLS.map((skill) => ({
|
|
4464
6422
|
name: skill.name,
|
|
4465
|
-
status: getSkillStatus(skill, global),
|
|
4466
|
-
path: isSkillInstalled(skill, global) ? getSkillPath(skill.dirName, global) : void 0
|
|
6423
|
+
status: getSkillStatus(skill, target, global),
|
|
6424
|
+
path: isSkillInstalled(skill, target, global) ? getSkillPath(skill.dirName, target, global) : void 0
|
|
4467
6425
|
}));
|
|
4468
6426
|
}
|
|
4469
|
-
function installSkill(skill, global) {
|
|
4470
|
-
const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();
|
|
6427
|
+
function installSkill(skill, target, global) {
|
|
6428
|
+
const baseDir = global ? getGlobalSkillsDir(target) : getProjectSkillsDir(target);
|
|
4471
6429
|
const skillDir = (0, import_path5.join)(baseDir, skill.dirName);
|
|
4472
|
-
const skillPath = (0, import_path5.join)(skillDir,
|
|
6430
|
+
const skillPath = (0, import_path5.join)(skillDir, target.skillFileName);
|
|
4473
6431
|
(0, import_fs4.mkdirSync)(skillDir, { recursive: true });
|
|
4474
6432
|
(0, import_fs4.writeFileSync)(skillPath, skill.content, "utf-8");
|
|
4475
6433
|
}
|
|
4476
|
-
function uninstallSkill(skill, global) {
|
|
4477
|
-
const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();
|
|
6434
|
+
function uninstallSkill(skill, target, global) {
|
|
6435
|
+
const baseDir = global ? getGlobalSkillsDir(target) : getProjectSkillsDir(target);
|
|
4478
6436
|
const skillDir = (0, import_path5.join)(baseDir, skill.dirName);
|
|
4479
6437
|
if (!(0, import_fs4.existsSync)(skillDir)) {
|
|
4480
6438
|
return false;
|
|
@@ -4482,15 +6440,15 @@ function uninstallSkill(skill, global) {
|
|
|
4482
6440
|
(0, import_fs4.rmSync)(skillDir, { recursive: true, force: true });
|
|
4483
6441
|
return true;
|
|
4484
6442
|
}
|
|
4485
|
-
function installAllSkills(global) {
|
|
6443
|
+
function installAllSkills(target, global) {
|
|
4486
6444
|
const result = { installed: 0, updated: 0, skipped: 0 };
|
|
4487
6445
|
for (const skill of BUNDLED_SKILLS) {
|
|
4488
|
-
const status = getSkillStatus(skill, global);
|
|
6446
|
+
const status = getSkillStatus(skill, target, global);
|
|
4489
6447
|
if (status === "not_installed") {
|
|
4490
|
-
installSkill(skill, global);
|
|
6448
|
+
installSkill(skill, target, global);
|
|
4491
6449
|
result.installed++;
|
|
4492
6450
|
} else if (status === "outdated") {
|
|
4493
|
-
installSkill(skill, global);
|
|
6451
|
+
installSkill(skill, target, global);
|
|
4494
6452
|
result.updated++;
|
|
4495
6453
|
} else {
|
|
4496
6454
|
result.skipped++;
|
|
@@ -4498,10 +6456,10 @@ function installAllSkills(global) {
|
|
|
4498
6456
|
}
|
|
4499
6457
|
return result;
|
|
4500
6458
|
}
|
|
4501
|
-
function uninstallAllSkills(global) {
|
|
6459
|
+
function uninstallAllSkills(target, global) {
|
|
4502
6460
|
const result = { removed: 0, notFound: 0 };
|
|
4503
6461
|
for (const skill of BUNDLED_SKILLS) {
|
|
4504
|
-
if (uninstallSkill(skill, global)) {
|
|
6462
|
+
if (uninstallSkill(skill, target, global)) {
|
|
4505
6463
|
result.removed++;
|
|
4506
6464
|
} else {
|
|
4507
6465
|
result.notFound++;
|
|
@@ -4509,41 +6467,103 @@ function uninstallAllSkills(global) {
|
|
|
4509
6467
|
}
|
|
4510
6468
|
return result;
|
|
4511
6469
|
}
|
|
4512
|
-
function getInstallDir(global) {
|
|
4513
|
-
return global ? getGlobalSkillsDir() : getProjectSkillsDir();
|
|
6470
|
+
function getInstallDir(target, global) {
|
|
6471
|
+
return global ? getGlobalSkillsDir(target) : getProjectSkillsDir(target);
|
|
4514
6472
|
}
|
|
4515
6473
|
function getTotalSkillCount() {
|
|
4516
6474
|
return BUNDLED_SKILLS.length;
|
|
4517
6475
|
}
|
|
4518
6476
|
|
|
6477
|
+
// src/skills/target-config.ts
|
|
6478
|
+
var TARGET_CONFIGS = {
|
|
6479
|
+
claude: {
|
|
6480
|
+
id: "claude",
|
|
6481
|
+
displayName: "Claude Code",
|
|
6482
|
+
projectDir: ".claude",
|
|
6483
|
+
skillFileName: "SKILL.md"
|
|
6484
|
+
},
|
|
6485
|
+
codex: {
|
|
6486
|
+
id: "codex",
|
|
6487
|
+
displayName: "Codex CLI",
|
|
6488
|
+
projectDir: ".codex",
|
|
6489
|
+
skillFileName: "SKILL.md"
|
|
6490
|
+
}
|
|
6491
|
+
};
|
|
6492
|
+
var ALL_TARGET_IDS = ["claude", "codex"];
|
|
6493
|
+
function getTargetConfig(id) {
|
|
6494
|
+
return TARGET_CONFIGS[id];
|
|
6495
|
+
}
|
|
6496
|
+
|
|
4519
6497
|
// src/skills/skills-command.ts
|
|
4520
6498
|
function registerSkillsCommand(program3) {
|
|
4521
|
-
const skillsCmd = program3.command("skills").description("Manage uloop skills for
|
|
4522
|
-
skillsCmd.command("list").description("List all uloop skills and their installation status").option("-g, --global", "Check global installation
|
|
4523
|
-
|
|
6499
|
+
const skillsCmd = program3.command("skills").description("Manage uloop skills for AI coding tools");
|
|
6500
|
+
skillsCmd.command("list").description("List all uloop skills and their installation status").option("-g, --global", "Check global installation").option("--claude", "Check Claude Code installation").option("--codex", "Check Codex CLI installation").action((options) => {
|
|
6501
|
+
const targets = resolveTargets(options);
|
|
6502
|
+
const global = options.global ?? false;
|
|
6503
|
+
listSkills(targets, global);
|
|
4524
6504
|
});
|
|
4525
|
-
skillsCmd.command("install").description("Install all uloop skills").option("-g, --global", "Install to global location
|
|
4526
|
-
|
|
6505
|
+
skillsCmd.command("install").description("Install all uloop skills").option("-g, --global", "Install to global location").option("--claude", "Install to Claude Code").option("--codex", "Install to Codex CLI").action((options) => {
|
|
6506
|
+
const targets = resolveTargets(options);
|
|
6507
|
+
if (targets.length === 0) {
|
|
6508
|
+
showTargetGuidance("install");
|
|
6509
|
+
return;
|
|
6510
|
+
}
|
|
6511
|
+
installSkills(targets, options.global ?? false);
|
|
4527
6512
|
});
|
|
4528
|
-
skillsCmd.command("uninstall").description("Uninstall all uloop skills").option("-g, --global", "Uninstall from global location
|
|
4529
|
-
|
|
6513
|
+
skillsCmd.command("uninstall").description("Uninstall all uloop skills").option("-g, --global", "Uninstall from global location").option("--claude", "Uninstall from Claude Code").option("--codex", "Uninstall from Codex CLI").action((options) => {
|
|
6514
|
+
const targets = resolveTargets(options);
|
|
6515
|
+
if (targets.length === 0) {
|
|
6516
|
+
showTargetGuidance("uninstall");
|
|
6517
|
+
return;
|
|
6518
|
+
}
|
|
6519
|
+
uninstallSkills(targets, options.global ?? false);
|
|
4530
6520
|
});
|
|
4531
6521
|
}
|
|
4532
|
-
function
|
|
6522
|
+
function resolveTargets(options) {
|
|
6523
|
+
const targets = [];
|
|
6524
|
+
if (options.claude) {
|
|
6525
|
+
targets.push(getTargetConfig("claude"));
|
|
6526
|
+
}
|
|
6527
|
+
if (options.codex) {
|
|
6528
|
+
targets.push(getTargetConfig("codex"));
|
|
6529
|
+
}
|
|
6530
|
+
return targets;
|
|
6531
|
+
}
|
|
6532
|
+
function showTargetGuidance(command) {
|
|
6533
|
+
console.log(`
|
|
6534
|
+
Please specify at least one target for '${command}':`);
|
|
6535
|
+
console.log("");
|
|
6536
|
+
console.log("Available targets:");
|
|
6537
|
+
console.log(" --claude Claude Code (.claude/skills/)");
|
|
6538
|
+
console.log(" --codex Codex CLI (.codex/skills/)");
|
|
6539
|
+
console.log("");
|
|
6540
|
+
console.log("Options:");
|
|
6541
|
+
console.log(" -g, --global Use global location (~/.claude/ or ~/.codex/)");
|
|
6542
|
+
console.log("");
|
|
6543
|
+
console.log("Examples:");
|
|
6544
|
+
console.log(` uloop skills ${command} --claude`);
|
|
6545
|
+
console.log(` uloop skills ${command} --codex --global`);
|
|
6546
|
+
console.log(` uloop skills ${command} --claude --codex`);
|
|
6547
|
+
}
|
|
6548
|
+
function listSkills(targets, global) {
|
|
4533
6549
|
const location = global ? "Global" : "Project";
|
|
4534
|
-
const
|
|
6550
|
+
const targetConfigs = targets.length > 0 ? targets : ALL_TARGET_IDS.map(getTargetConfig);
|
|
4535
6551
|
console.log(`
|
|
4536
|
-
uloop Skills Status
|
|
4537
|
-
console.log(`Location: ${dir}`);
|
|
4538
|
-
console.log("=".repeat(50));
|
|
6552
|
+
uloop Skills Status:`);
|
|
4539
6553
|
console.log("");
|
|
4540
|
-
const
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
console.log(
|
|
6554
|
+
for (const target of targetConfigs) {
|
|
6555
|
+
const dir = getInstallDir(target, global);
|
|
6556
|
+
console.log(`${target.displayName} (${location}):`);
|
|
6557
|
+
console.log(`Location: ${dir}`);
|
|
6558
|
+
console.log("=".repeat(50));
|
|
6559
|
+
const statuses = getAllSkillStatuses(target, global);
|
|
6560
|
+
for (const skill of statuses) {
|
|
6561
|
+
const icon = getStatusIcon(skill.status);
|
|
6562
|
+
const statusText = getStatusText(skill.status);
|
|
6563
|
+
console.log(` ${icon} ${skill.name} (${statusText})`);
|
|
6564
|
+
}
|
|
6565
|
+
console.log("");
|
|
4545
6566
|
}
|
|
4546
|
-
console.log("");
|
|
4547
6567
|
console.log(`Total: ${getTotalSkillCount()} bundled skills`);
|
|
4548
6568
|
}
|
|
4549
6569
|
function getStatusIcon(status) {
|
|
@@ -4570,30 +6590,36 @@ function getStatusText(status) {
|
|
|
4570
6590
|
return "unknown";
|
|
4571
6591
|
}
|
|
4572
6592
|
}
|
|
4573
|
-
function installSkills(global) {
|
|
6593
|
+
function installSkills(targets, global) {
|
|
4574
6594
|
const location = global ? "global" : "project";
|
|
4575
|
-
const dir = getInstallDir(global);
|
|
4576
6595
|
console.log(`
|
|
4577
6596
|
Installing uloop skills (${location})...`);
|
|
4578
6597
|
console.log("");
|
|
4579
|
-
const
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
6598
|
+
for (const target of targets) {
|
|
6599
|
+
const dir = getInstallDir(target, global);
|
|
6600
|
+
const result = installAllSkills(target, global);
|
|
6601
|
+
console.log(`${target.displayName}:`);
|
|
6602
|
+
console.log(` \x1B[32m\u2713\x1B[0m Installed: ${result.installed}`);
|
|
6603
|
+
console.log(` \x1B[33m\u2191\x1B[0m Updated: ${result.updated}`);
|
|
6604
|
+
console.log(` \x1B[90m-\x1B[0m Skipped (up-to-date): ${result.skipped}`);
|
|
6605
|
+
console.log(` Location: ${dir}`);
|
|
6606
|
+
console.log("");
|
|
6607
|
+
}
|
|
4585
6608
|
}
|
|
4586
|
-
function uninstallSkills(global) {
|
|
6609
|
+
function uninstallSkills(targets, global) {
|
|
4587
6610
|
const location = global ? "global" : "project";
|
|
4588
|
-
const dir = getInstallDir(global);
|
|
4589
6611
|
console.log(`
|
|
4590
6612
|
Uninstalling uloop skills (${location})...`);
|
|
4591
6613
|
console.log("");
|
|
4592
|
-
const
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
6614
|
+
for (const target of targets) {
|
|
6615
|
+
const dir = getInstallDir(target, global);
|
|
6616
|
+
const result = uninstallAllSkills(target, global);
|
|
6617
|
+
console.log(`${target.displayName}:`);
|
|
6618
|
+
console.log(` \x1B[31m\u2717\x1B[0m Removed: ${result.removed}`);
|
|
6619
|
+
console.log(` \x1B[90m-\x1B[0m Not found: ${result.notFound}`);
|
|
6620
|
+
console.log(` Location: ${dir}`);
|
|
6621
|
+
console.log("");
|
|
6622
|
+
}
|
|
4597
6623
|
}
|
|
4598
6624
|
|
|
4599
6625
|
// src/cli.ts
|