@ant-design/cli 6.4.2 → 6.4.3
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/data/v6.4.3.json.gz +0 -0
- package/data/v6.json.gz +0 -0
- package/data/versions.json +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +255 -2245
- package/package.json +8 -2
- package/skills/antd/SKILL.md +7 -3
- package/data/v6.3.1.json.gz +0 -0
- package/data/v6.3.3.json.gz +0 -0
- package/data/v6.3.4.json.gz +0 -0
- package/data/v6.3.5.json.gz +0 -0
- package/data/v6.3.6.json.gz +0 -0
- package/data/v6.4.0.json.gz +0 -0
- package/data/v6.4.1.json.gz +0 -0
- package/data/v6.4.2.json.gz +0 -0
package/dist/index.js
CHANGED
|
@@ -11150,1936 +11150,6 @@ var require_dist = __commonJS({
|
|
|
11150
11150
|
}
|
|
11151
11151
|
});
|
|
11152
11152
|
|
|
11153
|
-
// node_modules/semver/internal/constants.js
|
|
11154
|
-
var require_constants = __commonJS({
|
|
11155
|
-
"node_modules/semver/internal/constants.js"(exports, module) {
|
|
11156
|
-
"use strict";
|
|
11157
|
-
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
11158
|
-
var MAX_LENGTH = 256;
|
|
11159
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
11160
|
-
9007199254740991;
|
|
11161
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
11162
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
11163
|
-
var RELEASE_TYPES = [
|
|
11164
|
-
"major",
|
|
11165
|
-
"premajor",
|
|
11166
|
-
"minor",
|
|
11167
|
-
"preminor",
|
|
11168
|
-
"patch",
|
|
11169
|
-
"prepatch",
|
|
11170
|
-
"prerelease"
|
|
11171
|
-
];
|
|
11172
|
-
module.exports = {
|
|
11173
|
-
MAX_LENGTH,
|
|
11174
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
11175
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
11176
|
-
MAX_SAFE_INTEGER,
|
|
11177
|
-
RELEASE_TYPES,
|
|
11178
|
-
SEMVER_SPEC_VERSION,
|
|
11179
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
11180
|
-
FLAG_LOOSE: 2
|
|
11181
|
-
};
|
|
11182
|
-
}
|
|
11183
|
-
});
|
|
11184
|
-
|
|
11185
|
-
// node_modules/semver/internal/debug.js
|
|
11186
|
-
var require_debug = __commonJS({
|
|
11187
|
-
"node_modules/semver/internal/debug.js"(exports, module) {
|
|
11188
|
-
"use strict";
|
|
11189
|
-
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
11190
|
-
};
|
|
11191
|
-
module.exports = debug;
|
|
11192
|
-
}
|
|
11193
|
-
});
|
|
11194
|
-
|
|
11195
|
-
// node_modules/semver/internal/re.js
|
|
11196
|
-
var require_re = __commonJS({
|
|
11197
|
-
"node_modules/semver/internal/re.js"(exports, module) {
|
|
11198
|
-
"use strict";
|
|
11199
|
-
var {
|
|
11200
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
11201
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
11202
|
-
MAX_LENGTH
|
|
11203
|
-
} = require_constants();
|
|
11204
|
-
var debug = require_debug();
|
|
11205
|
-
exports = module.exports = {};
|
|
11206
|
-
var re = exports.re = [];
|
|
11207
|
-
var safeRe = exports.safeRe = [];
|
|
11208
|
-
var src = exports.src = [];
|
|
11209
|
-
var safeSrc = exports.safeSrc = [];
|
|
11210
|
-
var t = exports.t = {};
|
|
11211
|
-
var R = 0;
|
|
11212
|
-
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
11213
|
-
var safeRegexReplacements = [
|
|
11214
|
-
["\\s", 1],
|
|
11215
|
-
["\\d", MAX_LENGTH],
|
|
11216
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
11217
|
-
];
|
|
11218
|
-
var makeSafeRegex = (value) => {
|
|
11219
|
-
for (const [token, max] of safeRegexReplacements) {
|
|
11220
|
-
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
11221
|
-
}
|
|
11222
|
-
return value;
|
|
11223
|
-
};
|
|
11224
|
-
var createToken = (name, value, isGlobal) => {
|
|
11225
|
-
const safe = makeSafeRegex(value);
|
|
11226
|
-
const index = R++;
|
|
11227
|
-
debug(name, index, value);
|
|
11228
|
-
t[name] = index;
|
|
11229
|
-
src[index] = value;
|
|
11230
|
-
safeSrc[index] = safe;
|
|
11231
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
11232
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
11233
|
-
};
|
|
11234
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
11235
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
11236
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
11237
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
11238
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
11239
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
11240
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
11241
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
11242
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
11243
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
11244
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
11245
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
11246
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
11247
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
11248
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
11249
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
11250
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
11251
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
11252
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
11253
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
11254
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
11255
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
11256
|
-
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
11257
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
11258
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
11259
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
11260
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
11261
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
11262
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
11263
|
-
exports.tildeTrimReplace = "$1~";
|
|
11264
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
11265
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
11266
|
-
createToken("LONECARET", "(?:\\^)");
|
|
11267
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
11268
|
-
exports.caretTrimReplace = "$1^";
|
|
11269
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
11270
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
11271
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
11272
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
11273
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
11274
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
11275
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
11276
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
11277
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
11278
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
11279
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
11280
|
-
}
|
|
11281
|
-
});
|
|
11282
|
-
|
|
11283
|
-
// node_modules/semver/internal/parse-options.js
|
|
11284
|
-
var require_parse_options = __commonJS({
|
|
11285
|
-
"node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
11286
|
-
"use strict";
|
|
11287
|
-
var looseOption = Object.freeze({ loose: true });
|
|
11288
|
-
var emptyOpts = Object.freeze({});
|
|
11289
|
-
var parseOptions = (options) => {
|
|
11290
|
-
if (!options) {
|
|
11291
|
-
return emptyOpts;
|
|
11292
|
-
}
|
|
11293
|
-
if (typeof options !== "object") {
|
|
11294
|
-
return looseOption;
|
|
11295
|
-
}
|
|
11296
|
-
return options;
|
|
11297
|
-
};
|
|
11298
|
-
module.exports = parseOptions;
|
|
11299
|
-
}
|
|
11300
|
-
});
|
|
11301
|
-
|
|
11302
|
-
// node_modules/semver/internal/identifiers.js
|
|
11303
|
-
var require_identifiers = __commonJS({
|
|
11304
|
-
"node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
11305
|
-
"use strict";
|
|
11306
|
-
var numeric = /^[0-9]+$/;
|
|
11307
|
-
var compareIdentifiers = (a, b) => {
|
|
11308
|
-
if (typeof a === "number" && typeof b === "number") {
|
|
11309
|
-
return a === b ? 0 : a < b ? -1 : 1;
|
|
11310
|
-
}
|
|
11311
|
-
const anum = numeric.test(a);
|
|
11312
|
-
const bnum = numeric.test(b);
|
|
11313
|
-
if (anum && bnum) {
|
|
11314
|
-
a = +a;
|
|
11315
|
-
b = +b;
|
|
11316
|
-
}
|
|
11317
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
11318
|
-
};
|
|
11319
|
-
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
11320
|
-
module.exports = {
|
|
11321
|
-
compareIdentifiers,
|
|
11322
|
-
rcompareIdentifiers
|
|
11323
|
-
};
|
|
11324
|
-
}
|
|
11325
|
-
});
|
|
11326
|
-
|
|
11327
|
-
// node_modules/semver/classes/semver.js
|
|
11328
|
-
var require_semver = __commonJS({
|
|
11329
|
-
"node_modules/semver/classes/semver.js"(exports, module) {
|
|
11330
|
-
"use strict";
|
|
11331
|
-
var debug = require_debug();
|
|
11332
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
11333
|
-
var { safeRe: re, t } = require_re();
|
|
11334
|
-
var parseOptions = require_parse_options();
|
|
11335
|
-
var { compareIdentifiers } = require_identifiers();
|
|
11336
|
-
var SemVer = class _SemVer {
|
|
11337
|
-
constructor(version2, options) {
|
|
11338
|
-
options = parseOptions(options);
|
|
11339
|
-
if (version2 instanceof _SemVer) {
|
|
11340
|
-
if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
|
|
11341
|
-
return version2;
|
|
11342
|
-
} else {
|
|
11343
|
-
version2 = version2.version;
|
|
11344
|
-
}
|
|
11345
|
-
} else if (typeof version2 !== "string") {
|
|
11346
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
|
|
11347
|
-
}
|
|
11348
|
-
if (version2.length > MAX_LENGTH) {
|
|
11349
|
-
throw new TypeError(
|
|
11350
|
-
`version is longer than ${MAX_LENGTH} characters`
|
|
11351
|
-
);
|
|
11352
|
-
}
|
|
11353
|
-
debug("SemVer", version2, options);
|
|
11354
|
-
this.options = options;
|
|
11355
|
-
this.loose = !!options.loose;
|
|
11356
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
11357
|
-
const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
11358
|
-
if (!m) {
|
|
11359
|
-
throw new TypeError(`Invalid Version: ${version2}`);
|
|
11360
|
-
}
|
|
11361
|
-
this.raw = version2;
|
|
11362
|
-
this.major = +m[1];
|
|
11363
|
-
this.minor = +m[2];
|
|
11364
|
-
this.patch = +m[3];
|
|
11365
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
11366
|
-
throw new TypeError("Invalid major version");
|
|
11367
|
-
}
|
|
11368
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
11369
|
-
throw new TypeError("Invalid minor version");
|
|
11370
|
-
}
|
|
11371
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
11372
|
-
throw new TypeError("Invalid patch version");
|
|
11373
|
-
}
|
|
11374
|
-
if (!m[4]) {
|
|
11375
|
-
this.prerelease = [];
|
|
11376
|
-
} else {
|
|
11377
|
-
this.prerelease = m[4].split(".").map((id) => {
|
|
11378
|
-
if (/^[0-9]+$/.test(id)) {
|
|
11379
|
-
const num = +id;
|
|
11380
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
11381
|
-
return num;
|
|
11382
|
-
}
|
|
11383
|
-
}
|
|
11384
|
-
return id;
|
|
11385
|
-
});
|
|
11386
|
-
}
|
|
11387
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
11388
|
-
this.format();
|
|
11389
|
-
}
|
|
11390
|
-
format() {
|
|
11391
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
11392
|
-
if (this.prerelease.length) {
|
|
11393
|
-
this.version += `-${this.prerelease.join(".")}`;
|
|
11394
|
-
}
|
|
11395
|
-
return this.version;
|
|
11396
|
-
}
|
|
11397
|
-
toString() {
|
|
11398
|
-
return this.version;
|
|
11399
|
-
}
|
|
11400
|
-
compare(other) {
|
|
11401
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
11402
|
-
if (!(other instanceof _SemVer)) {
|
|
11403
|
-
if (typeof other === "string" && other === this.version) {
|
|
11404
|
-
return 0;
|
|
11405
|
-
}
|
|
11406
|
-
other = new _SemVer(other, this.options);
|
|
11407
|
-
}
|
|
11408
|
-
if (other.version === this.version) {
|
|
11409
|
-
return 0;
|
|
11410
|
-
}
|
|
11411
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
11412
|
-
}
|
|
11413
|
-
compareMain(other) {
|
|
11414
|
-
if (!(other instanceof _SemVer)) {
|
|
11415
|
-
other = new _SemVer(other, this.options);
|
|
11416
|
-
}
|
|
11417
|
-
if (this.major < other.major) {
|
|
11418
|
-
return -1;
|
|
11419
|
-
}
|
|
11420
|
-
if (this.major > other.major) {
|
|
11421
|
-
return 1;
|
|
11422
|
-
}
|
|
11423
|
-
if (this.minor < other.minor) {
|
|
11424
|
-
return -1;
|
|
11425
|
-
}
|
|
11426
|
-
if (this.minor > other.minor) {
|
|
11427
|
-
return 1;
|
|
11428
|
-
}
|
|
11429
|
-
if (this.patch < other.patch) {
|
|
11430
|
-
return -1;
|
|
11431
|
-
}
|
|
11432
|
-
if (this.patch > other.patch) {
|
|
11433
|
-
return 1;
|
|
11434
|
-
}
|
|
11435
|
-
return 0;
|
|
11436
|
-
}
|
|
11437
|
-
comparePre(other) {
|
|
11438
|
-
if (!(other instanceof _SemVer)) {
|
|
11439
|
-
other = new _SemVer(other, this.options);
|
|
11440
|
-
}
|
|
11441
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
|
11442
|
-
return -1;
|
|
11443
|
-
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
11444
|
-
return 1;
|
|
11445
|
-
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
11446
|
-
return 0;
|
|
11447
|
-
}
|
|
11448
|
-
let i = 0;
|
|
11449
|
-
do {
|
|
11450
|
-
const a = this.prerelease[i];
|
|
11451
|
-
const b = other.prerelease[i];
|
|
11452
|
-
debug("prerelease compare", i, a, b);
|
|
11453
|
-
if (a === void 0 && b === void 0) {
|
|
11454
|
-
return 0;
|
|
11455
|
-
} else if (b === void 0) {
|
|
11456
|
-
return 1;
|
|
11457
|
-
} else if (a === void 0) {
|
|
11458
|
-
return -1;
|
|
11459
|
-
} else if (a === b) {
|
|
11460
|
-
continue;
|
|
11461
|
-
} else {
|
|
11462
|
-
return compareIdentifiers(a, b);
|
|
11463
|
-
}
|
|
11464
|
-
} while (++i);
|
|
11465
|
-
}
|
|
11466
|
-
compareBuild(other) {
|
|
11467
|
-
if (!(other instanceof _SemVer)) {
|
|
11468
|
-
other = new _SemVer(other, this.options);
|
|
11469
|
-
}
|
|
11470
|
-
let i = 0;
|
|
11471
|
-
do {
|
|
11472
|
-
const a = this.build[i];
|
|
11473
|
-
const b = other.build[i];
|
|
11474
|
-
debug("build compare", i, a, b);
|
|
11475
|
-
if (a === void 0 && b === void 0) {
|
|
11476
|
-
return 0;
|
|
11477
|
-
} else if (b === void 0) {
|
|
11478
|
-
return 1;
|
|
11479
|
-
} else if (a === void 0) {
|
|
11480
|
-
return -1;
|
|
11481
|
-
} else if (a === b) {
|
|
11482
|
-
continue;
|
|
11483
|
-
} else {
|
|
11484
|
-
return compareIdentifiers(a, b);
|
|
11485
|
-
}
|
|
11486
|
-
} while (++i);
|
|
11487
|
-
}
|
|
11488
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
11489
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
11490
|
-
inc(release2, identifier, identifierBase) {
|
|
11491
|
-
if (release2.startsWith("pre")) {
|
|
11492
|
-
if (!identifier && identifierBase === false) {
|
|
11493
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
11494
|
-
}
|
|
11495
|
-
if (identifier) {
|
|
11496
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
11497
|
-
if (!match || match[1] !== identifier) {
|
|
11498
|
-
throw new Error(`invalid identifier: ${identifier}`);
|
|
11499
|
-
}
|
|
11500
|
-
}
|
|
11501
|
-
}
|
|
11502
|
-
switch (release2) {
|
|
11503
|
-
case "premajor":
|
|
11504
|
-
this.prerelease.length = 0;
|
|
11505
|
-
this.patch = 0;
|
|
11506
|
-
this.minor = 0;
|
|
11507
|
-
this.major++;
|
|
11508
|
-
this.inc("pre", identifier, identifierBase);
|
|
11509
|
-
break;
|
|
11510
|
-
case "preminor":
|
|
11511
|
-
this.prerelease.length = 0;
|
|
11512
|
-
this.patch = 0;
|
|
11513
|
-
this.minor++;
|
|
11514
|
-
this.inc("pre", identifier, identifierBase);
|
|
11515
|
-
break;
|
|
11516
|
-
case "prepatch":
|
|
11517
|
-
this.prerelease.length = 0;
|
|
11518
|
-
this.inc("patch", identifier, identifierBase);
|
|
11519
|
-
this.inc("pre", identifier, identifierBase);
|
|
11520
|
-
break;
|
|
11521
|
-
// If the input is a non-prerelease version, this acts the same as
|
|
11522
|
-
// prepatch.
|
|
11523
|
-
case "prerelease":
|
|
11524
|
-
if (this.prerelease.length === 0) {
|
|
11525
|
-
this.inc("patch", identifier, identifierBase);
|
|
11526
|
-
}
|
|
11527
|
-
this.inc("pre", identifier, identifierBase);
|
|
11528
|
-
break;
|
|
11529
|
-
case "release":
|
|
11530
|
-
if (this.prerelease.length === 0) {
|
|
11531
|
-
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
11532
|
-
}
|
|
11533
|
-
this.prerelease.length = 0;
|
|
11534
|
-
break;
|
|
11535
|
-
case "major":
|
|
11536
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
11537
|
-
this.major++;
|
|
11538
|
-
}
|
|
11539
|
-
this.minor = 0;
|
|
11540
|
-
this.patch = 0;
|
|
11541
|
-
this.prerelease = [];
|
|
11542
|
-
break;
|
|
11543
|
-
case "minor":
|
|
11544
|
-
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
11545
|
-
this.minor++;
|
|
11546
|
-
}
|
|
11547
|
-
this.patch = 0;
|
|
11548
|
-
this.prerelease = [];
|
|
11549
|
-
break;
|
|
11550
|
-
case "patch":
|
|
11551
|
-
if (this.prerelease.length === 0) {
|
|
11552
|
-
this.patch++;
|
|
11553
|
-
}
|
|
11554
|
-
this.prerelease = [];
|
|
11555
|
-
break;
|
|
11556
|
-
// This probably shouldn't be used publicly.
|
|
11557
|
-
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
11558
|
-
case "pre": {
|
|
11559
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
11560
|
-
if (this.prerelease.length === 0) {
|
|
11561
|
-
this.prerelease = [base];
|
|
11562
|
-
} else {
|
|
11563
|
-
let i = this.prerelease.length;
|
|
11564
|
-
while (--i >= 0) {
|
|
11565
|
-
if (typeof this.prerelease[i] === "number") {
|
|
11566
|
-
this.prerelease[i]++;
|
|
11567
|
-
i = -2;
|
|
11568
|
-
}
|
|
11569
|
-
}
|
|
11570
|
-
if (i === -1) {
|
|
11571
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
11572
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
11573
|
-
}
|
|
11574
|
-
this.prerelease.push(base);
|
|
11575
|
-
}
|
|
11576
|
-
}
|
|
11577
|
-
if (identifier) {
|
|
11578
|
-
let prerelease = [identifier, base];
|
|
11579
|
-
if (identifierBase === false) {
|
|
11580
|
-
prerelease = [identifier];
|
|
11581
|
-
}
|
|
11582
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
11583
|
-
if (isNaN(this.prerelease[1])) {
|
|
11584
|
-
this.prerelease = prerelease;
|
|
11585
|
-
}
|
|
11586
|
-
} else {
|
|
11587
|
-
this.prerelease = prerelease;
|
|
11588
|
-
}
|
|
11589
|
-
}
|
|
11590
|
-
break;
|
|
11591
|
-
}
|
|
11592
|
-
default:
|
|
11593
|
-
throw new Error(`invalid increment argument: ${release2}`);
|
|
11594
|
-
}
|
|
11595
|
-
this.raw = this.format();
|
|
11596
|
-
if (this.build.length) {
|
|
11597
|
-
this.raw += `+${this.build.join(".")}`;
|
|
11598
|
-
}
|
|
11599
|
-
return this;
|
|
11600
|
-
}
|
|
11601
|
-
};
|
|
11602
|
-
module.exports = SemVer;
|
|
11603
|
-
}
|
|
11604
|
-
});
|
|
11605
|
-
|
|
11606
|
-
// node_modules/semver/functions/parse.js
|
|
11607
|
-
var require_parse = __commonJS({
|
|
11608
|
-
"node_modules/semver/functions/parse.js"(exports, module) {
|
|
11609
|
-
"use strict";
|
|
11610
|
-
var SemVer = require_semver();
|
|
11611
|
-
var parse3 = (version2, options, throwErrors = false) => {
|
|
11612
|
-
if (version2 instanceof SemVer) {
|
|
11613
|
-
return version2;
|
|
11614
|
-
}
|
|
11615
|
-
try {
|
|
11616
|
-
return new SemVer(version2, options);
|
|
11617
|
-
} catch (er) {
|
|
11618
|
-
if (!throwErrors) {
|
|
11619
|
-
return null;
|
|
11620
|
-
}
|
|
11621
|
-
throw er;
|
|
11622
|
-
}
|
|
11623
|
-
};
|
|
11624
|
-
module.exports = parse3;
|
|
11625
|
-
}
|
|
11626
|
-
});
|
|
11627
|
-
|
|
11628
|
-
// node_modules/semver/functions/valid.js
|
|
11629
|
-
var require_valid = __commonJS({
|
|
11630
|
-
"node_modules/semver/functions/valid.js"(exports, module) {
|
|
11631
|
-
"use strict";
|
|
11632
|
-
var parse3 = require_parse();
|
|
11633
|
-
var valid2 = (version2, options) => {
|
|
11634
|
-
const v = parse3(version2, options);
|
|
11635
|
-
return v ? v.version : null;
|
|
11636
|
-
};
|
|
11637
|
-
module.exports = valid2;
|
|
11638
|
-
}
|
|
11639
|
-
});
|
|
11640
|
-
|
|
11641
|
-
// node_modules/semver/functions/clean.js
|
|
11642
|
-
var require_clean = __commonJS({
|
|
11643
|
-
"node_modules/semver/functions/clean.js"(exports, module) {
|
|
11644
|
-
"use strict";
|
|
11645
|
-
var parse3 = require_parse();
|
|
11646
|
-
var clean = (version2, options) => {
|
|
11647
|
-
const s = parse3(version2.trim().replace(/^[=v]+/, ""), options);
|
|
11648
|
-
return s ? s.version : null;
|
|
11649
|
-
};
|
|
11650
|
-
module.exports = clean;
|
|
11651
|
-
}
|
|
11652
|
-
});
|
|
11653
|
-
|
|
11654
|
-
// node_modules/semver/functions/inc.js
|
|
11655
|
-
var require_inc = __commonJS({
|
|
11656
|
-
"node_modules/semver/functions/inc.js"(exports, module) {
|
|
11657
|
-
"use strict";
|
|
11658
|
-
var SemVer = require_semver();
|
|
11659
|
-
var inc = (version2, release2, options, identifier, identifierBase) => {
|
|
11660
|
-
if (typeof options === "string") {
|
|
11661
|
-
identifierBase = identifier;
|
|
11662
|
-
identifier = options;
|
|
11663
|
-
options = void 0;
|
|
11664
|
-
}
|
|
11665
|
-
try {
|
|
11666
|
-
return new SemVer(
|
|
11667
|
-
version2 instanceof SemVer ? version2.version : version2,
|
|
11668
|
-
options
|
|
11669
|
-
).inc(release2, identifier, identifierBase).version;
|
|
11670
|
-
} catch (er) {
|
|
11671
|
-
return null;
|
|
11672
|
-
}
|
|
11673
|
-
};
|
|
11674
|
-
module.exports = inc;
|
|
11675
|
-
}
|
|
11676
|
-
});
|
|
11677
|
-
|
|
11678
|
-
// node_modules/semver/functions/diff.js
|
|
11679
|
-
var require_diff = __commonJS({
|
|
11680
|
-
"node_modules/semver/functions/diff.js"(exports, module) {
|
|
11681
|
-
"use strict";
|
|
11682
|
-
var parse3 = require_parse();
|
|
11683
|
-
var diff = (version1, version2) => {
|
|
11684
|
-
const v1 = parse3(version1, null, true);
|
|
11685
|
-
const v2 = parse3(version2, null, true);
|
|
11686
|
-
const comparison = v1.compare(v2);
|
|
11687
|
-
if (comparison === 0) {
|
|
11688
|
-
return null;
|
|
11689
|
-
}
|
|
11690
|
-
const v1Higher = comparison > 0;
|
|
11691
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
11692
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
11693
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
11694
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
11695
|
-
if (lowHasPre && !highHasPre) {
|
|
11696
|
-
if (!lowVersion.patch && !lowVersion.minor) {
|
|
11697
|
-
return "major";
|
|
11698
|
-
}
|
|
11699
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
11700
|
-
if (lowVersion.minor && !lowVersion.patch) {
|
|
11701
|
-
return "minor";
|
|
11702
|
-
}
|
|
11703
|
-
return "patch";
|
|
11704
|
-
}
|
|
11705
|
-
}
|
|
11706
|
-
const prefix = highHasPre ? "pre" : "";
|
|
11707
|
-
if (v1.major !== v2.major) {
|
|
11708
|
-
return prefix + "major";
|
|
11709
|
-
}
|
|
11710
|
-
if (v1.minor !== v2.minor) {
|
|
11711
|
-
return prefix + "minor";
|
|
11712
|
-
}
|
|
11713
|
-
if (v1.patch !== v2.patch) {
|
|
11714
|
-
return prefix + "patch";
|
|
11715
|
-
}
|
|
11716
|
-
return "prerelease";
|
|
11717
|
-
};
|
|
11718
|
-
module.exports = diff;
|
|
11719
|
-
}
|
|
11720
|
-
});
|
|
11721
|
-
|
|
11722
|
-
// node_modules/semver/functions/major.js
|
|
11723
|
-
var require_major = __commonJS({
|
|
11724
|
-
"node_modules/semver/functions/major.js"(exports, module) {
|
|
11725
|
-
"use strict";
|
|
11726
|
-
var SemVer = require_semver();
|
|
11727
|
-
var major = (a, loose) => new SemVer(a, loose).major;
|
|
11728
|
-
module.exports = major;
|
|
11729
|
-
}
|
|
11730
|
-
});
|
|
11731
|
-
|
|
11732
|
-
// node_modules/semver/functions/minor.js
|
|
11733
|
-
var require_minor = __commonJS({
|
|
11734
|
-
"node_modules/semver/functions/minor.js"(exports, module) {
|
|
11735
|
-
"use strict";
|
|
11736
|
-
var SemVer = require_semver();
|
|
11737
|
-
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
11738
|
-
module.exports = minor;
|
|
11739
|
-
}
|
|
11740
|
-
});
|
|
11741
|
-
|
|
11742
|
-
// node_modules/semver/functions/patch.js
|
|
11743
|
-
var require_patch = __commonJS({
|
|
11744
|
-
"node_modules/semver/functions/patch.js"(exports, module) {
|
|
11745
|
-
"use strict";
|
|
11746
|
-
var SemVer = require_semver();
|
|
11747
|
-
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
11748
|
-
module.exports = patch;
|
|
11749
|
-
}
|
|
11750
|
-
});
|
|
11751
|
-
|
|
11752
|
-
// node_modules/semver/functions/prerelease.js
|
|
11753
|
-
var require_prerelease = __commonJS({
|
|
11754
|
-
"node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
11755
|
-
"use strict";
|
|
11756
|
-
var parse3 = require_parse();
|
|
11757
|
-
var prerelease = (version2, options) => {
|
|
11758
|
-
const parsed = parse3(version2, options);
|
|
11759
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
11760
|
-
};
|
|
11761
|
-
module.exports = prerelease;
|
|
11762
|
-
}
|
|
11763
|
-
});
|
|
11764
|
-
|
|
11765
|
-
// node_modules/semver/functions/compare.js
|
|
11766
|
-
var require_compare = __commonJS({
|
|
11767
|
-
"node_modules/semver/functions/compare.js"(exports, module) {
|
|
11768
|
-
"use strict";
|
|
11769
|
-
var SemVer = require_semver();
|
|
11770
|
-
var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
11771
|
-
module.exports = compare2;
|
|
11772
|
-
}
|
|
11773
|
-
});
|
|
11774
|
-
|
|
11775
|
-
// node_modules/semver/functions/rcompare.js
|
|
11776
|
-
var require_rcompare = __commonJS({
|
|
11777
|
-
"node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
11778
|
-
"use strict";
|
|
11779
|
-
var compare2 = require_compare();
|
|
11780
|
-
var rcompare = (a, b, loose) => compare2(b, a, loose);
|
|
11781
|
-
module.exports = rcompare;
|
|
11782
|
-
}
|
|
11783
|
-
});
|
|
11784
|
-
|
|
11785
|
-
// node_modules/semver/functions/compare-loose.js
|
|
11786
|
-
var require_compare_loose = __commonJS({
|
|
11787
|
-
"node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
11788
|
-
"use strict";
|
|
11789
|
-
var compare2 = require_compare();
|
|
11790
|
-
var compareLoose = (a, b) => compare2(a, b, true);
|
|
11791
|
-
module.exports = compareLoose;
|
|
11792
|
-
}
|
|
11793
|
-
});
|
|
11794
|
-
|
|
11795
|
-
// node_modules/semver/functions/compare-build.js
|
|
11796
|
-
var require_compare_build = __commonJS({
|
|
11797
|
-
"node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
11798
|
-
"use strict";
|
|
11799
|
-
var SemVer = require_semver();
|
|
11800
|
-
var compareBuild = (a, b, loose) => {
|
|
11801
|
-
const versionA = new SemVer(a, loose);
|
|
11802
|
-
const versionB = new SemVer(b, loose);
|
|
11803
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
11804
|
-
};
|
|
11805
|
-
module.exports = compareBuild;
|
|
11806
|
-
}
|
|
11807
|
-
});
|
|
11808
|
-
|
|
11809
|
-
// node_modules/semver/functions/sort.js
|
|
11810
|
-
var require_sort = __commonJS({
|
|
11811
|
-
"node_modules/semver/functions/sort.js"(exports, module) {
|
|
11812
|
-
"use strict";
|
|
11813
|
-
var compareBuild = require_compare_build();
|
|
11814
|
-
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
11815
|
-
module.exports = sort;
|
|
11816
|
-
}
|
|
11817
|
-
});
|
|
11818
|
-
|
|
11819
|
-
// node_modules/semver/functions/rsort.js
|
|
11820
|
-
var require_rsort = __commonJS({
|
|
11821
|
-
"node_modules/semver/functions/rsort.js"(exports, module) {
|
|
11822
|
-
"use strict";
|
|
11823
|
-
var compareBuild = require_compare_build();
|
|
11824
|
-
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
11825
|
-
module.exports = rsort;
|
|
11826
|
-
}
|
|
11827
|
-
});
|
|
11828
|
-
|
|
11829
|
-
// node_modules/semver/functions/gt.js
|
|
11830
|
-
var require_gt = __commonJS({
|
|
11831
|
-
"node_modules/semver/functions/gt.js"(exports, module) {
|
|
11832
|
-
"use strict";
|
|
11833
|
-
var compare2 = require_compare();
|
|
11834
|
-
var gt = (a, b, loose) => compare2(a, b, loose) > 0;
|
|
11835
|
-
module.exports = gt;
|
|
11836
|
-
}
|
|
11837
|
-
});
|
|
11838
|
-
|
|
11839
|
-
// node_modules/semver/functions/lt.js
|
|
11840
|
-
var require_lt = __commonJS({
|
|
11841
|
-
"node_modules/semver/functions/lt.js"(exports, module) {
|
|
11842
|
-
"use strict";
|
|
11843
|
-
var compare2 = require_compare();
|
|
11844
|
-
var lt = (a, b, loose) => compare2(a, b, loose) < 0;
|
|
11845
|
-
module.exports = lt;
|
|
11846
|
-
}
|
|
11847
|
-
});
|
|
11848
|
-
|
|
11849
|
-
// node_modules/semver/functions/eq.js
|
|
11850
|
-
var require_eq = __commonJS({
|
|
11851
|
-
"node_modules/semver/functions/eq.js"(exports, module) {
|
|
11852
|
-
"use strict";
|
|
11853
|
-
var compare2 = require_compare();
|
|
11854
|
-
var eq = (a, b, loose) => compare2(a, b, loose) === 0;
|
|
11855
|
-
module.exports = eq;
|
|
11856
|
-
}
|
|
11857
|
-
});
|
|
11858
|
-
|
|
11859
|
-
// node_modules/semver/functions/neq.js
|
|
11860
|
-
var require_neq = __commonJS({
|
|
11861
|
-
"node_modules/semver/functions/neq.js"(exports, module) {
|
|
11862
|
-
"use strict";
|
|
11863
|
-
var compare2 = require_compare();
|
|
11864
|
-
var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
|
|
11865
|
-
module.exports = neq;
|
|
11866
|
-
}
|
|
11867
|
-
});
|
|
11868
|
-
|
|
11869
|
-
// node_modules/semver/functions/gte.js
|
|
11870
|
-
var require_gte = __commonJS({
|
|
11871
|
-
"node_modules/semver/functions/gte.js"(exports, module) {
|
|
11872
|
-
"use strict";
|
|
11873
|
-
var compare2 = require_compare();
|
|
11874
|
-
var gte = (a, b, loose) => compare2(a, b, loose) >= 0;
|
|
11875
|
-
module.exports = gte;
|
|
11876
|
-
}
|
|
11877
|
-
});
|
|
11878
|
-
|
|
11879
|
-
// node_modules/semver/functions/lte.js
|
|
11880
|
-
var require_lte = __commonJS({
|
|
11881
|
-
"node_modules/semver/functions/lte.js"(exports, module) {
|
|
11882
|
-
"use strict";
|
|
11883
|
-
var compare2 = require_compare();
|
|
11884
|
-
var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
|
|
11885
|
-
module.exports = lte;
|
|
11886
|
-
}
|
|
11887
|
-
});
|
|
11888
|
-
|
|
11889
|
-
// node_modules/semver/functions/cmp.js
|
|
11890
|
-
var require_cmp = __commonJS({
|
|
11891
|
-
"node_modules/semver/functions/cmp.js"(exports, module) {
|
|
11892
|
-
"use strict";
|
|
11893
|
-
var eq = require_eq();
|
|
11894
|
-
var neq = require_neq();
|
|
11895
|
-
var gt = require_gt();
|
|
11896
|
-
var gte = require_gte();
|
|
11897
|
-
var lt = require_lt();
|
|
11898
|
-
var lte = require_lte();
|
|
11899
|
-
var cmp = (a, op, b, loose) => {
|
|
11900
|
-
switch (op) {
|
|
11901
|
-
case "===":
|
|
11902
|
-
if (typeof a === "object") {
|
|
11903
|
-
a = a.version;
|
|
11904
|
-
}
|
|
11905
|
-
if (typeof b === "object") {
|
|
11906
|
-
b = b.version;
|
|
11907
|
-
}
|
|
11908
|
-
return a === b;
|
|
11909
|
-
case "!==":
|
|
11910
|
-
if (typeof a === "object") {
|
|
11911
|
-
a = a.version;
|
|
11912
|
-
}
|
|
11913
|
-
if (typeof b === "object") {
|
|
11914
|
-
b = b.version;
|
|
11915
|
-
}
|
|
11916
|
-
return a !== b;
|
|
11917
|
-
case "":
|
|
11918
|
-
case "=":
|
|
11919
|
-
case "==":
|
|
11920
|
-
return eq(a, b, loose);
|
|
11921
|
-
case "!=":
|
|
11922
|
-
return neq(a, b, loose);
|
|
11923
|
-
case ">":
|
|
11924
|
-
return gt(a, b, loose);
|
|
11925
|
-
case ">=":
|
|
11926
|
-
return gte(a, b, loose);
|
|
11927
|
-
case "<":
|
|
11928
|
-
return lt(a, b, loose);
|
|
11929
|
-
case "<=":
|
|
11930
|
-
return lte(a, b, loose);
|
|
11931
|
-
default:
|
|
11932
|
-
throw new TypeError(`Invalid operator: ${op}`);
|
|
11933
|
-
}
|
|
11934
|
-
};
|
|
11935
|
-
module.exports = cmp;
|
|
11936
|
-
}
|
|
11937
|
-
});
|
|
11938
|
-
|
|
11939
|
-
// node_modules/semver/functions/coerce.js
|
|
11940
|
-
var require_coerce = __commonJS({
|
|
11941
|
-
"node_modules/semver/functions/coerce.js"(exports, module) {
|
|
11942
|
-
"use strict";
|
|
11943
|
-
var SemVer = require_semver();
|
|
11944
|
-
var parse3 = require_parse();
|
|
11945
|
-
var { safeRe: re, t } = require_re();
|
|
11946
|
-
var coerce = (version2, options) => {
|
|
11947
|
-
if (version2 instanceof SemVer) {
|
|
11948
|
-
return version2;
|
|
11949
|
-
}
|
|
11950
|
-
if (typeof version2 === "number") {
|
|
11951
|
-
version2 = String(version2);
|
|
11952
|
-
}
|
|
11953
|
-
if (typeof version2 !== "string") {
|
|
11954
|
-
return null;
|
|
11955
|
-
}
|
|
11956
|
-
options = options || {};
|
|
11957
|
-
let match = null;
|
|
11958
|
-
if (!options.rtl) {
|
|
11959
|
-
match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
11960
|
-
} else {
|
|
11961
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
11962
|
-
let next;
|
|
11963
|
-
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
11964
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
11965
|
-
match = next;
|
|
11966
|
-
}
|
|
11967
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
11968
|
-
}
|
|
11969
|
-
coerceRtlRegex.lastIndex = -1;
|
|
11970
|
-
}
|
|
11971
|
-
if (match === null) {
|
|
11972
|
-
return null;
|
|
11973
|
-
}
|
|
11974
|
-
const major = match[2];
|
|
11975
|
-
const minor = match[3] || "0";
|
|
11976
|
-
const patch = match[4] || "0";
|
|
11977
|
-
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
11978
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
11979
|
-
return parse3(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
11980
|
-
};
|
|
11981
|
-
module.exports = coerce;
|
|
11982
|
-
}
|
|
11983
|
-
});
|
|
11984
|
-
|
|
11985
|
-
// node_modules/semver/internal/lrucache.js
|
|
11986
|
-
var require_lrucache = __commonJS({
|
|
11987
|
-
"node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
11988
|
-
"use strict";
|
|
11989
|
-
var LRUCache = class {
|
|
11990
|
-
constructor() {
|
|
11991
|
-
this.max = 1e3;
|
|
11992
|
-
this.map = /* @__PURE__ */ new Map();
|
|
11993
|
-
}
|
|
11994
|
-
get(key) {
|
|
11995
|
-
const value = this.map.get(key);
|
|
11996
|
-
if (value === void 0) {
|
|
11997
|
-
return void 0;
|
|
11998
|
-
} else {
|
|
11999
|
-
this.map.delete(key);
|
|
12000
|
-
this.map.set(key, value);
|
|
12001
|
-
return value;
|
|
12002
|
-
}
|
|
12003
|
-
}
|
|
12004
|
-
delete(key) {
|
|
12005
|
-
return this.map.delete(key);
|
|
12006
|
-
}
|
|
12007
|
-
set(key, value) {
|
|
12008
|
-
const deleted = this.delete(key);
|
|
12009
|
-
if (!deleted && value !== void 0) {
|
|
12010
|
-
if (this.map.size >= this.max) {
|
|
12011
|
-
const firstKey = this.map.keys().next().value;
|
|
12012
|
-
this.delete(firstKey);
|
|
12013
|
-
}
|
|
12014
|
-
this.map.set(key, value);
|
|
12015
|
-
}
|
|
12016
|
-
return this;
|
|
12017
|
-
}
|
|
12018
|
-
};
|
|
12019
|
-
module.exports = LRUCache;
|
|
12020
|
-
}
|
|
12021
|
-
});
|
|
12022
|
-
|
|
12023
|
-
// node_modules/semver/classes/range.js
|
|
12024
|
-
var require_range = __commonJS({
|
|
12025
|
-
"node_modules/semver/classes/range.js"(exports, module) {
|
|
12026
|
-
"use strict";
|
|
12027
|
-
var SPACE_CHARACTERS = /\s+/g;
|
|
12028
|
-
var Range = class _Range {
|
|
12029
|
-
constructor(range, options) {
|
|
12030
|
-
options = parseOptions(options);
|
|
12031
|
-
if (range instanceof _Range) {
|
|
12032
|
-
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
12033
|
-
return range;
|
|
12034
|
-
} else {
|
|
12035
|
-
return new _Range(range.raw, options);
|
|
12036
|
-
}
|
|
12037
|
-
}
|
|
12038
|
-
if (range instanceof Comparator) {
|
|
12039
|
-
this.raw = range.value;
|
|
12040
|
-
this.set = [[range]];
|
|
12041
|
-
this.formatted = void 0;
|
|
12042
|
-
return this;
|
|
12043
|
-
}
|
|
12044
|
-
this.options = options;
|
|
12045
|
-
this.loose = !!options.loose;
|
|
12046
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
12047
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
12048
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
12049
|
-
if (!this.set.length) {
|
|
12050
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
12051
|
-
}
|
|
12052
|
-
if (this.set.length > 1) {
|
|
12053
|
-
const first = this.set[0];
|
|
12054
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
12055
|
-
if (this.set.length === 0) {
|
|
12056
|
-
this.set = [first];
|
|
12057
|
-
} else if (this.set.length > 1) {
|
|
12058
|
-
for (const c of this.set) {
|
|
12059
|
-
if (c.length === 1 && isAny(c[0])) {
|
|
12060
|
-
this.set = [c];
|
|
12061
|
-
break;
|
|
12062
|
-
}
|
|
12063
|
-
}
|
|
12064
|
-
}
|
|
12065
|
-
}
|
|
12066
|
-
this.formatted = void 0;
|
|
12067
|
-
}
|
|
12068
|
-
get range() {
|
|
12069
|
-
if (this.formatted === void 0) {
|
|
12070
|
-
this.formatted = "";
|
|
12071
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
12072
|
-
if (i > 0) {
|
|
12073
|
-
this.formatted += "||";
|
|
12074
|
-
}
|
|
12075
|
-
const comps = this.set[i];
|
|
12076
|
-
for (let k = 0; k < comps.length; k++) {
|
|
12077
|
-
if (k > 0) {
|
|
12078
|
-
this.formatted += " ";
|
|
12079
|
-
}
|
|
12080
|
-
this.formatted += comps[k].toString().trim();
|
|
12081
|
-
}
|
|
12082
|
-
}
|
|
12083
|
-
}
|
|
12084
|
-
return this.formatted;
|
|
12085
|
-
}
|
|
12086
|
-
format() {
|
|
12087
|
-
return this.range;
|
|
12088
|
-
}
|
|
12089
|
-
toString() {
|
|
12090
|
-
return this.range;
|
|
12091
|
-
}
|
|
12092
|
-
parseRange(range) {
|
|
12093
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
12094
|
-
const memoKey = memoOpts + ":" + range;
|
|
12095
|
-
const cached2 = cache.get(memoKey);
|
|
12096
|
-
if (cached2) {
|
|
12097
|
-
return cached2;
|
|
12098
|
-
}
|
|
12099
|
-
const loose = this.options.loose;
|
|
12100
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
12101
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
12102
|
-
debug("hyphen replace", range);
|
|
12103
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
12104
|
-
debug("comparator trim", range);
|
|
12105
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
12106
|
-
debug("tilde trim", range);
|
|
12107
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
12108
|
-
debug("caret trim", range);
|
|
12109
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
12110
|
-
if (loose) {
|
|
12111
|
-
rangeList = rangeList.filter((comp) => {
|
|
12112
|
-
debug("loose invalid filter", comp, this.options);
|
|
12113
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
12114
|
-
});
|
|
12115
|
-
}
|
|
12116
|
-
debug("range list", rangeList);
|
|
12117
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
12118
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
12119
|
-
for (const comp of comparators) {
|
|
12120
|
-
if (isNullSet(comp)) {
|
|
12121
|
-
return [comp];
|
|
12122
|
-
}
|
|
12123
|
-
rangeMap.set(comp.value, comp);
|
|
12124
|
-
}
|
|
12125
|
-
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
12126
|
-
rangeMap.delete("");
|
|
12127
|
-
}
|
|
12128
|
-
const result = [...rangeMap.values()];
|
|
12129
|
-
cache.set(memoKey, result);
|
|
12130
|
-
return result;
|
|
12131
|
-
}
|
|
12132
|
-
intersects(range, options) {
|
|
12133
|
-
if (!(range instanceof _Range)) {
|
|
12134
|
-
throw new TypeError("a Range is required");
|
|
12135
|
-
}
|
|
12136
|
-
return this.set.some((thisComparators) => {
|
|
12137
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
12138
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
12139
|
-
return rangeComparators.every((rangeComparator) => {
|
|
12140
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
12141
|
-
});
|
|
12142
|
-
});
|
|
12143
|
-
});
|
|
12144
|
-
});
|
|
12145
|
-
}
|
|
12146
|
-
// if ANY of the sets match ALL of its comparators, then pass
|
|
12147
|
-
test(version2) {
|
|
12148
|
-
if (!version2) {
|
|
12149
|
-
return false;
|
|
12150
|
-
}
|
|
12151
|
-
if (typeof version2 === "string") {
|
|
12152
|
-
try {
|
|
12153
|
-
version2 = new SemVer(version2, this.options);
|
|
12154
|
-
} catch (er) {
|
|
12155
|
-
return false;
|
|
12156
|
-
}
|
|
12157
|
-
}
|
|
12158
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
12159
|
-
if (testSet(this.set[i], version2, this.options)) {
|
|
12160
|
-
return true;
|
|
12161
|
-
}
|
|
12162
|
-
}
|
|
12163
|
-
return false;
|
|
12164
|
-
}
|
|
12165
|
-
};
|
|
12166
|
-
module.exports = Range;
|
|
12167
|
-
var LRU = require_lrucache();
|
|
12168
|
-
var cache = new LRU();
|
|
12169
|
-
var parseOptions = require_parse_options();
|
|
12170
|
-
var Comparator = require_comparator();
|
|
12171
|
-
var debug = require_debug();
|
|
12172
|
-
var SemVer = require_semver();
|
|
12173
|
-
var {
|
|
12174
|
-
safeRe: re,
|
|
12175
|
-
t,
|
|
12176
|
-
comparatorTrimReplace,
|
|
12177
|
-
tildeTrimReplace,
|
|
12178
|
-
caretTrimReplace
|
|
12179
|
-
} = require_re();
|
|
12180
|
-
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
12181
|
-
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
12182
|
-
var isAny = (c) => c.value === "";
|
|
12183
|
-
var isSatisfiable = (comparators, options) => {
|
|
12184
|
-
let result = true;
|
|
12185
|
-
const remainingComparators = comparators.slice();
|
|
12186
|
-
let testComparator = remainingComparators.pop();
|
|
12187
|
-
while (result && remainingComparators.length) {
|
|
12188
|
-
result = remainingComparators.every((otherComparator) => {
|
|
12189
|
-
return testComparator.intersects(otherComparator, options);
|
|
12190
|
-
});
|
|
12191
|
-
testComparator = remainingComparators.pop();
|
|
12192
|
-
}
|
|
12193
|
-
return result;
|
|
12194
|
-
};
|
|
12195
|
-
var parseComparator = (comp, options) => {
|
|
12196
|
-
comp = comp.replace(re[t.BUILD], "");
|
|
12197
|
-
debug("comp", comp, options);
|
|
12198
|
-
comp = replaceCarets(comp, options);
|
|
12199
|
-
debug("caret", comp);
|
|
12200
|
-
comp = replaceTildes(comp, options);
|
|
12201
|
-
debug("tildes", comp);
|
|
12202
|
-
comp = replaceXRanges(comp, options);
|
|
12203
|
-
debug("xrange", comp);
|
|
12204
|
-
comp = replaceStars(comp, options);
|
|
12205
|
-
debug("stars", comp);
|
|
12206
|
-
return comp;
|
|
12207
|
-
};
|
|
12208
|
-
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
12209
|
-
var replaceTildes = (comp, options) => {
|
|
12210
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
12211
|
-
};
|
|
12212
|
-
var replaceTilde = (comp, options) => {
|
|
12213
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
12214
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
12215
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
12216
|
-
let ret;
|
|
12217
|
-
if (isX(M)) {
|
|
12218
|
-
ret = "";
|
|
12219
|
-
} else if (isX(m)) {
|
|
12220
|
-
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
12221
|
-
} else if (isX(p)) {
|
|
12222
|
-
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
12223
|
-
} else if (pr) {
|
|
12224
|
-
debug("replaceTilde pr", pr);
|
|
12225
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
12226
|
-
} else {
|
|
12227
|
-
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
12228
|
-
}
|
|
12229
|
-
debug("tilde return", ret);
|
|
12230
|
-
return ret;
|
|
12231
|
-
});
|
|
12232
|
-
};
|
|
12233
|
-
var replaceCarets = (comp, options) => {
|
|
12234
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
12235
|
-
};
|
|
12236
|
-
var replaceCaret = (comp, options) => {
|
|
12237
|
-
debug("caret", comp, options);
|
|
12238
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
12239
|
-
const z2 = options.includePrerelease ? "-0" : "";
|
|
12240
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
12241
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
12242
|
-
let ret;
|
|
12243
|
-
if (isX(M)) {
|
|
12244
|
-
ret = "";
|
|
12245
|
-
} else if (isX(m)) {
|
|
12246
|
-
ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`;
|
|
12247
|
-
} else if (isX(p)) {
|
|
12248
|
-
if (M === "0") {
|
|
12249
|
-
ret = `>=${M}.${m}.0${z2} <${M}.${+m + 1}.0-0`;
|
|
12250
|
-
} else {
|
|
12251
|
-
ret = `>=${M}.${m}.0${z2} <${+M + 1}.0.0-0`;
|
|
12252
|
-
}
|
|
12253
|
-
} else if (pr) {
|
|
12254
|
-
debug("replaceCaret pr", pr);
|
|
12255
|
-
if (M === "0") {
|
|
12256
|
-
if (m === "0") {
|
|
12257
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
12258
|
-
} else {
|
|
12259
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
12260
|
-
}
|
|
12261
|
-
} else {
|
|
12262
|
-
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
12263
|
-
}
|
|
12264
|
-
} else {
|
|
12265
|
-
debug("no pr");
|
|
12266
|
-
if (M === "0") {
|
|
12267
|
-
if (m === "0") {
|
|
12268
|
-
ret = `>=${M}.${m}.${p}${z2} <${M}.${m}.${+p + 1}-0`;
|
|
12269
|
-
} else {
|
|
12270
|
-
ret = `>=${M}.${m}.${p}${z2} <${M}.${+m + 1}.0-0`;
|
|
12271
|
-
}
|
|
12272
|
-
} else {
|
|
12273
|
-
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
12274
|
-
}
|
|
12275
|
-
}
|
|
12276
|
-
debug("caret return", ret);
|
|
12277
|
-
return ret;
|
|
12278
|
-
});
|
|
12279
|
-
};
|
|
12280
|
-
var replaceXRanges = (comp, options) => {
|
|
12281
|
-
debug("replaceXRanges", comp, options);
|
|
12282
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
12283
|
-
};
|
|
12284
|
-
var replaceXRange = (comp, options) => {
|
|
12285
|
-
comp = comp.trim();
|
|
12286
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
12287
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
12288
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
12289
|
-
const xM = isX(M);
|
|
12290
|
-
const xm = xM || isX(m);
|
|
12291
|
-
const xp = xm || isX(p);
|
|
12292
|
-
const anyX = xp;
|
|
12293
|
-
if (gtlt === "=" && anyX) {
|
|
12294
|
-
gtlt = "";
|
|
12295
|
-
}
|
|
12296
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
12297
|
-
if (xM) {
|
|
12298
|
-
if (gtlt === ">" || gtlt === "<") {
|
|
12299
|
-
ret = "<0.0.0-0";
|
|
12300
|
-
} else {
|
|
12301
|
-
ret = "*";
|
|
12302
|
-
}
|
|
12303
|
-
} else if (gtlt && anyX) {
|
|
12304
|
-
if (xm) {
|
|
12305
|
-
m = 0;
|
|
12306
|
-
}
|
|
12307
|
-
p = 0;
|
|
12308
|
-
if (gtlt === ">") {
|
|
12309
|
-
gtlt = ">=";
|
|
12310
|
-
if (xm) {
|
|
12311
|
-
M = +M + 1;
|
|
12312
|
-
m = 0;
|
|
12313
|
-
p = 0;
|
|
12314
|
-
} else {
|
|
12315
|
-
m = +m + 1;
|
|
12316
|
-
p = 0;
|
|
12317
|
-
}
|
|
12318
|
-
} else if (gtlt === "<=") {
|
|
12319
|
-
gtlt = "<";
|
|
12320
|
-
if (xm) {
|
|
12321
|
-
M = +M + 1;
|
|
12322
|
-
} else {
|
|
12323
|
-
m = +m + 1;
|
|
12324
|
-
}
|
|
12325
|
-
}
|
|
12326
|
-
if (gtlt === "<") {
|
|
12327
|
-
pr = "-0";
|
|
12328
|
-
}
|
|
12329
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
12330
|
-
} else if (xm) {
|
|
12331
|
-
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
12332
|
-
} else if (xp) {
|
|
12333
|
-
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
12334
|
-
}
|
|
12335
|
-
debug("xRange return", ret);
|
|
12336
|
-
return ret;
|
|
12337
|
-
});
|
|
12338
|
-
};
|
|
12339
|
-
var replaceStars = (comp, options) => {
|
|
12340
|
-
debug("replaceStars", comp, options);
|
|
12341
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
12342
|
-
};
|
|
12343
|
-
var replaceGTE0 = (comp, options) => {
|
|
12344
|
-
debug("replaceGTE0", comp, options);
|
|
12345
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
12346
|
-
};
|
|
12347
|
-
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
12348
|
-
if (isX(fM)) {
|
|
12349
|
-
from = "";
|
|
12350
|
-
} else if (isX(fm)) {
|
|
12351
|
-
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
12352
|
-
} else if (isX(fp)) {
|
|
12353
|
-
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
12354
|
-
} else if (fpr) {
|
|
12355
|
-
from = `>=${from}`;
|
|
12356
|
-
} else {
|
|
12357
|
-
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
12358
|
-
}
|
|
12359
|
-
if (isX(tM)) {
|
|
12360
|
-
to = "";
|
|
12361
|
-
} else if (isX(tm)) {
|
|
12362
|
-
to = `<${+tM + 1}.0.0-0`;
|
|
12363
|
-
} else if (isX(tp)) {
|
|
12364
|
-
to = `<${tM}.${+tm + 1}.0-0`;
|
|
12365
|
-
} else if (tpr) {
|
|
12366
|
-
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
12367
|
-
} else if (incPr) {
|
|
12368
|
-
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
12369
|
-
} else {
|
|
12370
|
-
to = `<=${to}`;
|
|
12371
|
-
}
|
|
12372
|
-
return `${from} ${to}`.trim();
|
|
12373
|
-
};
|
|
12374
|
-
var testSet = (set2, version2, options) => {
|
|
12375
|
-
for (let i = 0; i < set2.length; i++) {
|
|
12376
|
-
if (!set2[i].test(version2)) {
|
|
12377
|
-
return false;
|
|
12378
|
-
}
|
|
12379
|
-
}
|
|
12380
|
-
if (version2.prerelease.length && !options.includePrerelease) {
|
|
12381
|
-
for (let i = 0; i < set2.length; i++) {
|
|
12382
|
-
debug(set2[i].semver);
|
|
12383
|
-
if (set2[i].semver === Comparator.ANY) {
|
|
12384
|
-
continue;
|
|
12385
|
-
}
|
|
12386
|
-
if (set2[i].semver.prerelease.length > 0) {
|
|
12387
|
-
const allowed = set2[i].semver;
|
|
12388
|
-
if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
|
|
12389
|
-
return true;
|
|
12390
|
-
}
|
|
12391
|
-
}
|
|
12392
|
-
}
|
|
12393
|
-
return false;
|
|
12394
|
-
}
|
|
12395
|
-
return true;
|
|
12396
|
-
};
|
|
12397
|
-
}
|
|
12398
|
-
});
|
|
12399
|
-
|
|
12400
|
-
// node_modules/semver/classes/comparator.js
|
|
12401
|
-
var require_comparator = __commonJS({
|
|
12402
|
-
"node_modules/semver/classes/comparator.js"(exports, module) {
|
|
12403
|
-
"use strict";
|
|
12404
|
-
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
12405
|
-
var Comparator = class _Comparator {
|
|
12406
|
-
static get ANY() {
|
|
12407
|
-
return ANY;
|
|
12408
|
-
}
|
|
12409
|
-
constructor(comp, options) {
|
|
12410
|
-
options = parseOptions(options);
|
|
12411
|
-
if (comp instanceof _Comparator) {
|
|
12412
|
-
if (comp.loose === !!options.loose) {
|
|
12413
|
-
return comp;
|
|
12414
|
-
} else {
|
|
12415
|
-
comp = comp.value;
|
|
12416
|
-
}
|
|
12417
|
-
}
|
|
12418
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
12419
|
-
debug("comparator", comp, options);
|
|
12420
|
-
this.options = options;
|
|
12421
|
-
this.loose = !!options.loose;
|
|
12422
|
-
this.parse(comp);
|
|
12423
|
-
if (this.semver === ANY) {
|
|
12424
|
-
this.value = "";
|
|
12425
|
-
} else {
|
|
12426
|
-
this.value = this.operator + this.semver.version;
|
|
12427
|
-
}
|
|
12428
|
-
debug("comp", this);
|
|
12429
|
-
}
|
|
12430
|
-
parse(comp) {
|
|
12431
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
12432
|
-
const m = comp.match(r);
|
|
12433
|
-
if (!m) {
|
|
12434
|
-
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
12435
|
-
}
|
|
12436
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
12437
|
-
if (this.operator === "=") {
|
|
12438
|
-
this.operator = "";
|
|
12439
|
-
}
|
|
12440
|
-
if (!m[2]) {
|
|
12441
|
-
this.semver = ANY;
|
|
12442
|
-
} else {
|
|
12443
|
-
this.semver = new SemVer(m[2], this.options.loose);
|
|
12444
|
-
}
|
|
12445
|
-
}
|
|
12446
|
-
toString() {
|
|
12447
|
-
return this.value;
|
|
12448
|
-
}
|
|
12449
|
-
test(version2) {
|
|
12450
|
-
debug("Comparator.test", version2, this.options.loose);
|
|
12451
|
-
if (this.semver === ANY || version2 === ANY) {
|
|
12452
|
-
return true;
|
|
12453
|
-
}
|
|
12454
|
-
if (typeof version2 === "string") {
|
|
12455
|
-
try {
|
|
12456
|
-
version2 = new SemVer(version2, this.options);
|
|
12457
|
-
} catch (er) {
|
|
12458
|
-
return false;
|
|
12459
|
-
}
|
|
12460
|
-
}
|
|
12461
|
-
return cmp(version2, this.operator, this.semver, this.options);
|
|
12462
|
-
}
|
|
12463
|
-
intersects(comp, options) {
|
|
12464
|
-
if (!(comp instanceof _Comparator)) {
|
|
12465
|
-
throw new TypeError("a Comparator is required");
|
|
12466
|
-
}
|
|
12467
|
-
if (this.operator === "") {
|
|
12468
|
-
if (this.value === "") {
|
|
12469
|
-
return true;
|
|
12470
|
-
}
|
|
12471
|
-
return new Range(comp.value, options).test(this.value);
|
|
12472
|
-
} else if (comp.operator === "") {
|
|
12473
|
-
if (comp.value === "") {
|
|
12474
|
-
return true;
|
|
12475
|
-
}
|
|
12476
|
-
return new Range(this.value, options).test(comp.semver);
|
|
12477
|
-
}
|
|
12478
|
-
options = parseOptions(options);
|
|
12479
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
12480
|
-
return false;
|
|
12481
|
-
}
|
|
12482
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
12483
|
-
return false;
|
|
12484
|
-
}
|
|
12485
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
12486
|
-
return true;
|
|
12487
|
-
}
|
|
12488
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
12489
|
-
return true;
|
|
12490
|
-
}
|
|
12491
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
12492
|
-
return true;
|
|
12493
|
-
}
|
|
12494
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
12495
|
-
return true;
|
|
12496
|
-
}
|
|
12497
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
12498
|
-
return true;
|
|
12499
|
-
}
|
|
12500
|
-
return false;
|
|
12501
|
-
}
|
|
12502
|
-
};
|
|
12503
|
-
module.exports = Comparator;
|
|
12504
|
-
var parseOptions = require_parse_options();
|
|
12505
|
-
var { safeRe: re, t } = require_re();
|
|
12506
|
-
var cmp = require_cmp();
|
|
12507
|
-
var debug = require_debug();
|
|
12508
|
-
var SemVer = require_semver();
|
|
12509
|
-
var Range = require_range();
|
|
12510
|
-
}
|
|
12511
|
-
});
|
|
12512
|
-
|
|
12513
|
-
// node_modules/semver/functions/satisfies.js
|
|
12514
|
-
var require_satisfies = __commonJS({
|
|
12515
|
-
"node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
12516
|
-
"use strict";
|
|
12517
|
-
var Range = require_range();
|
|
12518
|
-
var satisfies2 = (version2, range, options) => {
|
|
12519
|
-
try {
|
|
12520
|
-
range = new Range(range, options);
|
|
12521
|
-
} catch (er) {
|
|
12522
|
-
return false;
|
|
12523
|
-
}
|
|
12524
|
-
return range.test(version2);
|
|
12525
|
-
};
|
|
12526
|
-
module.exports = satisfies2;
|
|
12527
|
-
}
|
|
12528
|
-
});
|
|
12529
|
-
|
|
12530
|
-
// node_modules/semver/ranges/to-comparators.js
|
|
12531
|
-
var require_to_comparators = __commonJS({
|
|
12532
|
-
"node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
12533
|
-
"use strict";
|
|
12534
|
-
var Range = require_range();
|
|
12535
|
-
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
12536
|
-
module.exports = toComparators;
|
|
12537
|
-
}
|
|
12538
|
-
});
|
|
12539
|
-
|
|
12540
|
-
// node_modules/semver/ranges/max-satisfying.js
|
|
12541
|
-
var require_max_satisfying = __commonJS({
|
|
12542
|
-
"node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
12543
|
-
"use strict";
|
|
12544
|
-
var SemVer = require_semver();
|
|
12545
|
-
var Range = require_range();
|
|
12546
|
-
var maxSatisfying = (versions, range, options) => {
|
|
12547
|
-
let max = null;
|
|
12548
|
-
let maxSV = null;
|
|
12549
|
-
let rangeObj = null;
|
|
12550
|
-
try {
|
|
12551
|
-
rangeObj = new Range(range, options);
|
|
12552
|
-
} catch (er) {
|
|
12553
|
-
return null;
|
|
12554
|
-
}
|
|
12555
|
-
versions.forEach((v) => {
|
|
12556
|
-
if (rangeObj.test(v)) {
|
|
12557
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
12558
|
-
max = v;
|
|
12559
|
-
maxSV = new SemVer(max, options);
|
|
12560
|
-
}
|
|
12561
|
-
}
|
|
12562
|
-
});
|
|
12563
|
-
return max;
|
|
12564
|
-
};
|
|
12565
|
-
module.exports = maxSatisfying;
|
|
12566
|
-
}
|
|
12567
|
-
});
|
|
12568
|
-
|
|
12569
|
-
// node_modules/semver/ranges/min-satisfying.js
|
|
12570
|
-
var require_min_satisfying = __commonJS({
|
|
12571
|
-
"node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
12572
|
-
"use strict";
|
|
12573
|
-
var SemVer = require_semver();
|
|
12574
|
-
var Range = require_range();
|
|
12575
|
-
var minSatisfying = (versions, range, options) => {
|
|
12576
|
-
let min = null;
|
|
12577
|
-
let minSV = null;
|
|
12578
|
-
let rangeObj = null;
|
|
12579
|
-
try {
|
|
12580
|
-
rangeObj = new Range(range, options);
|
|
12581
|
-
} catch (er) {
|
|
12582
|
-
return null;
|
|
12583
|
-
}
|
|
12584
|
-
versions.forEach((v) => {
|
|
12585
|
-
if (rangeObj.test(v)) {
|
|
12586
|
-
if (!min || minSV.compare(v) === 1) {
|
|
12587
|
-
min = v;
|
|
12588
|
-
minSV = new SemVer(min, options);
|
|
12589
|
-
}
|
|
12590
|
-
}
|
|
12591
|
-
});
|
|
12592
|
-
return min;
|
|
12593
|
-
};
|
|
12594
|
-
module.exports = minSatisfying;
|
|
12595
|
-
}
|
|
12596
|
-
});
|
|
12597
|
-
|
|
12598
|
-
// node_modules/semver/ranges/min-version.js
|
|
12599
|
-
var require_min_version = __commonJS({
|
|
12600
|
-
"node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
12601
|
-
"use strict";
|
|
12602
|
-
var SemVer = require_semver();
|
|
12603
|
-
var Range = require_range();
|
|
12604
|
-
var gt = require_gt();
|
|
12605
|
-
var minVersion = (range, loose) => {
|
|
12606
|
-
range = new Range(range, loose);
|
|
12607
|
-
let minver = new SemVer("0.0.0");
|
|
12608
|
-
if (range.test(minver)) {
|
|
12609
|
-
return minver;
|
|
12610
|
-
}
|
|
12611
|
-
minver = new SemVer("0.0.0-0");
|
|
12612
|
-
if (range.test(minver)) {
|
|
12613
|
-
return minver;
|
|
12614
|
-
}
|
|
12615
|
-
minver = null;
|
|
12616
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
12617
|
-
const comparators = range.set[i];
|
|
12618
|
-
let setMin = null;
|
|
12619
|
-
comparators.forEach((comparator) => {
|
|
12620
|
-
const compver = new SemVer(comparator.semver.version);
|
|
12621
|
-
switch (comparator.operator) {
|
|
12622
|
-
case ">":
|
|
12623
|
-
if (compver.prerelease.length === 0) {
|
|
12624
|
-
compver.patch++;
|
|
12625
|
-
} else {
|
|
12626
|
-
compver.prerelease.push(0);
|
|
12627
|
-
}
|
|
12628
|
-
compver.raw = compver.format();
|
|
12629
|
-
/* fallthrough */
|
|
12630
|
-
case "":
|
|
12631
|
-
case ">=":
|
|
12632
|
-
if (!setMin || gt(compver, setMin)) {
|
|
12633
|
-
setMin = compver;
|
|
12634
|
-
}
|
|
12635
|
-
break;
|
|
12636
|
-
case "<":
|
|
12637
|
-
case "<=":
|
|
12638
|
-
break;
|
|
12639
|
-
/* istanbul ignore next */
|
|
12640
|
-
default:
|
|
12641
|
-
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
12642
|
-
}
|
|
12643
|
-
});
|
|
12644
|
-
if (setMin && (!minver || gt(minver, setMin))) {
|
|
12645
|
-
minver = setMin;
|
|
12646
|
-
}
|
|
12647
|
-
}
|
|
12648
|
-
if (minver && range.test(minver)) {
|
|
12649
|
-
return minver;
|
|
12650
|
-
}
|
|
12651
|
-
return null;
|
|
12652
|
-
};
|
|
12653
|
-
module.exports = minVersion;
|
|
12654
|
-
}
|
|
12655
|
-
});
|
|
12656
|
-
|
|
12657
|
-
// node_modules/semver/ranges/valid.js
|
|
12658
|
-
var require_valid2 = __commonJS({
|
|
12659
|
-
"node_modules/semver/ranges/valid.js"(exports, module) {
|
|
12660
|
-
"use strict";
|
|
12661
|
-
var Range = require_range();
|
|
12662
|
-
var validRange = (range, options) => {
|
|
12663
|
-
try {
|
|
12664
|
-
return new Range(range, options).range || "*";
|
|
12665
|
-
} catch (er) {
|
|
12666
|
-
return null;
|
|
12667
|
-
}
|
|
12668
|
-
};
|
|
12669
|
-
module.exports = validRange;
|
|
12670
|
-
}
|
|
12671
|
-
});
|
|
12672
|
-
|
|
12673
|
-
// node_modules/semver/ranges/outside.js
|
|
12674
|
-
var require_outside = __commonJS({
|
|
12675
|
-
"node_modules/semver/ranges/outside.js"(exports, module) {
|
|
12676
|
-
"use strict";
|
|
12677
|
-
var SemVer = require_semver();
|
|
12678
|
-
var Comparator = require_comparator();
|
|
12679
|
-
var { ANY } = Comparator;
|
|
12680
|
-
var Range = require_range();
|
|
12681
|
-
var satisfies2 = require_satisfies();
|
|
12682
|
-
var gt = require_gt();
|
|
12683
|
-
var lt = require_lt();
|
|
12684
|
-
var lte = require_lte();
|
|
12685
|
-
var gte = require_gte();
|
|
12686
|
-
var outside = (version2, range, hilo, options) => {
|
|
12687
|
-
version2 = new SemVer(version2, options);
|
|
12688
|
-
range = new Range(range, options);
|
|
12689
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
12690
|
-
switch (hilo) {
|
|
12691
|
-
case ">":
|
|
12692
|
-
gtfn = gt;
|
|
12693
|
-
ltefn = lte;
|
|
12694
|
-
ltfn = lt;
|
|
12695
|
-
comp = ">";
|
|
12696
|
-
ecomp = ">=";
|
|
12697
|
-
break;
|
|
12698
|
-
case "<":
|
|
12699
|
-
gtfn = lt;
|
|
12700
|
-
ltefn = gte;
|
|
12701
|
-
ltfn = gt;
|
|
12702
|
-
comp = "<";
|
|
12703
|
-
ecomp = "<=";
|
|
12704
|
-
break;
|
|
12705
|
-
default:
|
|
12706
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
12707
|
-
}
|
|
12708
|
-
if (satisfies2(version2, range, options)) {
|
|
12709
|
-
return false;
|
|
12710
|
-
}
|
|
12711
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
12712
|
-
const comparators = range.set[i];
|
|
12713
|
-
let high = null;
|
|
12714
|
-
let low = null;
|
|
12715
|
-
comparators.forEach((comparator) => {
|
|
12716
|
-
if (comparator.semver === ANY) {
|
|
12717
|
-
comparator = new Comparator(">=0.0.0");
|
|
12718
|
-
}
|
|
12719
|
-
high = high || comparator;
|
|
12720
|
-
low = low || comparator;
|
|
12721
|
-
if (gtfn(comparator.semver, high.semver, options)) {
|
|
12722
|
-
high = comparator;
|
|
12723
|
-
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
12724
|
-
low = comparator;
|
|
12725
|
-
}
|
|
12726
|
-
});
|
|
12727
|
-
if (high.operator === comp || high.operator === ecomp) {
|
|
12728
|
-
return false;
|
|
12729
|
-
}
|
|
12730
|
-
if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
|
|
12731
|
-
return false;
|
|
12732
|
-
} else if (low.operator === ecomp && ltfn(version2, low.semver)) {
|
|
12733
|
-
return false;
|
|
12734
|
-
}
|
|
12735
|
-
}
|
|
12736
|
-
return true;
|
|
12737
|
-
};
|
|
12738
|
-
module.exports = outside;
|
|
12739
|
-
}
|
|
12740
|
-
});
|
|
12741
|
-
|
|
12742
|
-
// node_modules/semver/ranges/gtr.js
|
|
12743
|
-
var require_gtr = __commonJS({
|
|
12744
|
-
"node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
12745
|
-
"use strict";
|
|
12746
|
-
var outside = require_outside();
|
|
12747
|
-
var gtr = (version2, range, options) => outside(version2, range, ">", options);
|
|
12748
|
-
module.exports = gtr;
|
|
12749
|
-
}
|
|
12750
|
-
});
|
|
12751
|
-
|
|
12752
|
-
// node_modules/semver/ranges/ltr.js
|
|
12753
|
-
var require_ltr = __commonJS({
|
|
12754
|
-
"node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
12755
|
-
"use strict";
|
|
12756
|
-
var outside = require_outside();
|
|
12757
|
-
var ltr = (version2, range, options) => outside(version2, range, "<", options);
|
|
12758
|
-
module.exports = ltr;
|
|
12759
|
-
}
|
|
12760
|
-
});
|
|
12761
|
-
|
|
12762
|
-
// node_modules/semver/ranges/intersects.js
|
|
12763
|
-
var require_intersects = __commonJS({
|
|
12764
|
-
"node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
12765
|
-
"use strict";
|
|
12766
|
-
var Range = require_range();
|
|
12767
|
-
var intersects = (r1, r2, options) => {
|
|
12768
|
-
r1 = new Range(r1, options);
|
|
12769
|
-
r2 = new Range(r2, options);
|
|
12770
|
-
return r1.intersects(r2, options);
|
|
12771
|
-
};
|
|
12772
|
-
module.exports = intersects;
|
|
12773
|
-
}
|
|
12774
|
-
});
|
|
12775
|
-
|
|
12776
|
-
// node_modules/semver/ranges/simplify.js
|
|
12777
|
-
var require_simplify = __commonJS({
|
|
12778
|
-
"node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
12779
|
-
"use strict";
|
|
12780
|
-
var satisfies2 = require_satisfies();
|
|
12781
|
-
var compare2 = require_compare();
|
|
12782
|
-
module.exports = (versions, range, options) => {
|
|
12783
|
-
const set2 = [];
|
|
12784
|
-
let first = null;
|
|
12785
|
-
let prev = null;
|
|
12786
|
-
const v = versions.sort((a, b) => compare2(a, b, options));
|
|
12787
|
-
for (const version2 of v) {
|
|
12788
|
-
const included = satisfies2(version2, range, options);
|
|
12789
|
-
if (included) {
|
|
12790
|
-
prev = version2;
|
|
12791
|
-
if (!first) {
|
|
12792
|
-
first = version2;
|
|
12793
|
-
}
|
|
12794
|
-
} else {
|
|
12795
|
-
if (prev) {
|
|
12796
|
-
set2.push([first, prev]);
|
|
12797
|
-
}
|
|
12798
|
-
prev = null;
|
|
12799
|
-
first = null;
|
|
12800
|
-
}
|
|
12801
|
-
}
|
|
12802
|
-
if (first) {
|
|
12803
|
-
set2.push([first, null]);
|
|
12804
|
-
}
|
|
12805
|
-
const ranges = [];
|
|
12806
|
-
for (const [min, max] of set2) {
|
|
12807
|
-
if (min === max) {
|
|
12808
|
-
ranges.push(min);
|
|
12809
|
-
} else if (!max && min === v[0]) {
|
|
12810
|
-
ranges.push("*");
|
|
12811
|
-
} else if (!max) {
|
|
12812
|
-
ranges.push(`>=${min}`);
|
|
12813
|
-
} else if (min === v[0]) {
|
|
12814
|
-
ranges.push(`<=${max}`);
|
|
12815
|
-
} else {
|
|
12816
|
-
ranges.push(`${min} - ${max}`);
|
|
12817
|
-
}
|
|
12818
|
-
}
|
|
12819
|
-
const simplified = ranges.join(" || ");
|
|
12820
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
12821
|
-
return simplified.length < original.length ? simplified : range;
|
|
12822
|
-
};
|
|
12823
|
-
}
|
|
12824
|
-
});
|
|
12825
|
-
|
|
12826
|
-
// node_modules/semver/ranges/subset.js
|
|
12827
|
-
var require_subset = __commonJS({
|
|
12828
|
-
"node_modules/semver/ranges/subset.js"(exports, module) {
|
|
12829
|
-
"use strict";
|
|
12830
|
-
var Range = require_range();
|
|
12831
|
-
var Comparator = require_comparator();
|
|
12832
|
-
var { ANY } = Comparator;
|
|
12833
|
-
var satisfies2 = require_satisfies();
|
|
12834
|
-
var compare2 = require_compare();
|
|
12835
|
-
var subset = (sub, dom, options = {}) => {
|
|
12836
|
-
if (sub === dom) {
|
|
12837
|
-
return true;
|
|
12838
|
-
}
|
|
12839
|
-
sub = new Range(sub, options);
|
|
12840
|
-
dom = new Range(dom, options);
|
|
12841
|
-
let sawNonNull = false;
|
|
12842
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
12843
|
-
for (const simpleDom of dom.set) {
|
|
12844
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
12845
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
12846
|
-
if (isSub) {
|
|
12847
|
-
continue OUTER;
|
|
12848
|
-
}
|
|
12849
|
-
}
|
|
12850
|
-
if (sawNonNull) {
|
|
12851
|
-
return false;
|
|
12852
|
-
}
|
|
12853
|
-
}
|
|
12854
|
-
return true;
|
|
12855
|
-
};
|
|
12856
|
-
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
12857
|
-
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
12858
|
-
var simpleSubset = (sub, dom, options) => {
|
|
12859
|
-
if (sub === dom) {
|
|
12860
|
-
return true;
|
|
12861
|
-
}
|
|
12862
|
-
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
12863
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
12864
|
-
return true;
|
|
12865
|
-
} else if (options.includePrerelease) {
|
|
12866
|
-
sub = minimumVersionWithPreRelease;
|
|
12867
|
-
} else {
|
|
12868
|
-
sub = minimumVersion;
|
|
12869
|
-
}
|
|
12870
|
-
}
|
|
12871
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
12872
|
-
if (options.includePrerelease) {
|
|
12873
|
-
return true;
|
|
12874
|
-
} else {
|
|
12875
|
-
dom = minimumVersion;
|
|
12876
|
-
}
|
|
12877
|
-
}
|
|
12878
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
12879
|
-
let gt, lt;
|
|
12880
|
-
for (const c of sub) {
|
|
12881
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
12882
|
-
gt = higherGT(gt, c, options);
|
|
12883
|
-
} else if (c.operator === "<" || c.operator === "<=") {
|
|
12884
|
-
lt = lowerLT(lt, c, options);
|
|
12885
|
-
} else {
|
|
12886
|
-
eqSet.add(c.semver);
|
|
12887
|
-
}
|
|
12888
|
-
}
|
|
12889
|
-
if (eqSet.size > 1) {
|
|
12890
|
-
return null;
|
|
12891
|
-
}
|
|
12892
|
-
let gtltComp;
|
|
12893
|
-
if (gt && lt) {
|
|
12894
|
-
gtltComp = compare2(gt.semver, lt.semver, options);
|
|
12895
|
-
if (gtltComp > 0) {
|
|
12896
|
-
return null;
|
|
12897
|
-
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
12898
|
-
return null;
|
|
12899
|
-
}
|
|
12900
|
-
}
|
|
12901
|
-
for (const eq of eqSet) {
|
|
12902
|
-
if (gt && !satisfies2(eq, String(gt), options)) {
|
|
12903
|
-
return null;
|
|
12904
|
-
}
|
|
12905
|
-
if (lt && !satisfies2(eq, String(lt), options)) {
|
|
12906
|
-
return null;
|
|
12907
|
-
}
|
|
12908
|
-
for (const c of dom) {
|
|
12909
|
-
if (!satisfies2(eq, String(c), options)) {
|
|
12910
|
-
return false;
|
|
12911
|
-
}
|
|
12912
|
-
}
|
|
12913
|
-
return true;
|
|
12914
|
-
}
|
|
12915
|
-
let higher, lower;
|
|
12916
|
-
let hasDomLT, hasDomGT;
|
|
12917
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
12918
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
12919
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
12920
|
-
needDomLTPre = false;
|
|
12921
|
-
}
|
|
12922
|
-
for (const c of dom) {
|
|
12923
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
12924
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
12925
|
-
if (gt) {
|
|
12926
|
-
if (needDomGTPre) {
|
|
12927
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
12928
|
-
needDomGTPre = false;
|
|
12929
|
-
}
|
|
12930
|
-
}
|
|
12931
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
12932
|
-
higher = higherGT(gt, c, options);
|
|
12933
|
-
if (higher === c && higher !== gt) {
|
|
12934
|
-
return false;
|
|
12935
|
-
}
|
|
12936
|
-
} else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) {
|
|
12937
|
-
return false;
|
|
12938
|
-
}
|
|
12939
|
-
}
|
|
12940
|
-
if (lt) {
|
|
12941
|
-
if (needDomLTPre) {
|
|
12942
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
12943
|
-
needDomLTPre = false;
|
|
12944
|
-
}
|
|
12945
|
-
}
|
|
12946
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
12947
|
-
lower = lowerLT(lt, c, options);
|
|
12948
|
-
if (lower === c && lower !== lt) {
|
|
12949
|
-
return false;
|
|
12950
|
-
}
|
|
12951
|
-
} else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) {
|
|
12952
|
-
return false;
|
|
12953
|
-
}
|
|
12954
|
-
}
|
|
12955
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
12956
|
-
return false;
|
|
12957
|
-
}
|
|
12958
|
-
}
|
|
12959
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
12960
|
-
return false;
|
|
12961
|
-
}
|
|
12962
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
12963
|
-
return false;
|
|
12964
|
-
}
|
|
12965
|
-
if (needDomGTPre || needDomLTPre) {
|
|
12966
|
-
return false;
|
|
12967
|
-
}
|
|
12968
|
-
return true;
|
|
12969
|
-
};
|
|
12970
|
-
var higherGT = (a, b, options) => {
|
|
12971
|
-
if (!a) {
|
|
12972
|
-
return b;
|
|
12973
|
-
}
|
|
12974
|
-
const comp = compare2(a.semver, b.semver, options);
|
|
12975
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
12976
|
-
};
|
|
12977
|
-
var lowerLT = (a, b, options) => {
|
|
12978
|
-
if (!a) {
|
|
12979
|
-
return b;
|
|
12980
|
-
}
|
|
12981
|
-
const comp = compare2(a.semver, b.semver, options);
|
|
12982
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
12983
|
-
};
|
|
12984
|
-
module.exports = subset;
|
|
12985
|
-
}
|
|
12986
|
-
});
|
|
12987
|
-
|
|
12988
|
-
// node_modules/semver/index.js
|
|
12989
|
-
var require_semver2 = __commonJS({
|
|
12990
|
-
"node_modules/semver/index.js"(exports, module) {
|
|
12991
|
-
"use strict";
|
|
12992
|
-
var internalRe = require_re();
|
|
12993
|
-
var constants = require_constants();
|
|
12994
|
-
var SemVer = require_semver();
|
|
12995
|
-
var identifiers = require_identifiers();
|
|
12996
|
-
var parse3 = require_parse();
|
|
12997
|
-
var valid2 = require_valid();
|
|
12998
|
-
var clean = require_clean();
|
|
12999
|
-
var inc = require_inc();
|
|
13000
|
-
var diff = require_diff();
|
|
13001
|
-
var major = require_major();
|
|
13002
|
-
var minor = require_minor();
|
|
13003
|
-
var patch = require_patch();
|
|
13004
|
-
var prerelease = require_prerelease();
|
|
13005
|
-
var compare2 = require_compare();
|
|
13006
|
-
var rcompare = require_rcompare();
|
|
13007
|
-
var compareLoose = require_compare_loose();
|
|
13008
|
-
var compareBuild = require_compare_build();
|
|
13009
|
-
var sort = require_sort();
|
|
13010
|
-
var rsort = require_rsort();
|
|
13011
|
-
var gt = require_gt();
|
|
13012
|
-
var lt = require_lt();
|
|
13013
|
-
var eq = require_eq();
|
|
13014
|
-
var neq = require_neq();
|
|
13015
|
-
var gte = require_gte();
|
|
13016
|
-
var lte = require_lte();
|
|
13017
|
-
var cmp = require_cmp();
|
|
13018
|
-
var coerce = require_coerce();
|
|
13019
|
-
var Comparator = require_comparator();
|
|
13020
|
-
var Range = require_range();
|
|
13021
|
-
var satisfies2 = require_satisfies();
|
|
13022
|
-
var toComparators = require_to_comparators();
|
|
13023
|
-
var maxSatisfying = require_max_satisfying();
|
|
13024
|
-
var minSatisfying = require_min_satisfying();
|
|
13025
|
-
var minVersion = require_min_version();
|
|
13026
|
-
var validRange = require_valid2();
|
|
13027
|
-
var outside = require_outside();
|
|
13028
|
-
var gtr = require_gtr();
|
|
13029
|
-
var ltr = require_ltr();
|
|
13030
|
-
var intersects = require_intersects();
|
|
13031
|
-
var simplifyRange = require_simplify();
|
|
13032
|
-
var subset = require_subset();
|
|
13033
|
-
module.exports = {
|
|
13034
|
-
parse: parse3,
|
|
13035
|
-
valid: valid2,
|
|
13036
|
-
clean,
|
|
13037
|
-
inc,
|
|
13038
|
-
diff,
|
|
13039
|
-
major,
|
|
13040
|
-
minor,
|
|
13041
|
-
patch,
|
|
13042
|
-
prerelease,
|
|
13043
|
-
compare: compare2,
|
|
13044
|
-
rcompare,
|
|
13045
|
-
compareLoose,
|
|
13046
|
-
compareBuild,
|
|
13047
|
-
sort,
|
|
13048
|
-
rsort,
|
|
13049
|
-
gt,
|
|
13050
|
-
lt,
|
|
13051
|
-
eq,
|
|
13052
|
-
neq,
|
|
13053
|
-
gte,
|
|
13054
|
-
lte,
|
|
13055
|
-
cmp,
|
|
13056
|
-
coerce,
|
|
13057
|
-
Comparator,
|
|
13058
|
-
Range,
|
|
13059
|
-
satisfies: satisfies2,
|
|
13060
|
-
toComparators,
|
|
13061
|
-
maxSatisfying,
|
|
13062
|
-
minSatisfying,
|
|
13063
|
-
minVersion,
|
|
13064
|
-
validRange,
|
|
13065
|
-
outside,
|
|
13066
|
-
gtr,
|
|
13067
|
-
ltr,
|
|
13068
|
-
intersects,
|
|
13069
|
-
simplifyRange,
|
|
13070
|
-
subset,
|
|
13071
|
-
SemVer,
|
|
13072
|
-
re: internalRe.re,
|
|
13073
|
-
src: internalRe.src,
|
|
13074
|
-
tokens: internalRe.t,
|
|
13075
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
13076
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
13077
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
13078
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
13079
|
-
};
|
|
13080
|
-
}
|
|
13081
|
-
});
|
|
13082
|
-
|
|
13083
11153
|
// node_modules/envinfo/dist/envinfo.js
|
|
13084
11154
|
var require_envinfo = __commonJS({
|
|
13085
11155
|
"node_modules/envinfo/dist/envinfo.js"(exports, module) {
|
|
@@ -17416,12 +15486,13 @@ var {
|
|
|
17416
15486
|
} = import_index.default;
|
|
17417
15487
|
|
|
17418
15488
|
// src/data/loader.ts
|
|
17419
|
-
import {
|
|
15489
|
+
import { existsSync, readFileSync as readFileSync2 } from "fs";
|
|
17420
15490
|
import { gunzipSync } from "zlib";
|
|
17421
15491
|
import { join, dirname } from "path";
|
|
17422
15492
|
import { fileURLToPath } from "url";
|
|
17423
15493
|
|
|
17424
15494
|
// src/output/error.ts
|
|
15495
|
+
import levenshtein from "fast-levenshtein";
|
|
17425
15496
|
var ErrorCodes = {
|
|
17426
15497
|
COMPONENT_NOT_FOUND: "COMPONENT_NOT_FOUND",
|
|
17427
15498
|
VERSION_NOT_FOUND: "VERSION_NOT_FOUND",
|
|
@@ -17461,7 +15532,7 @@ function fuzzyMatch(input, candidates) {
|
|
|
17461
15532
|
let best;
|
|
17462
15533
|
let bestDist = Infinity;
|
|
17463
15534
|
for (const candidate of candidates) {
|
|
17464
|
-
const dist = levenshtein(lower, candidate.toLowerCase());
|
|
15535
|
+
const dist = levenshtein.get(lower, candidate.toLowerCase());
|
|
17465
15536
|
if (dist <= 3) {
|
|
17466
15537
|
const sameFirstLetter = lower[0] === candidate[0]?.toLowerCase();
|
|
17467
15538
|
const bestSameFirstLetter = best ? lower[0] === best[0]?.toLowerCase() : false;
|
|
@@ -17473,18 +15544,15 @@ function fuzzyMatch(input, candidates) {
|
|
|
17473
15544
|
}
|
|
17474
15545
|
return best;
|
|
17475
15546
|
}
|
|
17476
|
-
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
dp[i][j] = a[i - 1] === b[j - 1] ? dp[i - 1][j - 1] : 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);
|
|
17485
|
-
}
|
|
15547
|
+
|
|
15548
|
+
// src/utils/json.ts
|
|
15549
|
+
import { readFileSync } from "fs";
|
|
15550
|
+
function readJson(path6) {
|
|
15551
|
+
try {
|
|
15552
|
+
return JSON.parse(readFileSync(path6, "utf-8"));
|
|
15553
|
+
} catch {
|
|
15554
|
+
return null;
|
|
17486
15555
|
}
|
|
17487
|
-
return dp[m][n];
|
|
17488
15556
|
}
|
|
17489
15557
|
|
|
17490
15558
|
// src/data/loader.ts
|
|
@@ -17506,9 +15574,9 @@ function getDataPath() {
|
|
|
17506
15574
|
function readDataFile(filePath) {
|
|
17507
15575
|
const gzPath = filePath + ".gz";
|
|
17508
15576
|
if (existsSync(gzPath)) {
|
|
17509
|
-
return gunzipSync(
|
|
15577
|
+
return gunzipSync(readFileSync2(gzPath)).toString("utf-8");
|
|
17510
15578
|
}
|
|
17511
|
-
return
|
|
15579
|
+
return readFileSync2(filePath, "utf-8");
|
|
17512
15580
|
}
|
|
17513
15581
|
function normalizeStore(store) {
|
|
17514
15582
|
for (const comp of store.components) {
|
|
@@ -17554,10 +15622,8 @@ function loadMetadataForVersionUncached(version2) {
|
|
|
17554
15622
|
}
|
|
17555
15623
|
const minorKey = `${major}.${parts[1]}`;
|
|
17556
15624
|
const versionsPath = join(getDataPath(), "versions.json");
|
|
17557
|
-
|
|
17558
|
-
|
|
17559
|
-
versionsIndex = JSON.parse(readFileSync(versionsPath, "utf-8"));
|
|
17560
|
-
} catch {
|
|
15625
|
+
const versionsIndex = readJson(versionsPath);
|
|
15626
|
+
if (!versionsIndex) {
|
|
17561
15627
|
return loadMetadata(majorVersion);
|
|
17562
15628
|
}
|
|
17563
15629
|
const majorIndex = versionsIndex[majorVersion] ?? {};
|
|
@@ -17612,8 +15678,9 @@ function resolveComponent(component, version2) {
|
|
|
17612
15678
|
}
|
|
17613
15679
|
|
|
17614
15680
|
// src/data/version.ts
|
|
17615
|
-
import {
|
|
15681
|
+
import { existsSync as existsSync2 } from "fs";
|
|
17616
15682
|
import { join as join2 } from "path";
|
|
15683
|
+
import semver from "semver";
|
|
17617
15684
|
var FALLBACK_VERSION = "5.24.0";
|
|
17618
15685
|
var FALLBACK_MAJOR = "v5";
|
|
17619
15686
|
function detectVersion(flagVersion) {
|
|
@@ -17626,32 +15693,26 @@ function detectVersion(flagVersion) {
|
|
|
17626
15693
|
}
|
|
17627
15694
|
const nmPath = join2(process.cwd(), "node_modules", "antd", "package.json");
|
|
17628
15695
|
if (existsSync2(nmPath)) {
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
};
|
|
17637
|
-
}
|
|
17638
|
-
} catch {
|
|
15696
|
+
const pkg = readJson(nmPath);
|
|
15697
|
+
if (pkg?.version) {
|
|
15698
|
+
return {
|
|
15699
|
+
version: pkg.version,
|
|
15700
|
+
majorVersion: toMajor(pkg.version),
|
|
15701
|
+
source: "node_modules"
|
|
15702
|
+
};
|
|
17639
15703
|
}
|
|
17640
15704
|
}
|
|
17641
15705
|
const pkgPath = join2(process.cwd(), "package.json");
|
|
17642
15706
|
if (existsSync2(pkgPath)) {
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
};
|
|
17653
|
-
}
|
|
17654
|
-
} catch {
|
|
15707
|
+
const pkg = readJson(pkgPath);
|
|
15708
|
+
const depVersion = pkg?.dependencies?.antd || pkg?.devDependencies?.antd || pkg?.peerDependencies?.antd;
|
|
15709
|
+
if (depVersion) {
|
|
15710
|
+
const cleaned = depVersion.replace(/[\^~>=<\s]/g, "");
|
|
15711
|
+
return {
|
|
15712
|
+
version: cleaned,
|
|
15713
|
+
majorVersion: toMajor(cleaned),
|
|
15714
|
+
source: "package.json"
|
|
15715
|
+
};
|
|
17655
15716
|
}
|
|
17656
15717
|
}
|
|
17657
15718
|
return {
|
|
@@ -17665,70 +15726,21 @@ function toMajor(version2) {
|
|
|
17665
15726
|
return `v${major}`;
|
|
17666
15727
|
}
|
|
17667
15728
|
function compare(a, b) {
|
|
17668
|
-
const
|
|
17669
|
-
const
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
const nb = pb[i] || 0;
|
|
17673
|
-
if (na < nb) return -1;
|
|
17674
|
-
if (na > nb) return 1;
|
|
17675
|
-
}
|
|
17676
|
-
return 0;
|
|
15729
|
+
const sa = semver.coerce(a);
|
|
15730
|
+
const sb = semver.coerce(b);
|
|
15731
|
+
if (!sa || !sb) return null;
|
|
15732
|
+
return semver.compare(sa, sb);
|
|
17677
15733
|
}
|
|
17678
15734
|
function valid(version2) {
|
|
17679
|
-
return
|
|
15735
|
+
return semver.valid(version2) !== null;
|
|
17680
15736
|
}
|
|
17681
15737
|
function satisfies(version2, range) {
|
|
17682
|
-
range
|
|
17683
|
-
version2 = version2.trim();
|
|
17684
|
-
const constraints = range.match(/(?:>=|<=|>|<)\s*\d+[\d.]*/g);
|
|
17685
|
-
if (constraints && constraints.length > 1) {
|
|
17686
|
-
return constraints.every((c) => satisfies(version2, c.trim()));
|
|
17687
|
-
}
|
|
17688
|
-
if (range.startsWith("<=")) {
|
|
17689
|
-
const bound = range.slice(2).trim();
|
|
17690
|
-
return compare(version2, bound) <= 0;
|
|
17691
|
-
}
|
|
17692
|
-
if (range.startsWith(">=")) {
|
|
17693
|
-
const bound = range.slice(2).trim();
|
|
17694
|
-
return compare(version2, bound) >= 0;
|
|
17695
|
-
}
|
|
17696
|
-
if (range.startsWith("<")) {
|
|
17697
|
-
const bound = range.slice(1).trim();
|
|
17698
|
-
return compare(version2, bound) < 0;
|
|
17699
|
-
}
|
|
17700
|
-
if (range.startsWith(">")) {
|
|
17701
|
-
const bound = range.slice(1).trim();
|
|
17702
|
-
return compare(version2, bound) > 0;
|
|
17703
|
-
}
|
|
17704
|
-
if (range.startsWith("^")) {
|
|
17705
|
-
const bound = range.slice(1).trim();
|
|
17706
|
-
const vParts = version2.split(".").map(Number);
|
|
17707
|
-
const bParts = bound.split(".").map(Number);
|
|
17708
|
-
if (vParts[0] !== bParts[0]) return false;
|
|
17709
|
-
return compare(version2, bound) >= 0;
|
|
17710
|
-
}
|
|
17711
|
-
if (range.startsWith("~")) {
|
|
17712
|
-
const bound = range.slice(1).trim();
|
|
17713
|
-
const vParts = version2.split(".").map(Number);
|
|
17714
|
-
const bParts = bound.split(".").map(Number);
|
|
17715
|
-
if (vParts[0] !== bParts[0] || vParts[1] !== bParts[1]) return false;
|
|
17716
|
-
return compare(version2, bound) >= 0;
|
|
17717
|
-
}
|
|
17718
|
-
const parts = range.split(".");
|
|
17719
|
-
if (parts.length <= 2 && parts.every((p) => /^\d+$/.test(p))) {
|
|
17720
|
-
const vParts = version2.split(".").map(Number);
|
|
17721
|
-
const rParts = parts.map(Number);
|
|
17722
|
-
if (vParts[0] !== rParts[0]) return false;
|
|
17723
|
-
if (rParts.length === 2 && vParts[1] !== rParts[1]) return false;
|
|
17724
|
-
return true;
|
|
17725
|
-
}
|
|
17726
|
-
if (/^\d+\.\d+\.\d+/.test(range)) {
|
|
17727
|
-
return compare(version2, range) === 0;
|
|
17728
|
-
}
|
|
17729
|
-
return true;
|
|
15738
|
+
return semver.satisfies(version2, range, { includePrerelease: true }) ?? false;
|
|
17730
15739
|
}
|
|
17731
15740
|
|
|
15741
|
+
// src/output/formatter.ts
|
|
15742
|
+
import stringWidth from "string-width";
|
|
15743
|
+
|
|
17732
15744
|
// src/types.ts
|
|
17733
15745
|
function localize(en, zh, lang) {
|
|
17734
15746
|
if (lang === "zh" && zh) return zh;
|
|
@@ -17828,13 +15840,17 @@ function formatTable(headers, rows, format) {
|
|
|
17828
15840
|
const bodyLines2 = rows.map((row) => "| " + row.map(escPipe).join(" | ") + " |");
|
|
17829
15841
|
return [headerLine2, separator2, ...bodyLines2].join("\n");
|
|
17830
15842
|
}
|
|
15843
|
+
const sw = (s) => stringWidth(s);
|
|
15844
|
+
const headerWidths = headers.map(sw);
|
|
15845
|
+
const cellWidths = rows.map((row) => row.map((cell) => sw(cell || "")));
|
|
17831
15846
|
const colWidths = headers.map(
|
|
17832
|
-
(
|
|
15847
|
+
(_, i) => Math.max(headerWidths[i], ...cellWidths.map((rw) => rw[i]))
|
|
17833
15848
|
);
|
|
17834
|
-
const
|
|
15849
|
+
const padCell = (cell, cellWidth, colWidth) => cell + " ".repeat(colWidth - cellWidth);
|
|
15850
|
+
const headerLine = headers.map((h, i) => padCell(h, headerWidths[i], colWidths[i])).join(" ");
|
|
17835
15851
|
const separator = colWidths.map((w) => "-".repeat(w)).join(" ");
|
|
17836
15852
|
const bodyLines = rows.map(
|
|
17837
|
-
(row) => row.map((cell,
|
|
15853
|
+
(row, ri) => row.map((cell, ci) => padCell(cell || "", cellWidths[ri][ci], colWidths[ci])).join(" ")
|
|
17838
15854
|
);
|
|
17839
15855
|
return [headerLine, separator, ...bodyLines].join("\n");
|
|
17840
15856
|
}
|
|
@@ -17854,9 +15870,9 @@ function listComponents(opts) {
|
|
|
17854
15870
|
category: c.category ?? ""
|
|
17855
15871
|
}));
|
|
17856
15872
|
}
|
|
17857
|
-
function registerListCommand(
|
|
17858
|
-
|
|
17859
|
-
const opts =
|
|
15873
|
+
function registerListCommand(program2) {
|
|
15874
|
+
program2.command("list").description("List all components with bilingual names, descriptions, and first-supported version").action(() => {
|
|
15875
|
+
const opts = program2.opts();
|
|
17860
15876
|
const versionInfo = detectVersion(opts.version);
|
|
17861
15877
|
const components = listComponents({ version: versionInfo.version });
|
|
17862
15878
|
if (components.length === 0) {
|
|
@@ -17942,9 +15958,9 @@ function getComponentInfo(component, opts) {
|
|
|
17942
15958
|
) : void 0
|
|
17943
15959
|
};
|
|
17944
15960
|
}
|
|
17945
|
-
function registerInfoCommand(
|
|
17946
|
-
|
|
17947
|
-
const opts =
|
|
15961
|
+
function registerInfoCommand(program2) {
|
|
15962
|
+
program2.command("info <component>").description("Query component API: props, type definitions, default values").action((component) => {
|
|
15963
|
+
const opts = program2.opts();
|
|
17948
15964
|
const lang = opts.lang;
|
|
17949
15965
|
const versionInfo = detectVersion(opts.version);
|
|
17950
15966
|
const result = getComponentInfo(component, {
|
|
@@ -18009,9 +16025,9 @@ function getComponentDoc(component, opts) {
|
|
|
18009
16025
|
}
|
|
18010
16026
|
return { name: comp.name, doc };
|
|
18011
16027
|
}
|
|
18012
|
-
function registerDocCommand(
|
|
18013
|
-
|
|
18014
|
-
const opts =
|
|
16028
|
+
function registerDocCommand(program2) {
|
|
16029
|
+
program2.command("doc <component>").description("Output the full API documentation for a component in markdown").action((component) => {
|
|
16030
|
+
const opts = program2.opts();
|
|
18015
16031
|
const lang = opts.lang;
|
|
18016
16032
|
const versionInfo = detectVersion(opts.version);
|
|
18017
16033
|
const result = getComponentDoc(component, {
|
|
@@ -18065,9 +16081,9 @@ function getComponentDemo(component, opts) {
|
|
|
18065
16081
|
code: demo.code
|
|
18066
16082
|
};
|
|
18067
16083
|
}
|
|
18068
|
-
function registerDemoCommand(
|
|
18069
|
-
|
|
18070
|
-
const opts =
|
|
16084
|
+
function registerDemoCommand(program2) {
|
|
16085
|
+
program2.command("demo <component> [name]").description("Get demo source code for a component").action((component, name) => {
|
|
16086
|
+
const opts = program2.opts();
|
|
18071
16087
|
const versionInfo = detectVersion(opts.version);
|
|
18072
16088
|
const result = getComponentDemo(component, {
|
|
18073
16089
|
version: versionInfo.version,
|
|
@@ -18133,9 +16149,9 @@ function getTokens(component, opts) {
|
|
|
18133
16149
|
const tokens = comp.tokens || [];
|
|
18134
16150
|
return { component: comp.name, tokens };
|
|
18135
16151
|
}
|
|
18136
|
-
function registerTokenCommand(
|
|
18137
|
-
|
|
18138
|
-
const opts =
|
|
16152
|
+
function registerTokenCommand(program2) {
|
|
16153
|
+
program2.command("token [component]").description("Query Design Tokens (global or component-level)").action((component) => {
|
|
16154
|
+
const opts = program2.opts();
|
|
18139
16155
|
const versionInfo = detectVersion(opts.version);
|
|
18140
16156
|
const result = getTokens(component, {
|
|
18141
16157
|
lang: opts.lang,
|
|
@@ -18166,9 +16182,9 @@ function getSemanticStructure(component, opts) {
|
|
|
18166
16182
|
const structure = comp.semanticStructure || [];
|
|
18167
16183
|
return { name: comp.name, semanticStructure: structure };
|
|
18168
16184
|
}
|
|
18169
|
-
function registerSemanticCommand(
|
|
18170
|
-
|
|
18171
|
-
const opts =
|
|
16185
|
+
function registerSemanticCommand(program2) {
|
|
16186
|
+
program2.command("semantic <component>").description("Query the semantic customization structure of a component").action((component) => {
|
|
16187
|
+
const opts = program2.opts();
|
|
18172
16188
|
const versionInfo = detectVersion(opts.version);
|
|
18173
16189
|
const result = getSemanticStructure(component, {
|
|
18174
16190
|
version: versionInfo.version
|
|
@@ -18214,7 +16230,7 @@ function filterEntries(changelog, versionArg) {
|
|
|
18214
16230
|
return changelog.filter((e) => e.version === parsed.exact);
|
|
18215
16231
|
}
|
|
18216
16232
|
return changelog.filter(
|
|
18217
|
-
(e) => compare(e.version, parsed.from) >= 0 && compare(e.version, parsed.to) <= 0
|
|
16233
|
+
(e) => (compare(e.version, parsed.from) ?? -1) >= 0 && (compare(e.version, parsed.to) ?? 1) <= 0
|
|
18218
16234
|
);
|
|
18219
16235
|
}
|
|
18220
16236
|
var EMOJI_MAP = {
|
|
@@ -18271,7 +16287,7 @@ function queryChangelog(opts) {
|
|
|
18271
16287
|
return { entries, versionArg: opts.entryFilter };
|
|
18272
16288
|
}
|
|
18273
16289
|
function diffChangelog(opts) {
|
|
18274
|
-
if (compare(opts.v1, opts.v2) > 0) {
|
|
16290
|
+
if ((compare(opts.v1, opts.v2) ?? 0) > 0) {
|
|
18275
16291
|
return createError(
|
|
18276
16292
|
ErrorCodes.INVALID_ARGUMENT,
|
|
18277
16293
|
`Version order is invalid: "${opts.v1}" is newer than "${opts.v2}"`,
|
|
@@ -18355,9 +16371,9 @@ function printApiDiff(result, format) {
|
|
|
18355
16371
|
console.log("");
|
|
18356
16372
|
}
|
|
18357
16373
|
}
|
|
18358
|
-
function registerChangelogCommand(
|
|
18359
|
-
|
|
18360
|
-
const opts =
|
|
16374
|
+
function registerChangelogCommand(program2) {
|
|
16375
|
+
program2.command("changelog [v1] [v2] [component]").description("Query changelog or compare API differences between versions").action((v1, v2, component) => {
|
|
16376
|
+
const opts = program2.opts();
|
|
18361
16377
|
const isChangelogMode = !v2 || v1 && v1.includes("..");
|
|
18362
16378
|
if (isChangelogMode) {
|
|
18363
16379
|
const v1ForDetect = v1?.includes("..") ? v1.split("..")[1] : v1;
|
|
@@ -18390,53 +16406,8 @@ function registerChangelogCommand(program3) {
|
|
|
18390
16406
|
}
|
|
18391
16407
|
|
|
18392
16408
|
// src/commands/doctor.ts
|
|
18393
|
-
import { readFileSync as
|
|
18394
|
-
import { join as
|
|
18395
|
-
|
|
18396
|
-
// src/utils/scan.ts
|
|
18397
|
-
import { readFileSync as readFileSync3, readdirSync, statSync } from "fs";
|
|
18398
|
-
import { join as join3, extname } from "path";
|
|
18399
|
-
var SCAN_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx"]);
|
|
18400
|
-
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "build", ".next"]);
|
|
18401
|
-
function collectFiles(dir) {
|
|
18402
|
-
const files = [];
|
|
18403
|
-
try {
|
|
18404
|
-
const stat = statSync(dir);
|
|
18405
|
-
if (stat.isFile()) return [dir];
|
|
18406
|
-
} catch {
|
|
18407
|
-
return [];
|
|
18408
|
-
}
|
|
18409
|
-
try {
|
|
18410
|
-
const entries = readdirSync(dir, { withFileTypes: true });
|
|
18411
|
-
for (const entry of entries) {
|
|
18412
|
-
if (entry.name.startsWith(".umi") || SKIP_DIRS.has(entry.name)) continue;
|
|
18413
|
-
const fullPath = join3(dir, entry.name);
|
|
18414
|
-
if (entry.isDirectory()) {
|
|
18415
|
-
files.push(...collectFiles(fullPath));
|
|
18416
|
-
} else if (SCAN_EXTENSIONS.has(extname(entry.name))) {
|
|
18417
|
-
files.push(fullPath);
|
|
18418
|
-
}
|
|
18419
|
-
}
|
|
18420
|
-
} catch {
|
|
18421
|
-
}
|
|
18422
|
-
return files;
|
|
18423
|
-
}
|
|
18424
|
-
function getJSXElementName(name) {
|
|
18425
|
-
if (name.type === "JSXMemberExpression") {
|
|
18426
|
-
return getJSXElementName(name.object) + "." + name.property.name;
|
|
18427
|
-
}
|
|
18428
|
-
if (name.type === "JSXIdentifier") {
|
|
18429
|
-
return name.name;
|
|
18430
|
-
}
|
|
18431
|
-
return "";
|
|
18432
|
-
}
|
|
18433
|
-
function readJson(path6) {
|
|
18434
|
-
try {
|
|
18435
|
-
return JSON.parse(readFileSync3(path6, "utf-8"));
|
|
18436
|
-
} catch {
|
|
18437
|
-
return null;
|
|
18438
|
-
}
|
|
18439
|
-
}
|
|
16409
|
+
import { readFileSync as readFileSync3, readdirSync, existsSync as existsSync3 } from "fs";
|
|
16410
|
+
import { join as join3 } from "path";
|
|
18440
16411
|
|
|
18441
16412
|
// node_modules/conf/dist/source/index.js
|
|
18442
16413
|
import { isDeepStrictEqual } from "util";
|
|
@@ -19282,7 +17253,7 @@ var debounceFunction = (inputFunction, options = {}) => {
|
|
|
19282
17253
|
var debounce_fn_default = debounceFunction;
|
|
19283
17254
|
|
|
19284
17255
|
// node_modules/conf/dist/source/index.js
|
|
19285
|
-
|
|
17256
|
+
import semver2 from "semver";
|
|
19286
17257
|
|
|
19287
17258
|
// node_modules/uint8array-extras/index.js
|
|
19288
17259
|
var objectToString = Object.prototype.toString;
|
|
@@ -19794,7 +17765,7 @@ var Conf = class {
|
|
|
19794
17765
|
throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${errorMessage}`);
|
|
19795
17766
|
}
|
|
19796
17767
|
}
|
|
19797
|
-
if (this._isVersionInRangeFormat(previousMigratedVersion) || !
|
|
17768
|
+
if (this._isVersionInRangeFormat(previousMigratedVersion) || !semver2.eq(previousMigratedVersion, versionToMigrate)) {
|
|
19798
17769
|
this._set(MIGRATION_KEY, versionToMigrate);
|
|
19799
17770
|
}
|
|
19800
17771
|
}
|
|
@@ -19825,19 +17796,19 @@ var Conf = class {
|
|
|
19825
17796
|
return candidate === INTERNAL_KEY || candidate.startsWith(`${INTERNAL_KEY}.`);
|
|
19826
17797
|
}
|
|
19827
17798
|
_isVersionInRangeFormat(version2) {
|
|
19828
|
-
return
|
|
17799
|
+
return semver2.clean(version2) === null;
|
|
19829
17800
|
}
|
|
19830
17801
|
_shouldPerformMigration(candidateVersion, previousMigratedVersion, versionToMigrate) {
|
|
19831
17802
|
if (this._isVersionInRangeFormat(candidateVersion)) {
|
|
19832
|
-
if (previousMigratedVersion !== "0.0.0" &&
|
|
17803
|
+
if (previousMigratedVersion !== "0.0.0" && semver2.satisfies(previousMigratedVersion, candidateVersion)) {
|
|
19833
17804
|
return false;
|
|
19834
17805
|
}
|
|
19835
|
-
return
|
|
17806
|
+
return semver2.satisfies(versionToMigrate, candidateVersion);
|
|
19836
17807
|
}
|
|
19837
|
-
if (
|
|
17808
|
+
if (semver2.lte(candidateVersion, previousMigratedVersion)) {
|
|
19838
17809
|
return false;
|
|
19839
17810
|
}
|
|
19840
|
-
if (
|
|
17811
|
+
if (semver2.gt(candidateVersion, versionToMigrate)) {
|
|
19841
17812
|
return false;
|
|
19842
17813
|
}
|
|
19843
17814
|
return true;
|
|
@@ -20077,30 +18048,37 @@ var cacheStore = new Conf({
|
|
|
20077
18048
|
configName: "cache"
|
|
20078
18049
|
});
|
|
20079
18050
|
|
|
20080
|
-
// src/utils/
|
|
20081
|
-
|
|
20082
|
-
async function fetchBugVersionsFromUrl(url2) {
|
|
18051
|
+
// src/utils/fetch.ts
|
|
18052
|
+
async function fetchWithTimeout(url2, timeoutMs, init) {
|
|
20083
18053
|
const controller = new AbortController();
|
|
20084
|
-
const timer = setTimeout(() => controller.abort(),
|
|
18054
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
20085
18055
|
try {
|
|
20086
|
-
const res = await fetch(url2, { signal: controller.signal, redirect: "follow" });
|
|
18056
|
+
const res = await fetch(url2, { ...init, signal: controller.signal, redirect: "follow" });
|
|
20087
18057
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
20088
|
-
return
|
|
18058
|
+
return res;
|
|
20089
18059
|
} finally {
|
|
20090
18060
|
clearTimeout(timer);
|
|
20091
18061
|
}
|
|
20092
18062
|
}
|
|
20093
|
-
async function
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20097
|
-
|
|
20098
|
-
|
|
20099
|
-
|
|
20100
|
-
// jsDelivr CDN
|
|
20101
|
-
];
|
|
20102
|
-
return Promise.any(sources.map((url2) => fetchBugVersionsFromUrl(url2))).catch(() => null);
|
|
18063
|
+
async function fetchFirstJson(urls, timeoutMs) {
|
|
18064
|
+
return Promise.any(
|
|
18065
|
+
urls.map(async (url2) => {
|
|
18066
|
+
const res = await fetchWithTimeout(url2, timeoutMs);
|
|
18067
|
+
return res.json();
|
|
18068
|
+
})
|
|
18069
|
+
).catch(() => null);
|
|
20103
18070
|
}
|
|
18071
|
+
|
|
18072
|
+
// src/utils/bug-versions.ts
|
|
18073
|
+
var BUG_VERSIONS_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
18074
|
+
var BUG_VERSIONS_SOURCES = [
|
|
18075
|
+
"https://registry.npmmirror.com/antd/latest/files/BUG_VERSIONS.json",
|
|
18076
|
+
// China mirror (fast in CN)
|
|
18077
|
+
"https://unpkg.com/antd/BUG_VERSIONS.json",
|
|
18078
|
+
// Unpkg CDN
|
|
18079
|
+
"https://cdn.jsdelivr.net/npm/antd/BUG_VERSIONS.json"
|
|
18080
|
+
// jsDelivr CDN
|
|
18081
|
+
];
|
|
20104
18082
|
function findBugInfo(version2, bugVersions) {
|
|
20105
18083
|
for (const [range, urls] of Object.entries(bugVersions)) {
|
|
20106
18084
|
if (satisfies(version2, range)) {
|
|
@@ -20115,7 +18093,7 @@ async function getBugVersions() {
|
|
|
20115
18093
|
if (cached2 && now - cached2.lastChecked < BUG_VERSIONS_TTL_MS) {
|
|
20116
18094
|
return cached2.data;
|
|
20117
18095
|
}
|
|
20118
|
-
const fetched = await
|
|
18096
|
+
const fetched = await fetchFirstJson(BUG_VERSIONS_SOURCES, 5e3);
|
|
20119
18097
|
if (fetched) {
|
|
20120
18098
|
cacheStore.set("bugVersionsCache", { lastChecked: now, data: fetched });
|
|
20121
18099
|
return fetched;
|
|
@@ -20125,21 +18103,21 @@ async function getBugVersions() {
|
|
|
20125
18103
|
|
|
20126
18104
|
// src/commands/doctor.ts
|
|
20127
18105
|
function getInstalledVersion(cwd, pkgName) {
|
|
20128
|
-
const pkg = readJson(
|
|
18106
|
+
const pkg = readJson(join3(cwd, "node_modules", pkgName, "package.json"));
|
|
20129
18107
|
return pkg?.version ?? null;
|
|
20130
18108
|
}
|
|
20131
18109
|
function scanEcosystemPackages(cwd) {
|
|
20132
|
-
const scopeDir =
|
|
18110
|
+
const scopeDir = join3(cwd, "node_modules", "@ant-design");
|
|
20133
18111
|
let entries;
|
|
20134
18112
|
try {
|
|
20135
|
-
entries =
|
|
18113
|
+
entries = readdirSync(scopeDir);
|
|
20136
18114
|
} catch {
|
|
20137
18115
|
return [];
|
|
20138
18116
|
}
|
|
20139
18117
|
const result = [];
|
|
20140
18118
|
for (const entry of entries) {
|
|
20141
18119
|
if (entry.startsWith(".")) continue;
|
|
20142
|
-
const pkg = readJson(
|
|
18120
|
+
const pkg = readJson(join3(scopeDir, entry, "package.json"));
|
|
20143
18121
|
if (!pkg?.version) continue;
|
|
20144
18122
|
const peerDeps = pkg.peerDependencies ?? {};
|
|
20145
18123
|
if (Object.keys(peerDeps).length === 0) continue;
|
|
@@ -20154,12 +18132,12 @@ function scanEcosystemPackages(cwd) {
|
|
|
20154
18132
|
return result;
|
|
20155
18133
|
}
|
|
20156
18134
|
function buildContext(cwd) {
|
|
20157
|
-
const antdPkg = readJson(
|
|
20158
|
-
const antdMajor = antdPkg ? parseInt(antdPkg.version.split(".")[0], 10) : 0;
|
|
20159
|
-
const projectPkg = readJson(
|
|
20160
|
-
const reactPkg = readJson(
|
|
20161
|
-
const cssinjsPkg = readJson(
|
|
20162
|
-
const iconsPkg = readJson(
|
|
18135
|
+
const antdPkg = readJson(join3(cwd, "node_modules", "antd", "package.json"));
|
|
18136
|
+
const antdMajor = antdPkg?.version ? parseInt(antdPkg.version.split(".")[0], 10) : 0;
|
|
18137
|
+
const projectPkg = readJson(join3(cwd, "package.json"));
|
|
18138
|
+
const reactPkg = readJson(join3(cwd, "node_modules", "react", "package.json"));
|
|
18139
|
+
const cssinjsPkg = readJson(join3(cwd, "node_modules", "@ant-design", "cssinjs", "package.json"));
|
|
18140
|
+
const iconsPkg = readJson(join3(cwd, "node_modules", "@ant-design", "icons", "package.json"));
|
|
20163
18141
|
const ecosystemPackages = scanEcosystemPackages(cwd);
|
|
20164
18142
|
return { cwd, antdPkg, antdMajor, projectPkg, reactPkg, cssinjsPkg, iconsPkg, ecosystemPackages };
|
|
20165
18143
|
}
|
|
@@ -20218,14 +18196,14 @@ function checkReactCompat(ctx) {
|
|
|
20218
18196
|
}
|
|
20219
18197
|
function findDuplicateVersions(cwd, pkgPath) {
|
|
20220
18198
|
const versions = [];
|
|
20221
|
-
const topPkg = readJson(
|
|
18199
|
+
const topPkg = readJson(join3(cwd, "node_modules", pkgPath, "package.json"));
|
|
20222
18200
|
if (topPkg?.version) versions.push(topPkg.version);
|
|
20223
|
-
const nmDir =
|
|
18201
|
+
const nmDir = join3(cwd, "node_modules");
|
|
20224
18202
|
try {
|
|
20225
|
-
const entries =
|
|
18203
|
+
const entries = readdirSync(nmDir);
|
|
20226
18204
|
for (const entry of entries) {
|
|
20227
18205
|
if (entry.startsWith(".") || entry === pkgPath) continue;
|
|
20228
|
-
const nestedPkg = readJson(
|
|
18206
|
+
const nestedPkg = readJson(join3(nmDir, entry, "node_modules", pkgPath, "package.json"));
|
|
20229
18207
|
if (nestedPkg?.version) versions.push(nestedPkg.version);
|
|
20230
18208
|
}
|
|
20231
18209
|
} catch {
|
|
@@ -20251,9 +18229,9 @@ function checkDuplicateInstall(ctx) {
|
|
|
20251
18229
|
}
|
|
20252
18230
|
function checkThemeConfig(ctx) {
|
|
20253
18231
|
if (ctx.antdMajor >= 5) {
|
|
20254
|
-
const
|
|
18232
|
+
const hasLessOverrides = existsSync3(join3(ctx.cwd, "theme", "antd.less"));
|
|
20255
18233
|
const modifyVars = ctx.projectPkg?.theme;
|
|
20256
|
-
if (
|
|
18234
|
+
if (hasLessOverrides || modifyVars) {
|
|
20257
18235
|
return {
|
|
20258
18236
|
name: "theme-config",
|
|
20259
18237
|
status: "warn",
|
|
@@ -20274,7 +18252,7 @@ function checkBabelPlugins(ctx) {
|
|
|
20274
18252
|
let hasBabelPluginImport = false;
|
|
20275
18253
|
for (const configName of babelConfigs) {
|
|
20276
18254
|
try {
|
|
20277
|
-
const content =
|
|
18255
|
+
const content = readFileSync3(join3(ctx.cwd, configName), "utf-8");
|
|
20278
18256
|
if (content.includes("babel-plugin-import") || content.includes("import, { libraryName")) {
|
|
20279
18257
|
hasBabelPluginImport = true;
|
|
20280
18258
|
break;
|
|
@@ -20463,9 +18441,9 @@ function checkEcosystemPeerDeps(ctx) {
|
|
|
20463
18441
|
};
|
|
20464
18442
|
});
|
|
20465
18443
|
}
|
|
20466
|
-
function registerDoctorCommand(
|
|
20467
|
-
|
|
20468
|
-
const opts =
|
|
18444
|
+
function registerDoctorCommand(program2) {
|
|
18445
|
+
program2.command("doctor").description("Diagnose project-level antd configuration issues").action(async () => {
|
|
18446
|
+
const opts = program2.opts();
|
|
20469
18447
|
const ctx = buildContext(process.cwd());
|
|
20470
18448
|
const checks = [
|
|
20471
18449
|
await checkAntdInstalled(ctx),
|
|
@@ -20513,13 +18491,50 @@ function registerDoctorCommand(program3) {
|
|
|
20513
18491
|
}
|
|
20514
18492
|
|
|
20515
18493
|
// src/commands/usage.ts
|
|
20516
|
-
import { readFileSync as
|
|
18494
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
20517
18495
|
import { parseSync, Visitor } from "oxc-parser";
|
|
18496
|
+
|
|
18497
|
+
// src/utils/scan.ts
|
|
18498
|
+
import { statSync } from "fs";
|
|
18499
|
+
import fg from "fast-glob";
|
|
18500
|
+
var SCAN_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx"]);
|
|
18501
|
+
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "build", ".next"]);
|
|
18502
|
+
var GLOB_IGNORE = [...SKIP_DIRS, ".umi*"].map((d) => `**/${d}/**`);
|
|
18503
|
+
var SOURCE_GLOB = `**/*.{${[...SCAN_EXTENSIONS].map((e) => e.slice(1)).join(",")}}`;
|
|
18504
|
+
function collectFiles(dir) {
|
|
18505
|
+
try {
|
|
18506
|
+
const stat = statSync(dir);
|
|
18507
|
+
if (stat.isFile()) return [dir];
|
|
18508
|
+
} catch {
|
|
18509
|
+
return [];
|
|
18510
|
+
}
|
|
18511
|
+
try {
|
|
18512
|
+
return fg.globSync(SOURCE_GLOB, {
|
|
18513
|
+
cwd: dir,
|
|
18514
|
+
absolute: true,
|
|
18515
|
+
ignore: GLOB_IGNORE,
|
|
18516
|
+
onlyFiles: true
|
|
18517
|
+
});
|
|
18518
|
+
} catch {
|
|
18519
|
+
return [];
|
|
18520
|
+
}
|
|
18521
|
+
}
|
|
18522
|
+
function getJSXElementName(name) {
|
|
18523
|
+
if (name.type === "JSXMemberExpression") {
|
|
18524
|
+
return getJSXElementName(name.object) + "." + name.property.name;
|
|
18525
|
+
}
|
|
18526
|
+
if (name.type === "JSXIdentifier") {
|
|
18527
|
+
return name.name;
|
|
18528
|
+
}
|
|
18529
|
+
return "";
|
|
18530
|
+
}
|
|
18531
|
+
|
|
18532
|
+
// src/commands/usage.ts
|
|
20518
18533
|
function scanFile(filePath) {
|
|
20519
18534
|
const result = /* @__PURE__ */ new Map();
|
|
20520
18535
|
let content;
|
|
20521
18536
|
try {
|
|
20522
|
-
content =
|
|
18537
|
+
content = readFileSync4(filePath, "utf-8");
|
|
20523
18538
|
} catch {
|
|
20524
18539
|
return result;
|
|
20525
18540
|
}
|
|
@@ -20562,9 +18577,9 @@ function scanFile(filePath) {
|
|
|
20562
18577
|
visitor.visit(parsed.program);
|
|
20563
18578
|
return result;
|
|
20564
18579
|
}
|
|
20565
|
-
function registerUsageCommand(
|
|
20566
|
-
|
|
20567
|
-
const opts =
|
|
18580
|
+
function registerUsageCommand(program2) {
|
|
18581
|
+
program2.command("usage [dir]").description("Scan project for antd component/API usage statistics").option("-f, --filter <component>", "Filter results to a specific component (e.g. Button)").action((dir, cmdOpts) => {
|
|
18582
|
+
const opts = program2.opts();
|
|
20568
18583
|
const targetDir = dir || ".";
|
|
20569
18584
|
const filterName = cmdOpts?.filter?.toLowerCase();
|
|
20570
18585
|
const versionInfo = detectVersion(opts.version);
|
|
@@ -20645,7 +18660,7 @@ Non-component antd exports (${nonComponents.length}):`);
|
|
|
20645
18660
|
}
|
|
20646
18661
|
|
|
20647
18662
|
// src/commands/lint.ts
|
|
20648
|
-
import { readFileSync as
|
|
18663
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
20649
18664
|
import { parseSync as parseSync2, Visitor as Visitor2 } from "oxc-parser";
|
|
20650
18665
|
function getDeprecatedProps(store) {
|
|
20651
18666
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -20736,7 +18751,7 @@ function collectAntdAlias(source, previous) {
|
|
|
20736
18751
|
function lintFile(filePath, deprecatedMap, antdAliases, only) {
|
|
20737
18752
|
let content;
|
|
20738
18753
|
try {
|
|
20739
|
-
content =
|
|
18754
|
+
content = readFileSync5(filePath, "utf-8");
|
|
20740
18755
|
} catch {
|
|
20741
18756
|
return [];
|
|
20742
18757
|
}
|
|
@@ -20927,9 +18942,9 @@ function lintFile(filePath, deprecatedMap, antdAliases, only) {
|
|
|
20927
18942
|
}
|
|
20928
18943
|
return issues;
|
|
20929
18944
|
}
|
|
20930
|
-
function registerLintCommand(
|
|
20931
|
-
|
|
20932
|
-
const opts =
|
|
18945
|
+
function registerLintCommand(program2) {
|
|
18946
|
+
program2.command("lint [target]").description("Check antd usage against best practices").option("--only <category>", "Only check specific category (deprecated, a11y, usage, performance)").option("--antd-alias <source>", "Treat additional package names as aliases of antd imports", collectAntdAlias, []).action((target, cmdOpts) => {
|
|
18947
|
+
const opts = program2.opts();
|
|
20933
18948
|
const targetPath = target || ".";
|
|
20934
18949
|
const versionInfo = detectVersion(opts.version);
|
|
20935
18950
|
const store = loadMetadataForVersion(versionInfo.version);
|
|
@@ -22319,9 +20334,9 @@ function groupByComponent(steps) {
|
|
|
22319
20334
|
}
|
|
22320
20335
|
return map2;
|
|
22321
20336
|
}
|
|
22322
|
-
function registerMigrateCommand(
|
|
22323
|
-
|
|
22324
|
-
const opts =
|
|
20337
|
+
function registerMigrateCommand(program2) {
|
|
20338
|
+
program2.command("migrate <from> <to>").description("Version migration guide with optional auto-fix").option("--component <name>", "Component-specific migration guide").option("--apply <dir>", "Generate migration prompts for scanning a directory").option("--confirm", "Confirm auto-fix (required with --apply)").action((rawFrom, rawTo, cmdOpts) => {
|
|
20339
|
+
const opts = program2.opts();
|
|
22325
20340
|
const from = rawFrom.replace(/^v/i, "");
|
|
22326
20341
|
const to = rawTo.replace(/^v/i, "");
|
|
22327
20342
|
const key = `${from}-${to}`;
|
|
@@ -22370,13 +20385,13 @@ function registerMigrateCommand(program3) {
|
|
|
22370
20385
|
// src/utils/issue.ts
|
|
22371
20386
|
import { platform, release } from "os";
|
|
22372
20387
|
import { execFileSync } from "child_process";
|
|
22373
|
-
import { join as
|
|
20388
|
+
import { join as join4 } from "path";
|
|
22374
20389
|
function getSystem() {
|
|
22375
20390
|
return `${platform()} ${release()}`;
|
|
22376
20391
|
}
|
|
22377
20392
|
function collectAntdEnv(cwd, versionOverride) {
|
|
22378
|
-
const antdPkg = readJson(
|
|
22379
|
-
const reactPkg = readJson(
|
|
20393
|
+
const antdPkg = readJson(join4(cwd, "node_modules", "antd", "package.json"));
|
|
20394
|
+
const reactPkg = readJson(join4(cwd, "node_modules", "react", "package.json"));
|
|
22380
20395
|
return {
|
|
22381
20396
|
antd: versionOverride || antdPkg?.version || "unknown",
|
|
22382
20397
|
react: reactPkg?.version || "unknown",
|
|
@@ -22387,7 +20402,7 @@ function collectAntdEnv(cwd, versionOverride) {
|
|
|
22387
20402
|
function collectCliEnv() {
|
|
22388
20403
|
let cliVersion;
|
|
22389
20404
|
try {
|
|
22390
|
-
cliVersion = "6.4.
|
|
20405
|
+
cliVersion = "6.4.3";
|
|
22391
20406
|
} catch (err) {
|
|
22392
20407
|
console.error("Failed to get CLI version:", err);
|
|
22393
20408
|
cliVersion = "unknown";
|
|
@@ -22527,9 +20542,9 @@ function buildIssueUrl(repo, title, body) {
|
|
|
22527
20542
|
// src/commands/bug.ts
|
|
22528
20543
|
var ANTD_REPO = "ant-design/ant-design";
|
|
22529
20544
|
var CLI_REPO = "ant-design/ant-design-cli";
|
|
22530
|
-
function registerBugCommand(
|
|
22531
|
-
|
|
22532
|
-
const opts =
|
|
20545
|
+
function registerBugCommand(program2) {
|
|
20546
|
+
program2.command("bug").description("Report a bug to the antd repository").option("--title <title>", "Issue title").option("--reproduction <url>", "Reproduction link").option("--steps <text>", "Steps to reproduce").option("--expected <text>", "Expected behavior").option("--actual <text>", "Actual behavior").option("--extra <text>", "Additional comments").option("--submit", "Submit via gh CLI instead of previewing", false).action((cmdOpts) => {
|
|
20547
|
+
const opts = program2.opts();
|
|
22533
20548
|
if (!cmdOpts.title) {
|
|
22534
20549
|
printError(
|
|
22535
20550
|
createError(ErrorCodes.TITLE_REQUIRED, "--title is required", "Provide --title <title>"),
|
|
@@ -22589,9 +20604,9 @@ function registerBugCommand(program3) {
|
|
|
22589
20604
|
}
|
|
22590
20605
|
});
|
|
22591
20606
|
}
|
|
22592
|
-
function registerBugCliCommand(
|
|
22593
|
-
|
|
22594
|
-
const opts =
|
|
20607
|
+
function registerBugCliCommand(program2) {
|
|
20608
|
+
program2.command("bug-cli").description("Report a bug to the ant-design-cli repository").option("--title <title>", "Issue title").option("--description <desc>", "Problem description").option("--steps <text>", "Steps to reproduce").option("--expected <text>", "Expected behavior").option("--actual <text>", "Actual behavior").option("--extra <text>", "Additional comments").option("--submit", "Submit via gh CLI instead of previewing", false).action((cmdOpts) => {
|
|
20609
|
+
const opts = program2.opts();
|
|
22595
20610
|
if (!cmdOpts.title) {
|
|
22596
20611
|
printError(
|
|
22597
20612
|
createError(ErrorCodes.TITLE_REQUIRED, "--title is required", "Provide --title <title>"),
|
|
@@ -22653,9 +20668,10 @@ function registerBugCliCommand(program3) {
|
|
|
22653
20668
|
}
|
|
22654
20669
|
|
|
22655
20670
|
// src/commands/env.ts
|
|
22656
|
-
import { readdirSync as
|
|
20671
|
+
import { readdirSync as readdirSync2 } from "fs";
|
|
22657
20672
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
22658
|
-
import { join as
|
|
20673
|
+
import { join as join5, isAbsolute } from "path";
|
|
20674
|
+
import stringWidth2 from "string-width";
|
|
22659
20675
|
async function collectEnvinfo(cwd) {
|
|
22660
20676
|
try {
|
|
22661
20677
|
const envinfo = await Promise.resolve().then(() => __toESM(require_envinfo(), 1));
|
|
@@ -22708,7 +20724,7 @@ var CORE_DEPS = ["antd", "react", "react-dom", "dayjs", "@ant-design/cssinjs", "
|
|
|
22708
20724
|
function collectDependencies(cwd) {
|
|
22709
20725
|
const result = {};
|
|
22710
20726
|
for (const dep of CORE_DEPS) {
|
|
22711
|
-
const pkg = readJson(
|
|
20727
|
+
const pkg = readJson(join5(cwd, "node_modules", dep, "package.json"));
|
|
22712
20728
|
result[dep] = pkg?.version ?? null;
|
|
22713
20729
|
}
|
|
22714
20730
|
return result;
|
|
@@ -22716,24 +20732,24 @@ function collectDependencies(cwd) {
|
|
|
22716
20732
|
function scanEcosystem(cwd) {
|
|
22717
20733
|
const result = {};
|
|
22718
20734
|
const coreSet = new Set(CORE_DEPS);
|
|
22719
|
-
const scopeDir =
|
|
20735
|
+
const scopeDir = join5(cwd, "node_modules", "@ant-design");
|
|
22720
20736
|
try {
|
|
22721
|
-
const entries =
|
|
20737
|
+
const entries = readdirSync2(scopeDir);
|
|
22722
20738
|
for (const entry of entries) {
|
|
22723
20739
|
if (entry.startsWith(".")) continue;
|
|
22724
20740
|
const fullName = `@ant-design/${entry}`;
|
|
22725
20741
|
if (coreSet.has(fullName)) continue;
|
|
22726
|
-
const pkg = readJson(
|
|
20742
|
+
const pkg = readJson(join5(scopeDir, entry, "package.json"));
|
|
22727
20743
|
if (pkg?.version) result[fullName] = pkg.version;
|
|
22728
20744
|
}
|
|
22729
20745
|
} catch {
|
|
22730
20746
|
}
|
|
22731
|
-
const nmDir =
|
|
20747
|
+
const nmDir = join5(cwd, "node_modules");
|
|
22732
20748
|
try {
|
|
22733
|
-
const entries =
|
|
20749
|
+
const entries = readdirSync2(nmDir);
|
|
22734
20750
|
for (const entry of entries) {
|
|
22735
20751
|
if (!entry.startsWith("rc-")) continue;
|
|
22736
|
-
const pkg = readJson(
|
|
20752
|
+
const pkg = readJson(join5(nmDir, entry, "package.json"));
|
|
22737
20753
|
if (pkg?.version) result[entry] = pkg.version;
|
|
22738
20754
|
}
|
|
22739
20755
|
} catch {
|
|
@@ -22776,7 +20792,7 @@ var ENVINFO_ORDER = ["System", "Binaries", "Managers", "Utilities", "Servers", "
|
|
|
22776
20792
|
function collectBuildTools(cwd) {
|
|
22777
20793
|
const result = {};
|
|
22778
20794
|
for (const tool of BUILD_TOOLS) {
|
|
22779
|
-
const pkg = readJson(
|
|
20795
|
+
const pkg = readJson(join5(cwd, "node_modules", tool, "package.json"));
|
|
22780
20796
|
if (pkg?.version) result[tool] = pkg.version;
|
|
22781
20797
|
}
|
|
22782
20798
|
return result;
|
|
@@ -22792,10 +20808,11 @@ function formatText2(data) {
|
|
|
22792
20808
|
const filtered = showNull ? Object.entries(entries) : Object.entries(entries).filter(([, v]) => getDisplayValue(v) !== null);
|
|
22793
20809
|
if (filtered.length === 0) return;
|
|
22794
20810
|
lines.push(` ${title}:`);
|
|
22795
|
-
const
|
|
20811
|
+
const maxKeyWidth = Math.max(...filtered.map(([k]) => stringWidth2(k)));
|
|
22796
20812
|
for (const [key, value] of filtered) {
|
|
22797
20813
|
const display = getDisplayValue(value);
|
|
22798
|
-
|
|
20814
|
+
const padded = key + " ".repeat(maxKeyWidth - stringWidth2(key) + 1);
|
|
20815
|
+
lines.push(` ${padded} ${display ?? "Not found"}`);
|
|
22799
20816
|
}
|
|
22800
20817
|
lines.push("");
|
|
22801
20818
|
};
|
|
@@ -22833,10 +20850,10 @@ function formatMarkdown2(data) {
|
|
|
22833
20850
|
table("Build Tools", "Package", "Version", data.buildTools, false);
|
|
22834
20851
|
return lines.join("\n");
|
|
22835
20852
|
}
|
|
22836
|
-
function registerEnvCommand(
|
|
22837
|
-
|
|
22838
|
-
const opts =
|
|
22839
|
-
const cwd = dir ? isAbsolute(dir) ? dir :
|
|
20853
|
+
function registerEnvCommand(program2) {
|
|
20854
|
+
program2.command("env [dir]").description("Collect antd-related environment information for bug reporting").action(async (dir) => {
|
|
20855
|
+
const opts = program2.opts();
|
|
20856
|
+
const cwd = dir ? isAbsolute(dir) ? dir : join5(process.cwd(), dir) : process.cwd();
|
|
22840
20857
|
const data = {
|
|
22841
20858
|
envinfo: await collectEnvinfo(cwd),
|
|
22842
20859
|
dependencies: collectDependencies(cwd),
|
|
@@ -37095,14 +35112,14 @@ ${SHARED_TOOL_WORKFLOW}
|
|
|
37095
35112
|
`;
|
|
37096
35113
|
|
|
37097
35114
|
// src/commands/mcp.ts
|
|
37098
|
-
function registerMcpCommand(
|
|
37099
|
-
|
|
35115
|
+
function registerMcpCommand(program2) {
|
|
35116
|
+
program2.command("mcp").description("Start MCP (Model Context Protocol) server for AI assistant integration").action(
|
|
37100
35117
|
/* v8 ignore start */
|
|
37101
35118
|
async () => {
|
|
37102
|
-
const opts =
|
|
35119
|
+
const opts = program2.opts();
|
|
37103
35120
|
const versionInfo = detectVersion(opts.version);
|
|
37104
35121
|
const server = new Server(
|
|
37105
|
-
{ name: "antd", version: "6.4.
|
|
35122
|
+
{ name: "antd", version: "6.4.3" },
|
|
37106
35123
|
{ capabilities: { tools: {}, prompts: {} } }
|
|
37107
35124
|
);
|
|
37108
35125
|
const handleTool = createToolHandler({
|
|
@@ -37151,29 +35168,17 @@ function registerMcpCommand(program3) {
|
|
|
37151
35168
|
|
|
37152
35169
|
// src/utils/update-check.ts
|
|
37153
35170
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
37154
|
-
|
|
37155
|
-
|
|
37156
|
-
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
|
|
37161
|
-
|
|
37162
|
-
|
|
37163
|
-
|
|
37164
|
-
|
|
37165
|
-
}
|
|
37166
|
-
}
|
|
37167
|
-
function fetchLatestVersion() {
|
|
37168
|
-
const sources = [
|
|
37169
|
-
"https://registry.npmjs.org/@ant-design/cli/latest",
|
|
37170
|
-
// Official npm
|
|
37171
|
-
"https://registry.npmmirror.com/@ant-design/cli/latest",
|
|
37172
|
-
// China mirror
|
|
37173
|
-
"https://unpkg.com/@ant-design/cli@latest/package.json"
|
|
37174
|
-
// Unpkg CDN
|
|
37175
|
-
];
|
|
37176
|
-
return Promise.any(sources.map((url2) => fetchVersionFromUrl(url2))).catch(() => null);
|
|
35171
|
+
var NPM_SOURCES = [
|
|
35172
|
+
"https://registry.npmjs.org/@ant-design/cli/latest",
|
|
35173
|
+
// Official npm
|
|
35174
|
+
"https://registry.npmmirror.com/@ant-design/cli/latest",
|
|
35175
|
+
// China mirror
|
|
35176
|
+
"https://unpkg.com/@ant-design/cli@latest/package.json"
|
|
35177
|
+
// Unpkg CDN
|
|
35178
|
+
];
|
|
35179
|
+
async function fetchLatestVersion() {
|
|
35180
|
+
const json2 = await fetchFirstJson(NPM_SOURCES, 3e3);
|
|
35181
|
+
return json2?.version ?? null;
|
|
37177
35182
|
}
|
|
37178
35183
|
function printUpdateNotice(currentVersion, latestVersion) {
|
|
37179
35184
|
const line = ` Update available: ${currentVersion} \u2192 ${latestVersion} `;
|
|
@@ -37193,7 +35198,7 @@ function printUpdateNotice(currentVersion, latestVersion) {
|
|
|
37193
35198
|
}
|
|
37194
35199
|
async function checkForUpdate() {
|
|
37195
35200
|
if (process.env.CI || process.env.NO_UPDATE_CHECK) return;
|
|
37196
|
-
const currentVersion = "6.4.
|
|
35201
|
+
const currentVersion = "6.4.3";
|
|
37197
35202
|
if (!valid(currentVersion)) return;
|
|
37198
35203
|
const now = Date.now();
|
|
37199
35204
|
const cache = cacheStore.get("updateCache") ?? null;
|
|
@@ -37206,39 +35211,44 @@ async function checkForUpdate() {
|
|
|
37206
35211
|
});
|
|
37207
35212
|
if (fetched) latestVersion = fetched;
|
|
37208
35213
|
}
|
|
37209
|
-
if (latestVersion && valid(latestVersion) && compare(currentVersion, latestVersion) < 0) {
|
|
35214
|
+
if (latestVersion && valid(latestVersion) && (compare(currentVersion, latestVersion) ?? 0) < 0) {
|
|
37210
35215
|
printUpdateNotice(currentVersion, latestVersion);
|
|
37211
35216
|
}
|
|
37212
35217
|
}
|
|
37213
35218
|
|
|
37214
35219
|
// src/index.ts
|
|
37215
|
-
var CLI_VERSION = "6.4.
|
|
37216
|
-
|
|
37217
|
-
program2
|
|
37218
|
-
program2.
|
|
37219
|
-
|
|
37220
|
-
|
|
37221
|
-
|
|
37222
|
-
|
|
37223
|
-
|
|
37224
|
-
|
|
37225
|
-
|
|
37226
|
-
|
|
37227
|
-
|
|
37228
|
-
|
|
37229
|
-
|
|
37230
|
-
|
|
37231
|
-
|
|
37232
|
-
|
|
37233
|
-
|
|
37234
|
-
program2
|
|
37235
|
-
|
|
37236
|
-
|
|
37237
|
-
|
|
37238
|
-
|
|
37239
|
-
|
|
37240
|
-
|
|
37241
|
-
|
|
37242
|
-
|
|
37243
|
-
}
|
|
37244
|
-
|
|
35220
|
+
var CLI_VERSION = "6.4.3";
|
|
35221
|
+
function createProgram() {
|
|
35222
|
+
const program2 = new Command();
|
|
35223
|
+
program2.name("antd").description("CLI tool for querying antd knowledge and analyzing antd usage").option("--format <format>", "Output format: json, text, or markdown", "text").option("--version <version>", "Target antd version (e.g. 5.20.0)").option("--lang <lang>", "Output language: en or zh", "en").option("--detail", "Full information output", false);
|
|
35224
|
+
program2.addOption(new Option("-V, --cli-version", "Output the CLI version number"));
|
|
35225
|
+
program2.on("option:cli-version", () => {
|
|
35226
|
+
console.log(CLI_VERSION);
|
|
35227
|
+
process.exit(0);
|
|
35228
|
+
});
|
|
35229
|
+
registerListCommand(program2);
|
|
35230
|
+
registerInfoCommand(program2);
|
|
35231
|
+
registerDocCommand(program2);
|
|
35232
|
+
registerDemoCommand(program2);
|
|
35233
|
+
registerTokenCommand(program2);
|
|
35234
|
+
registerSemanticCommand(program2);
|
|
35235
|
+
registerChangelogCommand(program2);
|
|
35236
|
+
registerDoctorCommand(program2);
|
|
35237
|
+
registerUsageCommand(program2);
|
|
35238
|
+
registerLintCommand(program2);
|
|
35239
|
+
registerMigrateCommand(program2);
|
|
35240
|
+
registerEnvCommand(program2);
|
|
35241
|
+
registerMcpCommand(program2);
|
|
35242
|
+
registerBugCommand(program2);
|
|
35243
|
+
registerBugCliCommand(program2);
|
|
35244
|
+
program2.hook("postAction", async () => {
|
|
35245
|
+
await checkForUpdate();
|
|
35246
|
+
});
|
|
35247
|
+
return program2;
|
|
35248
|
+
}
|
|
35249
|
+
if (!process.env.VITEST) {
|
|
35250
|
+
createProgram().parseAsync();
|
|
35251
|
+
}
|
|
35252
|
+
export {
|
|
35253
|
+
createProgram
|
|
35254
|
+
};
|