@dsh-workbench/core 1.0.0-beta.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -15
- package/bin/dsh-workbench +27 -26
- package/client.js +240 -332
- package/dist/client/client.body.js +240 -332
- package/dist/client/index.js +240 -332
- package/dist/host/index.js +1555 -169
- package/dist/types/app/layouts/market/discover-sources-dialog.d.ts +1 -0
- package/dist/types/app/layouts/market/use-discover.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/market-shared-rows.d.ts +0 -1
- package/dist/types/app/layouts/workbench-settings/ConfigSyncRows.d.ts +1 -3
- package/dist/types/kernel/contract/config-sync.d.ts +1 -1
- package/dist/types/kernel/contract/index.d.ts +1 -0
- package/dist/types/kernel/host/mount-units.d.ts +3 -0
- package/dist/types/modules/panels/model/diy-context.d.ts +14 -4
- package/dist/types/modules/panels/model/diy-report.d.ts +2 -0
- package/dist/types/modules/panels/model/diy-tools.d.ts +2 -1
- package/package.json +5 -3
- package/profile/sandbox.patch.yml +7 -5
- package/scripts/clone-profile.mjs +11 -199
- package/scripts/create-workbench.mjs +7 -20
- package/scripts/patch-blocks.mjs +60 -0
- package/scripts/seed-profile.sh +14 -27
- package/scripts/share-data-root.mjs +211 -0
- package/skills/workbench-module-diy/FAMILY.md +4 -6
- package/skills/workbench-module-diy/KIT.md +4 -2
- package/skills/workbench-module-diy/SKILL.md +4 -5
- package/skills/workbench-module-diy/WIRING.md +4 -13
- package/dist/types/shared/api/host/git.test.d.ts +0 -1
- package/profile/isolation.patch.yml +0 -46
package/dist/host/index.js
CHANGED
|
@@ -7,6 +7,29 @@ import { createRequire } from "node:module";
|
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
8
|
import { deflateSync, inflateSync } from "node:zlib";
|
|
9
9
|
import writeFileAtomic from "write-file-atomic";
|
|
10
|
+
//#region \0rolldown/runtime.js
|
|
11
|
+
var __create = Object.create;
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
15
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
16
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
+
key = keys[i];
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
+
get: ((k) => from[k]).bind(null, key),
|
|
23
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
29
|
+
value: mod,
|
|
30
|
+
enumerable: true
|
|
31
|
+
}) : target, mod));
|
|
32
|
+
//#endregion
|
|
10
33
|
//#region ../shared/dist/config/constants.js
|
|
11
34
|
/** 外壳插件的包名:浏览器模块表与宿主按它注册、认领这枚插件。 */
|
|
12
35
|
var PLUGIN_ID = "@dsh-workbench/core";
|
|
@@ -941,69 +964,6 @@ function wroteNow(result) {
|
|
|
941
964
|
function unitFactScope(unit) {
|
|
942
965
|
return `${unit}*`;
|
|
943
966
|
}
|
|
944
|
-
//#endregion
|
|
945
|
-
//#region ../shared/dist/host/shell-text.js
|
|
946
|
-
/**
|
|
947
|
-
* 按目标平台把一个值裹成 shell 字面量:POSIX 用单引号,win32 用双引号(cmd 与 PowerShell 都认)。
|
|
948
|
-
* @param value - 任意值;不是字符串的先 `String()`。
|
|
949
|
-
* @param platform - 目标平台,默认当前 `process.platform`。
|
|
950
|
-
* @returns 可安全拼进该平台 shell 命令的一段文本;含空格 / 元字符的值不会被当成语法。
|
|
951
|
-
*/
|
|
952
|
-
function quoteShellArgFor(value, platform = process.platform) {
|
|
953
|
-
const text = String(value);
|
|
954
|
-
if (platform === "win32") return `"${text.replace(/"/g, "\\\"")}"`;
|
|
955
|
-
return `'${text.replace(/'/g, `'\\''`)}'`;
|
|
956
|
-
}
|
|
957
|
-
/**
|
|
958
|
-
* 按当前平台把值裹成 shell 字面量;跨平台代码要固定平台时用 `quoteShellArgFor`。
|
|
959
|
-
* @param value - 任意值;不是字符串的先 `String()`。
|
|
960
|
-
* @returns 可安全拼进当前平台 shell 命令的一段文本。
|
|
961
|
-
*/
|
|
962
|
-
function quoteShellArg(value) {
|
|
963
|
-
return quoteShellArgFor(value, process.platform);
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* 取一段文本的末尾若干行(如命令输出),顺带去掉首尾空白。
|
|
967
|
-
* @param text - 原文;`null` / `undefined` 当空串。
|
|
968
|
-
* @param lines - 最多留几行,默认 6;0 给全篇、负数从开头砍掉那么多行(都是 `slice` 语义),调用方传正数。
|
|
969
|
-
* @returns 末尾若干行、去首尾空行后的文本;原文行数不够就全给,空输入给空串。
|
|
970
|
-
*/
|
|
971
|
-
function tailLines(text, lines = 6) {
|
|
972
|
-
return String(text ?? "").trim().split("\n").slice(-lines).join("\n");
|
|
973
|
-
}
|
|
974
|
-
//#endregion
|
|
975
|
-
//#region ../shared/dist/host/shell.js
|
|
976
|
-
var DEFAULT_MAX_BYTES$2 = 8388608;
|
|
977
|
-
async function runShell(shell, command, options = {}) {
|
|
978
|
-
const { workdir, timeoutMs = GIT_TIMEOUT_MS, signal } = options;
|
|
979
|
-
const spec = shell.resolve({
|
|
980
|
-
command,
|
|
981
|
-
...workdir === void 0 ? {} : { workdir },
|
|
982
|
-
timeoutMs,
|
|
983
|
-
onExpiry: "kill",
|
|
984
|
-
stdoutMaxBytes: DEFAULT_MAX_BYTES$2,
|
|
985
|
-
...signal === void 0 ? {} : { signal }
|
|
986
|
-
});
|
|
987
|
-
const result = await (await shell.execute(spec)).result();
|
|
988
|
-
return {
|
|
989
|
-
exitCode: result.exitCode,
|
|
990
|
-
timedOut: result.timedOut === true,
|
|
991
|
-
aborted: result.aborted === true,
|
|
992
|
-
stdout: result.stdout.text,
|
|
993
|
-
stderr: result.stderr.text,
|
|
994
|
-
truncated: result.stdout.truncated || result.stderr.truncated
|
|
995
|
-
};
|
|
996
|
-
}
|
|
997
|
-
function backgroundPrefix() {
|
|
998
|
-
return [quoteShellArg("env"), quoteShellArg("OPENCLI_WINDOW=background")];
|
|
999
|
-
}
|
|
1000
|
-
function backgroundLine(command, argv) {
|
|
1001
|
-
return [
|
|
1002
|
-
...backgroundPrefix(),
|
|
1003
|
-
quoteShellArg(command),
|
|
1004
|
-
...argv.map(quoteShellArg)
|
|
1005
|
-
].join(" ");
|
|
1006
|
-
}
|
|
1007
967
|
/**
|
|
1008
968
|
* 上报文本字段的截断长度(2000 字符;workspace / reason / message 共用)。
|
|
1009
969
|
*/
|
|
@@ -1439,7 +1399,7 @@ function registerApi(ctx, routes) {
|
|
|
1439
1399
|
try {
|
|
1440
1400
|
sendJson(res, 200, await handler(search));
|
|
1441
1401
|
} catch (error) {
|
|
1442
|
-
if (error
|
|
1402
|
+
if (isDataError(error)) {
|
|
1443
1403
|
sendJson(res, 200, {
|
|
1444
1404
|
ok: false,
|
|
1445
1405
|
error: toErrorPayload(error)
|
|
@@ -2362,6 +2322,69 @@ function createWorkspaceStore(options) {
|
|
|
2362
2322
|
};
|
|
2363
2323
|
}
|
|
2364
2324
|
//#endregion
|
|
2325
|
+
//#region ../shared/dist/host/shell-text.js
|
|
2326
|
+
/**
|
|
2327
|
+
* 按目标平台把一个值裹成 shell 字面量:POSIX 用单引号,win32 用双引号(cmd 与 PowerShell 都认)。
|
|
2328
|
+
* @param value - 任意值;不是字符串的先 `String()`。
|
|
2329
|
+
* @param platform - 目标平台,默认当前 `process.platform`。
|
|
2330
|
+
* @returns 可安全拼进该平台 shell 命令的一段文本;含空格 / 元字符的值不会被当成语法。
|
|
2331
|
+
*/
|
|
2332
|
+
function quoteShellArgFor(value, platform = process.platform) {
|
|
2333
|
+
const text = String(value);
|
|
2334
|
+
if (platform === "win32") return `"${text.replace(/"/g, "\\\"")}"`;
|
|
2335
|
+
return `'${text.replace(/'/g, `'\\''`)}'`;
|
|
2336
|
+
}
|
|
2337
|
+
/**
|
|
2338
|
+
* 按当前平台把值裹成 shell 字面量;跨平台代码要固定平台时用 `quoteShellArgFor`。
|
|
2339
|
+
* @param value - 任意值;不是字符串的先 `String()`。
|
|
2340
|
+
* @returns 可安全拼进当前平台 shell 命令的一段文本。
|
|
2341
|
+
*/
|
|
2342
|
+
function quoteShellArg(value) {
|
|
2343
|
+
return quoteShellArgFor(value, process.platform);
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* 取一段文本的末尾若干行(如命令输出),顺带去掉首尾空白。
|
|
2347
|
+
* @param text - 原文;`null` / `undefined` 当空串。
|
|
2348
|
+
* @param lines - 最多留几行,默认 6;0 给全篇、负数从开头砍掉那么多行(都是 `slice` 语义),调用方传正数。
|
|
2349
|
+
* @returns 末尾若干行、去首尾空行后的文本;原文行数不够就全给,空输入给空串。
|
|
2350
|
+
*/
|
|
2351
|
+
function tailLines(text, lines = 6) {
|
|
2352
|
+
return String(text ?? "").trim().split("\n").slice(-lines).join("\n");
|
|
2353
|
+
}
|
|
2354
|
+
//#endregion
|
|
2355
|
+
//#region ../shared/dist/host/shell.js
|
|
2356
|
+
var DEFAULT_MAX_BYTES$2 = 8388608;
|
|
2357
|
+
async function runShell(shell, command, options = {}) {
|
|
2358
|
+
const { workdir, timeoutMs = GIT_TIMEOUT_MS, signal } = options;
|
|
2359
|
+
const spec = shell.resolve({
|
|
2360
|
+
command,
|
|
2361
|
+
...workdir === void 0 ? {} : { workdir },
|
|
2362
|
+
timeoutMs,
|
|
2363
|
+
onExpiry: "kill",
|
|
2364
|
+
stdoutMaxBytes: DEFAULT_MAX_BYTES$2,
|
|
2365
|
+
...signal === void 0 ? {} : { signal }
|
|
2366
|
+
});
|
|
2367
|
+
const result = await (await shell.execute(spec)).result();
|
|
2368
|
+
return {
|
|
2369
|
+
exitCode: result.exitCode,
|
|
2370
|
+
timedOut: result.timedOut === true,
|
|
2371
|
+
aborted: result.aborted === true,
|
|
2372
|
+
stdout: result.stdout.text,
|
|
2373
|
+
stderr: result.stderr.text,
|
|
2374
|
+
truncated: result.stdout.truncated || result.stderr.truncated
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2377
|
+
function backgroundPrefix() {
|
|
2378
|
+
return [quoteShellArg("env"), quoteShellArg("OPENCLI_WINDOW=background")];
|
|
2379
|
+
}
|
|
2380
|
+
function backgroundLine(command, argv) {
|
|
2381
|
+
return [
|
|
2382
|
+
...backgroundPrefix(),
|
|
2383
|
+
quoteShellArg(command),
|
|
2384
|
+
...argv.map(quoteShellArg)
|
|
2385
|
+
].join(" ");
|
|
2386
|
+
}
|
|
2387
|
+
//#endregion
|
|
2365
2388
|
//#region ../shared/dist/host/paths.js
|
|
2366
2389
|
function isolatedRoot() {
|
|
2367
2390
|
return `${workbenchRoot()}/opencli`;
|
|
@@ -2477,7 +2500,1407 @@ function requireSupply() {
|
|
|
2477
2500
|
throw new Error("workbenchSupply 未提供");
|
|
2478
2501
|
}
|
|
2479
2502
|
//#endregion
|
|
2503
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
|
|
2504
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2505
|
+
module.exports = {
|
|
2506
|
+
MAX_LENGTH: 256,
|
|
2507
|
+
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
2508
|
+
MAX_SAFE_BUILD_LENGTH: 250,
|
|
2509
|
+
MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER ||
|
|
2510
|
+
/* istanbul ignore next */ 9007199254740991,
|
|
2511
|
+
RELEASE_TYPES: [
|
|
2512
|
+
"major",
|
|
2513
|
+
"premajor",
|
|
2514
|
+
"minor",
|
|
2515
|
+
"preminor",
|
|
2516
|
+
"patch",
|
|
2517
|
+
"prepatch",
|
|
2518
|
+
"prerelease"
|
|
2519
|
+
],
|
|
2520
|
+
SEMVER_SPEC_VERSION: "2.0.0",
|
|
2521
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
2522
|
+
FLAG_LOOSE: 2
|
|
2523
|
+
};
|
|
2524
|
+
}));
|
|
2525
|
+
//#endregion
|
|
2526
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
|
|
2527
|
+
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2528
|
+
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
2529
|
+
}));
|
|
2530
|
+
//#endregion
|
|
2531
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
|
|
2532
|
+
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2533
|
+
var { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
2534
|
+
var debug = require_debug();
|
|
2535
|
+
exports = module.exports = {};
|
|
2536
|
+
var re = exports.re = [];
|
|
2537
|
+
var safeRe = exports.safeRe = [];
|
|
2538
|
+
var src = exports.src = [];
|
|
2539
|
+
var safeSrc = exports.safeSrc = [];
|
|
2540
|
+
var t = exports.t = {};
|
|
2541
|
+
var R = 0;
|
|
2542
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
2543
|
+
var safeRegexReplacements = [
|
|
2544
|
+
["\\s", 1],
|
|
2545
|
+
["\\d", MAX_LENGTH],
|
|
2546
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
2547
|
+
];
|
|
2548
|
+
var makeSafeRegex = (value) => {
|
|
2549
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
2550
|
+
return value;
|
|
2551
|
+
};
|
|
2552
|
+
var createToken = (name, value, isGlobal) => {
|
|
2553
|
+
const safe = makeSafeRegex(value);
|
|
2554
|
+
const index = R++;
|
|
2555
|
+
debug(name, index, value);
|
|
2556
|
+
t[name] = index;
|
|
2557
|
+
src[index] = value;
|
|
2558
|
+
safeSrc[index] = safe;
|
|
2559
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
2560
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
2561
|
+
};
|
|
2562
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
2563
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
2564
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
2565
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
2566
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
2567
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
2568
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
2569
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
2570
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
2571
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
2572
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
2573
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
2574
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
2575
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
2576
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
2577
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
2578
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
2579
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
2580
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
2581
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
2582
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
2583
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2584
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
2585
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
2586
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
2587
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
2588
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
2589
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
2590
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
2591
|
+
exports.tildeTrimReplace = "$1~";
|
|
2592
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
2593
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2594
|
+
createToken("LONECARET", "(?:\\^)");
|
|
2595
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
2596
|
+
exports.caretTrimReplace = "$1^";
|
|
2597
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
2598
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2599
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
2600
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
2601
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
2602
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
2603
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
2604
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
2605
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
2606
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
2607
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
2608
|
+
}));
|
|
2609
|
+
//#endregion
|
|
2610
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
|
|
2611
|
+
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2612
|
+
var looseOption = Object.freeze({ loose: true });
|
|
2613
|
+
var emptyOpts = Object.freeze({});
|
|
2614
|
+
var parseOptions = (options) => {
|
|
2615
|
+
if (!options) return emptyOpts;
|
|
2616
|
+
if (typeof options !== "object") return looseOption;
|
|
2617
|
+
return options;
|
|
2618
|
+
};
|
|
2619
|
+
module.exports = parseOptions;
|
|
2620
|
+
}));
|
|
2621
|
+
//#endregion
|
|
2622
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
|
|
2623
|
+
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2624
|
+
var numeric = /^[0-9]+$/;
|
|
2625
|
+
var compareIdentifiers = (a, b) => {
|
|
2626
|
+
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
2627
|
+
const anum = numeric.test(a);
|
|
2628
|
+
const bnum = numeric.test(b);
|
|
2629
|
+
if (anum && bnum) {
|
|
2630
|
+
a = +a;
|
|
2631
|
+
b = +b;
|
|
2632
|
+
}
|
|
2633
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
2634
|
+
};
|
|
2635
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
2636
|
+
module.exports = {
|
|
2637
|
+
compareIdentifiers,
|
|
2638
|
+
rcompareIdentifiers
|
|
2639
|
+
};
|
|
2640
|
+
}));
|
|
2641
|
+
//#endregion
|
|
2642
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
|
|
2643
|
+
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2644
|
+
var debug = require_debug();
|
|
2645
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
2646
|
+
var { safeRe: re, t } = require_re();
|
|
2647
|
+
var parseOptions = require_parse_options();
|
|
2648
|
+
var { compareIdentifiers } = require_identifiers();
|
|
2649
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
2650
|
+
const identifiers = identifier.split(".");
|
|
2651
|
+
if (identifiers.length > prerelease.length) return false;
|
|
2652
|
+
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
2653
|
+
return true;
|
|
2654
|
+
};
|
|
2655
|
+
module.exports = class SemVer {
|
|
2656
|
+
constructor(version, options) {
|
|
2657
|
+
options = parseOptions(options);
|
|
2658
|
+
if (version instanceof SemVer) {
|
|
2659
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
2660
|
+
else version = version.version;
|
|
2661
|
+
} else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
2662
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
2663
|
+
debug("SemVer", version, options);
|
|
2664
|
+
this.options = options;
|
|
2665
|
+
this.loose = !!options.loose;
|
|
2666
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
2667
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
2668
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
2669
|
+
this.raw = version;
|
|
2670
|
+
this.major = +m[1];
|
|
2671
|
+
this.minor = +m[2];
|
|
2672
|
+
this.patch = +m[3];
|
|
2673
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
2674
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
2675
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
2676
|
+
if (!m[4]) this.prerelease = [];
|
|
2677
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
2678
|
+
if (/^[0-9]+$/.test(id)) {
|
|
2679
|
+
const num = +id;
|
|
2680
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
2681
|
+
}
|
|
2682
|
+
return id;
|
|
2683
|
+
});
|
|
2684
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
2685
|
+
this.format();
|
|
2686
|
+
}
|
|
2687
|
+
format() {
|
|
2688
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
2689
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
2690
|
+
return this.version;
|
|
2691
|
+
}
|
|
2692
|
+
toString() {
|
|
2693
|
+
return this.version;
|
|
2694
|
+
}
|
|
2695
|
+
compare(other) {
|
|
2696
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
2697
|
+
if (!(other instanceof SemVer)) {
|
|
2698
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
2699
|
+
other = new SemVer(other, this.options);
|
|
2700
|
+
}
|
|
2701
|
+
if (other.version === this.version) return 0;
|
|
2702
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
2703
|
+
}
|
|
2704
|
+
compareMain(other) {
|
|
2705
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2706
|
+
if (this.major < other.major) return -1;
|
|
2707
|
+
if (this.major > other.major) return 1;
|
|
2708
|
+
if (this.minor < other.minor) return -1;
|
|
2709
|
+
if (this.minor > other.minor) return 1;
|
|
2710
|
+
if (this.patch < other.patch) return -1;
|
|
2711
|
+
if (this.patch > other.patch) return 1;
|
|
2712
|
+
return 0;
|
|
2713
|
+
}
|
|
2714
|
+
comparePre(other) {
|
|
2715
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2716
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
2717
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
2718
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
2719
|
+
let i = 0;
|
|
2720
|
+
do {
|
|
2721
|
+
const a = this.prerelease[i];
|
|
2722
|
+
const b = other.prerelease[i];
|
|
2723
|
+
debug("prerelease compare", i, a, b);
|
|
2724
|
+
if (a === void 0 && b === void 0) return 0;
|
|
2725
|
+
else if (b === void 0) return 1;
|
|
2726
|
+
else if (a === void 0) return -1;
|
|
2727
|
+
else if (a === b) continue;
|
|
2728
|
+
else return compareIdentifiers(a, b);
|
|
2729
|
+
} while (++i);
|
|
2730
|
+
}
|
|
2731
|
+
compareBuild(other) {
|
|
2732
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2733
|
+
let i = 0;
|
|
2734
|
+
do {
|
|
2735
|
+
const a = this.build[i];
|
|
2736
|
+
const b = other.build[i];
|
|
2737
|
+
debug("build compare", i, a, b);
|
|
2738
|
+
if (a === void 0 && b === void 0) return 0;
|
|
2739
|
+
else if (b === void 0) return 1;
|
|
2740
|
+
else if (a === void 0) return -1;
|
|
2741
|
+
else if (a === b) continue;
|
|
2742
|
+
else return compareIdentifiers(a, b);
|
|
2743
|
+
} while (++i);
|
|
2744
|
+
}
|
|
2745
|
+
inc(release, identifier, identifierBase) {
|
|
2746
|
+
if (release.startsWith("pre")) {
|
|
2747
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
2748
|
+
if (identifier) {
|
|
2749
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
2750
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
switch (release) {
|
|
2754
|
+
case "premajor":
|
|
2755
|
+
this.prerelease.length = 0;
|
|
2756
|
+
this.patch = 0;
|
|
2757
|
+
this.minor = 0;
|
|
2758
|
+
this.major++;
|
|
2759
|
+
this.inc("pre", identifier, identifierBase);
|
|
2760
|
+
break;
|
|
2761
|
+
case "preminor":
|
|
2762
|
+
this.prerelease.length = 0;
|
|
2763
|
+
this.patch = 0;
|
|
2764
|
+
this.minor++;
|
|
2765
|
+
this.inc("pre", identifier, identifierBase);
|
|
2766
|
+
break;
|
|
2767
|
+
case "prepatch":
|
|
2768
|
+
this.prerelease.length = 0;
|
|
2769
|
+
this.inc("patch", identifier, identifierBase);
|
|
2770
|
+
this.inc("pre", identifier, identifierBase);
|
|
2771
|
+
break;
|
|
2772
|
+
case "prerelease":
|
|
2773
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
2774
|
+
this.inc("pre", identifier, identifierBase);
|
|
2775
|
+
break;
|
|
2776
|
+
case "release":
|
|
2777
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
2778
|
+
this.prerelease.length = 0;
|
|
2779
|
+
break;
|
|
2780
|
+
case "major":
|
|
2781
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
2782
|
+
this.minor = 0;
|
|
2783
|
+
this.patch = 0;
|
|
2784
|
+
this.prerelease = [];
|
|
2785
|
+
break;
|
|
2786
|
+
case "minor":
|
|
2787
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
2788
|
+
this.patch = 0;
|
|
2789
|
+
this.prerelease = [];
|
|
2790
|
+
break;
|
|
2791
|
+
case "patch":
|
|
2792
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
2793
|
+
this.prerelease = [];
|
|
2794
|
+
break;
|
|
2795
|
+
case "pre": {
|
|
2796
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
2797
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
2798
|
+
else {
|
|
2799
|
+
let i = this.prerelease.length;
|
|
2800
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
2801
|
+
this.prerelease[i]++;
|
|
2802
|
+
i = -2;
|
|
2803
|
+
}
|
|
2804
|
+
if (i === -1) {
|
|
2805
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
2806
|
+
this.prerelease.push(base);
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
if (identifier) {
|
|
2810
|
+
let prerelease = [identifier, base];
|
|
2811
|
+
if (identifierBase === false) prerelease = [identifier];
|
|
2812
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
2813
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
2814
|
+
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
2815
|
+
} else this.prerelease = prerelease;
|
|
2816
|
+
}
|
|
2817
|
+
break;
|
|
2818
|
+
}
|
|
2819
|
+
default: throw new Error(`invalid increment argument: ${release}`);
|
|
2820
|
+
}
|
|
2821
|
+
this.raw = this.format();
|
|
2822
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
2823
|
+
return this;
|
|
2824
|
+
}
|
|
2825
|
+
};
|
|
2826
|
+
}));
|
|
2827
|
+
//#endregion
|
|
2828
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
|
|
2829
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2830
|
+
var SemVer = require_semver$1();
|
|
2831
|
+
var parse = (version, options, throwErrors = false) => {
|
|
2832
|
+
if (version instanceof SemVer) return version;
|
|
2833
|
+
try {
|
|
2834
|
+
return new SemVer(version, options);
|
|
2835
|
+
} catch (er) {
|
|
2836
|
+
if (!throwErrors) return null;
|
|
2837
|
+
throw er;
|
|
2838
|
+
}
|
|
2839
|
+
};
|
|
2840
|
+
module.exports = parse;
|
|
2841
|
+
}));
|
|
2842
|
+
//#endregion
|
|
2843
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
|
|
2844
|
+
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2845
|
+
var parse = require_parse();
|
|
2846
|
+
var valid = (version, options) => {
|
|
2847
|
+
const v = parse(version, options);
|
|
2848
|
+
return v ? v.version : null;
|
|
2849
|
+
};
|
|
2850
|
+
module.exports = valid;
|
|
2851
|
+
}));
|
|
2852
|
+
//#endregion
|
|
2853
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
|
|
2854
|
+
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2855
|
+
var parse = require_parse();
|
|
2856
|
+
var clean = (version, options) => {
|
|
2857
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
2858
|
+
return s ? s.version : null;
|
|
2859
|
+
};
|
|
2860
|
+
module.exports = clean;
|
|
2861
|
+
}));
|
|
2862
|
+
//#endregion
|
|
2863
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
|
|
2864
|
+
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2865
|
+
var SemVer = require_semver$1();
|
|
2866
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
2867
|
+
if (typeof options === "string") {
|
|
2868
|
+
identifierBase = identifier;
|
|
2869
|
+
identifier = options;
|
|
2870
|
+
options = void 0;
|
|
2871
|
+
}
|
|
2872
|
+
try {
|
|
2873
|
+
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
2874
|
+
} catch (er) {
|
|
2875
|
+
return null;
|
|
2876
|
+
}
|
|
2877
|
+
};
|
|
2878
|
+
module.exports = inc;
|
|
2879
|
+
}));
|
|
2880
|
+
//#endregion
|
|
2881
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
|
|
2882
|
+
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2883
|
+
var parse = require_parse();
|
|
2884
|
+
var diff = (version1, version2) => {
|
|
2885
|
+
const v1 = parse(version1, null, true);
|
|
2886
|
+
const v2 = parse(version2, null, true);
|
|
2887
|
+
const comparison = v1.compare(v2);
|
|
2888
|
+
if (comparison === 0) return null;
|
|
2889
|
+
const v1Higher = comparison > 0;
|
|
2890
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
2891
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
2892
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
2893
|
+
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
2894
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
2895
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
2896
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
2897
|
+
return "patch";
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
const prefix = highHasPre ? "pre" : "";
|
|
2901
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
2902
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
2903
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
2904
|
+
return "prerelease";
|
|
2905
|
+
};
|
|
2906
|
+
module.exports = diff;
|
|
2907
|
+
}));
|
|
2908
|
+
//#endregion
|
|
2909
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
|
|
2910
|
+
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2911
|
+
var SemVer = require_semver$1();
|
|
2912
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
2913
|
+
module.exports = major;
|
|
2914
|
+
}));
|
|
2915
|
+
//#endregion
|
|
2916
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
|
|
2917
|
+
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2918
|
+
var SemVer = require_semver$1();
|
|
2919
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
2920
|
+
module.exports = minor;
|
|
2921
|
+
}));
|
|
2922
|
+
//#endregion
|
|
2923
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
|
|
2924
|
+
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2925
|
+
var SemVer = require_semver$1();
|
|
2926
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
2927
|
+
module.exports = patch;
|
|
2928
|
+
}));
|
|
2929
|
+
//#endregion
|
|
2930
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
|
|
2931
|
+
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2932
|
+
var parse = require_parse();
|
|
2933
|
+
var prerelease = (version, options) => {
|
|
2934
|
+
const parsed = parse(version, options);
|
|
2935
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
2936
|
+
};
|
|
2937
|
+
module.exports = prerelease;
|
|
2938
|
+
}));
|
|
2939
|
+
//#endregion
|
|
2940
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
|
|
2941
|
+
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2942
|
+
var SemVer = require_semver$1();
|
|
2943
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
2944
|
+
module.exports = compare;
|
|
2945
|
+
}));
|
|
2946
|
+
//#endregion
|
|
2947
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
|
|
2948
|
+
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2949
|
+
var compare = require_compare();
|
|
2950
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
2951
|
+
module.exports = rcompare;
|
|
2952
|
+
}));
|
|
2953
|
+
//#endregion
|
|
2954
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
|
|
2955
|
+
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2956
|
+
var compare = require_compare();
|
|
2957
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
2958
|
+
module.exports = compareLoose;
|
|
2959
|
+
}));
|
|
2960
|
+
//#endregion
|
|
2961
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
|
|
2962
|
+
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2963
|
+
var SemVer = require_semver$1();
|
|
2964
|
+
var compareBuild = (a, b, loose) => {
|
|
2965
|
+
const versionA = new SemVer(a, loose);
|
|
2966
|
+
const versionB = new SemVer(b, loose);
|
|
2967
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
2968
|
+
};
|
|
2969
|
+
module.exports = compareBuild;
|
|
2970
|
+
}));
|
|
2971
|
+
//#endregion
|
|
2972
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
|
|
2973
|
+
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2974
|
+
var compareBuild = require_compare_build();
|
|
2975
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
2976
|
+
module.exports = sort;
|
|
2977
|
+
}));
|
|
2978
|
+
//#endregion
|
|
2979
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
|
|
2980
|
+
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2981
|
+
var compareBuild = require_compare_build();
|
|
2982
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
2983
|
+
module.exports = rsort;
|
|
2984
|
+
}));
|
|
2985
|
+
//#endregion
|
|
2986
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
|
|
2987
|
+
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2988
|
+
var compare = require_compare();
|
|
2989
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
2990
|
+
module.exports = gt;
|
|
2991
|
+
}));
|
|
2992
|
+
//#endregion
|
|
2993
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
|
|
2994
|
+
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2995
|
+
var compare = require_compare();
|
|
2996
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
2997
|
+
module.exports = lt;
|
|
2998
|
+
}));
|
|
2999
|
+
//#endregion
|
|
3000
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
|
|
3001
|
+
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3002
|
+
var compare = require_compare();
|
|
3003
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
3004
|
+
module.exports = eq;
|
|
3005
|
+
}));
|
|
3006
|
+
//#endregion
|
|
3007
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
|
|
3008
|
+
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3009
|
+
var compare = require_compare();
|
|
3010
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
3011
|
+
module.exports = neq;
|
|
3012
|
+
}));
|
|
3013
|
+
//#endregion
|
|
3014
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
|
|
3015
|
+
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3016
|
+
var compare = require_compare();
|
|
3017
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
3018
|
+
module.exports = gte;
|
|
3019
|
+
}));
|
|
3020
|
+
//#endregion
|
|
3021
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
|
|
3022
|
+
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3023
|
+
var compare = require_compare();
|
|
3024
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
3025
|
+
module.exports = lte;
|
|
3026
|
+
}));
|
|
3027
|
+
//#endregion
|
|
3028
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
|
|
3029
|
+
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3030
|
+
var eq = require_eq();
|
|
3031
|
+
var neq = require_neq();
|
|
3032
|
+
var gt = require_gt();
|
|
3033
|
+
var gte = require_gte();
|
|
3034
|
+
var lt = require_lt();
|
|
3035
|
+
var lte = require_lte();
|
|
3036
|
+
var cmp = (a, op, b, loose) => {
|
|
3037
|
+
switch (op) {
|
|
3038
|
+
case "===":
|
|
3039
|
+
if (typeof a === "object") a = a.version;
|
|
3040
|
+
if (typeof b === "object") b = b.version;
|
|
3041
|
+
return a === b;
|
|
3042
|
+
case "!==":
|
|
3043
|
+
if (typeof a === "object") a = a.version;
|
|
3044
|
+
if (typeof b === "object") b = b.version;
|
|
3045
|
+
return a !== b;
|
|
3046
|
+
case "":
|
|
3047
|
+
case "=":
|
|
3048
|
+
case "==": return eq(a, b, loose);
|
|
3049
|
+
case "!=": return neq(a, b, loose);
|
|
3050
|
+
case ">": return gt(a, b, loose);
|
|
3051
|
+
case ">=": return gte(a, b, loose);
|
|
3052
|
+
case "<": return lt(a, b, loose);
|
|
3053
|
+
case "<=": return lte(a, b, loose);
|
|
3054
|
+
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
3055
|
+
}
|
|
3056
|
+
};
|
|
3057
|
+
module.exports = cmp;
|
|
3058
|
+
}));
|
|
3059
|
+
//#endregion
|
|
3060
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
|
|
3061
|
+
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3062
|
+
var SemVer = require_semver$1();
|
|
3063
|
+
var parse = require_parse();
|
|
3064
|
+
var { safeRe: re, t } = require_re();
|
|
3065
|
+
var coerce = (version, options) => {
|
|
3066
|
+
if (version instanceof SemVer) return version;
|
|
3067
|
+
if (typeof version === "number") version = String(version);
|
|
3068
|
+
if (typeof version !== "string") return null;
|
|
3069
|
+
options = options || {};
|
|
3070
|
+
let match = null;
|
|
3071
|
+
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
3072
|
+
else {
|
|
3073
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
3074
|
+
let next;
|
|
3075
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
3076
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
3077
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
3078
|
+
}
|
|
3079
|
+
coerceRtlRegex.lastIndex = -1;
|
|
3080
|
+
}
|
|
3081
|
+
if (match === null) return null;
|
|
3082
|
+
const major = match[2];
|
|
3083
|
+
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
3084
|
+
};
|
|
3085
|
+
module.exports = coerce;
|
|
3086
|
+
}));
|
|
3087
|
+
//#endregion
|
|
3088
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
|
|
3089
|
+
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3090
|
+
var parse = require_parse();
|
|
3091
|
+
var constants = require_constants();
|
|
3092
|
+
var SemVer = require_semver$1();
|
|
3093
|
+
var truncate = (version, truncation, options) => {
|
|
3094
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
3095
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
3096
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
3097
|
+
};
|
|
3098
|
+
var cloneInputVersion = (version, options) => {
|
|
3099
|
+
return parse(version instanceof SemVer ? version.version : version, options);
|
|
3100
|
+
};
|
|
3101
|
+
var doTruncation = (version, truncation) => {
|
|
3102
|
+
if (isPrerelease(truncation)) return version.version;
|
|
3103
|
+
version.prerelease = [];
|
|
3104
|
+
switch (truncation) {
|
|
3105
|
+
case "major":
|
|
3106
|
+
version.minor = 0;
|
|
3107
|
+
version.patch = 0;
|
|
3108
|
+
break;
|
|
3109
|
+
case "minor": version.patch = 0;
|
|
3110
|
+
}
|
|
3111
|
+
return version.format();
|
|
3112
|
+
};
|
|
3113
|
+
var isPrerelease = (type) => {
|
|
3114
|
+
return type.startsWith("pre");
|
|
3115
|
+
};
|
|
3116
|
+
module.exports = truncate;
|
|
3117
|
+
}));
|
|
3118
|
+
//#endregion
|
|
3119
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
|
|
3120
|
+
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3121
|
+
var LRUCache = class {
|
|
3122
|
+
constructor() {
|
|
3123
|
+
this.max = 1e3;
|
|
3124
|
+
this.map = /* @__PURE__ */ new Map();
|
|
3125
|
+
}
|
|
3126
|
+
get(key) {
|
|
3127
|
+
const value = this.map.get(key);
|
|
3128
|
+
if (value === void 0) return;
|
|
3129
|
+
else {
|
|
3130
|
+
this.map.delete(key);
|
|
3131
|
+
this.map.set(key, value);
|
|
3132
|
+
return value;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
delete(key) {
|
|
3136
|
+
return this.map.delete(key);
|
|
3137
|
+
}
|
|
3138
|
+
set(key, value) {
|
|
3139
|
+
if (!this.delete(key) && value !== void 0) {
|
|
3140
|
+
if (this.map.size >= this.max) {
|
|
3141
|
+
const firstKey = this.map.keys().next().value;
|
|
3142
|
+
this.delete(firstKey);
|
|
3143
|
+
}
|
|
3144
|
+
this.map.set(key, value);
|
|
3145
|
+
}
|
|
3146
|
+
return this;
|
|
3147
|
+
}
|
|
3148
|
+
};
|
|
3149
|
+
module.exports = LRUCache;
|
|
3150
|
+
}));
|
|
3151
|
+
//#endregion
|
|
3152
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
|
|
3153
|
+
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3154
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
3155
|
+
module.exports = class Range {
|
|
3156
|
+
constructor(range, options) {
|
|
3157
|
+
options = parseOptions(options);
|
|
3158
|
+
if (range instanceof Range) {
|
|
3159
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
3160
|
+
else return new Range(range.raw, options);
|
|
3161
|
+
}
|
|
3162
|
+
if (range instanceof Comparator) {
|
|
3163
|
+
this.raw = range.value;
|
|
3164
|
+
this.set = [[range]];
|
|
3165
|
+
this.formatted = void 0;
|
|
3166
|
+
return this;
|
|
3167
|
+
}
|
|
3168
|
+
this.options = options;
|
|
3169
|
+
this.loose = !!options.loose;
|
|
3170
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
3171
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
3172
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
3173
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
3174
|
+
if (this.set.length > 1) {
|
|
3175
|
+
const first = this.set[0];
|
|
3176
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
3177
|
+
if (this.set.length === 0) this.set = [first];
|
|
3178
|
+
else if (this.set.length > 1) {
|
|
3179
|
+
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
3180
|
+
this.set = [c];
|
|
3181
|
+
break;
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
this.formatted = void 0;
|
|
3186
|
+
}
|
|
3187
|
+
get range() {
|
|
3188
|
+
if (this.formatted === void 0) {
|
|
3189
|
+
this.formatted = "";
|
|
3190
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
3191
|
+
if (i > 0) this.formatted += "||";
|
|
3192
|
+
const comps = this.set[i];
|
|
3193
|
+
for (let k = 0; k < comps.length; k++) {
|
|
3194
|
+
if (k > 0) this.formatted += " ";
|
|
3195
|
+
this.formatted += comps[k].toString().trim();
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
return this.formatted;
|
|
3200
|
+
}
|
|
3201
|
+
format() {
|
|
3202
|
+
return this.range;
|
|
3203
|
+
}
|
|
3204
|
+
toString() {
|
|
3205
|
+
return this.range;
|
|
3206
|
+
}
|
|
3207
|
+
parseRange(range) {
|
|
3208
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
3209
|
+
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
3210
|
+
const cached = cache.get(memoKey);
|
|
3211
|
+
if (cached) return cached;
|
|
3212
|
+
const loose = this.options.loose;
|
|
3213
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
3214
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
3215
|
+
debug("hyphen replace", range);
|
|
3216
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
3217
|
+
debug("comparator trim", range);
|
|
3218
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
3219
|
+
debug("tilde trim", range);
|
|
3220
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
3221
|
+
debug("caret trim", range);
|
|
3222
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
3223
|
+
if (loose) rangeList = rangeList.filter((comp) => {
|
|
3224
|
+
debug("loose invalid filter", comp, this.options);
|
|
3225
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
3226
|
+
});
|
|
3227
|
+
debug("range list", rangeList);
|
|
3228
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
3229
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
3230
|
+
for (const comp of comparators) {
|
|
3231
|
+
if (isNullSet(comp)) return [comp];
|
|
3232
|
+
rangeMap.set(comp.value, comp);
|
|
3233
|
+
}
|
|
3234
|
+
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
3235
|
+
const result = [...rangeMap.values()];
|
|
3236
|
+
cache.set(memoKey, result);
|
|
3237
|
+
return result;
|
|
3238
|
+
}
|
|
3239
|
+
intersects(range, options) {
|
|
3240
|
+
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
3241
|
+
return this.set.some((thisComparators) => {
|
|
3242
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
3243
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
3244
|
+
return rangeComparators.every((rangeComparator) => {
|
|
3245
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
3246
|
+
});
|
|
3247
|
+
});
|
|
3248
|
+
});
|
|
3249
|
+
});
|
|
3250
|
+
}
|
|
3251
|
+
test(version) {
|
|
3252
|
+
if (!version) return false;
|
|
3253
|
+
if (typeof version === "string") try {
|
|
3254
|
+
version = new SemVer(version, this.options);
|
|
3255
|
+
} catch (er) {
|
|
3256
|
+
return false;
|
|
3257
|
+
}
|
|
3258
|
+
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
3259
|
+
return false;
|
|
3260
|
+
}
|
|
3261
|
+
};
|
|
3262
|
+
var cache = new (require_lrucache())();
|
|
3263
|
+
var parseOptions = require_parse_options();
|
|
3264
|
+
var Comparator = require_comparator();
|
|
3265
|
+
var debug = require_debug();
|
|
3266
|
+
var SemVer = require_semver$1();
|
|
3267
|
+
var { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
3268
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
3269
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
3270
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
3271
|
+
var isAny = (c) => c.value === "";
|
|
3272
|
+
var isSatisfiable = (comparators, options) => {
|
|
3273
|
+
let result = true;
|
|
3274
|
+
const remainingComparators = comparators.slice();
|
|
3275
|
+
let testComparator = remainingComparators.pop();
|
|
3276
|
+
while (result && remainingComparators.length) {
|
|
3277
|
+
result = remainingComparators.every((otherComparator) => {
|
|
3278
|
+
return testComparator.intersects(otherComparator, options);
|
|
3279
|
+
});
|
|
3280
|
+
testComparator = remainingComparators.pop();
|
|
3281
|
+
}
|
|
3282
|
+
return result;
|
|
3283
|
+
};
|
|
3284
|
+
var parseComparator = (comp, options) => {
|
|
3285
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
3286
|
+
debug("comp", comp, options);
|
|
3287
|
+
comp = replaceCarets(comp, options);
|
|
3288
|
+
debug("caret", comp);
|
|
3289
|
+
comp = replaceTildes(comp, options);
|
|
3290
|
+
debug("tildes", comp);
|
|
3291
|
+
comp = replaceXRanges(comp, options);
|
|
3292
|
+
debug("xrange", comp);
|
|
3293
|
+
comp = replaceStars(comp, options);
|
|
3294
|
+
debug("stars", comp);
|
|
3295
|
+
return comp;
|
|
3296
|
+
};
|
|
3297
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
3298
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
3299
|
+
var replaceTildes = (comp, options) => {
|
|
3300
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
3301
|
+
};
|
|
3302
|
+
var replaceTilde = (comp, options) => {
|
|
3303
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
3304
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
3305
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
3306
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
3307
|
+
let ret;
|
|
3308
|
+
if (isX(M)) ret = "";
|
|
3309
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
3310
|
+
else if (isX(p)) ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
3311
|
+
else if (pr) {
|
|
3312
|
+
debug("replaceTilde pr", pr);
|
|
3313
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
3314
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
3315
|
+
debug("tilde return", ret);
|
|
3316
|
+
return ret;
|
|
3317
|
+
});
|
|
3318
|
+
};
|
|
3319
|
+
var replaceCarets = (comp, options) => {
|
|
3320
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
3321
|
+
};
|
|
3322
|
+
var replaceCaret = (comp, options) => {
|
|
3323
|
+
debug("caret", comp, options);
|
|
3324
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
3325
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
3326
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
3327
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
3328
|
+
let ret;
|
|
3329
|
+
if (isX(M)) ret = "";
|
|
3330
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
3331
|
+
else if (isX(p)) {
|
|
3332
|
+
if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
3333
|
+
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
3334
|
+
} else if (pr) {
|
|
3335
|
+
debug("replaceCaret pr", pr);
|
|
3336
|
+
if (M === "0") {
|
|
3337
|
+
if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
3338
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
3339
|
+
} else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
3340
|
+
} else {
|
|
3341
|
+
debug("no pr");
|
|
3342
|
+
if (M === "0") {
|
|
3343
|
+
if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
3344
|
+
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
3345
|
+
} else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
3346
|
+
}
|
|
3347
|
+
debug("caret return", ret);
|
|
3348
|
+
return ret;
|
|
3349
|
+
});
|
|
3350
|
+
};
|
|
3351
|
+
var replaceXRanges = (comp, options) => {
|
|
3352
|
+
debug("replaceXRanges", comp, options);
|
|
3353
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
3354
|
+
};
|
|
3355
|
+
var replaceXRange = (comp, options) => {
|
|
3356
|
+
comp = comp.trim();
|
|
3357
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
3358
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
3359
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
3360
|
+
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
3361
|
+
const xM = isX(M);
|
|
3362
|
+
const xm = xM || isX(m);
|
|
3363
|
+
const xp = xm || isX(p);
|
|
3364
|
+
const anyX = xp;
|
|
3365
|
+
if (gtlt === "=" && anyX) gtlt = "";
|
|
3366
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
3367
|
+
if (xM) {
|
|
3368
|
+
if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
3369
|
+
else ret = "*";
|
|
3370
|
+
} else if (gtlt && anyX) {
|
|
3371
|
+
if (xm) m = 0;
|
|
3372
|
+
p = 0;
|
|
3373
|
+
if (gtlt === ">") {
|
|
3374
|
+
gtlt = ">=";
|
|
3375
|
+
if (xm) {
|
|
3376
|
+
M = +M + 1;
|
|
3377
|
+
m = 0;
|
|
3378
|
+
p = 0;
|
|
3379
|
+
} else {
|
|
3380
|
+
m = +m + 1;
|
|
3381
|
+
p = 0;
|
|
3382
|
+
}
|
|
3383
|
+
} else if (gtlt === "<=") {
|
|
3384
|
+
gtlt = "<";
|
|
3385
|
+
if (xm) M = +M + 1;
|
|
3386
|
+
else m = +m + 1;
|
|
3387
|
+
}
|
|
3388
|
+
if (gtlt === "<") pr = "-0";
|
|
3389
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
3390
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
3391
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
3392
|
+
debug("xRange return", ret);
|
|
3393
|
+
return ret;
|
|
3394
|
+
});
|
|
3395
|
+
};
|
|
3396
|
+
var replaceStars = (comp, options) => {
|
|
3397
|
+
debug("replaceStars", comp, options);
|
|
3398
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
3399
|
+
};
|
|
3400
|
+
var replaceGTE0 = (comp, options) => {
|
|
3401
|
+
debug("replaceGTE0", comp, options);
|
|
3402
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
3403
|
+
};
|
|
3404
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
3405
|
+
if (isX(fM)) from = "";
|
|
3406
|
+
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
3407
|
+
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
3408
|
+
else if (fpr) from = `>=${from}`;
|
|
3409
|
+
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
3410
|
+
if (isX(tM)) to = "";
|
|
3411
|
+
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
3412
|
+
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
3413
|
+
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
3414
|
+
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
3415
|
+
else to = `<=${to}`;
|
|
3416
|
+
return `${from} ${to}`.trim();
|
|
3417
|
+
};
|
|
3418
|
+
var testSet = (set, version, options) => {
|
|
3419
|
+
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
3420
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
3421
|
+
for (let i = 0; i < set.length; i++) {
|
|
3422
|
+
debug(set[i].semver);
|
|
3423
|
+
if (set[i].semver === Comparator.ANY) continue;
|
|
3424
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
3425
|
+
const allowed = set[i].semver;
|
|
3426
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
return false;
|
|
3430
|
+
}
|
|
3431
|
+
return true;
|
|
3432
|
+
};
|
|
3433
|
+
}));
|
|
3434
|
+
//#endregion
|
|
3435
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
|
|
3436
|
+
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3437
|
+
var ANY = Symbol("SemVer ANY");
|
|
3438
|
+
module.exports = class Comparator {
|
|
3439
|
+
static get ANY() {
|
|
3440
|
+
return ANY;
|
|
3441
|
+
}
|
|
3442
|
+
constructor(comp, options) {
|
|
3443
|
+
options = parseOptions(options);
|
|
3444
|
+
if (comp instanceof Comparator) {
|
|
3445
|
+
if (comp.loose === !!options.loose) return comp;
|
|
3446
|
+
else comp = comp.value;
|
|
3447
|
+
}
|
|
3448
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
3449
|
+
debug("comparator", comp, options);
|
|
3450
|
+
this.options = options;
|
|
3451
|
+
this.loose = !!options.loose;
|
|
3452
|
+
this.parse(comp);
|
|
3453
|
+
if (this.semver === ANY) this.value = "";
|
|
3454
|
+
else this.value = this.operator + this.semver.version;
|
|
3455
|
+
debug("comp", this);
|
|
3456
|
+
}
|
|
3457
|
+
parse(comp) {
|
|
3458
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
3459
|
+
const m = comp.match(r);
|
|
3460
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
3461
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
3462
|
+
if (this.operator === "=") this.operator = "";
|
|
3463
|
+
if (!m[2]) this.semver = ANY;
|
|
3464
|
+
else this.semver = new SemVer(m[2], this.options.loose);
|
|
3465
|
+
}
|
|
3466
|
+
toString() {
|
|
3467
|
+
return this.value;
|
|
3468
|
+
}
|
|
3469
|
+
test(version) {
|
|
3470
|
+
debug("Comparator.test", version, this.options.loose);
|
|
3471
|
+
if (this.semver === ANY || version === ANY) return true;
|
|
3472
|
+
if (typeof version === "string") try {
|
|
3473
|
+
version = new SemVer(version, this.options);
|
|
3474
|
+
} catch (er) {
|
|
3475
|
+
return false;
|
|
3476
|
+
}
|
|
3477
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
3478
|
+
}
|
|
3479
|
+
intersects(comp, options) {
|
|
3480
|
+
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
3481
|
+
if (this.operator === "") {
|
|
3482
|
+
if (this.value === "") return true;
|
|
3483
|
+
return new Range(comp.value, options).test(this.value);
|
|
3484
|
+
} else if (comp.operator === "") {
|
|
3485
|
+
if (comp.value === "") return true;
|
|
3486
|
+
return new Range(this.value, options).test(comp.semver);
|
|
3487
|
+
}
|
|
3488
|
+
options = parseOptions(options);
|
|
3489
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
3490
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
3491
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
3492
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
3493
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
3494
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
3495
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
3496
|
+
return false;
|
|
3497
|
+
}
|
|
3498
|
+
};
|
|
3499
|
+
var parseOptions = require_parse_options();
|
|
3500
|
+
var { safeRe: re, t } = require_re();
|
|
3501
|
+
var cmp = require_cmp();
|
|
3502
|
+
var debug = require_debug();
|
|
3503
|
+
var SemVer = require_semver$1();
|
|
3504
|
+
var Range = require_range();
|
|
3505
|
+
}));
|
|
3506
|
+
//#endregion
|
|
3507
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
|
|
3508
|
+
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3509
|
+
var Range = require_range();
|
|
3510
|
+
var satisfies = (version, range, options) => {
|
|
3511
|
+
try {
|
|
3512
|
+
range = new Range(range, options);
|
|
3513
|
+
} catch (er) {
|
|
3514
|
+
return false;
|
|
3515
|
+
}
|
|
3516
|
+
return range.test(version);
|
|
3517
|
+
};
|
|
3518
|
+
module.exports = satisfies;
|
|
3519
|
+
}));
|
|
3520
|
+
//#endregion
|
|
3521
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
|
|
3522
|
+
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3523
|
+
var Range = require_range();
|
|
3524
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
3525
|
+
module.exports = toComparators;
|
|
3526
|
+
}));
|
|
3527
|
+
//#endregion
|
|
3528
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
|
|
3529
|
+
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3530
|
+
var SemVer = require_semver$1();
|
|
3531
|
+
var Range = require_range();
|
|
3532
|
+
var maxSatisfying = (versions, range, options) => {
|
|
3533
|
+
let max = null;
|
|
3534
|
+
let maxSV = null;
|
|
3535
|
+
let rangeObj = null;
|
|
3536
|
+
try {
|
|
3537
|
+
rangeObj = new Range(range, options);
|
|
3538
|
+
} catch (er) {
|
|
3539
|
+
return null;
|
|
3540
|
+
}
|
|
3541
|
+
versions.forEach((v) => {
|
|
3542
|
+
if (rangeObj.test(v)) {
|
|
3543
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
3544
|
+
max = v;
|
|
3545
|
+
maxSV = new SemVer(max, options);
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
});
|
|
3549
|
+
return max;
|
|
3550
|
+
};
|
|
3551
|
+
module.exports = maxSatisfying;
|
|
3552
|
+
}));
|
|
3553
|
+
//#endregion
|
|
3554
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
|
|
3555
|
+
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3556
|
+
var SemVer = require_semver$1();
|
|
3557
|
+
var Range = require_range();
|
|
3558
|
+
var minSatisfying = (versions, range, options) => {
|
|
3559
|
+
let min = null;
|
|
3560
|
+
let minSV = null;
|
|
3561
|
+
let rangeObj = null;
|
|
3562
|
+
try {
|
|
3563
|
+
rangeObj = new Range(range, options);
|
|
3564
|
+
} catch (er) {
|
|
3565
|
+
return null;
|
|
3566
|
+
}
|
|
3567
|
+
versions.forEach((v) => {
|
|
3568
|
+
if (rangeObj.test(v)) {
|
|
3569
|
+
if (!min || minSV.compare(v) === 1) {
|
|
3570
|
+
min = v;
|
|
3571
|
+
minSV = new SemVer(min, options);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
});
|
|
3575
|
+
return min;
|
|
3576
|
+
};
|
|
3577
|
+
module.exports = minSatisfying;
|
|
3578
|
+
}));
|
|
3579
|
+
//#endregion
|
|
3580
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
|
|
3581
|
+
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3582
|
+
var SemVer = require_semver$1();
|
|
3583
|
+
var Range = require_range();
|
|
3584
|
+
var gt = require_gt();
|
|
3585
|
+
var minVersion = (range, loose) => {
|
|
3586
|
+
range = new Range(range, loose);
|
|
3587
|
+
let minver = new SemVer("0.0.0");
|
|
3588
|
+
if (range.test(minver)) return minver;
|
|
3589
|
+
minver = new SemVer("0.0.0-0");
|
|
3590
|
+
if (range.test(minver)) return minver;
|
|
3591
|
+
minver = null;
|
|
3592
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
3593
|
+
const comparators = range.set[i];
|
|
3594
|
+
let setMin = null;
|
|
3595
|
+
comparators.forEach((comparator) => {
|
|
3596
|
+
const compver = new SemVer(comparator.semver.version);
|
|
3597
|
+
switch (comparator.operator) {
|
|
3598
|
+
case ">":
|
|
3599
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
3600
|
+
else compver.prerelease.push(0);
|
|
3601
|
+
compver.raw = compver.format();
|
|
3602
|
+
case "":
|
|
3603
|
+
case ">=":
|
|
3604
|
+
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
3605
|
+
break;
|
|
3606
|
+
case "<":
|
|
3607
|
+
case "<=": break;
|
|
3608
|
+
/* istanbul ignore next */
|
|
3609
|
+
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
3610
|
+
}
|
|
3611
|
+
});
|
|
3612
|
+
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
3613
|
+
}
|
|
3614
|
+
if (minver && range.test(minver)) return minver;
|
|
3615
|
+
return null;
|
|
3616
|
+
};
|
|
3617
|
+
module.exports = minVersion;
|
|
3618
|
+
}));
|
|
3619
|
+
//#endregion
|
|
3620
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
|
|
3621
|
+
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3622
|
+
var Range = require_range();
|
|
3623
|
+
var validRange = (range, options) => {
|
|
3624
|
+
try {
|
|
3625
|
+
return new Range(range, options).range || "*";
|
|
3626
|
+
} catch (er) {
|
|
3627
|
+
return null;
|
|
3628
|
+
}
|
|
3629
|
+
};
|
|
3630
|
+
module.exports = validRange;
|
|
3631
|
+
}));
|
|
3632
|
+
//#endregion
|
|
3633
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
|
|
3634
|
+
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3635
|
+
var SemVer = require_semver$1();
|
|
3636
|
+
var Comparator = require_comparator();
|
|
3637
|
+
var { ANY } = Comparator;
|
|
3638
|
+
var Range = require_range();
|
|
3639
|
+
var satisfies = require_satisfies();
|
|
3640
|
+
var gt = require_gt();
|
|
3641
|
+
var lt = require_lt();
|
|
3642
|
+
var lte = require_lte();
|
|
3643
|
+
var gte = require_gte();
|
|
3644
|
+
var outside = (version, range, hilo, options) => {
|
|
3645
|
+
version = new SemVer(version, options);
|
|
3646
|
+
range = new Range(range, options);
|
|
3647
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
3648
|
+
switch (hilo) {
|
|
3649
|
+
case ">":
|
|
3650
|
+
gtfn = gt;
|
|
3651
|
+
ltefn = lte;
|
|
3652
|
+
ltfn = lt;
|
|
3653
|
+
comp = ">";
|
|
3654
|
+
ecomp = ">=";
|
|
3655
|
+
break;
|
|
3656
|
+
case "<":
|
|
3657
|
+
gtfn = lt;
|
|
3658
|
+
ltefn = gte;
|
|
3659
|
+
ltfn = gt;
|
|
3660
|
+
comp = "<";
|
|
3661
|
+
ecomp = "<=";
|
|
3662
|
+
break;
|
|
3663
|
+
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
3664
|
+
}
|
|
3665
|
+
if (satisfies(version, range, options)) return false;
|
|
3666
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
3667
|
+
const comparators = range.set[i];
|
|
3668
|
+
let high = null;
|
|
3669
|
+
let low = null;
|
|
3670
|
+
comparators.forEach((comparator) => {
|
|
3671
|
+
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
3672
|
+
high = high || comparator;
|
|
3673
|
+
low = low || comparator;
|
|
3674
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
3675
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
3676
|
+
});
|
|
3677
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
3678
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
3679
|
+
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
3680
|
+
}
|
|
3681
|
+
return true;
|
|
3682
|
+
};
|
|
3683
|
+
module.exports = outside;
|
|
3684
|
+
}));
|
|
3685
|
+
//#endregion
|
|
3686
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
|
|
3687
|
+
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3688
|
+
var outside = require_outside();
|
|
3689
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
3690
|
+
module.exports = gtr;
|
|
3691
|
+
}));
|
|
3692
|
+
//#endregion
|
|
3693
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
|
|
3694
|
+
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3695
|
+
var outside = require_outside();
|
|
3696
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
3697
|
+
module.exports = ltr;
|
|
3698
|
+
}));
|
|
3699
|
+
//#endregion
|
|
3700
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
|
|
3701
|
+
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3702
|
+
var Range = require_range();
|
|
3703
|
+
var intersects = (r1, r2, options) => {
|
|
3704
|
+
r1 = new Range(r1, options);
|
|
3705
|
+
r2 = new Range(r2, options);
|
|
3706
|
+
return r1.intersects(r2, options);
|
|
3707
|
+
};
|
|
3708
|
+
module.exports = intersects;
|
|
3709
|
+
}));
|
|
3710
|
+
//#endregion
|
|
3711
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
|
|
3712
|
+
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3713
|
+
var satisfies = require_satisfies();
|
|
3714
|
+
var compare = require_compare();
|
|
3715
|
+
module.exports = (versions, range, options) => {
|
|
3716
|
+
const set = [];
|
|
3717
|
+
let first = null;
|
|
3718
|
+
let prev = null;
|
|
3719
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
3720
|
+
for (const version of v) if (satisfies(version, range, options)) {
|
|
3721
|
+
prev = version;
|
|
3722
|
+
if (!first) first = version;
|
|
3723
|
+
} else {
|
|
3724
|
+
if (prev) set.push([first, prev]);
|
|
3725
|
+
prev = null;
|
|
3726
|
+
first = null;
|
|
3727
|
+
}
|
|
3728
|
+
if (first) set.push([first, null]);
|
|
3729
|
+
const ranges = [];
|
|
3730
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
3731
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
3732
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
3733
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
3734
|
+
else ranges.push(`${min} - ${max}`);
|
|
3735
|
+
const simplified = ranges.join(" || ");
|
|
3736
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
3737
|
+
return simplified.length < original.length ? simplified : range;
|
|
3738
|
+
};
|
|
3739
|
+
}));
|
|
3740
|
+
//#endregion
|
|
3741
|
+
//#region ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
|
|
3742
|
+
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3743
|
+
var Range = require_range();
|
|
3744
|
+
var Comparator = require_comparator();
|
|
3745
|
+
var { ANY } = Comparator;
|
|
3746
|
+
var satisfies = require_satisfies();
|
|
3747
|
+
var compare = require_compare();
|
|
3748
|
+
var subset = (sub, dom, options = {}) => {
|
|
3749
|
+
if (sub === dom) return true;
|
|
3750
|
+
sub = new Range(sub, options);
|
|
3751
|
+
dom = new Range(dom, options);
|
|
3752
|
+
let sawNonNull = false;
|
|
3753
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
3754
|
+
for (const simpleDom of dom.set) {
|
|
3755
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
3756
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
3757
|
+
if (isSub) continue OUTER;
|
|
3758
|
+
}
|
|
3759
|
+
if (sawNonNull) return false;
|
|
3760
|
+
}
|
|
3761
|
+
return true;
|
|
3762
|
+
};
|
|
3763
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
3764
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
3765
|
+
var simpleSubset = (sub, dom, options) => {
|
|
3766
|
+
if (sub === dom) return true;
|
|
3767
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
3768
|
+
if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
3769
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
3770
|
+
else sub = minimumVersion;
|
|
3771
|
+
}
|
|
3772
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
3773
|
+
if (options.includePrerelease) return true;
|
|
3774
|
+
else dom = minimumVersion;
|
|
3775
|
+
}
|
|
3776
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
3777
|
+
let gt, lt;
|
|
3778
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
3779
|
+
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
3780
|
+
else eqSet.add(c.semver);
|
|
3781
|
+
if (eqSet.size > 1) return null;
|
|
3782
|
+
let gtltComp;
|
|
3783
|
+
if (gt && lt) {
|
|
3784
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
3785
|
+
if (gtltComp > 0) return null;
|
|
3786
|
+
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
3787
|
+
}
|
|
3788
|
+
for (const eq of eqSet) {
|
|
3789
|
+
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
3790
|
+
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
3791
|
+
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
3792
|
+
return true;
|
|
3793
|
+
}
|
|
3794
|
+
let higher, lower;
|
|
3795
|
+
let hasDomLT, hasDomGT;
|
|
3796
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
3797
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
3798
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
3799
|
+
for (const c of dom) {
|
|
3800
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
3801
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
3802
|
+
if (gt) {
|
|
3803
|
+
if (needDomGTPre) {
|
|
3804
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
3805
|
+
}
|
|
3806
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
3807
|
+
higher = higherGT(gt, c, options);
|
|
3808
|
+
if (higher === c && higher !== gt) return false;
|
|
3809
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
3810
|
+
}
|
|
3811
|
+
if (lt) {
|
|
3812
|
+
if (needDomLTPre) {
|
|
3813
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
3814
|
+
}
|
|
3815
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
3816
|
+
lower = lowerLT(lt, c, options);
|
|
3817
|
+
if (lower === c && lower !== lt) return false;
|
|
3818
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
3819
|
+
}
|
|
3820
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
3821
|
+
}
|
|
3822
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
3823
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
3824
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
3825
|
+
return true;
|
|
3826
|
+
};
|
|
3827
|
+
var higherGT = (a, b, options) => {
|
|
3828
|
+
if (!a) return b;
|
|
3829
|
+
const comp = compare(a.semver, b.semver, options);
|
|
3830
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
3831
|
+
};
|
|
3832
|
+
var lowerLT = (a, b, options) => {
|
|
3833
|
+
if (!a) return b;
|
|
3834
|
+
const comp = compare(a.semver, b.semver, options);
|
|
3835
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
3836
|
+
};
|
|
3837
|
+
module.exports = subset;
|
|
3838
|
+
}));
|
|
3839
|
+
//#endregion
|
|
2480
3840
|
//#region ../shared/dist/host/version.js
|
|
3841
|
+
var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3842
|
+
var internalRe = require_re();
|
|
3843
|
+
var constants = require_constants();
|
|
3844
|
+
var SemVer = require_semver$1();
|
|
3845
|
+
var identifiers = require_identifiers();
|
|
3846
|
+
module.exports = {
|
|
3847
|
+
parse: require_parse(),
|
|
3848
|
+
valid: require_valid$1(),
|
|
3849
|
+
clean: require_clean(),
|
|
3850
|
+
inc: require_inc(),
|
|
3851
|
+
diff: require_diff(),
|
|
3852
|
+
major: require_major(),
|
|
3853
|
+
minor: require_minor(),
|
|
3854
|
+
patch: require_patch(),
|
|
3855
|
+
prerelease: require_prerelease(),
|
|
3856
|
+
compare: require_compare(),
|
|
3857
|
+
rcompare: require_rcompare(),
|
|
3858
|
+
compareLoose: require_compare_loose(),
|
|
3859
|
+
compareBuild: require_compare_build(),
|
|
3860
|
+
sort: require_sort(),
|
|
3861
|
+
rsort: require_rsort(),
|
|
3862
|
+
gt: require_gt(),
|
|
3863
|
+
lt: require_lt(),
|
|
3864
|
+
eq: require_eq(),
|
|
3865
|
+
neq: require_neq(),
|
|
3866
|
+
gte: require_gte(),
|
|
3867
|
+
lte: require_lte(),
|
|
3868
|
+
cmp: require_cmp(),
|
|
3869
|
+
coerce: require_coerce(),
|
|
3870
|
+
truncate: require_truncate(),
|
|
3871
|
+
Comparator: require_comparator(),
|
|
3872
|
+
Range: require_range(),
|
|
3873
|
+
satisfies: require_satisfies(),
|
|
3874
|
+
toComparators: require_to_comparators(),
|
|
3875
|
+
maxSatisfying: require_max_satisfying(),
|
|
3876
|
+
minSatisfying: require_min_satisfying(),
|
|
3877
|
+
minVersion: require_min_version(),
|
|
3878
|
+
validRange: require_valid(),
|
|
3879
|
+
outside: require_outside(),
|
|
3880
|
+
gtr: require_gtr(),
|
|
3881
|
+
ltr: require_ltr(),
|
|
3882
|
+
intersects: require_intersects(),
|
|
3883
|
+
simplifyRange: require_simplify(),
|
|
3884
|
+
subset: require_subset(),
|
|
3885
|
+
SemVer,
|
|
3886
|
+
re: internalRe.re,
|
|
3887
|
+
src: internalRe.src,
|
|
3888
|
+
tokens: internalRe.t,
|
|
3889
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
3890
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
3891
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
3892
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
3893
|
+
};
|
|
3894
|
+
})))(), 1);
|
|
3895
|
+
function compareVersions(left, right) {
|
|
3896
|
+
const a = import_semver.default.valid(left.trim());
|
|
3897
|
+
const b = import_semver.default.valid(right.trim());
|
|
3898
|
+
if (a === null || b === null) return void 0;
|
|
3899
|
+
return import_semver.default.compare(a, b);
|
|
3900
|
+
}
|
|
3901
|
+
function isValidVersion(value) {
|
|
3902
|
+
return import_semver.default.valid(value.trim()) !== null;
|
|
3903
|
+
}
|
|
2481
3904
|
function runningVersionOf(moduleUrl) {
|
|
2482
3905
|
try {
|
|
2483
3906
|
const read = JSON.parse(readFileSync(new URL("../../package.json", moduleUrl), "utf8"));
|
|
@@ -2486,17 +3909,6 @@ function runningVersionOf(moduleUrl) {
|
|
|
2486
3909
|
return;
|
|
2487
3910
|
}
|
|
2488
3911
|
}
|
|
2489
|
-
function compareVersions(a, b) {
|
|
2490
|
-
const na = a.split(".").map((part) => Number.parseInt(part, 10));
|
|
2491
|
-
const nb = b.split(".").map((part) => Number.parseInt(part, 10));
|
|
2492
|
-
if (na.some(Number.isNaN) || nb.some(Number.isNaN)) return void 0;
|
|
2493
|
-
for (let index = 0; index < Math.max(na.length, nb.length); index += 1) {
|
|
2494
|
-
const left = na[index] ?? 0;
|
|
2495
|
-
const right = nb[index] ?? 0;
|
|
2496
|
-
if (left !== right) return left > right ? 1 : -1;
|
|
2497
|
-
}
|
|
2498
|
-
return 0;
|
|
2499
|
-
}
|
|
2500
3912
|
//#endregion
|
|
2501
3913
|
//#region ../shared/dist/host/adapter-types.js
|
|
2502
3914
|
function scopeOf$2(pkg) {
|
|
@@ -3018,6 +4430,7 @@ function withDefaultAdapterSet(defaults, loaded) {
|
|
|
3018
4430
|
id: set.id ?? defaults.id,
|
|
3019
4431
|
version: set.version ?? defaults.version,
|
|
3020
4432
|
data: set.data ?? defaults.data,
|
|
4433
|
+
libs: set.libs ?? defaults.libs,
|
|
3021
4434
|
supply: set.supply ?? defaults.supply,
|
|
3022
4435
|
modules: set.modules ?? defaults.modules,
|
|
3023
4436
|
profile: set.profile ?? defaults.profile,
|
|
@@ -3051,57 +4464,14 @@ async function resolveAdapterSet(ctx, spec, makeDefaults) {
|
|
|
3051
4464
|
}
|
|
3052
4465
|
//#endregion
|
|
3053
4466
|
//#region ../shared/dist/host/version-range.js
|
|
3054
|
-
function readable(version) {
|
|
3055
|
-
return compareVersions(version, "0.0.0") !== void 0;
|
|
3056
|
-
}
|
|
3057
|
-
function segmentsOf(version) {
|
|
3058
|
-
if (!readable(version)) return void 0;
|
|
3059
|
-
return version.split(".").map((part) => Number.parseInt(part, 10));
|
|
3060
|
-
}
|
|
3061
|
-
function caretUpper(base) {
|
|
3062
|
-
const [major = 0, minor = 0, patch = 0] = base;
|
|
3063
|
-
if (major > 0) return `${major + 1}.0.0`;
|
|
3064
|
-
return minor > 0 ? `0.${minor + 1}.0` : `0.0.${patch + 1}`;
|
|
3065
|
-
}
|
|
3066
|
-
function tildeUpper(base) {
|
|
3067
|
-
const [major = 0, minor = 0] = base;
|
|
3068
|
-
return `${major}.${minor + 1}.0`;
|
|
3069
|
-
}
|
|
3070
|
-
function comparator(token, version) {
|
|
3071
|
-
const match = /^(>=|<=|>|<|=|\^|~)?\s*(.+)$/.exec(token.trim());
|
|
3072
|
-
if (match === null) return void 0;
|
|
3073
|
-
const [, operator = "", raw = ""] = match;
|
|
3074
|
-
const base = segmentsOf(raw.trim());
|
|
3075
|
-
if (base === void 0) return void 0;
|
|
3076
|
-
const at = (other) => compareVersions(version, other);
|
|
3077
|
-
switch (operator) {
|
|
3078
|
-
case "^": return (at(raw) ?? -1) >= 0 && (at(caretUpper(base)) ?? 1) < 0;
|
|
3079
|
-
case "~": return (at(raw) ?? -1) >= 0 && (at(tildeUpper(base)) ?? 1) < 0;
|
|
3080
|
-
}
|
|
3081
|
-
const compared = at(raw.trim());
|
|
3082
|
-
if (compared === void 0) return void 0;
|
|
3083
|
-
switch (operator) {
|
|
3084
|
-
case ">=": return compared >= 0;
|
|
3085
|
-
case "<=": return compared <= 0;
|
|
3086
|
-
case ">": return compared > 0;
|
|
3087
|
-
case "<": return compared < 0;
|
|
3088
|
-
case "=":
|
|
3089
|
-
case "": return compared === 0;
|
|
3090
|
-
default: return;
|
|
3091
|
-
}
|
|
3092
|
-
}
|
|
3093
4467
|
function checkVersionRange(contract, version) {
|
|
3094
4468
|
const spec = contract?.trim() ?? "";
|
|
3095
4469
|
if (spec === "") return "satisfied";
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
if (verdict === void 0) return "malformed";
|
|
3102
|
-
if (!verdict) return "unsatisfied";
|
|
3103
|
-
}
|
|
3104
|
-
return "satisfied";
|
|
4470
|
+
const range = import_semver.default.validRange(spec);
|
|
4471
|
+
if (range === null) return "malformed";
|
|
4472
|
+
const parsed = import_semver.default.coerce(version);
|
|
4473
|
+
if (parsed === null) return "malformed";
|
|
4474
|
+
return import_semver.default.satisfies(parsed, range) ? "satisfied" : "unsatisfied";
|
|
3105
4475
|
}
|
|
3106
4476
|
var MARKET_DISCOVER_ROUTE = "panels/market-discover";
|
|
3107
4477
|
var MARKET_DOC_ROUTE = "panels/market-doc";
|
|
@@ -3143,7 +4513,6 @@ var MARKET_INDEX_README_LINES = [
|
|
|
3143
4513
|
"在工作台的「模块市场 → 发现」里添加本仓库地址,即可浏览与安装。",
|
|
3144
4514
|
""
|
|
3145
4515
|
];
|
|
3146
|
-
var SEMVER$2 = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+([0-9A-Za-z.-]+))?$/;
|
|
3147
4516
|
var NPM_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
3148
4517
|
var GIT_COMMIT = /^[0-9a-f]{40}$/;
|
|
3149
4518
|
var MAX_ICON_CHARS = 32768;
|
|
@@ -3174,37 +4543,7 @@ function problem(kind, detail, at) {
|
|
|
3174
4543
|
};
|
|
3175
4544
|
}
|
|
3176
4545
|
function compareSemver(left, right) {
|
|
3177
|
-
|
|
3178
|
-
const b = SEMVER$2.exec(right);
|
|
3179
|
-
if (a === null || b === null) return void 0;
|
|
3180
|
-
for (let index = 1; index <= 3; index += 1) {
|
|
3181
|
-
const diff = Number(a[index]) - Number(b[index]);
|
|
3182
|
-
if (diff !== 0) return diff > 0 ? 1 : -1;
|
|
3183
|
-
}
|
|
3184
|
-
const preA = a[4];
|
|
3185
|
-
const preB = b[4];
|
|
3186
|
-
if (preA === void 0 && preB === void 0) return 0;
|
|
3187
|
-
if (preA === void 0) return 1;
|
|
3188
|
-
if (preB === void 0) return -1;
|
|
3189
|
-
const leftParts = preA.split(".");
|
|
3190
|
-
const rightParts = preB.split(".");
|
|
3191
|
-
for (let index = 0; index < Math.max(leftParts.length, rightParts.length); index += 1) {
|
|
3192
|
-
const one = leftParts[index];
|
|
3193
|
-
const other = rightParts[index];
|
|
3194
|
-
if (one === void 0) return -1;
|
|
3195
|
-
if (other === void 0) return 1;
|
|
3196
|
-
const oneNumber = /^\d+$/.test(one);
|
|
3197
|
-
const otherNumber = /^\d+$/.test(other);
|
|
3198
|
-
if (oneNumber && otherNumber) {
|
|
3199
|
-
const diff = Number(one) - Number(other);
|
|
3200
|
-
if (diff !== 0) return diff > 0 ? 1 : -1;
|
|
3201
|
-
continue;
|
|
3202
|
-
}
|
|
3203
|
-
if (oneNumber) return -1;
|
|
3204
|
-
if (otherNumber) return 1;
|
|
3205
|
-
if (one !== other) return one > other ? 1 : -1;
|
|
3206
|
-
}
|
|
3207
|
-
return 0;
|
|
4546
|
+
return compareVersions(left, right);
|
|
3208
4547
|
}
|
|
3209
4548
|
function sourceOf(raw, at) {
|
|
3210
4549
|
const record = asRecord$3(raw);
|
|
@@ -3236,7 +4575,7 @@ function versionOf(raw, at) {
|
|
|
3236
4575
|
const record = asRecord$3(raw);
|
|
3237
4576
|
if (record === void 0) return problem("version", "版本必须是一个对象", at);
|
|
3238
4577
|
const version = asText$3(record["version"]);
|
|
3239
|
-
if (!
|
|
4578
|
+
if (!isValidVersion(version)) return problem("version", `版本号不是合法 SemVer:${JSON.stringify(version)}`, at);
|
|
3240
4579
|
const source = sourceOf(record["source"], `${at}.source`);
|
|
3241
4580
|
if ("kind" in source) return source;
|
|
3242
4581
|
const timestamp = record["publishTimestamp"];
|
|
@@ -3697,6 +5036,7 @@ var holdLog = /* @__PURE__ */ new Map();
|
|
|
3697
5036
|
async function latestIfReleaseReady(supply, input) {
|
|
3698
5037
|
const missing = await supply.missingReleaseParts({
|
|
3699
5038
|
shell: input.shell,
|
|
5039
|
+
name: input.pkg,
|
|
3700
5040
|
registry: input.registry,
|
|
3701
5041
|
version: input.version,
|
|
3702
5042
|
force: input.force
|
|
@@ -4398,10 +5738,11 @@ function stopVerdict(call, runs) {
|
|
|
4398
5738
|
function publishVerdict(call, preview) {
|
|
4399
5739
|
const raw = argsOf$1(call);
|
|
4400
5740
|
if (raw["verify"] === true || raw["target"] === "local") return { kind: "allow" };
|
|
5741
|
+
const refresh = raw["refresh"] === true;
|
|
4401
5742
|
const unit = textOf$3(raw, "unit");
|
|
4402
5743
|
const found = unit === "" ? null : preview?.(unit) ?? null;
|
|
4403
5744
|
const asked = textOf$3(raw, "target");
|
|
4404
|
-
const target = asked === "" ? found?.market === void 0 ? found?.registry === void 0 ? "tarball" : "team" : "market" : asked;
|
|
5745
|
+
const target = refresh ? "market" : asked === "" ? found?.market === void 0 ? found?.registry === void 0 ? "tarball" : "team" : "market" : asked;
|
|
4405
5746
|
const label = unit === "" ? "工作台模块" : `工作台模块 [${unit}]`;
|
|
4406
5747
|
const labelEn = unit === "" ? "the workbench module" : `the workbench module [${unit}]`;
|
|
4407
5748
|
const copies = {
|
|
@@ -4431,7 +5772,9 @@ function publishVerdict(call, preview) {
|
|
|
4431
5772
|
}
|
|
4432
5773
|
};
|
|
4433
5774
|
const copy = copies[target] ?? copies["team"];
|
|
4434
|
-
|
|
5775
|
+
const targetLabel = found === null ? target : target === "market" && found.market !== void 0 ? `${found.name}@${found.version} → market (${found.market.url})` : `${found.name}@${found.version} → ${target}${found.registry === void 0 ? "" : ` (${found.registry})`}`;
|
|
5776
|
+
const question = refresh ? pair(`只刷新${label}在市集里的元数据(标题 / 作者 / 说明),不升版本、不重发产物,允许吗?`, `Only refresh ${labelEn}'s market metadata (title, author, description); no version bump, no artifacts. Allow?`) : pair(copy.zh, copy.en);
|
|
5777
|
+
return askOf(`${DIY_PUBLISH_TOOL} ${targetLabel}${refresh ? "(元数据)" : ""}`, question, question);
|
|
4435
5778
|
}
|
|
4436
5779
|
var panelsApproval = (call) => {
|
|
4437
5780
|
if (call.name === "workbench_long_tasks_stop") return stopVerdict(call, void 0);
|
|
@@ -5452,10 +6795,10 @@ var OUTPUT$2 = {
|
|
|
5452
6795
|
},
|
|
5453
6796
|
unit: { type: "string" },
|
|
5454
6797
|
path: { type: "string" },
|
|
5455
|
-
install: {
|
|
6798
|
+
install: { oneOf: [{
|
|
5456
6799
|
type: "object",
|
|
5457
6800
|
additionalProperties: true
|
|
5458
|
-
},
|
|
6801
|
+
}, { type: "string" }] },
|
|
5459
6802
|
alreadyInstalled: { type: "boolean" },
|
|
5460
6803
|
panel: {
|
|
5461
6804
|
type: "object",
|
|
@@ -5706,7 +7049,6 @@ function writeChangelogEntry(dir, input) {
|
|
|
5706
7049
|
}
|
|
5707
7050
|
//#endregion
|
|
5708
7051
|
//#region src/modules/panels/model/diy-changelog.ts
|
|
5709
|
-
var SEMVER$1 = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
|
|
5710
7052
|
function toolOf(ctx) {
|
|
5711
7053
|
return {
|
|
5712
7054
|
name: DIY_CHANGELOG_TOOL,
|
|
@@ -5748,7 +7090,7 @@ function toolOf(ctx) {
|
|
|
5748
7090
|
const note = asText(args["note"]).trim();
|
|
5749
7091
|
if (note === "") throw new Error("要一句 note:这一版改了什么");
|
|
5750
7092
|
const version = (asText(args["version"]) || moduleVersionOf(found.dir)).replace(/^v/, "");
|
|
5751
|
-
if (!
|
|
7093
|
+
if (!isValidVersion(version)) throw new Error(`版本要写成 x.y.z(收到「${version}」)—— 也可以不填,用 package.json 里的`);
|
|
5752
7094
|
const kind = asText(args["type"]) || "changed";
|
|
5753
7095
|
if (!CHANGELOG_KINDS.includes(kind)) throw new Error(`type 只认 ${CHANGELOG_KINDS.join(" / ")}(收到「${kind}」)`);
|
|
5754
7096
|
const written = writeChangelogEntry(found.dir, {
|
|
@@ -7534,6 +8876,10 @@ function renderStatus(root, lines, options = {}) {
|
|
|
7534
8876
|
});
|
|
7535
8877
|
return `${notice === void 0 ? `工作区:${root}` : `工作区:${root}\n${notice}`}\n${block.join("\n")}`;
|
|
7536
8878
|
}
|
|
8879
|
+
function publishStatusOf(preview) {
|
|
8880
|
+
if (preview === null) return "";
|
|
8881
|
+
return [preview.market === void 0 ? preview.registry === void 0 ? "发布出口:安装包(这个环境没配可写市场索引源,模块也没声明 publishConfig.registry)" : `发布出口:团队源 ${preview.registry}(package.json 的 publishConfig.registry)` : `发布出口:市场索引 ${preview.market.url}${preview.market.ref === void 0 ? "" : `(${preview.market.ref})`}—— 不填 target 时默认发这里;这一版会发 ${preview.market.nextVersion ?? preview.version}`, preview.changelog === void 0 ? void 0 : preview.changelog.missing ? `发布前置:CHANGELOG 还差 ${preview.changelog.version} 这一版 —— 先 workbench_diy_changelog(unit=…)` : `发布前置:CHANGELOG 里已有 ${preview.changelog.version}`].filter((one) => one !== void 0).join("\n");
|
|
8882
|
+
}
|
|
7537
8883
|
function renderList(root, modules, shape = "bare") {
|
|
7538
8884
|
if (modules.length === 0) return [
|
|
7539
8885
|
`这个工作区里没有模块源码(${root})—— ${shape === "workspace" ? "它声明了 workspace,但里面的包没有一个报 dsh.workbench.unit" : shape === "package" ? "它是一个包(有 package.json),但没声明 dsh.workbench.unit,也没声明 workspace" : "它没有 package.json(空项目 / 一堆散文件都算这一档)"};这条会话也还没装过任何模块。`,
|
|
@@ -7548,7 +8894,7 @@ function renderList(root, modules, shape = "bare") {
|
|
|
7548
8894
|
//#endregion
|
|
7549
8895
|
//#region src/modules/panels/model/diy-tools.ts
|
|
7550
8896
|
var PUBLISH_TIMEOUT_MS = 18e5;
|
|
7551
|
-
function registerDiyTools(ctx, market, panels, debug) {
|
|
8897
|
+
function registerDiyTools(ctx, market, panels, debug, previewOf = () => null) {
|
|
7552
8898
|
const supply = supplyPortOf(ctx);
|
|
7553
8899
|
const tools = ctx.get("tools");
|
|
7554
8900
|
if (tools === void 0) {
|
|
@@ -7589,10 +8935,13 @@ function registerDiyTools(ctx, market, panels, debug) {
|
|
|
7589
8935
|
installed: one.installed
|
|
7590
8936
|
})
|
|
7591
8937
|
}));
|
|
8938
|
+
const preview = wanted === "" ? null : previewOf(wanted);
|
|
8939
|
+
const text = [renderStatus(root, rows), publishStatusOf(preview)].filter((one) => one !== "").join("\n");
|
|
7592
8940
|
return plainJson({
|
|
7593
8941
|
workspace: root,
|
|
7594
8942
|
status: rows,
|
|
7595
|
-
|
|
8943
|
+
...preview === null ? {} : { publish: preview },
|
|
8944
|
+
text
|
|
7596
8945
|
});
|
|
7597
8946
|
}
|
|
7598
8947
|
};
|
|
@@ -7786,7 +9135,7 @@ function registerDiyTools(ctx, market, panels, debug) {
|
|
|
7786
9135
|
};
|
|
7787
9136
|
const publishTool = {
|
|
7788
9137
|
name: DIY_PUBLISH_TOOL,
|
|
7789
|
-
description: "
|
|
9138
|
+
description: "用户说“发布”后才用:把这一格发到 target 指定的出口(不填按环境默认)。",
|
|
7790
9139
|
parameters: {
|
|
7791
9140
|
type: "object",
|
|
7792
9141
|
properties: {
|
|
@@ -7821,6 +9170,10 @@ function registerDiyTools(ctx, market, panels, debug) {
|
|
|
7821
9170
|
license: {
|
|
7822
9171
|
type: "string",
|
|
7823
9172
|
description: "公开发布用的许可证(MIT / Apache-2.0 / 仓库已有 LICENSE)。"
|
|
9173
|
+
},
|
|
9174
|
+
refresh: {
|
|
9175
|
+
type: "boolean",
|
|
9176
|
+
description: "只刷市集元数据(标题/作者/说明),不升版本、不重发产物。"
|
|
7824
9177
|
}
|
|
7825
9178
|
},
|
|
7826
9179
|
required: ["unit"],
|
|
@@ -7852,6 +9205,7 @@ function registerDiyTools(ctx, market, panels, debug) {
|
|
|
7852
9205
|
if (target !== "") argv.push("--target", target);
|
|
7853
9206
|
if (version !== "") argv.push("--version", version);
|
|
7854
9207
|
if (license !== "") argv.push("--license", license);
|
|
9208
|
+
if (asRecord$1(raw)["refresh"] === true) argv.push("--refresh");
|
|
7855
9209
|
const result = await runShell(shell, argv.map((one) => quoteShellArg(one)).join(" "), {
|
|
7856
9210
|
workdir: root,
|
|
7857
9211
|
timeoutMs: PUBLISH_TIMEOUT_MS
|
|
@@ -7892,7 +9246,7 @@ function registerDiyTools(ctx, market, panels, debug) {
|
|
|
7892
9246
|
`已核过 ${name}@${released}`,
|
|
7893
9247
|
`安装:${install}`,
|
|
7894
9248
|
"没有重新发布。"
|
|
7895
|
-
].join("\n") : targetOfPayload === "tarball" ? [
|
|
9249
|
+
].join("\n") : payload["refresh"] === true ? [payload["refreshed"] === true ? `已刷新 ${name} 的市集元数据(版本 ${released} 不变)` : `${name} 的市集元数据本来就是这样,没动`, `市场索引:${asText(asRecord$1(payload["market"])["url"])}`].join("\n") : targetOfPayload === "tarball" ? [
|
|
7896
9250
|
`安装包在 ${file}`,
|
|
7897
9251
|
`本机装:${install}`,
|
|
7898
9252
|
"文件可以从对话里带走,发给同事。"
|
|
@@ -8023,14 +9377,26 @@ function publishPreviewOf(root, unit, options = {}) {
|
|
|
8023
9377
|
const registry = typeof publishConfig === "object" && publishConfig !== null ? publishConfig["registry"] : void 0;
|
|
8024
9378
|
const market = marketOf(found.unit, found.dir, name, version);
|
|
8025
9379
|
const target = targetVersionOf(version, (options.version ?? "").trim(), market);
|
|
9380
|
+
const author = authorOf(record);
|
|
8026
9381
|
return {
|
|
8027
9382
|
name,
|
|
8028
9383
|
version,
|
|
9384
|
+
...author === "" ? {} : { author },
|
|
8029
9385
|
...typeof registry === "string" && registry !== "" ? { registry } : {},
|
|
8030
9386
|
...market === void 0 ? {} : { market },
|
|
8031
9387
|
changelog: changelogOf(found.dir, target)
|
|
8032
9388
|
};
|
|
8033
9389
|
}
|
|
9390
|
+
function authorOf(manifest) {
|
|
9391
|
+
const author = manifest["author"];
|
|
9392
|
+
if (typeof author === "string") return author.trim();
|
|
9393
|
+
if (author === null || typeof author !== "object") return "";
|
|
9394
|
+
const record = author;
|
|
9395
|
+
const name = typeof record["name"] === "string" ? record["name"].trim() : "";
|
|
9396
|
+
if (name === "") return "";
|
|
9397
|
+
const email = typeof record["email"] === "string" ? record["email"].trim() : "";
|
|
9398
|
+
return email === "" ? name : `${name} <${email}>`;
|
|
9399
|
+
}
|
|
8034
9400
|
function targetVersionOf(version, asked, market) {
|
|
8035
9401
|
if (asked === "") return market?.nextVersion ?? version;
|
|
8036
9402
|
if (/^(major|minor|patch)$/.test(asked)) return bumped(version, asked) ?? version;
|
|
@@ -10174,6 +11540,7 @@ async function updateWorkbenchOnce(deps) {
|
|
|
10174
11540
|
if (shell !== void 0 && registry !== void 0 && askedLatest !== void 0) {
|
|
10175
11541
|
const missing = await supply.missingReleaseParts({
|
|
10176
11542
|
shell,
|
|
11543
|
+
name: read.pkg,
|
|
10177
11544
|
registry,
|
|
10178
11545
|
version: askedLatest,
|
|
10179
11546
|
force: true
|
|
@@ -11511,11 +12878,18 @@ function createMarketDocReader(options) {
|
|
|
11511
12878
|
const directory = (git.path ?? "").replace(/^\/+|\/+$/g, "");
|
|
11512
12879
|
const file = directory === "" ? FILES[kind] : `${directory}/${FILES[kind]}`;
|
|
11513
12880
|
const repo = join(options.root, "market-index", marketSourceKey(source), "repo.git");
|
|
12881
|
+
const show = () => runShell(shell, `git -C ${quoteShellArg(repo)} show ${git.commit}:${quoteShellArg(file)}`, { timeoutMs });
|
|
12882
|
+
const hasCommit = async () => {
|
|
12883
|
+
return (await runShell(shell, `git -C ${quoteShellArg(repo)} cat-file -e ${quoteShellArg(`${git.commit}^{commit}`)}`, { timeoutMs })).exitCode === 0;
|
|
12884
|
+
};
|
|
11514
12885
|
try {
|
|
11515
|
-
|
|
12886
|
+
let result = await show();
|
|
12887
|
+
if (result.exitCode !== 0 && !await hasCommit()) {
|
|
12888
|
+
if ((await runShell(shell, `git -C ${quoteShellArg(repo)} fetch --depth 1 origin ${git.commit}`, { timeoutMs })).exitCode === 0) result = await show();
|
|
12889
|
+
}
|
|
11516
12890
|
if (result.exitCode !== 0) {
|
|
11517
12891
|
const text = result.stderr.trim();
|
|
11518
|
-
return
|
|
12892
|
+
return missingText(text) ? fail(kind, target.version, "missing") : fail(kind, target.version, "unavailable", text);
|
|
11519
12893
|
}
|
|
11520
12894
|
return remember(key, {
|
|
11521
12895
|
ok: true,
|
|
@@ -13013,7 +14387,7 @@ var OWNED = [{
|
|
|
13013
14387
|
registerTools: () => [
|
|
13014
14388
|
...registerPanelTools(ctx, panels, values),
|
|
13015
14389
|
...registerMarketTools(ctx, market),
|
|
13016
|
-
...registerDiyTools(ctx, market, panels, debug),
|
|
14390
|
+
...registerDiyTools(ctx, market, panels, debug, (unit) => publishPreviewOf(workshopPathOf(ctx), unit)),
|
|
13017
14391
|
...registerRecordTools(ctx, record),
|
|
13018
14392
|
...registerLongTaskTools(ctx, longTaskRuns)
|
|
13019
14393
|
],
|
|
@@ -13261,6 +14635,11 @@ function collectWarmReads(mounted) {
|
|
|
13261
14635
|
return reads;
|
|
13262
14636
|
};
|
|
13263
14637
|
}
|
|
14638
|
+
function declaredEnvOf(manifest) {
|
|
14639
|
+
const out = {};
|
|
14640
|
+
for (const need of manifest.needs ?? []) if (need.kind === "env") out[need.name] = process.env[need.name];
|
|
14641
|
+
return out;
|
|
14642
|
+
}
|
|
13264
14643
|
function mountUnits(units, deps) {
|
|
13265
14644
|
const store = deps.store ?? createWorkspaceStore({ root: null });
|
|
13266
14645
|
const missingData = async () => ({
|
|
@@ -13319,6 +14698,10 @@ function mountUnits(units, deps) {
|
|
|
13319
14698
|
ownedUnits,
|
|
13320
14699
|
...deps.installable === void 0 ? {} : { installable: deps.installable },
|
|
13321
14700
|
data,
|
|
14701
|
+
env: declaredEnvOf(host.manifest),
|
|
14702
|
+
...deps.libs === void 0 ? {} : { libs: deps.libs },
|
|
14703
|
+
...deps.git === void 0 ? {} : { git: deps.git },
|
|
14704
|
+
...deps.commands === void 0 ? {} : { commands: deps.commands },
|
|
13322
14705
|
...deps.probe === void 0 ? {} : { probe: deps.probe },
|
|
13323
14706
|
...deps.values === void 0 ? {} : { values: deps.values },
|
|
13324
14707
|
...longTasks === void 0 ? {} : { longTasks: longTasks.host },
|
|
@@ -14355,6 +15738,9 @@ async function apply(ctx, config) {
|
|
|
14355
15738
|
installable: () => installableUnitsOf(units),
|
|
14356
15739
|
store,
|
|
14357
15740
|
data: adapters.data,
|
|
15741
|
+
libs: adapters.libs,
|
|
15742
|
+
git: adapters.git,
|
|
15743
|
+
commands: adapters.commands,
|
|
14358
15744
|
probe: (unit, options) => probeOne(unit, options?.force ?? false),
|
|
14359
15745
|
values,
|
|
14360
15746
|
longTasks: {
|