@socketsecurity/lib 5.19.0 → 5.19.1
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/CHANGELOG.md +14 -0
- package/dist/constants/socket.js +1 -1
- package/dist/external/@inquirer/checkbox.js +5 -0
- package/dist/external/@inquirer/confirm.js +5 -0
- package/dist/external/@inquirer/input.js +5 -0
- package/dist/external/@inquirer/password.js +5 -0
- package/dist/external/@inquirer/search.js +5 -0
- package/dist/external/@inquirer/select.js +5 -0
- package/dist/external/@npmcli/package-json.js +3968 -9
- package/dist/external/debug.js +328 -162
- package/dist/external/external-pack.js +2749 -28
- package/dist/external/npm-pack.js +44319 -24912
- package/dist/external/zod.js +7558 -160
- package/dist/stdio/clear.d.ts +163 -0
- package/dist/stdio/clear.js +96 -0
- package/dist/stdio/progress.d.ts +152 -0
- package/dist/stdio/progress.js +217 -0
- package/dist/stdio/prompts.d.ts +196 -0
- package/dist/stdio/prompts.js +177 -0
- package/package.json +20 -2
|
@@ -10067,11 +10067,3970 @@ var require_normalize_data = __commonJS({
|
|
|
10067
10067
|
}
|
|
10068
10068
|
});
|
|
10069
10069
|
|
|
10070
|
-
//
|
|
10071
|
-
var
|
|
10072
|
-
"
|
|
10070
|
+
// node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js
|
|
10071
|
+
var require_posix = __commonJS({
|
|
10072
|
+
"node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js"(exports2) {
|
|
10073
10073
|
"use strict";
|
|
10074
|
-
|
|
10074
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10075
|
+
exports2.sync = exports2.isexe = void 0;
|
|
10076
|
+
var fs_1 = require("fs");
|
|
10077
|
+
var promises_1 = require("fs/promises");
|
|
10078
|
+
var isexe = /* @__PURE__ */ __name(async (path, options = {}) => {
|
|
10079
|
+
const { ignoreErrors = false } = options;
|
|
10080
|
+
try {
|
|
10081
|
+
return checkStat(await (0, promises_1.stat)(path), options);
|
|
10082
|
+
} catch (e) {
|
|
10083
|
+
const er = e;
|
|
10084
|
+
if (ignoreErrors || er.code === "EACCES")
|
|
10085
|
+
return false;
|
|
10086
|
+
throw er;
|
|
10087
|
+
}
|
|
10088
|
+
}, "isexe");
|
|
10089
|
+
exports2.isexe = isexe;
|
|
10090
|
+
var sync = /* @__PURE__ */ __name((path, options = {}) => {
|
|
10091
|
+
const { ignoreErrors = false } = options;
|
|
10092
|
+
try {
|
|
10093
|
+
return checkStat((0, fs_1.statSync)(path), options);
|
|
10094
|
+
} catch (e) {
|
|
10095
|
+
const er = e;
|
|
10096
|
+
if (ignoreErrors || er.code === "EACCES")
|
|
10097
|
+
return false;
|
|
10098
|
+
throw er;
|
|
10099
|
+
}
|
|
10100
|
+
}, "sync");
|
|
10101
|
+
exports2.sync = sync;
|
|
10102
|
+
var checkStat = /* @__PURE__ */ __name((stat, options) => stat.isFile() && checkMode(stat, options), "checkStat");
|
|
10103
|
+
var checkMode = /* @__PURE__ */ __name((stat, options) => {
|
|
10104
|
+
const myUid = options.uid ?? process.getuid?.();
|
|
10105
|
+
const myGroups = options.groups ?? process.getgroups?.() ?? [];
|
|
10106
|
+
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
|
|
10107
|
+
if (myUid === void 0 || myGid === void 0) {
|
|
10108
|
+
throw new Error("cannot get uid or gid");
|
|
10109
|
+
}
|
|
10110
|
+
const groups = /* @__PURE__ */ new Set([myGid, ...myGroups]);
|
|
10111
|
+
const mod = stat.mode;
|
|
10112
|
+
const uid = stat.uid;
|
|
10113
|
+
const gid = stat.gid;
|
|
10114
|
+
const u = parseInt("100", 8);
|
|
10115
|
+
const g = parseInt("010", 8);
|
|
10116
|
+
const o = parseInt("001", 8);
|
|
10117
|
+
const ug = u | g;
|
|
10118
|
+
return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0);
|
|
10119
|
+
}, "checkMode");
|
|
10120
|
+
}
|
|
10121
|
+
});
|
|
10122
|
+
|
|
10123
|
+
// node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/win32.js
|
|
10124
|
+
var require_win32 = __commonJS({
|
|
10125
|
+
"node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/win32.js"(exports2) {
|
|
10126
|
+
"use strict";
|
|
10127
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10128
|
+
exports2.sync = exports2.isexe = void 0;
|
|
10129
|
+
var fs_1 = require("fs");
|
|
10130
|
+
var promises_1 = require("fs/promises");
|
|
10131
|
+
var isexe = /* @__PURE__ */ __name(async (path, options = {}) => {
|
|
10132
|
+
const { ignoreErrors = false } = options;
|
|
10133
|
+
try {
|
|
10134
|
+
return checkStat(await (0, promises_1.stat)(path), path, options);
|
|
10135
|
+
} catch (e) {
|
|
10136
|
+
const er = e;
|
|
10137
|
+
if (ignoreErrors || er.code === "EACCES")
|
|
10138
|
+
return false;
|
|
10139
|
+
throw er;
|
|
10140
|
+
}
|
|
10141
|
+
}, "isexe");
|
|
10142
|
+
exports2.isexe = isexe;
|
|
10143
|
+
var sync = /* @__PURE__ */ __name((path, options = {}) => {
|
|
10144
|
+
const { ignoreErrors = false } = options;
|
|
10145
|
+
try {
|
|
10146
|
+
return checkStat((0, fs_1.statSync)(path), path, options);
|
|
10147
|
+
} catch (e) {
|
|
10148
|
+
const er = e;
|
|
10149
|
+
if (ignoreErrors || er.code === "EACCES")
|
|
10150
|
+
return false;
|
|
10151
|
+
throw er;
|
|
10152
|
+
}
|
|
10153
|
+
}, "sync");
|
|
10154
|
+
exports2.sync = sync;
|
|
10155
|
+
var checkPathExt = /* @__PURE__ */ __name((path, options) => {
|
|
10156
|
+
const { pathExt = process.env.PATHEXT || "" } = options;
|
|
10157
|
+
const peSplit = pathExt.split(";");
|
|
10158
|
+
if (peSplit.indexOf("") !== -1) {
|
|
10159
|
+
return true;
|
|
10160
|
+
}
|
|
10161
|
+
for (let i = 0; i < peSplit.length; i++) {
|
|
10162
|
+
const p = peSplit[i].toLowerCase();
|
|
10163
|
+
const ext = path.substring(path.length - p.length).toLowerCase();
|
|
10164
|
+
if (p && ext === p) {
|
|
10165
|
+
return true;
|
|
10166
|
+
}
|
|
10167
|
+
}
|
|
10168
|
+
return false;
|
|
10169
|
+
}, "checkPathExt");
|
|
10170
|
+
var checkStat = /* @__PURE__ */ __name((stat, path, options) => stat.isFile() && checkPathExt(path, options), "checkStat");
|
|
10171
|
+
}
|
|
10172
|
+
});
|
|
10173
|
+
|
|
10174
|
+
// node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/options.js
|
|
10175
|
+
var require_options = __commonJS({
|
|
10176
|
+
"node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/options.js"(exports2) {
|
|
10177
|
+
"use strict";
|
|
10178
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10179
|
+
}
|
|
10180
|
+
});
|
|
10181
|
+
|
|
10182
|
+
// node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/index.js
|
|
10183
|
+
var require_cjs = __commonJS({
|
|
10184
|
+
"node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/index.js"(exports2) {
|
|
10185
|
+
"use strict";
|
|
10186
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
10187
|
+
if (k2 === void 0) k2 = k;
|
|
10188
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10189
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10190
|
+
desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
10191
|
+
return m[k];
|
|
10192
|
+
}, "get") };
|
|
10193
|
+
}
|
|
10194
|
+
Object.defineProperty(o, k2, desc);
|
|
10195
|
+
}) : (function(o, m, k, k2) {
|
|
10196
|
+
if (k2 === void 0) k2 = k;
|
|
10197
|
+
o[k2] = m[k];
|
|
10198
|
+
}));
|
|
10199
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
10200
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
10201
|
+
}) : function(o, v) {
|
|
10202
|
+
o["default"] = v;
|
|
10203
|
+
});
|
|
10204
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
10205
|
+
if (mod && mod.__esModule) return mod;
|
|
10206
|
+
var result = {};
|
|
10207
|
+
if (mod != null) {
|
|
10208
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
10209
|
+
}
|
|
10210
|
+
__setModuleDefault(result, mod);
|
|
10211
|
+
return result;
|
|
10212
|
+
};
|
|
10213
|
+
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
10214
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
10215
|
+
};
|
|
10216
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10217
|
+
exports2.sync = exports2.isexe = exports2.posix = exports2.win32 = void 0;
|
|
10218
|
+
var posix = __importStar(require_posix());
|
|
10219
|
+
exports2.posix = posix;
|
|
10220
|
+
var win32 = __importStar(require_win32());
|
|
10221
|
+
exports2.win32 = win32;
|
|
10222
|
+
__exportStar(require_options(), exports2);
|
|
10223
|
+
var platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
|
|
10224
|
+
var impl = platform === "win32" ? win32 : posix;
|
|
10225
|
+
exports2.isexe = impl.isexe;
|
|
10226
|
+
exports2.sync = impl.sync;
|
|
10227
|
+
}
|
|
10228
|
+
});
|
|
10229
|
+
|
|
10230
|
+
// node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js
|
|
10231
|
+
var require_lib4 = __commonJS({
|
|
10232
|
+
"node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js"(exports2, module2) {
|
|
10233
|
+
var { isexe, sync: isexeSync } = require_cjs();
|
|
10234
|
+
var { join, delimiter, sep, posix } = require("path");
|
|
10235
|
+
var isWindows = process.platform === "win32";
|
|
10236
|
+
var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
|
|
10237
|
+
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
10238
|
+
var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
|
|
10239
|
+
var getPathInfo = /* @__PURE__ */ __name((cmd, {
|
|
10240
|
+
path: optPath = process.env.PATH,
|
|
10241
|
+
pathExt: optPathExt = process.env.PATHEXT,
|
|
10242
|
+
delimiter: optDelimiter = delimiter
|
|
10243
|
+
}) => {
|
|
10244
|
+
const pathEnv = cmd.match(rSlash) ? [""] : [
|
|
10245
|
+
// windows always checks the cwd first
|
|
10246
|
+
...isWindows ? [process.cwd()] : [],
|
|
10247
|
+
...(optPath || /* istanbul ignore next: very unusual */
|
|
10248
|
+
"").split(optDelimiter)
|
|
10249
|
+
];
|
|
10250
|
+
if (isWindows) {
|
|
10251
|
+
const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
|
|
10252
|
+
const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
|
|
10253
|
+
if (cmd.includes(".") && pathExt[0] !== "") {
|
|
10254
|
+
pathExt.unshift("");
|
|
10255
|
+
}
|
|
10256
|
+
return { pathEnv, pathExt, pathExtExe };
|
|
10257
|
+
}
|
|
10258
|
+
return { pathEnv, pathExt: [""] };
|
|
10259
|
+
}, "getPathInfo");
|
|
10260
|
+
var getPathPart = /* @__PURE__ */ __name((raw, cmd) => {
|
|
10261
|
+
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
10262
|
+
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
10263
|
+
return prefix + join(pathPart, cmd);
|
|
10264
|
+
}, "getPathPart");
|
|
10265
|
+
var which = /* @__PURE__ */ __name(async (cmd, opt = {}) => {
|
|
10266
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
10267
|
+
const found = [];
|
|
10268
|
+
for (const envPart of pathEnv) {
|
|
10269
|
+
const p = getPathPart(envPart, cmd);
|
|
10270
|
+
for (const ext of pathExt) {
|
|
10271
|
+
const withExt = p + ext;
|
|
10272
|
+
const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
10273
|
+
if (is) {
|
|
10274
|
+
if (!opt.all) {
|
|
10275
|
+
return withExt;
|
|
10276
|
+
}
|
|
10277
|
+
found.push(withExt);
|
|
10278
|
+
}
|
|
10279
|
+
}
|
|
10280
|
+
}
|
|
10281
|
+
if (opt.all && found.length) {
|
|
10282
|
+
return found;
|
|
10283
|
+
}
|
|
10284
|
+
if (opt.nothrow) {
|
|
10285
|
+
return null;
|
|
10286
|
+
}
|
|
10287
|
+
throw getNotFoundError(cmd);
|
|
10288
|
+
}, "which");
|
|
10289
|
+
var whichSync = /* @__PURE__ */ __name((cmd, opt = {}) => {
|
|
10290
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
10291
|
+
const found = [];
|
|
10292
|
+
for (const pathEnvPart of pathEnv) {
|
|
10293
|
+
const p = getPathPart(pathEnvPart, cmd);
|
|
10294
|
+
for (const ext of pathExt) {
|
|
10295
|
+
const withExt = p + ext;
|
|
10296
|
+
const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
10297
|
+
if (is) {
|
|
10298
|
+
if (!opt.all) {
|
|
10299
|
+
return withExt;
|
|
10300
|
+
}
|
|
10301
|
+
found.push(withExt);
|
|
10302
|
+
}
|
|
10303
|
+
}
|
|
10304
|
+
}
|
|
10305
|
+
if (opt.all && found.length) {
|
|
10306
|
+
return found;
|
|
10307
|
+
}
|
|
10308
|
+
if (opt.nothrow) {
|
|
10309
|
+
return null;
|
|
10310
|
+
}
|
|
10311
|
+
throw getNotFoundError(cmd);
|
|
10312
|
+
}, "whichSync");
|
|
10313
|
+
module2.exports = which;
|
|
10314
|
+
which.sync = whichSync;
|
|
10315
|
+
}
|
|
10316
|
+
});
|
|
10317
|
+
|
|
10318
|
+
// node_modules/.pnpm/@npmcli+promise-spawn@9.0.1/node_modules/@npmcli/promise-spawn/lib/escape.js
|
|
10319
|
+
var require_escape2 = __commonJS({
|
|
10320
|
+
"node_modules/.pnpm/@npmcli+promise-spawn@9.0.1/node_modules/@npmcli/promise-spawn/lib/escape.js"(exports2, module2) {
|
|
10321
|
+
"use strict";
|
|
10322
|
+
var cmd = /* @__PURE__ */ __name((input, doubleEscape) => {
|
|
10323
|
+
if (!input.length) {
|
|
10324
|
+
return '""';
|
|
10325
|
+
}
|
|
10326
|
+
let result;
|
|
10327
|
+
if (!/[ \t\n\v"]/.test(input)) {
|
|
10328
|
+
result = input;
|
|
10329
|
+
} else {
|
|
10330
|
+
result = '"';
|
|
10331
|
+
for (let i = 0; i <= input.length; ++i) {
|
|
10332
|
+
let slashCount = 0;
|
|
10333
|
+
while (input[i] === "\\") {
|
|
10334
|
+
++i;
|
|
10335
|
+
++slashCount;
|
|
10336
|
+
}
|
|
10337
|
+
if (i === input.length) {
|
|
10338
|
+
result += "\\".repeat(slashCount * 2);
|
|
10339
|
+
break;
|
|
10340
|
+
}
|
|
10341
|
+
if (input[i] === '"') {
|
|
10342
|
+
result += "\\".repeat(slashCount * 2 + 1);
|
|
10343
|
+
result += input[i];
|
|
10344
|
+
} else {
|
|
10345
|
+
result += "\\".repeat(slashCount);
|
|
10346
|
+
result += input[i];
|
|
10347
|
+
}
|
|
10348
|
+
}
|
|
10349
|
+
result += '"';
|
|
10350
|
+
}
|
|
10351
|
+
result = result.replace(/[ !%^&()<>|"]/g, "^$&");
|
|
10352
|
+
if (doubleEscape) {
|
|
10353
|
+
result = result.replace(/[ !%^&()<>|"]/g, "^$&");
|
|
10354
|
+
}
|
|
10355
|
+
return result;
|
|
10356
|
+
}, "cmd");
|
|
10357
|
+
var sh = /* @__PURE__ */ __name((input) => {
|
|
10358
|
+
if (!input.length) {
|
|
10359
|
+
return `''`;
|
|
10360
|
+
}
|
|
10361
|
+
if (!/[\t\n\r "#$&'()*;<>?\\`|~]/.test(input)) {
|
|
10362
|
+
return input;
|
|
10363
|
+
}
|
|
10364
|
+
const result = `'${input.replace(/'/g, `'\\''`)}'`.replace(/^(?:'')+(?!$)/, "").replace(/\\'''/g, `\\'`);
|
|
10365
|
+
return result;
|
|
10366
|
+
}, "sh");
|
|
10367
|
+
module2.exports = {
|
|
10368
|
+
cmd,
|
|
10369
|
+
sh
|
|
10370
|
+
};
|
|
10371
|
+
}
|
|
10372
|
+
});
|
|
10373
|
+
|
|
10374
|
+
// node_modules/.pnpm/@npmcli+promise-spawn@9.0.1/node_modules/@npmcli/promise-spawn/lib/index.js
|
|
10375
|
+
var require_lib5 = __commonJS({
|
|
10376
|
+
"node_modules/.pnpm/@npmcli+promise-spawn@9.0.1/node_modules/@npmcli/promise-spawn/lib/index.js"(exports2, module2) {
|
|
10377
|
+
"use strict";
|
|
10378
|
+
var { spawn } = require("child_process");
|
|
10379
|
+
var os = require("os");
|
|
10380
|
+
var which = require_lib4();
|
|
10381
|
+
var escape = require_escape2();
|
|
10382
|
+
var promiseSpawn = /* @__PURE__ */ __name((cmd, args, opts = {}, extra = {}) => {
|
|
10383
|
+
if (opts.shell) {
|
|
10384
|
+
return spawnWithShell(cmd, args, opts, extra);
|
|
10385
|
+
}
|
|
10386
|
+
let resolve, reject;
|
|
10387
|
+
const promise = new Promise((_resolve, _reject) => {
|
|
10388
|
+
resolve = _resolve;
|
|
10389
|
+
reject = _reject;
|
|
10390
|
+
});
|
|
10391
|
+
const closeError = new Error("command failed");
|
|
10392
|
+
const stdout = [];
|
|
10393
|
+
const stderr = [];
|
|
10394
|
+
const getResult = /* @__PURE__ */ __name((result) => ({
|
|
10395
|
+
cmd,
|
|
10396
|
+
args,
|
|
10397
|
+
...result,
|
|
10398
|
+
...stdioResult(stdout, stderr, opts),
|
|
10399
|
+
...extra
|
|
10400
|
+
}), "getResult");
|
|
10401
|
+
const rejectWithOpts = /* @__PURE__ */ __name((er, erOpts) => {
|
|
10402
|
+
const resultError = getResult(erOpts);
|
|
10403
|
+
reject(Object.assign(er, resultError));
|
|
10404
|
+
}, "rejectWithOpts");
|
|
10405
|
+
const proc = spawn(cmd, args, opts);
|
|
10406
|
+
promise.stdin = proc.stdin;
|
|
10407
|
+
promise.process = proc;
|
|
10408
|
+
proc.on("error", rejectWithOpts);
|
|
10409
|
+
if (proc.stdout) {
|
|
10410
|
+
proc.stdout.on("data", (c) => stdout.push(c));
|
|
10411
|
+
proc.stdout.on("error", rejectWithOpts);
|
|
10412
|
+
}
|
|
10413
|
+
if (proc.stderr) {
|
|
10414
|
+
proc.stderr.on("data", (c) => stderr.push(c));
|
|
10415
|
+
proc.stderr.on("error", rejectWithOpts);
|
|
10416
|
+
}
|
|
10417
|
+
proc.on("close", (code, signal) => {
|
|
10418
|
+
if (code || signal) {
|
|
10419
|
+
rejectWithOpts(closeError, { code, signal });
|
|
10420
|
+
} else {
|
|
10421
|
+
resolve(getResult({ code, signal }));
|
|
10422
|
+
}
|
|
10423
|
+
});
|
|
10424
|
+
return promise;
|
|
10425
|
+
}, "promiseSpawn");
|
|
10426
|
+
var spawnWithShell = /* @__PURE__ */ __name((cmd, args, opts, extra) => {
|
|
10427
|
+
let command = opts.shell;
|
|
10428
|
+
if (command === true) {
|
|
10429
|
+
command = process.platform === "win32" ? process.env.ComSpec || "cmd.exe" : "sh";
|
|
10430
|
+
}
|
|
10431
|
+
const options = { ...opts, shell: false };
|
|
10432
|
+
const realArgs = [];
|
|
10433
|
+
let script = cmd;
|
|
10434
|
+
const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(command);
|
|
10435
|
+
if (isCmd) {
|
|
10436
|
+
let doubleEscape = false;
|
|
10437
|
+
let initialCmd = "";
|
|
10438
|
+
let insideQuotes = false;
|
|
10439
|
+
for (let i = 0; i < cmd.length; ++i) {
|
|
10440
|
+
const char = cmd.charAt(i);
|
|
10441
|
+
if (char === " " && !insideQuotes) {
|
|
10442
|
+
break;
|
|
10443
|
+
}
|
|
10444
|
+
initialCmd += char;
|
|
10445
|
+
if (char === '"' || char === "'") {
|
|
10446
|
+
insideQuotes = !insideQuotes;
|
|
10447
|
+
}
|
|
10448
|
+
}
|
|
10449
|
+
let pathToInitial;
|
|
10450
|
+
try {
|
|
10451
|
+
pathToInitial = which.sync(initialCmd, {
|
|
10452
|
+
path: options.env && findInObject(options.env, "PATH") || process.env.PATH,
|
|
10453
|
+
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
10454
|
+
}).toLowerCase();
|
|
10455
|
+
} catch (err) {
|
|
10456
|
+
pathToInitial = initialCmd.toLowerCase();
|
|
10457
|
+
}
|
|
10458
|
+
doubleEscape = pathToInitial.endsWith(".cmd") || pathToInitial.endsWith(".bat");
|
|
10459
|
+
for (const arg of args) {
|
|
10460
|
+
script += ` ${escape.cmd(arg, doubleEscape)}`;
|
|
10461
|
+
}
|
|
10462
|
+
realArgs.push("/d", "/s", "/c", script);
|
|
10463
|
+
options.windowsVerbatimArguments = true;
|
|
10464
|
+
} else {
|
|
10465
|
+
for (const arg of args) {
|
|
10466
|
+
script += ` ${escape.sh(arg)}`;
|
|
10467
|
+
}
|
|
10468
|
+
realArgs.push("-c", script);
|
|
10469
|
+
}
|
|
10470
|
+
return promiseSpawn(command, realArgs, options, extra);
|
|
10471
|
+
}, "spawnWithShell");
|
|
10472
|
+
var open = /* @__PURE__ */ __name((_args, opts = {}, extra = {}) => {
|
|
10473
|
+
const options = { ...opts, shell: true };
|
|
10474
|
+
const args = [].concat(_args);
|
|
10475
|
+
let platform = process.platform;
|
|
10476
|
+
if (platform === "linux" && os.release().toLowerCase().includes("microsoft")) {
|
|
10477
|
+
platform = "wsl";
|
|
10478
|
+
if (!process.env.BROWSER) {
|
|
10479
|
+
return Promise.reject(
|
|
10480
|
+
new Error("Set the BROWSER environment variable to your desired browser.")
|
|
10481
|
+
);
|
|
10482
|
+
}
|
|
10483
|
+
}
|
|
10484
|
+
let command = options.command;
|
|
10485
|
+
if (!command) {
|
|
10486
|
+
if (platform === "win32") {
|
|
10487
|
+
options.shell = process.env.ComSpec;
|
|
10488
|
+
command = 'start ""';
|
|
10489
|
+
} else if (platform === "wsl") {
|
|
10490
|
+
command = "sensible-browser";
|
|
10491
|
+
} else if (platform === "darwin") {
|
|
10492
|
+
command = "open";
|
|
10493
|
+
} else {
|
|
10494
|
+
command = "xdg-open";
|
|
10495
|
+
}
|
|
10496
|
+
}
|
|
10497
|
+
return spawnWithShell(command, args, options, extra);
|
|
10498
|
+
}, "open");
|
|
10499
|
+
promiseSpawn.open = open;
|
|
10500
|
+
var isPipe = /* @__PURE__ */ __name((stdio = "pipe", fd) => {
|
|
10501
|
+
if (stdio === "pipe" || stdio === null) {
|
|
10502
|
+
return true;
|
|
10503
|
+
}
|
|
10504
|
+
if (Array.isArray(stdio)) {
|
|
10505
|
+
return isPipe(stdio[fd], fd);
|
|
10506
|
+
}
|
|
10507
|
+
return false;
|
|
10508
|
+
}, "isPipe");
|
|
10509
|
+
var stdioResult = /* @__PURE__ */ __name((stdout, stderr, { stdioString = true, stdio }) => {
|
|
10510
|
+
const result = {
|
|
10511
|
+
stdout: null,
|
|
10512
|
+
stderr: null
|
|
10513
|
+
};
|
|
10514
|
+
if (isPipe(stdio, 1)) {
|
|
10515
|
+
result.stdout = Buffer.concat(stdout);
|
|
10516
|
+
if (stdioString) {
|
|
10517
|
+
result.stdout = result.stdout.toString().trim();
|
|
10518
|
+
}
|
|
10519
|
+
}
|
|
10520
|
+
if (isPipe(stdio, 2)) {
|
|
10521
|
+
result.stderr = Buffer.concat(stderr);
|
|
10522
|
+
if (stdioString) {
|
|
10523
|
+
result.stderr = result.stderr.toString().trim();
|
|
10524
|
+
}
|
|
10525
|
+
}
|
|
10526
|
+
return result;
|
|
10527
|
+
}, "stdioResult");
|
|
10528
|
+
var findInObject = /* @__PURE__ */ __name((obj, key) => {
|
|
10529
|
+
key = key.toLowerCase();
|
|
10530
|
+
for (const objKey of Object.keys(obj).sort()) {
|
|
10531
|
+
if (objKey.toLowerCase() === key) {
|
|
10532
|
+
return obj[objKey];
|
|
10533
|
+
}
|
|
10534
|
+
}
|
|
10535
|
+
}, "findInObject");
|
|
10536
|
+
module2.exports = promiseSpawn;
|
|
10537
|
+
}
|
|
10538
|
+
});
|
|
10539
|
+
|
|
10540
|
+
// node_modules/.pnpm/err-code@2.0.3/node_modules/err-code/index.js
|
|
10541
|
+
var require_err_code = __commonJS({
|
|
10542
|
+
"node_modules/.pnpm/err-code@2.0.3/node_modules/err-code/index.js"(exports2, module2) {
|
|
10543
|
+
"use strict";
|
|
10544
|
+
function assign(obj, props) {
|
|
10545
|
+
for (const key in props) {
|
|
10546
|
+
Object.defineProperty(obj, key, {
|
|
10547
|
+
value: props[key],
|
|
10548
|
+
enumerable: true,
|
|
10549
|
+
configurable: true
|
|
10550
|
+
});
|
|
10551
|
+
}
|
|
10552
|
+
return obj;
|
|
10553
|
+
}
|
|
10554
|
+
__name(assign, "assign");
|
|
10555
|
+
function createError(err, code, props) {
|
|
10556
|
+
if (!err || typeof err === "string") {
|
|
10557
|
+
throw new TypeError("Please pass an Error to err-code");
|
|
10558
|
+
}
|
|
10559
|
+
if (!props) {
|
|
10560
|
+
props = {};
|
|
10561
|
+
}
|
|
10562
|
+
if (typeof code === "object") {
|
|
10563
|
+
props = code;
|
|
10564
|
+
code = void 0;
|
|
10565
|
+
}
|
|
10566
|
+
if (code != null) {
|
|
10567
|
+
props.code = code;
|
|
10568
|
+
}
|
|
10569
|
+
try {
|
|
10570
|
+
return assign(err, props);
|
|
10571
|
+
} catch (_) {
|
|
10572
|
+
props.message = err.message;
|
|
10573
|
+
props.stack = err.stack;
|
|
10574
|
+
const ErrClass = /* @__PURE__ */ __name(function() {
|
|
10575
|
+
}, "ErrClass");
|
|
10576
|
+
ErrClass.prototype = Object.create(Object.getPrototypeOf(err));
|
|
10577
|
+
return assign(new ErrClass(), props);
|
|
10578
|
+
}
|
|
10579
|
+
}
|
|
10580
|
+
__name(createError, "createError");
|
|
10581
|
+
module2.exports = createError;
|
|
10582
|
+
}
|
|
10583
|
+
});
|
|
10584
|
+
|
|
10585
|
+
// node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js
|
|
10586
|
+
var require_retry_operation = __commonJS({
|
|
10587
|
+
"node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
|
|
10588
|
+
function RetryOperation(timeouts, options) {
|
|
10589
|
+
if (typeof options === "boolean") {
|
|
10590
|
+
options = { forever: options };
|
|
10591
|
+
}
|
|
10592
|
+
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
10593
|
+
this._timeouts = timeouts;
|
|
10594
|
+
this._options = options || {};
|
|
10595
|
+
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
10596
|
+
this._fn = null;
|
|
10597
|
+
this._errors = [];
|
|
10598
|
+
this._attempts = 1;
|
|
10599
|
+
this._operationTimeout = null;
|
|
10600
|
+
this._operationTimeoutCb = null;
|
|
10601
|
+
this._timeout = null;
|
|
10602
|
+
this._operationStart = null;
|
|
10603
|
+
if (this._options.forever) {
|
|
10604
|
+
this._cachedTimeouts = this._timeouts.slice(0);
|
|
10605
|
+
}
|
|
10606
|
+
}
|
|
10607
|
+
__name(RetryOperation, "RetryOperation");
|
|
10608
|
+
module2.exports = RetryOperation;
|
|
10609
|
+
RetryOperation.prototype.reset = function() {
|
|
10610
|
+
this._attempts = 1;
|
|
10611
|
+
this._timeouts = this._originalTimeouts;
|
|
10612
|
+
};
|
|
10613
|
+
RetryOperation.prototype.stop = function() {
|
|
10614
|
+
if (this._timeout) {
|
|
10615
|
+
clearTimeout(this._timeout);
|
|
10616
|
+
}
|
|
10617
|
+
this._timeouts = [];
|
|
10618
|
+
this._cachedTimeouts = null;
|
|
10619
|
+
};
|
|
10620
|
+
RetryOperation.prototype.retry = function(err) {
|
|
10621
|
+
if (this._timeout) {
|
|
10622
|
+
clearTimeout(this._timeout);
|
|
10623
|
+
}
|
|
10624
|
+
if (!err) {
|
|
10625
|
+
return false;
|
|
10626
|
+
}
|
|
10627
|
+
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
10628
|
+
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
10629
|
+
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
10630
|
+
return false;
|
|
10631
|
+
}
|
|
10632
|
+
this._errors.push(err);
|
|
10633
|
+
var timeout = this._timeouts.shift();
|
|
10634
|
+
if (timeout === void 0) {
|
|
10635
|
+
if (this._cachedTimeouts) {
|
|
10636
|
+
this._errors.splice(this._errors.length - 1, this._errors.length);
|
|
10637
|
+
this._timeouts = this._cachedTimeouts.slice(0);
|
|
10638
|
+
timeout = this._timeouts.shift();
|
|
10639
|
+
} else {
|
|
10640
|
+
return false;
|
|
10641
|
+
}
|
|
10642
|
+
}
|
|
10643
|
+
var self = this;
|
|
10644
|
+
var timer = setTimeout(function() {
|
|
10645
|
+
self._attempts++;
|
|
10646
|
+
if (self._operationTimeoutCb) {
|
|
10647
|
+
self._timeout = setTimeout(function() {
|
|
10648
|
+
self._operationTimeoutCb(self._attempts);
|
|
10649
|
+
}, self._operationTimeout);
|
|
10650
|
+
if (self._options.unref) {
|
|
10651
|
+
self._timeout.unref();
|
|
10652
|
+
}
|
|
10653
|
+
}
|
|
10654
|
+
self._fn(self._attempts);
|
|
10655
|
+
}, timeout);
|
|
10656
|
+
if (this._options.unref) {
|
|
10657
|
+
timer.unref();
|
|
10658
|
+
}
|
|
10659
|
+
return true;
|
|
10660
|
+
};
|
|
10661
|
+
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
10662
|
+
this._fn = fn;
|
|
10663
|
+
if (timeoutOps) {
|
|
10664
|
+
if (timeoutOps.timeout) {
|
|
10665
|
+
this._operationTimeout = timeoutOps.timeout;
|
|
10666
|
+
}
|
|
10667
|
+
if (timeoutOps.cb) {
|
|
10668
|
+
this._operationTimeoutCb = timeoutOps.cb;
|
|
10669
|
+
}
|
|
10670
|
+
}
|
|
10671
|
+
var self = this;
|
|
10672
|
+
if (this._operationTimeoutCb) {
|
|
10673
|
+
this._timeout = setTimeout(function() {
|
|
10674
|
+
self._operationTimeoutCb();
|
|
10675
|
+
}, self._operationTimeout);
|
|
10676
|
+
}
|
|
10677
|
+
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
10678
|
+
this._fn(this._attempts);
|
|
10679
|
+
};
|
|
10680
|
+
RetryOperation.prototype.try = function(fn) {
|
|
10681
|
+
/* @__PURE__ */ console.log("Using RetryOperation.try() is deprecated");
|
|
10682
|
+
this.attempt(fn);
|
|
10683
|
+
};
|
|
10684
|
+
RetryOperation.prototype.start = function(fn) {
|
|
10685
|
+
/* @__PURE__ */ console.log("Using RetryOperation.start() is deprecated");
|
|
10686
|
+
this.attempt(fn);
|
|
10687
|
+
};
|
|
10688
|
+
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
10689
|
+
RetryOperation.prototype.errors = function() {
|
|
10690
|
+
return this._errors;
|
|
10691
|
+
};
|
|
10692
|
+
RetryOperation.prototype.attempts = function() {
|
|
10693
|
+
return this._attempts;
|
|
10694
|
+
};
|
|
10695
|
+
RetryOperation.prototype.mainError = function() {
|
|
10696
|
+
if (this._errors.length === 0) {
|
|
10697
|
+
return null;
|
|
10698
|
+
}
|
|
10699
|
+
var counts = {};
|
|
10700
|
+
var mainError = null;
|
|
10701
|
+
var mainErrorCount = 0;
|
|
10702
|
+
for (var i = 0; i < this._errors.length; i++) {
|
|
10703
|
+
var error = this._errors[i];
|
|
10704
|
+
var message = error.message;
|
|
10705
|
+
var count = (counts[message] || 0) + 1;
|
|
10706
|
+
counts[message] = count;
|
|
10707
|
+
if (count >= mainErrorCount) {
|
|
10708
|
+
mainError = error;
|
|
10709
|
+
mainErrorCount = count;
|
|
10710
|
+
}
|
|
10711
|
+
}
|
|
10712
|
+
return mainError;
|
|
10713
|
+
};
|
|
10714
|
+
}
|
|
10715
|
+
});
|
|
10716
|
+
|
|
10717
|
+
// node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js
|
|
10718
|
+
var require_retry = __commonJS({
|
|
10719
|
+
"node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js"(exports2) {
|
|
10720
|
+
var RetryOperation = require_retry_operation();
|
|
10721
|
+
exports2.operation = function(options) {
|
|
10722
|
+
var timeouts = exports2.timeouts(options);
|
|
10723
|
+
return new RetryOperation(timeouts, {
|
|
10724
|
+
forever: options && options.forever,
|
|
10725
|
+
unref: options && options.unref,
|
|
10726
|
+
maxRetryTime: options && options.maxRetryTime
|
|
10727
|
+
});
|
|
10728
|
+
};
|
|
10729
|
+
exports2.timeouts = function(options) {
|
|
10730
|
+
if (options instanceof Array) {
|
|
10731
|
+
return [].concat(options);
|
|
10732
|
+
}
|
|
10733
|
+
var opts = {
|
|
10734
|
+
retries: 10,
|
|
10735
|
+
factor: 2,
|
|
10736
|
+
minTimeout: 1 * 1e3,
|
|
10737
|
+
maxTimeout: Infinity,
|
|
10738
|
+
randomize: false
|
|
10739
|
+
};
|
|
10740
|
+
for (var key in options) {
|
|
10741
|
+
opts[key] = options[key];
|
|
10742
|
+
}
|
|
10743
|
+
if (opts.minTimeout > opts.maxTimeout) {
|
|
10744
|
+
throw new Error("minTimeout is greater than maxTimeout");
|
|
10745
|
+
}
|
|
10746
|
+
var timeouts = [];
|
|
10747
|
+
for (var i = 0; i < opts.retries; i++) {
|
|
10748
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
10749
|
+
}
|
|
10750
|
+
if (options && options.forever && !timeouts.length) {
|
|
10751
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
10752
|
+
}
|
|
10753
|
+
timeouts.sort(function(a, b) {
|
|
10754
|
+
return a - b;
|
|
10755
|
+
});
|
|
10756
|
+
return timeouts;
|
|
10757
|
+
};
|
|
10758
|
+
exports2.createTimeout = function(attempt, opts) {
|
|
10759
|
+
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
10760
|
+
var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
|
|
10761
|
+
timeout = Math.min(timeout, opts.maxTimeout);
|
|
10762
|
+
return timeout;
|
|
10763
|
+
};
|
|
10764
|
+
exports2.wrap = function(obj, options, methods) {
|
|
10765
|
+
if (options instanceof Array) {
|
|
10766
|
+
methods = options;
|
|
10767
|
+
options = null;
|
|
10768
|
+
}
|
|
10769
|
+
if (!methods) {
|
|
10770
|
+
methods = [];
|
|
10771
|
+
for (var key in obj) {
|
|
10772
|
+
if (typeof obj[key] === "function") {
|
|
10773
|
+
methods.push(key);
|
|
10774
|
+
}
|
|
10775
|
+
}
|
|
10776
|
+
}
|
|
10777
|
+
for (var i = 0; i < methods.length; i++) {
|
|
10778
|
+
var method = methods[i];
|
|
10779
|
+
var original = obj[method];
|
|
10780
|
+
obj[method] = (/* @__PURE__ */ __name(function retryWrapper(original2) {
|
|
10781
|
+
var op = exports2.operation(options);
|
|
10782
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
10783
|
+
var callback = args.pop();
|
|
10784
|
+
args.push(function(err) {
|
|
10785
|
+
if (op.retry(err)) {
|
|
10786
|
+
return;
|
|
10787
|
+
}
|
|
10788
|
+
if (err) {
|
|
10789
|
+
arguments[0] = op.mainError();
|
|
10790
|
+
}
|
|
10791
|
+
callback.apply(this, arguments);
|
|
10792
|
+
});
|
|
10793
|
+
op.attempt(function() {
|
|
10794
|
+
original2.apply(obj, args);
|
|
10795
|
+
});
|
|
10796
|
+
}, "retryWrapper")).bind(obj, original);
|
|
10797
|
+
obj[method].options = options;
|
|
10798
|
+
}
|
|
10799
|
+
};
|
|
10800
|
+
}
|
|
10801
|
+
});
|
|
10802
|
+
|
|
10803
|
+
// node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js
|
|
10804
|
+
var require_retry2 = __commonJS({
|
|
10805
|
+
"node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js"(exports2, module2) {
|
|
10806
|
+
module2.exports = require_retry();
|
|
10807
|
+
}
|
|
10808
|
+
});
|
|
10809
|
+
|
|
10810
|
+
// node_modules/.pnpm/promise-retry@2.0.1/node_modules/promise-retry/index.js
|
|
10811
|
+
var require_promise_retry = __commonJS({
|
|
10812
|
+
"node_modules/.pnpm/promise-retry@2.0.1/node_modules/promise-retry/index.js"(exports2, module2) {
|
|
10813
|
+
"use strict";
|
|
10814
|
+
var errcode = require_err_code();
|
|
10815
|
+
var retry = require_retry2();
|
|
10816
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
10817
|
+
function isRetryError(err) {
|
|
10818
|
+
return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
|
|
10819
|
+
}
|
|
10820
|
+
__name(isRetryError, "isRetryError");
|
|
10821
|
+
function promiseRetry(fn, options) {
|
|
10822
|
+
var temp;
|
|
10823
|
+
var operation;
|
|
10824
|
+
if (typeof fn === "object" && typeof options === "function") {
|
|
10825
|
+
temp = options;
|
|
10826
|
+
options = fn;
|
|
10827
|
+
fn = temp;
|
|
10828
|
+
}
|
|
10829
|
+
operation = retry.operation(options);
|
|
10830
|
+
return new Promise(function(resolve, reject) {
|
|
10831
|
+
operation.attempt(function(number) {
|
|
10832
|
+
Promise.resolve().then(function() {
|
|
10833
|
+
return fn(function(err) {
|
|
10834
|
+
if (isRetryError(err)) {
|
|
10835
|
+
err = err.retried;
|
|
10836
|
+
}
|
|
10837
|
+
throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
|
|
10838
|
+
}, number);
|
|
10839
|
+
}).then(resolve, function(err) {
|
|
10840
|
+
if (isRetryError(err)) {
|
|
10841
|
+
err = err.retried;
|
|
10842
|
+
if (operation.retry(err || new Error())) {
|
|
10843
|
+
return;
|
|
10844
|
+
}
|
|
10845
|
+
}
|
|
10846
|
+
reject(err);
|
|
10847
|
+
});
|
|
10848
|
+
});
|
|
10849
|
+
});
|
|
10850
|
+
}
|
|
10851
|
+
__name(promiseRetry, "promiseRetry");
|
|
10852
|
+
module2.exports = promiseRetry;
|
|
10853
|
+
}
|
|
10854
|
+
});
|
|
10855
|
+
|
|
10856
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/errors.js
|
|
10857
|
+
var require_errors = __commonJS({
|
|
10858
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/errors.js"(exports2, module2) {
|
|
10859
|
+
var maxRetry = 3;
|
|
10860
|
+
var GitError = class extends Error {
|
|
10861
|
+
static {
|
|
10862
|
+
__name(this, "GitError");
|
|
10863
|
+
}
|
|
10864
|
+
shouldRetry() {
|
|
10865
|
+
return false;
|
|
10866
|
+
}
|
|
10867
|
+
};
|
|
10868
|
+
var GitConnectionError = class extends GitError {
|
|
10869
|
+
static {
|
|
10870
|
+
__name(this, "GitConnectionError");
|
|
10871
|
+
}
|
|
10872
|
+
constructor() {
|
|
10873
|
+
super("A git connection error occurred");
|
|
10874
|
+
}
|
|
10875
|
+
shouldRetry(number) {
|
|
10876
|
+
return number < maxRetry;
|
|
10877
|
+
}
|
|
10878
|
+
};
|
|
10879
|
+
var GitPathspecError = class extends GitError {
|
|
10880
|
+
static {
|
|
10881
|
+
__name(this, "GitPathspecError");
|
|
10882
|
+
}
|
|
10883
|
+
constructor() {
|
|
10884
|
+
super("The git reference could not be found");
|
|
10885
|
+
}
|
|
10886
|
+
};
|
|
10887
|
+
var GitUnknownError = class extends GitError {
|
|
10888
|
+
static {
|
|
10889
|
+
__name(this, "GitUnknownError");
|
|
10890
|
+
}
|
|
10891
|
+
constructor() {
|
|
10892
|
+
super("An unknown git error occurred");
|
|
10893
|
+
}
|
|
10894
|
+
};
|
|
10895
|
+
module2.exports = {
|
|
10896
|
+
GitConnectionError,
|
|
10897
|
+
GitPathspecError,
|
|
10898
|
+
GitUnknownError
|
|
10899
|
+
};
|
|
10900
|
+
}
|
|
10901
|
+
});
|
|
10902
|
+
|
|
10903
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/make-error.js
|
|
10904
|
+
var require_make_error = __commonJS({
|
|
10905
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/make-error.js"(exports2, module2) {
|
|
10906
|
+
var {
|
|
10907
|
+
GitConnectionError,
|
|
10908
|
+
GitPathspecError,
|
|
10909
|
+
GitUnknownError
|
|
10910
|
+
} = require_errors();
|
|
10911
|
+
var connectionErrorRe = new RegExp([
|
|
10912
|
+
"remote error: Internal Server Error",
|
|
10913
|
+
"The remote end hung up unexpectedly",
|
|
10914
|
+
"Connection timed out",
|
|
10915
|
+
"Operation timed out",
|
|
10916
|
+
"Failed to connect to .* Timed out",
|
|
10917
|
+
"Connection reset by peer",
|
|
10918
|
+
"SSL_ERROR_SYSCALL",
|
|
10919
|
+
"The requested URL returned error: 503"
|
|
10920
|
+
].join("|"));
|
|
10921
|
+
var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
|
|
10922
|
+
function makeError(er) {
|
|
10923
|
+
const message = er.stderr;
|
|
10924
|
+
let gitEr;
|
|
10925
|
+
if (connectionErrorRe.test(message)) {
|
|
10926
|
+
gitEr = new GitConnectionError(message);
|
|
10927
|
+
} else if (missingPathspecRe.test(message)) {
|
|
10928
|
+
gitEr = new GitPathspecError(message);
|
|
10929
|
+
} else {
|
|
10930
|
+
gitEr = new GitUnknownError(message);
|
|
10931
|
+
}
|
|
10932
|
+
return Object.assign(gitEr, er);
|
|
10933
|
+
}
|
|
10934
|
+
__name(makeError, "makeError");
|
|
10935
|
+
module2.exports = makeError;
|
|
10936
|
+
}
|
|
10937
|
+
});
|
|
10938
|
+
|
|
10939
|
+
// node_modules/.pnpm/ini@5.0.0/node_modules/ini/lib/ini.js
|
|
10940
|
+
var require_ini = __commonJS({
|
|
10941
|
+
"node_modules/.pnpm/ini@5.0.0/node_modules/ini/lib/ini.js"(exports2, module2) {
|
|
10942
|
+
var { hasOwnProperty } = Object.prototype;
|
|
10943
|
+
var encode = /* @__PURE__ */ __name((obj, opt = {}) => {
|
|
10944
|
+
if (typeof opt === "string") {
|
|
10945
|
+
opt = { section: opt };
|
|
10946
|
+
}
|
|
10947
|
+
opt.align = opt.align === true;
|
|
10948
|
+
opt.newline = opt.newline === true;
|
|
10949
|
+
opt.sort = opt.sort === true;
|
|
10950
|
+
opt.whitespace = opt.whitespace === true || opt.align === true;
|
|
10951
|
+
opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
|
|
10952
|
+
opt.bracketedArray = opt.bracketedArray !== false;
|
|
10953
|
+
const eol = opt.platform === "win32" ? "\r\n" : "\n";
|
|
10954
|
+
const separator = opt.whitespace ? " = " : "=";
|
|
10955
|
+
const children = [];
|
|
10956
|
+
const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
|
|
10957
|
+
let padToChars = 0;
|
|
10958
|
+
if (opt.align) {
|
|
10959
|
+
padToChars = safe(
|
|
10960
|
+
keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a, b) => safe(a).length >= safe(b).length ? a : b)
|
|
10961
|
+
).length;
|
|
10962
|
+
}
|
|
10963
|
+
let out = "";
|
|
10964
|
+
const arraySuffix = opt.bracketedArray ? "[]" : "";
|
|
10965
|
+
for (const k of keys) {
|
|
10966
|
+
const val = obj[k];
|
|
10967
|
+
if (val && Array.isArray(val)) {
|
|
10968
|
+
for (const item of val) {
|
|
10969
|
+
out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
|
|
10970
|
+
}
|
|
10971
|
+
} else if (val && typeof val === "object") {
|
|
10972
|
+
children.push(k);
|
|
10973
|
+
} else {
|
|
10974
|
+
out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
|
|
10975
|
+
}
|
|
10976
|
+
}
|
|
10977
|
+
if (opt.section && out.length) {
|
|
10978
|
+
out = "[" + safe(opt.section) + "]" + (opt.newline ? eol + eol : eol) + out;
|
|
10979
|
+
}
|
|
10980
|
+
for (const k of children) {
|
|
10981
|
+
const nk = splitSections(k, ".").join("\\.");
|
|
10982
|
+
const section = (opt.section ? opt.section + "." : "") + nk;
|
|
10983
|
+
const child = encode(obj[k], {
|
|
10984
|
+
...opt,
|
|
10985
|
+
section
|
|
10986
|
+
});
|
|
10987
|
+
if (out.length && child.length) {
|
|
10988
|
+
out += eol;
|
|
10989
|
+
}
|
|
10990
|
+
out += child;
|
|
10991
|
+
}
|
|
10992
|
+
return out;
|
|
10993
|
+
}, "encode");
|
|
10994
|
+
function splitSections(str, separator) {
|
|
10995
|
+
var lastMatchIndex = 0;
|
|
10996
|
+
var lastSeparatorIndex = 0;
|
|
10997
|
+
var nextIndex = 0;
|
|
10998
|
+
var sections = [];
|
|
10999
|
+
do {
|
|
11000
|
+
nextIndex = str.indexOf(separator, lastMatchIndex);
|
|
11001
|
+
if (nextIndex !== -1) {
|
|
11002
|
+
lastMatchIndex = nextIndex + separator.length;
|
|
11003
|
+
if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
|
|
11004
|
+
continue;
|
|
11005
|
+
}
|
|
11006
|
+
sections.push(str.slice(lastSeparatorIndex, nextIndex));
|
|
11007
|
+
lastSeparatorIndex = nextIndex + separator.length;
|
|
11008
|
+
}
|
|
11009
|
+
} while (nextIndex !== -1);
|
|
11010
|
+
sections.push(str.slice(lastSeparatorIndex));
|
|
11011
|
+
return sections;
|
|
11012
|
+
}
|
|
11013
|
+
__name(splitSections, "splitSections");
|
|
11014
|
+
var decode = /* @__PURE__ */ __name((str, opt = {}) => {
|
|
11015
|
+
opt.bracketedArray = opt.bracketedArray !== false;
|
|
11016
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
11017
|
+
let p = out;
|
|
11018
|
+
let section = null;
|
|
11019
|
+
const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
|
|
11020
|
+
const lines = str.split(/[\r\n]+/g);
|
|
11021
|
+
const duplicates = {};
|
|
11022
|
+
for (const line of lines) {
|
|
11023
|
+
if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
|
|
11024
|
+
continue;
|
|
11025
|
+
}
|
|
11026
|
+
const match = line.match(re);
|
|
11027
|
+
if (!match) {
|
|
11028
|
+
continue;
|
|
11029
|
+
}
|
|
11030
|
+
if (match[1] !== void 0) {
|
|
11031
|
+
section = unsafe(match[1]);
|
|
11032
|
+
if (section === "__proto__") {
|
|
11033
|
+
p = /* @__PURE__ */ Object.create(null);
|
|
11034
|
+
continue;
|
|
11035
|
+
}
|
|
11036
|
+
p = out[section] = out[section] || /* @__PURE__ */ Object.create(null);
|
|
11037
|
+
continue;
|
|
11038
|
+
}
|
|
11039
|
+
const keyRaw = unsafe(match[2]);
|
|
11040
|
+
let isArray;
|
|
11041
|
+
if (opt.bracketedArray) {
|
|
11042
|
+
isArray = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
|
|
11043
|
+
} else {
|
|
11044
|
+
duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;
|
|
11045
|
+
isArray = duplicates[keyRaw] > 1;
|
|
11046
|
+
}
|
|
11047
|
+
const key = isArray && keyRaw.endsWith("[]") ? keyRaw.slice(0, -2) : keyRaw;
|
|
11048
|
+
if (key === "__proto__") {
|
|
11049
|
+
continue;
|
|
11050
|
+
}
|
|
11051
|
+
const valueRaw = match[3] ? unsafe(match[4]) : true;
|
|
11052
|
+
const value = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
|
|
11053
|
+
if (isArray) {
|
|
11054
|
+
if (!hasOwnProperty.call(p, key)) {
|
|
11055
|
+
p[key] = [];
|
|
11056
|
+
} else if (!Array.isArray(p[key])) {
|
|
11057
|
+
p[key] = [p[key]];
|
|
11058
|
+
}
|
|
11059
|
+
}
|
|
11060
|
+
if (Array.isArray(p[key])) {
|
|
11061
|
+
p[key].push(value);
|
|
11062
|
+
} else {
|
|
11063
|
+
p[key] = value;
|
|
11064
|
+
}
|
|
11065
|
+
}
|
|
11066
|
+
const remove = [];
|
|
11067
|
+
for (const k of Object.keys(out)) {
|
|
11068
|
+
if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k])) {
|
|
11069
|
+
continue;
|
|
11070
|
+
}
|
|
11071
|
+
const parts = splitSections(k, ".");
|
|
11072
|
+
p = out;
|
|
11073
|
+
const l = parts.pop();
|
|
11074
|
+
const nl = l.replace(/\\\./g, ".");
|
|
11075
|
+
for (const part of parts) {
|
|
11076
|
+
if (part === "__proto__") {
|
|
11077
|
+
continue;
|
|
11078
|
+
}
|
|
11079
|
+
if (!hasOwnProperty.call(p, part) || typeof p[part] !== "object") {
|
|
11080
|
+
p[part] = /* @__PURE__ */ Object.create(null);
|
|
11081
|
+
}
|
|
11082
|
+
p = p[part];
|
|
11083
|
+
}
|
|
11084
|
+
if (p === out && nl === l) {
|
|
11085
|
+
continue;
|
|
11086
|
+
}
|
|
11087
|
+
p[nl] = out[k];
|
|
11088
|
+
remove.push(k);
|
|
11089
|
+
}
|
|
11090
|
+
for (const del of remove) {
|
|
11091
|
+
delete out[del];
|
|
11092
|
+
}
|
|
11093
|
+
return out;
|
|
11094
|
+
}, "decode");
|
|
11095
|
+
var isQuoted = /* @__PURE__ */ __name((val) => {
|
|
11096
|
+
return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
|
|
11097
|
+
}, "isQuoted");
|
|
11098
|
+
var safe = /* @__PURE__ */ __name((val) => {
|
|
11099
|
+
if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
|
|
11100
|
+
return JSON.stringify(val);
|
|
11101
|
+
}
|
|
11102
|
+
return val.split(";").join("\\;").split("#").join("\\#");
|
|
11103
|
+
}, "safe");
|
|
11104
|
+
var unsafe = /* @__PURE__ */ __name((val) => {
|
|
11105
|
+
val = (val || "").trim();
|
|
11106
|
+
if (isQuoted(val)) {
|
|
11107
|
+
if (val.charAt(0) === "'") {
|
|
11108
|
+
val = val.slice(1, -1);
|
|
11109
|
+
}
|
|
11110
|
+
try {
|
|
11111
|
+
val = JSON.parse(val);
|
|
11112
|
+
} catch {
|
|
11113
|
+
}
|
|
11114
|
+
} else {
|
|
11115
|
+
let esc = false;
|
|
11116
|
+
let unesc = "";
|
|
11117
|
+
for (let i = 0, l = val.length; i < l; i++) {
|
|
11118
|
+
const c = val.charAt(i);
|
|
11119
|
+
if (esc) {
|
|
11120
|
+
if ("\\;#".indexOf(c) !== -1) {
|
|
11121
|
+
unesc += c;
|
|
11122
|
+
} else {
|
|
11123
|
+
unesc += "\\" + c;
|
|
11124
|
+
}
|
|
11125
|
+
esc = false;
|
|
11126
|
+
} else if (";#".indexOf(c) !== -1) {
|
|
11127
|
+
break;
|
|
11128
|
+
} else if (c === "\\") {
|
|
11129
|
+
esc = true;
|
|
11130
|
+
} else {
|
|
11131
|
+
unesc += c;
|
|
11132
|
+
}
|
|
11133
|
+
}
|
|
11134
|
+
if (esc) {
|
|
11135
|
+
unesc += "\\";
|
|
11136
|
+
}
|
|
11137
|
+
return unesc.trim();
|
|
11138
|
+
}
|
|
11139
|
+
return val;
|
|
11140
|
+
}, "unsafe");
|
|
11141
|
+
module2.exports = {
|
|
11142
|
+
parse: decode,
|
|
11143
|
+
decode,
|
|
11144
|
+
stringify: encode,
|
|
11145
|
+
encode,
|
|
11146
|
+
safe,
|
|
11147
|
+
unsafe
|
|
11148
|
+
};
|
|
11149
|
+
}
|
|
11150
|
+
});
|
|
11151
|
+
|
|
11152
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/opts.js
|
|
11153
|
+
var require_opts = __commonJS({
|
|
11154
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/opts.js"(exports2, module2) {
|
|
11155
|
+
var fs = require("node:fs");
|
|
11156
|
+
var os = require("node:os");
|
|
11157
|
+
var path = require("node:path");
|
|
11158
|
+
var ini = require_ini();
|
|
11159
|
+
var gitConfigPath = path.join(os.homedir(), ".gitconfig");
|
|
11160
|
+
var cachedConfig = null;
|
|
11161
|
+
var loadGitConfig = /* @__PURE__ */ __name(() => {
|
|
11162
|
+
if (cachedConfig === null) {
|
|
11163
|
+
try {
|
|
11164
|
+
cachedConfig = {};
|
|
11165
|
+
if (fs.existsSync(gitConfigPath)) {
|
|
11166
|
+
const configContent = fs.readFileSync(gitConfigPath, "utf-8");
|
|
11167
|
+
cachedConfig = ini.parse(configContent);
|
|
11168
|
+
}
|
|
11169
|
+
} catch (error) {
|
|
11170
|
+
cachedConfig = {};
|
|
11171
|
+
}
|
|
11172
|
+
}
|
|
11173
|
+
return cachedConfig;
|
|
11174
|
+
}, "loadGitConfig");
|
|
11175
|
+
var checkGitConfigs = /* @__PURE__ */ __name(() => {
|
|
11176
|
+
const config = loadGitConfig();
|
|
11177
|
+
return {
|
|
11178
|
+
sshCommandSetInConfig: config?.core?.sshCommand !== void 0,
|
|
11179
|
+
askPassSetInConfig: config?.core?.askpass !== void 0
|
|
11180
|
+
};
|
|
11181
|
+
}, "checkGitConfigs");
|
|
11182
|
+
var sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== void 0;
|
|
11183
|
+
var askPassSetInEnv = process.env.GIT_ASKPASS !== void 0;
|
|
11184
|
+
var { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs();
|
|
11185
|
+
var finalGitEnv = {
|
|
11186
|
+
...askPassSetInEnv || askPassSetInConfig ? {} : {
|
|
11187
|
+
GIT_ASKPASS: "echo"
|
|
11188
|
+
},
|
|
11189
|
+
...sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
|
|
11190
|
+
GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
|
|
11191
|
+
}
|
|
11192
|
+
};
|
|
11193
|
+
module2.exports = (opts = {}) => ({
|
|
11194
|
+
stdioString: true,
|
|
11195
|
+
...opts,
|
|
11196
|
+
shell: false,
|
|
11197
|
+
env: opts.env || { ...finalGitEnv, ...process.env }
|
|
11198
|
+
});
|
|
11199
|
+
module2.exports.loadGitConfig = loadGitConfig;
|
|
11200
|
+
}
|
|
11201
|
+
});
|
|
11202
|
+
|
|
11203
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/which.js
|
|
11204
|
+
var require_which = __commonJS({
|
|
11205
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/which.js"(exports2, module2) {
|
|
11206
|
+
var which = require_lib4();
|
|
11207
|
+
var gitPath;
|
|
11208
|
+
try {
|
|
11209
|
+
gitPath = which.sync("git");
|
|
11210
|
+
} catch {
|
|
11211
|
+
}
|
|
11212
|
+
module2.exports = (opts = {}) => {
|
|
11213
|
+
if (opts.git) {
|
|
11214
|
+
return opts.git;
|
|
11215
|
+
}
|
|
11216
|
+
if (!gitPath || opts.git === false) {
|
|
11217
|
+
return Object.assign(new Error("No git binary found in $PATH"), { code: "ENOGIT" });
|
|
11218
|
+
}
|
|
11219
|
+
return gitPath;
|
|
11220
|
+
};
|
|
11221
|
+
}
|
|
11222
|
+
});
|
|
11223
|
+
|
|
11224
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/spawn.js
|
|
11225
|
+
var require_spawn = __commonJS({
|
|
11226
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/spawn.js"(exports2, module2) {
|
|
11227
|
+
var spawn = require_lib5();
|
|
11228
|
+
var promiseRetry = require_promise_retry();
|
|
11229
|
+
var { log } = require_lib2();
|
|
11230
|
+
var makeError = require_make_error();
|
|
11231
|
+
var makeOpts = require_opts();
|
|
11232
|
+
module2.exports = (gitArgs, opts = {}) => {
|
|
11233
|
+
const whichGit = require_which();
|
|
11234
|
+
const gitPath = whichGit(opts);
|
|
11235
|
+
if (gitPath instanceof Error) {
|
|
11236
|
+
return Promise.reject(gitPath);
|
|
11237
|
+
}
|
|
11238
|
+
const args = opts.allowReplace || gitArgs[0] === "--no-replace-objects" ? gitArgs : ["--no-replace-objects", ...gitArgs];
|
|
11239
|
+
let retryOpts = opts.retry;
|
|
11240
|
+
if (retryOpts === null || retryOpts === void 0) {
|
|
11241
|
+
retryOpts = {
|
|
11242
|
+
retries: opts.fetchRetries || 2,
|
|
11243
|
+
factor: opts.fetchRetryFactor || 10,
|
|
11244
|
+
maxTimeout: opts.fetchRetryMaxtimeout || 6e4,
|
|
11245
|
+
minTimeout: opts.fetchRetryMintimeout || 1e3
|
|
11246
|
+
};
|
|
11247
|
+
}
|
|
11248
|
+
return promiseRetry((retryFn, number) => {
|
|
11249
|
+
if (number !== 1) {
|
|
11250
|
+
log.silly("git", `Retrying git command: ${args.join(" ")} attempt # ${number}`);
|
|
11251
|
+
}
|
|
11252
|
+
return spawn(gitPath, args, makeOpts(opts)).catch((er) => {
|
|
11253
|
+
const gitError = makeError(er);
|
|
11254
|
+
if (!gitError.shouldRetry(number)) {
|
|
11255
|
+
throw gitError;
|
|
11256
|
+
}
|
|
11257
|
+
retryFn(gitError);
|
|
11258
|
+
});
|
|
11259
|
+
}, retryOpts);
|
|
11260
|
+
};
|
|
11261
|
+
}
|
|
11262
|
+
});
|
|
11263
|
+
|
|
11264
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
|
|
11265
|
+
var require_inc = __commonJS({
|
|
11266
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js"(exports2, module2) {
|
|
11267
|
+
"use strict";
|
|
11268
|
+
var SemVer = require_semver();
|
|
11269
|
+
var inc = /* @__PURE__ */ __name((version, release, options, identifier, identifierBase) => {
|
|
11270
|
+
if (typeof options === "string") {
|
|
11271
|
+
identifierBase = identifier;
|
|
11272
|
+
identifier = options;
|
|
11273
|
+
options = void 0;
|
|
11274
|
+
}
|
|
11275
|
+
try {
|
|
11276
|
+
return new SemVer(
|
|
11277
|
+
version instanceof SemVer ? version.version : version,
|
|
11278
|
+
options
|
|
11279
|
+
).inc(release, identifier, identifierBase).version;
|
|
11280
|
+
} catch (er) {
|
|
11281
|
+
return null;
|
|
11282
|
+
}
|
|
11283
|
+
}, "inc");
|
|
11284
|
+
module2.exports = inc;
|
|
11285
|
+
}
|
|
11286
|
+
});
|
|
11287
|
+
|
|
11288
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
|
|
11289
|
+
var require_diff = __commonJS({
|
|
11290
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
11291
|
+
"use strict";
|
|
11292
|
+
var parse = require_parse();
|
|
11293
|
+
var diff = /* @__PURE__ */ __name((version1, version2) => {
|
|
11294
|
+
const v1 = parse(version1, null, true);
|
|
11295
|
+
const v2 = parse(version2, null, true);
|
|
11296
|
+
const comparison = v1.compare(v2);
|
|
11297
|
+
if (comparison === 0) {
|
|
11298
|
+
return null;
|
|
11299
|
+
}
|
|
11300
|
+
const v1Higher = comparison > 0;
|
|
11301
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
11302
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
11303
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
11304
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
11305
|
+
if (lowHasPre && !highHasPre) {
|
|
11306
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
11307
|
+
return "major";
|
|
11308
|
+
}
|
|
11309
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
11310
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
11311
|
+
return "minor";
|
|
11312
|
+
}
|
|
11313
|
+
return "patch";
|
|
11314
|
+
}
|
|
11315
|
+
}
|
|
11316
|
+
const prefix = highHasPre ? "pre" : "";
|
|
11317
|
+
if (v1.major !== v2.major) {
|
|
11318
|
+
return prefix + "major";
|
|
11319
|
+
}
|
|
11320
|
+
if (v1.minor !== v2.minor) {
|
|
11321
|
+
return prefix + "minor";
|
|
11322
|
+
}
|
|
11323
|
+
if (v1.patch !== v2.patch) {
|
|
11324
|
+
return prefix + "patch";
|
|
11325
|
+
}
|
|
11326
|
+
return "prerelease";
|
|
11327
|
+
}, "diff");
|
|
11328
|
+
module2.exports = diff;
|
|
11329
|
+
}
|
|
11330
|
+
});
|
|
11331
|
+
|
|
11332
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
|
|
11333
|
+
var require_major = __commonJS({
|
|
11334
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js"(exports2, module2) {
|
|
11335
|
+
"use strict";
|
|
11336
|
+
var SemVer = require_semver();
|
|
11337
|
+
var major = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).major, "major");
|
|
11338
|
+
module2.exports = major;
|
|
11339
|
+
}
|
|
11340
|
+
});
|
|
11341
|
+
|
|
11342
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
|
|
11343
|
+
var require_minor = __commonJS({
|
|
11344
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js"(exports2, module2) {
|
|
11345
|
+
"use strict";
|
|
11346
|
+
var SemVer = require_semver();
|
|
11347
|
+
var minor = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).minor, "minor");
|
|
11348
|
+
module2.exports = minor;
|
|
11349
|
+
}
|
|
11350
|
+
});
|
|
11351
|
+
|
|
11352
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
|
|
11353
|
+
var require_patch = __commonJS({
|
|
11354
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js"(exports2, module2) {
|
|
11355
|
+
"use strict";
|
|
11356
|
+
var SemVer = require_semver();
|
|
11357
|
+
var patch = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).patch, "patch");
|
|
11358
|
+
module2.exports = patch;
|
|
11359
|
+
}
|
|
11360
|
+
});
|
|
11361
|
+
|
|
11362
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
|
|
11363
|
+
var require_prerelease = __commonJS({
|
|
11364
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
11365
|
+
"use strict";
|
|
11366
|
+
var parse = require_parse();
|
|
11367
|
+
var prerelease = /* @__PURE__ */ __name((version, options) => {
|
|
11368
|
+
const parsed = parse(version, options);
|
|
11369
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
11370
|
+
}, "prerelease");
|
|
11371
|
+
module2.exports = prerelease;
|
|
11372
|
+
}
|
|
11373
|
+
});
|
|
11374
|
+
|
|
11375
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
|
|
11376
|
+
var require_compare = __commonJS({
|
|
11377
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
11378
|
+
"use strict";
|
|
11379
|
+
var SemVer = require_semver();
|
|
11380
|
+
var compare = /* @__PURE__ */ __name((a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)), "compare");
|
|
11381
|
+
module2.exports = compare;
|
|
11382
|
+
}
|
|
11383
|
+
});
|
|
11384
|
+
|
|
11385
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
|
|
11386
|
+
var require_rcompare = __commonJS({
|
|
11387
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js"(exports2, module2) {
|
|
11388
|
+
"use strict";
|
|
11389
|
+
var compare = require_compare();
|
|
11390
|
+
var rcompare = /* @__PURE__ */ __name((a, b, loose) => compare(b, a, loose), "rcompare");
|
|
11391
|
+
module2.exports = rcompare;
|
|
11392
|
+
}
|
|
11393
|
+
});
|
|
11394
|
+
|
|
11395
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
|
|
11396
|
+
var require_compare_loose = __commonJS({
|
|
11397
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js"(exports2, module2) {
|
|
11398
|
+
"use strict";
|
|
11399
|
+
var compare = require_compare();
|
|
11400
|
+
var compareLoose = /* @__PURE__ */ __name((a, b) => compare(a, b, true), "compareLoose");
|
|
11401
|
+
module2.exports = compareLoose;
|
|
11402
|
+
}
|
|
11403
|
+
});
|
|
11404
|
+
|
|
11405
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
|
|
11406
|
+
var require_compare_build = __commonJS({
|
|
11407
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js"(exports2, module2) {
|
|
11408
|
+
"use strict";
|
|
11409
|
+
var SemVer = require_semver();
|
|
11410
|
+
var compareBuild = /* @__PURE__ */ __name((a, b, loose) => {
|
|
11411
|
+
const versionA = new SemVer(a, loose);
|
|
11412
|
+
const versionB = new SemVer(b, loose);
|
|
11413
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
11414
|
+
}, "compareBuild");
|
|
11415
|
+
module2.exports = compareBuild;
|
|
11416
|
+
}
|
|
11417
|
+
});
|
|
11418
|
+
|
|
11419
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
|
|
11420
|
+
var require_sort = __commonJS({
|
|
11421
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js"(exports2, module2) {
|
|
11422
|
+
"use strict";
|
|
11423
|
+
var compareBuild = require_compare_build();
|
|
11424
|
+
var sort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(a, b, loose)), "sort");
|
|
11425
|
+
module2.exports = sort;
|
|
11426
|
+
}
|
|
11427
|
+
});
|
|
11428
|
+
|
|
11429
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
|
|
11430
|
+
var require_rsort = __commonJS({
|
|
11431
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js"(exports2, module2) {
|
|
11432
|
+
"use strict";
|
|
11433
|
+
var compareBuild = require_compare_build();
|
|
11434
|
+
var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(b, a, loose)), "rsort");
|
|
11435
|
+
module2.exports = rsort;
|
|
11436
|
+
}
|
|
11437
|
+
});
|
|
11438
|
+
|
|
11439
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
|
|
11440
|
+
var require_gt = __commonJS({
|
|
11441
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports2, module2) {
|
|
11442
|
+
"use strict";
|
|
11443
|
+
var compare = require_compare();
|
|
11444
|
+
var gt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) > 0, "gt");
|
|
11445
|
+
module2.exports = gt;
|
|
11446
|
+
}
|
|
11447
|
+
});
|
|
11448
|
+
|
|
11449
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
|
|
11450
|
+
var require_lt = __commonJS({
|
|
11451
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports2, module2) {
|
|
11452
|
+
"use strict";
|
|
11453
|
+
var compare = require_compare();
|
|
11454
|
+
var lt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) < 0, "lt");
|
|
11455
|
+
module2.exports = lt;
|
|
11456
|
+
}
|
|
11457
|
+
});
|
|
11458
|
+
|
|
11459
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
|
|
11460
|
+
var require_eq = __commonJS({
|
|
11461
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
11462
|
+
"use strict";
|
|
11463
|
+
var compare = require_compare();
|
|
11464
|
+
var eq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) === 0, "eq");
|
|
11465
|
+
module2.exports = eq;
|
|
11466
|
+
}
|
|
11467
|
+
});
|
|
11468
|
+
|
|
11469
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
|
|
11470
|
+
var require_neq = __commonJS({
|
|
11471
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports2, module2) {
|
|
11472
|
+
"use strict";
|
|
11473
|
+
var compare = require_compare();
|
|
11474
|
+
var neq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) !== 0, "neq");
|
|
11475
|
+
module2.exports = neq;
|
|
11476
|
+
}
|
|
11477
|
+
});
|
|
11478
|
+
|
|
11479
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
|
|
11480
|
+
var require_gte = __commonJS({
|
|
11481
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
11482
|
+
"use strict";
|
|
11483
|
+
var compare = require_compare();
|
|
11484
|
+
var gte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) >= 0, "gte");
|
|
11485
|
+
module2.exports = gte;
|
|
11486
|
+
}
|
|
11487
|
+
});
|
|
11488
|
+
|
|
11489
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
|
|
11490
|
+
var require_lte = __commonJS({
|
|
11491
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports2, module2) {
|
|
11492
|
+
"use strict";
|
|
11493
|
+
var compare = require_compare();
|
|
11494
|
+
var lte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) <= 0, "lte");
|
|
11495
|
+
module2.exports = lte;
|
|
11496
|
+
}
|
|
11497
|
+
});
|
|
11498
|
+
|
|
11499
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
|
|
11500
|
+
var require_cmp = __commonJS({
|
|
11501
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports2, module2) {
|
|
11502
|
+
"use strict";
|
|
11503
|
+
var eq = require_eq();
|
|
11504
|
+
var neq = require_neq();
|
|
11505
|
+
var gt = require_gt();
|
|
11506
|
+
var gte = require_gte();
|
|
11507
|
+
var lt = require_lt();
|
|
11508
|
+
var lte = require_lte();
|
|
11509
|
+
var cmp = /* @__PURE__ */ __name((a, op, b, loose) => {
|
|
11510
|
+
switch (op) {
|
|
11511
|
+
case "===":
|
|
11512
|
+
if (typeof a === "object") {
|
|
11513
|
+
a = a.version;
|
|
11514
|
+
}
|
|
11515
|
+
if (typeof b === "object") {
|
|
11516
|
+
b = b.version;
|
|
11517
|
+
}
|
|
11518
|
+
return a === b;
|
|
11519
|
+
case "!==":
|
|
11520
|
+
if (typeof a === "object") {
|
|
11521
|
+
a = a.version;
|
|
11522
|
+
}
|
|
11523
|
+
if (typeof b === "object") {
|
|
11524
|
+
b = b.version;
|
|
11525
|
+
}
|
|
11526
|
+
return a !== b;
|
|
11527
|
+
case "":
|
|
11528
|
+
case "=":
|
|
11529
|
+
case "==":
|
|
11530
|
+
return eq(a, b, loose);
|
|
11531
|
+
case "!=":
|
|
11532
|
+
return neq(a, b, loose);
|
|
11533
|
+
case ">":
|
|
11534
|
+
return gt(a, b, loose);
|
|
11535
|
+
case ">=":
|
|
11536
|
+
return gte(a, b, loose);
|
|
11537
|
+
case "<":
|
|
11538
|
+
return lt(a, b, loose);
|
|
11539
|
+
case "<=":
|
|
11540
|
+
return lte(a, b, loose);
|
|
11541
|
+
default:
|
|
11542
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
11543
|
+
}
|
|
11544
|
+
}, "cmp");
|
|
11545
|
+
module2.exports = cmp;
|
|
11546
|
+
}
|
|
11547
|
+
});
|
|
11548
|
+
|
|
11549
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
|
|
11550
|
+
var require_coerce = __commonJS({
|
|
11551
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
11552
|
+
"use strict";
|
|
11553
|
+
var SemVer = require_semver();
|
|
11554
|
+
var parse = require_parse();
|
|
11555
|
+
var { safeRe: re, t } = require_re();
|
|
11556
|
+
var coerce = /* @__PURE__ */ __name((version, options) => {
|
|
11557
|
+
if (version instanceof SemVer) {
|
|
11558
|
+
return version;
|
|
11559
|
+
}
|
|
11560
|
+
if (typeof version === "number") {
|
|
11561
|
+
version = String(version);
|
|
11562
|
+
}
|
|
11563
|
+
if (typeof version !== "string") {
|
|
11564
|
+
return null;
|
|
11565
|
+
}
|
|
11566
|
+
options = options || {};
|
|
11567
|
+
let match = null;
|
|
11568
|
+
if (!options.rtl) {
|
|
11569
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
11570
|
+
} else {
|
|
11571
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
11572
|
+
let next;
|
|
11573
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
11574
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
11575
|
+
match = next;
|
|
11576
|
+
}
|
|
11577
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
11578
|
+
}
|
|
11579
|
+
coerceRtlRegex.lastIndex = -1;
|
|
11580
|
+
}
|
|
11581
|
+
if (match === null) {
|
|
11582
|
+
return null;
|
|
11583
|
+
}
|
|
11584
|
+
const major = match[2];
|
|
11585
|
+
const minor = match[3] || "0";
|
|
11586
|
+
const patch = match[4] || "0";
|
|
11587
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
11588
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
11589
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
11590
|
+
}, "coerce");
|
|
11591
|
+
module2.exports = coerce;
|
|
11592
|
+
}
|
|
11593
|
+
});
|
|
11594
|
+
|
|
11595
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js
|
|
11596
|
+
var require_lrucache = __commonJS({
|
|
11597
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js"(exports2, module2) {
|
|
11598
|
+
"use strict";
|
|
11599
|
+
var LRUCache = class {
|
|
11600
|
+
static {
|
|
11601
|
+
__name(this, "LRUCache");
|
|
11602
|
+
}
|
|
11603
|
+
constructor() {
|
|
11604
|
+
this.max = 1e3;
|
|
11605
|
+
this.map = /* @__PURE__ */ new Map();
|
|
11606
|
+
}
|
|
11607
|
+
get(key) {
|
|
11608
|
+
const value = this.map.get(key);
|
|
11609
|
+
if (value === void 0) {
|
|
11610
|
+
return void 0;
|
|
11611
|
+
} else {
|
|
11612
|
+
this.map.delete(key);
|
|
11613
|
+
this.map.set(key, value);
|
|
11614
|
+
return value;
|
|
11615
|
+
}
|
|
11616
|
+
}
|
|
11617
|
+
delete(key) {
|
|
11618
|
+
return this.map.delete(key);
|
|
11619
|
+
}
|
|
11620
|
+
set(key, value) {
|
|
11621
|
+
const deleted = this.delete(key);
|
|
11622
|
+
if (!deleted && value !== void 0) {
|
|
11623
|
+
if (this.map.size >= this.max) {
|
|
11624
|
+
const firstKey = this.map.keys().next().value;
|
|
11625
|
+
this.delete(firstKey);
|
|
11626
|
+
}
|
|
11627
|
+
this.map.set(key, value);
|
|
11628
|
+
}
|
|
11629
|
+
return this;
|
|
11630
|
+
}
|
|
11631
|
+
};
|
|
11632
|
+
module2.exports = LRUCache;
|
|
11633
|
+
}
|
|
11634
|
+
});
|
|
11635
|
+
|
|
11636
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
|
|
11637
|
+
var require_range = __commonJS({
|
|
11638
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports2, module2) {
|
|
11639
|
+
"use strict";
|
|
11640
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
11641
|
+
var Range = class _Range {
|
|
11642
|
+
static {
|
|
11643
|
+
__name(this, "Range");
|
|
11644
|
+
}
|
|
11645
|
+
constructor(range, options) {
|
|
11646
|
+
options = parseOptions(options);
|
|
11647
|
+
if (range instanceof _Range) {
|
|
11648
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
11649
|
+
return range;
|
|
11650
|
+
} else {
|
|
11651
|
+
return new _Range(range.raw, options);
|
|
11652
|
+
}
|
|
11653
|
+
}
|
|
11654
|
+
if (range instanceof Comparator) {
|
|
11655
|
+
this.raw = range.value;
|
|
11656
|
+
this.set = [[range]];
|
|
11657
|
+
this.formatted = void 0;
|
|
11658
|
+
return this;
|
|
11659
|
+
}
|
|
11660
|
+
this.options = options;
|
|
11661
|
+
this.loose = !!options.loose;
|
|
11662
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
11663
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
11664
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
11665
|
+
if (!this.set.length) {
|
|
11666
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
11667
|
+
}
|
|
11668
|
+
if (this.set.length > 1) {
|
|
11669
|
+
const first = this.set[0];
|
|
11670
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
11671
|
+
if (this.set.length === 0) {
|
|
11672
|
+
this.set = [first];
|
|
11673
|
+
} else if (this.set.length > 1) {
|
|
11674
|
+
for (const c of this.set) {
|
|
11675
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
11676
|
+
this.set = [c];
|
|
11677
|
+
break;
|
|
11678
|
+
}
|
|
11679
|
+
}
|
|
11680
|
+
}
|
|
11681
|
+
}
|
|
11682
|
+
this.formatted = void 0;
|
|
11683
|
+
}
|
|
11684
|
+
get range() {
|
|
11685
|
+
if (this.formatted === void 0) {
|
|
11686
|
+
this.formatted = "";
|
|
11687
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
11688
|
+
if (i > 0) {
|
|
11689
|
+
this.formatted += "||";
|
|
11690
|
+
}
|
|
11691
|
+
const comps = this.set[i];
|
|
11692
|
+
for (let k = 0; k < comps.length; k++) {
|
|
11693
|
+
if (k > 0) {
|
|
11694
|
+
this.formatted += " ";
|
|
11695
|
+
}
|
|
11696
|
+
this.formatted += comps[k].toString().trim();
|
|
11697
|
+
}
|
|
11698
|
+
}
|
|
11699
|
+
}
|
|
11700
|
+
return this.formatted;
|
|
11701
|
+
}
|
|
11702
|
+
format() {
|
|
11703
|
+
return this.range;
|
|
11704
|
+
}
|
|
11705
|
+
toString() {
|
|
11706
|
+
return this.range;
|
|
11707
|
+
}
|
|
11708
|
+
parseRange(range) {
|
|
11709
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
11710
|
+
const memoKey = memoOpts + ":" + range;
|
|
11711
|
+
const cached = cache.get(memoKey);
|
|
11712
|
+
if (cached) {
|
|
11713
|
+
return cached;
|
|
11714
|
+
}
|
|
11715
|
+
const loose = this.options.loose;
|
|
11716
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
11717
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
11718
|
+
debug("hyphen replace", range);
|
|
11719
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
11720
|
+
debug("comparator trim", range);
|
|
11721
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
11722
|
+
debug("tilde trim", range);
|
|
11723
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
11724
|
+
debug("caret trim", range);
|
|
11725
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
11726
|
+
if (loose) {
|
|
11727
|
+
rangeList = rangeList.filter((comp) => {
|
|
11728
|
+
debug("loose invalid filter", comp, this.options);
|
|
11729
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
11730
|
+
});
|
|
11731
|
+
}
|
|
11732
|
+
debug("range list", rangeList);
|
|
11733
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
11734
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
11735
|
+
for (const comp of comparators) {
|
|
11736
|
+
if (isNullSet(comp)) {
|
|
11737
|
+
return [comp];
|
|
11738
|
+
}
|
|
11739
|
+
rangeMap.set(comp.value, comp);
|
|
11740
|
+
}
|
|
11741
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
11742
|
+
rangeMap.delete("");
|
|
11743
|
+
}
|
|
11744
|
+
const result = [...rangeMap.values()];
|
|
11745
|
+
cache.set(memoKey, result);
|
|
11746
|
+
return result;
|
|
11747
|
+
}
|
|
11748
|
+
intersects(range, options) {
|
|
11749
|
+
if (!(range instanceof _Range)) {
|
|
11750
|
+
throw new TypeError("a Range is required");
|
|
11751
|
+
}
|
|
11752
|
+
return this.set.some((thisComparators) => {
|
|
11753
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
11754
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
11755
|
+
return rangeComparators.every((rangeComparator) => {
|
|
11756
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
11757
|
+
});
|
|
11758
|
+
});
|
|
11759
|
+
});
|
|
11760
|
+
});
|
|
11761
|
+
}
|
|
11762
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
11763
|
+
test(version) {
|
|
11764
|
+
if (!version) {
|
|
11765
|
+
return false;
|
|
11766
|
+
}
|
|
11767
|
+
if (typeof version === "string") {
|
|
11768
|
+
try {
|
|
11769
|
+
version = new SemVer(version, this.options);
|
|
11770
|
+
} catch (er) {
|
|
11771
|
+
return false;
|
|
11772
|
+
}
|
|
11773
|
+
}
|
|
11774
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
11775
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
11776
|
+
return true;
|
|
11777
|
+
}
|
|
11778
|
+
}
|
|
11779
|
+
return false;
|
|
11780
|
+
}
|
|
11781
|
+
};
|
|
11782
|
+
module2.exports = Range;
|
|
11783
|
+
var LRU = require_lrucache();
|
|
11784
|
+
var cache = new LRU();
|
|
11785
|
+
var parseOptions = require_parse_options();
|
|
11786
|
+
var Comparator = require_comparator();
|
|
11787
|
+
var debug = require_debug();
|
|
11788
|
+
var SemVer = require_semver();
|
|
11789
|
+
var {
|
|
11790
|
+
safeRe: re,
|
|
11791
|
+
t,
|
|
11792
|
+
comparatorTrimReplace,
|
|
11793
|
+
tildeTrimReplace,
|
|
11794
|
+
caretTrimReplace
|
|
11795
|
+
} = require_re();
|
|
11796
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
11797
|
+
var isNullSet = /* @__PURE__ */ __name((c) => c.value === "<0.0.0-0", "isNullSet");
|
|
11798
|
+
var isAny = /* @__PURE__ */ __name((c) => c.value === "", "isAny");
|
|
11799
|
+
var isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
|
|
11800
|
+
let result = true;
|
|
11801
|
+
const remainingComparators = comparators.slice();
|
|
11802
|
+
let testComparator = remainingComparators.pop();
|
|
11803
|
+
while (result && remainingComparators.length) {
|
|
11804
|
+
result = remainingComparators.every((otherComparator) => {
|
|
11805
|
+
return testComparator.intersects(otherComparator, options);
|
|
11806
|
+
});
|
|
11807
|
+
testComparator = remainingComparators.pop();
|
|
11808
|
+
}
|
|
11809
|
+
return result;
|
|
11810
|
+
}, "isSatisfiable");
|
|
11811
|
+
var parseComparator = /* @__PURE__ */ __name((comp, options) => {
|
|
11812
|
+
debug("comp", comp, options);
|
|
11813
|
+
comp = replaceCarets(comp, options);
|
|
11814
|
+
debug("caret", comp);
|
|
11815
|
+
comp = replaceTildes(comp, options);
|
|
11816
|
+
debug("tildes", comp);
|
|
11817
|
+
comp = replaceXRanges(comp, options);
|
|
11818
|
+
debug("xrange", comp);
|
|
11819
|
+
comp = replaceStars(comp, options);
|
|
11820
|
+
debug("stars", comp);
|
|
11821
|
+
return comp;
|
|
11822
|
+
}, "parseComparator");
|
|
11823
|
+
var isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
|
|
11824
|
+
var replaceTildes = /* @__PURE__ */ __name((comp, options) => {
|
|
11825
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
11826
|
+
}, "replaceTildes");
|
|
11827
|
+
var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
|
|
11828
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
11829
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
11830
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
11831
|
+
let ret;
|
|
11832
|
+
if (isX(M)) {
|
|
11833
|
+
ret = "";
|
|
11834
|
+
} else if (isX(m)) {
|
|
11835
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
11836
|
+
} else if (isX(p)) {
|
|
11837
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
11838
|
+
} else if (pr) {
|
|
11839
|
+
debug("replaceTilde pr", pr);
|
|
11840
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
11841
|
+
} else {
|
|
11842
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
11843
|
+
}
|
|
11844
|
+
debug("tilde return", ret);
|
|
11845
|
+
return ret;
|
|
11846
|
+
});
|
|
11847
|
+
}, "replaceTilde");
|
|
11848
|
+
var replaceCarets = /* @__PURE__ */ __name((comp, options) => {
|
|
11849
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
11850
|
+
}, "replaceCarets");
|
|
11851
|
+
var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
11852
|
+
debug("caret", comp, options);
|
|
11853
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
11854
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
11855
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
11856
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
11857
|
+
let ret;
|
|
11858
|
+
if (isX(M)) {
|
|
11859
|
+
ret = "";
|
|
11860
|
+
} else if (isX(m)) {
|
|
11861
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
11862
|
+
} else if (isX(p)) {
|
|
11863
|
+
if (M === "0") {
|
|
11864
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
11865
|
+
} else {
|
|
11866
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
11867
|
+
}
|
|
11868
|
+
} else if (pr) {
|
|
11869
|
+
debug("replaceCaret pr", pr);
|
|
11870
|
+
if (M === "0") {
|
|
11871
|
+
if (m === "0") {
|
|
11872
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
11873
|
+
} else {
|
|
11874
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
11875
|
+
}
|
|
11876
|
+
} else {
|
|
11877
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
11878
|
+
}
|
|
11879
|
+
} else {
|
|
11880
|
+
debug("no pr");
|
|
11881
|
+
if (M === "0") {
|
|
11882
|
+
if (m === "0") {
|
|
11883
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
11884
|
+
} else {
|
|
11885
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
11886
|
+
}
|
|
11887
|
+
} else {
|
|
11888
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
11889
|
+
}
|
|
11890
|
+
}
|
|
11891
|
+
debug("caret return", ret);
|
|
11892
|
+
return ret;
|
|
11893
|
+
});
|
|
11894
|
+
}, "replaceCaret");
|
|
11895
|
+
var replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
|
|
11896
|
+
debug("replaceXRanges", comp, options);
|
|
11897
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
11898
|
+
}, "replaceXRanges");
|
|
11899
|
+
var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
|
|
11900
|
+
comp = comp.trim();
|
|
11901
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
11902
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
11903
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
11904
|
+
const xM = isX(M);
|
|
11905
|
+
const xm = xM || isX(m);
|
|
11906
|
+
const xp = xm || isX(p);
|
|
11907
|
+
const anyX = xp;
|
|
11908
|
+
if (gtlt === "=" && anyX) {
|
|
11909
|
+
gtlt = "";
|
|
11910
|
+
}
|
|
11911
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
11912
|
+
if (xM) {
|
|
11913
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
11914
|
+
ret = "<0.0.0-0";
|
|
11915
|
+
} else {
|
|
11916
|
+
ret = "*";
|
|
11917
|
+
}
|
|
11918
|
+
} else if (gtlt && anyX) {
|
|
11919
|
+
if (xm) {
|
|
11920
|
+
m = 0;
|
|
11921
|
+
}
|
|
11922
|
+
p = 0;
|
|
11923
|
+
if (gtlt === ">") {
|
|
11924
|
+
gtlt = ">=";
|
|
11925
|
+
if (xm) {
|
|
11926
|
+
M = +M + 1;
|
|
11927
|
+
m = 0;
|
|
11928
|
+
p = 0;
|
|
11929
|
+
} else {
|
|
11930
|
+
m = +m + 1;
|
|
11931
|
+
p = 0;
|
|
11932
|
+
}
|
|
11933
|
+
} else if (gtlt === "<=") {
|
|
11934
|
+
gtlt = "<";
|
|
11935
|
+
if (xm) {
|
|
11936
|
+
M = +M + 1;
|
|
11937
|
+
} else {
|
|
11938
|
+
m = +m + 1;
|
|
11939
|
+
}
|
|
11940
|
+
}
|
|
11941
|
+
if (gtlt === "<") {
|
|
11942
|
+
pr = "-0";
|
|
11943
|
+
}
|
|
11944
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
11945
|
+
} else if (xm) {
|
|
11946
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
11947
|
+
} else if (xp) {
|
|
11948
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
11949
|
+
}
|
|
11950
|
+
debug("xRange return", ret);
|
|
11951
|
+
return ret;
|
|
11952
|
+
});
|
|
11953
|
+
}, "replaceXRange");
|
|
11954
|
+
var replaceStars = /* @__PURE__ */ __name((comp, options) => {
|
|
11955
|
+
debug("replaceStars", comp, options);
|
|
11956
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
11957
|
+
}, "replaceStars");
|
|
11958
|
+
var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
|
|
11959
|
+
debug("replaceGTE0", comp, options);
|
|
11960
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
11961
|
+
}, "replaceGTE0");
|
|
11962
|
+
var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
11963
|
+
if (isX(fM)) {
|
|
11964
|
+
from = "";
|
|
11965
|
+
} else if (isX(fm)) {
|
|
11966
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
11967
|
+
} else if (isX(fp)) {
|
|
11968
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
11969
|
+
} else if (fpr) {
|
|
11970
|
+
from = `>=${from}`;
|
|
11971
|
+
} else {
|
|
11972
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
11973
|
+
}
|
|
11974
|
+
if (isX(tM)) {
|
|
11975
|
+
to = "";
|
|
11976
|
+
} else if (isX(tm)) {
|
|
11977
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
11978
|
+
} else if (isX(tp)) {
|
|
11979
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
11980
|
+
} else if (tpr) {
|
|
11981
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
11982
|
+
} else if (incPr) {
|
|
11983
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
11984
|
+
} else {
|
|
11985
|
+
to = `<=${to}`;
|
|
11986
|
+
}
|
|
11987
|
+
return `${from} ${to}`.trim();
|
|
11988
|
+
}, "hyphenReplace");
|
|
11989
|
+
var testSet = /* @__PURE__ */ __name((set, version, options) => {
|
|
11990
|
+
for (let i = 0; i < set.length; i++) {
|
|
11991
|
+
if (!set[i].test(version)) {
|
|
11992
|
+
return false;
|
|
11993
|
+
}
|
|
11994
|
+
}
|
|
11995
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
11996
|
+
for (let i = 0; i < set.length; i++) {
|
|
11997
|
+
debug(set[i].semver);
|
|
11998
|
+
if (set[i].semver === Comparator.ANY) {
|
|
11999
|
+
continue;
|
|
12000
|
+
}
|
|
12001
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
12002
|
+
const allowed = set[i].semver;
|
|
12003
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
12004
|
+
return true;
|
|
12005
|
+
}
|
|
12006
|
+
}
|
|
12007
|
+
}
|
|
12008
|
+
return false;
|
|
12009
|
+
}
|
|
12010
|
+
return true;
|
|
12011
|
+
}, "testSet");
|
|
12012
|
+
}
|
|
12013
|
+
});
|
|
12014
|
+
|
|
12015
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
|
|
12016
|
+
var require_comparator = __commonJS({
|
|
12017
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports2, module2) {
|
|
12018
|
+
"use strict";
|
|
12019
|
+
var ANY = Symbol("SemVer ANY");
|
|
12020
|
+
var Comparator = class _Comparator {
|
|
12021
|
+
static {
|
|
12022
|
+
__name(this, "Comparator");
|
|
12023
|
+
}
|
|
12024
|
+
static get ANY() {
|
|
12025
|
+
return ANY;
|
|
12026
|
+
}
|
|
12027
|
+
constructor(comp, options) {
|
|
12028
|
+
options = parseOptions(options);
|
|
12029
|
+
if (comp instanceof _Comparator) {
|
|
12030
|
+
if (comp.loose === !!options.loose) {
|
|
12031
|
+
return comp;
|
|
12032
|
+
} else {
|
|
12033
|
+
comp = comp.value;
|
|
12034
|
+
}
|
|
12035
|
+
}
|
|
12036
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
12037
|
+
debug("comparator", comp, options);
|
|
12038
|
+
this.options = options;
|
|
12039
|
+
this.loose = !!options.loose;
|
|
12040
|
+
this.parse(comp);
|
|
12041
|
+
if (this.semver === ANY) {
|
|
12042
|
+
this.value = "";
|
|
12043
|
+
} else {
|
|
12044
|
+
this.value = this.operator + this.semver.version;
|
|
12045
|
+
}
|
|
12046
|
+
debug("comp", this);
|
|
12047
|
+
}
|
|
12048
|
+
parse(comp) {
|
|
12049
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
12050
|
+
const m = comp.match(r);
|
|
12051
|
+
if (!m) {
|
|
12052
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
12053
|
+
}
|
|
12054
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
12055
|
+
if (this.operator === "=") {
|
|
12056
|
+
this.operator = "";
|
|
12057
|
+
}
|
|
12058
|
+
if (!m[2]) {
|
|
12059
|
+
this.semver = ANY;
|
|
12060
|
+
} else {
|
|
12061
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
12062
|
+
}
|
|
12063
|
+
}
|
|
12064
|
+
toString() {
|
|
12065
|
+
return this.value;
|
|
12066
|
+
}
|
|
12067
|
+
test(version) {
|
|
12068
|
+
debug("Comparator.test", version, this.options.loose);
|
|
12069
|
+
if (this.semver === ANY || version === ANY) {
|
|
12070
|
+
return true;
|
|
12071
|
+
}
|
|
12072
|
+
if (typeof version === "string") {
|
|
12073
|
+
try {
|
|
12074
|
+
version = new SemVer(version, this.options);
|
|
12075
|
+
} catch (er) {
|
|
12076
|
+
return false;
|
|
12077
|
+
}
|
|
12078
|
+
}
|
|
12079
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
12080
|
+
}
|
|
12081
|
+
intersects(comp, options) {
|
|
12082
|
+
if (!(comp instanceof _Comparator)) {
|
|
12083
|
+
throw new TypeError("a Comparator is required");
|
|
12084
|
+
}
|
|
12085
|
+
if (this.operator === "") {
|
|
12086
|
+
if (this.value === "") {
|
|
12087
|
+
return true;
|
|
12088
|
+
}
|
|
12089
|
+
return new Range(comp.value, options).test(this.value);
|
|
12090
|
+
} else if (comp.operator === "") {
|
|
12091
|
+
if (comp.value === "") {
|
|
12092
|
+
return true;
|
|
12093
|
+
}
|
|
12094
|
+
return new Range(this.value, options).test(comp.semver);
|
|
12095
|
+
}
|
|
12096
|
+
options = parseOptions(options);
|
|
12097
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
12098
|
+
return false;
|
|
12099
|
+
}
|
|
12100
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
12101
|
+
return false;
|
|
12102
|
+
}
|
|
12103
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
12104
|
+
return true;
|
|
12105
|
+
}
|
|
12106
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
12107
|
+
return true;
|
|
12108
|
+
}
|
|
12109
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
12110
|
+
return true;
|
|
12111
|
+
}
|
|
12112
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
12113
|
+
return true;
|
|
12114
|
+
}
|
|
12115
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
12116
|
+
return true;
|
|
12117
|
+
}
|
|
12118
|
+
return false;
|
|
12119
|
+
}
|
|
12120
|
+
};
|
|
12121
|
+
module2.exports = Comparator;
|
|
12122
|
+
var parseOptions = require_parse_options();
|
|
12123
|
+
var { safeRe: re, t } = require_re();
|
|
12124
|
+
var cmp = require_cmp();
|
|
12125
|
+
var debug = require_debug();
|
|
12126
|
+
var SemVer = require_semver();
|
|
12127
|
+
var Range = require_range();
|
|
12128
|
+
}
|
|
12129
|
+
});
|
|
12130
|
+
|
|
12131
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
|
|
12132
|
+
var require_satisfies = __commonJS({
|
|
12133
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports2, module2) {
|
|
12134
|
+
"use strict";
|
|
12135
|
+
var Range = require_range();
|
|
12136
|
+
var satisfies = /* @__PURE__ */ __name((version, range, options) => {
|
|
12137
|
+
try {
|
|
12138
|
+
range = new Range(range, options);
|
|
12139
|
+
} catch (er) {
|
|
12140
|
+
return false;
|
|
12141
|
+
}
|
|
12142
|
+
return range.test(version);
|
|
12143
|
+
}, "satisfies");
|
|
12144
|
+
module2.exports = satisfies;
|
|
12145
|
+
}
|
|
12146
|
+
});
|
|
12147
|
+
|
|
12148
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
|
|
12149
|
+
var require_to_comparators = __commonJS({
|
|
12150
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
|
|
12151
|
+
"use strict";
|
|
12152
|
+
var Range = require_range();
|
|
12153
|
+
var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators");
|
|
12154
|
+
module2.exports = toComparators;
|
|
12155
|
+
}
|
|
12156
|
+
});
|
|
12157
|
+
|
|
12158
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
|
|
12159
|
+
var require_max_satisfying = __commonJS({
|
|
12160
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
|
|
12161
|
+
"use strict";
|
|
12162
|
+
var SemVer = require_semver();
|
|
12163
|
+
var Range = require_range();
|
|
12164
|
+
var maxSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
12165
|
+
let max = null;
|
|
12166
|
+
let maxSV = null;
|
|
12167
|
+
let rangeObj = null;
|
|
12168
|
+
try {
|
|
12169
|
+
rangeObj = new Range(range, options);
|
|
12170
|
+
} catch (er) {
|
|
12171
|
+
return null;
|
|
12172
|
+
}
|
|
12173
|
+
versions.forEach((v) => {
|
|
12174
|
+
if (rangeObj.test(v)) {
|
|
12175
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
12176
|
+
max = v;
|
|
12177
|
+
maxSV = new SemVer(max, options);
|
|
12178
|
+
}
|
|
12179
|
+
}
|
|
12180
|
+
});
|
|
12181
|
+
return max;
|
|
12182
|
+
}, "maxSatisfying");
|
|
12183
|
+
module2.exports = maxSatisfying;
|
|
12184
|
+
}
|
|
12185
|
+
});
|
|
12186
|
+
|
|
12187
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
|
|
12188
|
+
var require_min_satisfying = __commonJS({
|
|
12189
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
|
|
12190
|
+
"use strict";
|
|
12191
|
+
var SemVer = require_semver();
|
|
12192
|
+
var Range = require_range();
|
|
12193
|
+
var minSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
12194
|
+
let min = null;
|
|
12195
|
+
let minSV = null;
|
|
12196
|
+
let rangeObj = null;
|
|
12197
|
+
try {
|
|
12198
|
+
rangeObj = new Range(range, options);
|
|
12199
|
+
} catch (er) {
|
|
12200
|
+
return null;
|
|
12201
|
+
}
|
|
12202
|
+
versions.forEach((v) => {
|
|
12203
|
+
if (rangeObj.test(v)) {
|
|
12204
|
+
if (!min || minSV.compare(v) === 1) {
|
|
12205
|
+
min = v;
|
|
12206
|
+
minSV = new SemVer(min, options);
|
|
12207
|
+
}
|
|
12208
|
+
}
|
|
12209
|
+
});
|
|
12210
|
+
return min;
|
|
12211
|
+
}, "minSatisfying");
|
|
12212
|
+
module2.exports = minSatisfying;
|
|
12213
|
+
}
|
|
12214
|
+
});
|
|
12215
|
+
|
|
12216
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
|
|
12217
|
+
var require_min_version = __commonJS({
|
|
12218
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports2, module2) {
|
|
12219
|
+
"use strict";
|
|
12220
|
+
var SemVer = require_semver();
|
|
12221
|
+
var Range = require_range();
|
|
12222
|
+
var gt = require_gt();
|
|
12223
|
+
var minVersion = /* @__PURE__ */ __name((range, loose) => {
|
|
12224
|
+
range = new Range(range, loose);
|
|
12225
|
+
let minver = new SemVer("0.0.0");
|
|
12226
|
+
if (range.test(minver)) {
|
|
12227
|
+
return minver;
|
|
12228
|
+
}
|
|
12229
|
+
minver = new SemVer("0.0.0-0");
|
|
12230
|
+
if (range.test(minver)) {
|
|
12231
|
+
return minver;
|
|
12232
|
+
}
|
|
12233
|
+
minver = null;
|
|
12234
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
12235
|
+
const comparators = range.set[i];
|
|
12236
|
+
let setMin = null;
|
|
12237
|
+
comparators.forEach((comparator) => {
|
|
12238
|
+
const compver = new SemVer(comparator.semver.version);
|
|
12239
|
+
switch (comparator.operator) {
|
|
12240
|
+
case ">":
|
|
12241
|
+
if (compver.prerelease.length === 0) {
|
|
12242
|
+
compver.patch++;
|
|
12243
|
+
} else {
|
|
12244
|
+
compver.prerelease.push(0);
|
|
12245
|
+
}
|
|
12246
|
+
compver.raw = compver.format();
|
|
12247
|
+
/* fallthrough */
|
|
12248
|
+
case "":
|
|
12249
|
+
case ">=":
|
|
12250
|
+
if (!setMin || gt(compver, setMin)) {
|
|
12251
|
+
setMin = compver;
|
|
12252
|
+
}
|
|
12253
|
+
break;
|
|
12254
|
+
case "<":
|
|
12255
|
+
case "<=":
|
|
12256
|
+
break;
|
|
12257
|
+
/* istanbul ignore next */
|
|
12258
|
+
default:
|
|
12259
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
12260
|
+
}
|
|
12261
|
+
});
|
|
12262
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
12263
|
+
minver = setMin;
|
|
12264
|
+
}
|
|
12265
|
+
}
|
|
12266
|
+
if (minver && range.test(minver)) {
|
|
12267
|
+
return minver;
|
|
12268
|
+
}
|
|
12269
|
+
return null;
|
|
12270
|
+
}, "minVersion");
|
|
12271
|
+
module2.exports = minVersion;
|
|
12272
|
+
}
|
|
12273
|
+
});
|
|
12274
|
+
|
|
12275
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
|
|
12276
|
+
var require_valid2 = __commonJS({
|
|
12277
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js"(exports2, module2) {
|
|
12278
|
+
"use strict";
|
|
12279
|
+
var Range = require_range();
|
|
12280
|
+
var validRange = /* @__PURE__ */ __name((range, options) => {
|
|
12281
|
+
try {
|
|
12282
|
+
return new Range(range, options).range || "*";
|
|
12283
|
+
} catch (er) {
|
|
12284
|
+
return null;
|
|
12285
|
+
}
|
|
12286
|
+
}, "validRange");
|
|
12287
|
+
module2.exports = validRange;
|
|
12288
|
+
}
|
|
12289
|
+
});
|
|
12290
|
+
|
|
12291
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
|
|
12292
|
+
var require_outside = __commonJS({
|
|
12293
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports2, module2) {
|
|
12294
|
+
"use strict";
|
|
12295
|
+
var SemVer = require_semver();
|
|
12296
|
+
var Comparator = require_comparator();
|
|
12297
|
+
var { ANY } = Comparator;
|
|
12298
|
+
var Range = require_range();
|
|
12299
|
+
var satisfies = require_satisfies();
|
|
12300
|
+
var gt = require_gt();
|
|
12301
|
+
var lt = require_lt();
|
|
12302
|
+
var lte = require_lte();
|
|
12303
|
+
var gte = require_gte();
|
|
12304
|
+
var outside = /* @__PURE__ */ __name((version, range, hilo, options) => {
|
|
12305
|
+
version = new SemVer(version, options);
|
|
12306
|
+
range = new Range(range, options);
|
|
12307
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
12308
|
+
switch (hilo) {
|
|
12309
|
+
case ">":
|
|
12310
|
+
gtfn = gt;
|
|
12311
|
+
ltefn = lte;
|
|
12312
|
+
ltfn = lt;
|
|
12313
|
+
comp = ">";
|
|
12314
|
+
ecomp = ">=";
|
|
12315
|
+
break;
|
|
12316
|
+
case "<":
|
|
12317
|
+
gtfn = lt;
|
|
12318
|
+
ltefn = gte;
|
|
12319
|
+
ltfn = gt;
|
|
12320
|
+
comp = "<";
|
|
12321
|
+
ecomp = "<=";
|
|
12322
|
+
break;
|
|
12323
|
+
default:
|
|
12324
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
12325
|
+
}
|
|
12326
|
+
if (satisfies(version, range, options)) {
|
|
12327
|
+
return false;
|
|
12328
|
+
}
|
|
12329
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
12330
|
+
const comparators = range.set[i];
|
|
12331
|
+
let high = null;
|
|
12332
|
+
let low = null;
|
|
12333
|
+
comparators.forEach((comparator) => {
|
|
12334
|
+
if (comparator.semver === ANY) {
|
|
12335
|
+
comparator = new Comparator(">=0.0.0");
|
|
12336
|
+
}
|
|
12337
|
+
high = high || comparator;
|
|
12338
|
+
low = low || comparator;
|
|
12339
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
12340
|
+
high = comparator;
|
|
12341
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
12342
|
+
low = comparator;
|
|
12343
|
+
}
|
|
12344
|
+
});
|
|
12345
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
12346
|
+
return false;
|
|
12347
|
+
}
|
|
12348
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
12349
|
+
return false;
|
|
12350
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
12351
|
+
return false;
|
|
12352
|
+
}
|
|
12353
|
+
}
|
|
12354
|
+
return true;
|
|
12355
|
+
}, "outside");
|
|
12356
|
+
module2.exports = outside;
|
|
12357
|
+
}
|
|
12358
|
+
});
|
|
12359
|
+
|
|
12360
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
|
|
12361
|
+
var require_gtr = __commonJS({
|
|
12362
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports2, module2) {
|
|
12363
|
+
"use strict";
|
|
12364
|
+
var outside = require_outside();
|
|
12365
|
+
var gtr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, ">", options), "gtr");
|
|
12366
|
+
module2.exports = gtr;
|
|
12367
|
+
}
|
|
12368
|
+
});
|
|
12369
|
+
|
|
12370
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
|
|
12371
|
+
var require_ltr = __commonJS({
|
|
12372
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports2, module2) {
|
|
12373
|
+
"use strict";
|
|
12374
|
+
var outside = require_outside();
|
|
12375
|
+
var ltr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, "<", options), "ltr");
|
|
12376
|
+
module2.exports = ltr;
|
|
12377
|
+
}
|
|
12378
|
+
});
|
|
12379
|
+
|
|
12380
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
|
|
12381
|
+
var require_intersects = __commonJS({
|
|
12382
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js"(exports2, module2) {
|
|
12383
|
+
"use strict";
|
|
12384
|
+
var Range = require_range();
|
|
12385
|
+
var intersects = /* @__PURE__ */ __name((r1, r2, options) => {
|
|
12386
|
+
r1 = new Range(r1, options);
|
|
12387
|
+
r2 = new Range(r2, options);
|
|
12388
|
+
return r1.intersects(r2, options);
|
|
12389
|
+
}, "intersects");
|
|
12390
|
+
module2.exports = intersects;
|
|
12391
|
+
}
|
|
12392
|
+
});
|
|
12393
|
+
|
|
12394
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
|
|
12395
|
+
var require_simplify = __commonJS({
|
|
12396
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js"(exports2, module2) {
|
|
12397
|
+
"use strict";
|
|
12398
|
+
var satisfies = require_satisfies();
|
|
12399
|
+
var compare = require_compare();
|
|
12400
|
+
module2.exports = (versions, range, options) => {
|
|
12401
|
+
const set = [];
|
|
12402
|
+
let first = null;
|
|
12403
|
+
let prev = null;
|
|
12404
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
12405
|
+
for (const version of v) {
|
|
12406
|
+
const included = satisfies(version, range, options);
|
|
12407
|
+
if (included) {
|
|
12408
|
+
prev = version;
|
|
12409
|
+
if (!first) {
|
|
12410
|
+
first = version;
|
|
12411
|
+
}
|
|
12412
|
+
} else {
|
|
12413
|
+
if (prev) {
|
|
12414
|
+
set.push([first, prev]);
|
|
12415
|
+
}
|
|
12416
|
+
prev = null;
|
|
12417
|
+
first = null;
|
|
12418
|
+
}
|
|
12419
|
+
}
|
|
12420
|
+
if (first) {
|
|
12421
|
+
set.push([first, null]);
|
|
12422
|
+
}
|
|
12423
|
+
const ranges = [];
|
|
12424
|
+
for (const [min, max] of set) {
|
|
12425
|
+
if (min === max) {
|
|
12426
|
+
ranges.push(min);
|
|
12427
|
+
} else if (!max && min === v[0]) {
|
|
12428
|
+
ranges.push("*");
|
|
12429
|
+
} else if (!max) {
|
|
12430
|
+
ranges.push(`>=${min}`);
|
|
12431
|
+
} else if (min === v[0]) {
|
|
12432
|
+
ranges.push(`<=${max}`);
|
|
12433
|
+
} else {
|
|
12434
|
+
ranges.push(`${min} - ${max}`);
|
|
12435
|
+
}
|
|
12436
|
+
}
|
|
12437
|
+
const simplified = ranges.join(" || ");
|
|
12438
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
12439
|
+
return simplified.length < original.length ? simplified : range;
|
|
12440
|
+
};
|
|
12441
|
+
}
|
|
12442
|
+
});
|
|
12443
|
+
|
|
12444
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
|
|
12445
|
+
var require_subset = __commonJS({
|
|
12446
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js"(exports2, module2) {
|
|
12447
|
+
"use strict";
|
|
12448
|
+
var Range = require_range();
|
|
12449
|
+
var Comparator = require_comparator();
|
|
12450
|
+
var { ANY } = Comparator;
|
|
12451
|
+
var satisfies = require_satisfies();
|
|
12452
|
+
var compare = require_compare();
|
|
12453
|
+
var subset = /* @__PURE__ */ __name((sub, dom, options = {}) => {
|
|
12454
|
+
if (sub === dom) {
|
|
12455
|
+
return true;
|
|
12456
|
+
}
|
|
12457
|
+
sub = new Range(sub, options);
|
|
12458
|
+
dom = new Range(dom, options);
|
|
12459
|
+
let sawNonNull = false;
|
|
12460
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
12461
|
+
for (const simpleDom of dom.set) {
|
|
12462
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
12463
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
12464
|
+
if (isSub) {
|
|
12465
|
+
continue OUTER;
|
|
12466
|
+
}
|
|
12467
|
+
}
|
|
12468
|
+
if (sawNonNull) {
|
|
12469
|
+
return false;
|
|
12470
|
+
}
|
|
12471
|
+
}
|
|
12472
|
+
return true;
|
|
12473
|
+
}, "subset");
|
|
12474
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
12475
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
12476
|
+
var simpleSubset = /* @__PURE__ */ __name((sub, dom, options) => {
|
|
12477
|
+
if (sub === dom) {
|
|
12478
|
+
return true;
|
|
12479
|
+
}
|
|
12480
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
12481
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
12482
|
+
return true;
|
|
12483
|
+
} else if (options.includePrerelease) {
|
|
12484
|
+
sub = minimumVersionWithPreRelease;
|
|
12485
|
+
} else {
|
|
12486
|
+
sub = minimumVersion;
|
|
12487
|
+
}
|
|
12488
|
+
}
|
|
12489
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
12490
|
+
if (options.includePrerelease) {
|
|
12491
|
+
return true;
|
|
12492
|
+
} else {
|
|
12493
|
+
dom = minimumVersion;
|
|
12494
|
+
}
|
|
12495
|
+
}
|
|
12496
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
12497
|
+
let gt, lt;
|
|
12498
|
+
for (const c of sub) {
|
|
12499
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
12500
|
+
gt = higherGT(gt, c, options);
|
|
12501
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
12502
|
+
lt = lowerLT(lt, c, options);
|
|
12503
|
+
} else {
|
|
12504
|
+
eqSet.add(c.semver);
|
|
12505
|
+
}
|
|
12506
|
+
}
|
|
12507
|
+
if (eqSet.size > 1) {
|
|
12508
|
+
return null;
|
|
12509
|
+
}
|
|
12510
|
+
let gtltComp;
|
|
12511
|
+
if (gt && lt) {
|
|
12512
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
12513
|
+
if (gtltComp > 0) {
|
|
12514
|
+
return null;
|
|
12515
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
12516
|
+
return null;
|
|
12517
|
+
}
|
|
12518
|
+
}
|
|
12519
|
+
for (const eq of eqSet) {
|
|
12520
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
12521
|
+
return null;
|
|
12522
|
+
}
|
|
12523
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
12524
|
+
return null;
|
|
12525
|
+
}
|
|
12526
|
+
for (const c of dom) {
|
|
12527
|
+
if (!satisfies(eq, String(c), options)) {
|
|
12528
|
+
return false;
|
|
12529
|
+
}
|
|
12530
|
+
}
|
|
12531
|
+
return true;
|
|
12532
|
+
}
|
|
12533
|
+
let higher, lower;
|
|
12534
|
+
let hasDomLT, hasDomGT;
|
|
12535
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
12536
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
12537
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
12538
|
+
needDomLTPre = false;
|
|
12539
|
+
}
|
|
12540
|
+
for (const c of dom) {
|
|
12541
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
12542
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
12543
|
+
if (gt) {
|
|
12544
|
+
if (needDomGTPre) {
|
|
12545
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
12546
|
+
needDomGTPre = false;
|
|
12547
|
+
}
|
|
12548
|
+
}
|
|
12549
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
12550
|
+
higher = higherGT(gt, c, options);
|
|
12551
|
+
if (higher === c && higher !== gt) {
|
|
12552
|
+
return false;
|
|
12553
|
+
}
|
|
12554
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
12555
|
+
return false;
|
|
12556
|
+
}
|
|
12557
|
+
}
|
|
12558
|
+
if (lt) {
|
|
12559
|
+
if (needDomLTPre) {
|
|
12560
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
12561
|
+
needDomLTPre = false;
|
|
12562
|
+
}
|
|
12563
|
+
}
|
|
12564
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
12565
|
+
lower = lowerLT(lt, c, options);
|
|
12566
|
+
if (lower === c && lower !== lt) {
|
|
12567
|
+
return false;
|
|
12568
|
+
}
|
|
12569
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
12570
|
+
return false;
|
|
12571
|
+
}
|
|
12572
|
+
}
|
|
12573
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
12574
|
+
return false;
|
|
12575
|
+
}
|
|
12576
|
+
}
|
|
12577
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
12578
|
+
return false;
|
|
12579
|
+
}
|
|
12580
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
12581
|
+
return false;
|
|
12582
|
+
}
|
|
12583
|
+
if (needDomGTPre || needDomLTPre) {
|
|
12584
|
+
return false;
|
|
12585
|
+
}
|
|
12586
|
+
return true;
|
|
12587
|
+
}, "simpleSubset");
|
|
12588
|
+
var higherGT = /* @__PURE__ */ __name((a, b, options) => {
|
|
12589
|
+
if (!a) {
|
|
12590
|
+
return b;
|
|
12591
|
+
}
|
|
12592
|
+
const comp = compare(a.semver, b.semver, options);
|
|
12593
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
12594
|
+
}, "higherGT");
|
|
12595
|
+
var lowerLT = /* @__PURE__ */ __name((a, b, options) => {
|
|
12596
|
+
if (!a) {
|
|
12597
|
+
return b;
|
|
12598
|
+
}
|
|
12599
|
+
const comp = compare(a.semver, b.semver, options);
|
|
12600
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
12601
|
+
}, "lowerLT");
|
|
12602
|
+
module2.exports = subset;
|
|
12603
|
+
}
|
|
12604
|
+
});
|
|
12605
|
+
|
|
12606
|
+
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js
|
|
12607
|
+
var require_semver2 = __commonJS({
|
|
12608
|
+
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js"(exports2, module2) {
|
|
12609
|
+
"use strict";
|
|
12610
|
+
var internalRe = require_re();
|
|
12611
|
+
var constants = require_constants();
|
|
12612
|
+
var SemVer = require_semver();
|
|
12613
|
+
var identifiers = require_identifiers();
|
|
12614
|
+
var parse = require_parse();
|
|
12615
|
+
var valid = require_valid();
|
|
12616
|
+
var clean = require_clean();
|
|
12617
|
+
var inc = require_inc();
|
|
12618
|
+
var diff = require_diff();
|
|
12619
|
+
var major = require_major();
|
|
12620
|
+
var minor = require_minor();
|
|
12621
|
+
var patch = require_patch();
|
|
12622
|
+
var prerelease = require_prerelease();
|
|
12623
|
+
var compare = require_compare();
|
|
12624
|
+
var rcompare = require_rcompare();
|
|
12625
|
+
var compareLoose = require_compare_loose();
|
|
12626
|
+
var compareBuild = require_compare_build();
|
|
12627
|
+
var sort = require_sort();
|
|
12628
|
+
var rsort = require_rsort();
|
|
12629
|
+
var gt = require_gt();
|
|
12630
|
+
var lt = require_lt();
|
|
12631
|
+
var eq = require_eq();
|
|
12632
|
+
var neq = require_neq();
|
|
12633
|
+
var gte = require_gte();
|
|
12634
|
+
var lte = require_lte();
|
|
12635
|
+
var cmp = require_cmp();
|
|
12636
|
+
var coerce = require_coerce();
|
|
12637
|
+
var Comparator = require_comparator();
|
|
12638
|
+
var Range = require_range();
|
|
12639
|
+
var satisfies = require_satisfies();
|
|
12640
|
+
var toComparators = require_to_comparators();
|
|
12641
|
+
var maxSatisfying = require_max_satisfying();
|
|
12642
|
+
var minSatisfying = require_min_satisfying();
|
|
12643
|
+
var minVersion = require_min_version();
|
|
12644
|
+
var validRange = require_valid2();
|
|
12645
|
+
var outside = require_outside();
|
|
12646
|
+
var gtr = require_gtr();
|
|
12647
|
+
var ltr = require_ltr();
|
|
12648
|
+
var intersects = require_intersects();
|
|
12649
|
+
var simplifyRange = require_simplify();
|
|
12650
|
+
var subset = require_subset();
|
|
12651
|
+
module2.exports = {
|
|
12652
|
+
parse,
|
|
12653
|
+
valid,
|
|
12654
|
+
clean,
|
|
12655
|
+
inc,
|
|
12656
|
+
diff,
|
|
12657
|
+
major,
|
|
12658
|
+
minor,
|
|
12659
|
+
patch,
|
|
12660
|
+
prerelease,
|
|
12661
|
+
compare,
|
|
12662
|
+
rcompare,
|
|
12663
|
+
compareLoose,
|
|
12664
|
+
compareBuild,
|
|
12665
|
+
sort,
|
|
12666
|
+
rsort,
|
|
12667
|
+
gt,
|
|
12668
|
+
lt,
|
|
12669
|
+
eq,
|
|
12670
|
+
neq,
|
|
12671
|
+
gte,
|
|
12672
|
+
lte,
|
|
12673
|
+
cmp,
|
|
12674
|
+
coerce,
|
|
12675
|
+
Comparator,
|
|
12676
|
+
Range,
|
|
12677
|
+
satisfies,
|
|
12678
|
+
toComparators,
|
|
12679
|
+
maxSatisfying,
|
|
12680
|
+
minSatisfying,
|
|
12681
|
+
minVersion,
|
|
12682
|
+
validRange,
|
|
12683
|
+
outside,
|
|
12684
|
+
gtr,
|
|
12685
|
+
ltr,
|
|
12686
|
+
intersects,
|
|
12687
|
+
simplifyRange,
|
|
12688
|
+
subset,
|
|
12689
|
+
SemVer,
|
|
12690
|
+
re: internalRe.re,
|
|
12691
|
+
src: internalRe.src,
|
|
12692
|
+
tokens: internalRe.t,
|
|
12693
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
12694
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
12695
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
12696
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
12697
|
+
};
|
|
12698
|
+
}
|
|
12699
|
+
});
|
|
12700
|
+
|
|
12701
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/lines-to-revs.js
|
|
12702
|
+
var require_lines_to_revs = __commonJS({
|
|
12703
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/lines-to-revs.js"(exports2, module2) {
|
|
12704
|
+
var semver = require_semver2();
|
|
12705
|
+
module2.exports = (lines) => finish(lines.reduce(linesToRevsReducer, {
|
|
12706
|
+
versions: {},
|
|
12707
|
+
"dist-tags": {},
|
|
12708
|
+
refs: {},
|
|
12709
|
+
shas: {}
|
|
12710
|
+
}));
|
|
12711
|
+
var finish = /* @__PURE__ */ __name((revs) => distTags(shaList(peelTags(revs))), "finish");
|
|
12712
|
+
var shaList = /* @__PURE__ */ __name((revs) => {
|
|
12713
|
+
Object.keys(revs.refs).forEach((ref) => {
|
|
12714
|
+
const doc = revs.refs[ref];
|
|
12715
|
+
if (!revs.shas[doc.sha]) {
|
|
12716
|
+
revs.shas[doc.sha] = [ref];
|
|
12717
|
+
} else {
|
|
12718
|
+
revs.shas[doc.sha].push(ref);
|
|
12719
|
+
}
|
|
12720
|
+
});
|
|
12721
|
+
return revs;
|
|
12722
|
+
}, "shaList");
|
|
12723
|
+
var peelTags = /* @__PURE__ */ __name((revs) => {
|
|
12724
|
+
Object.keys(revs.refs).filter((ref) => ref.endsWith("^{}")).forEach((ref) => {
|
|
12725
|
+
const peeled = revs.refs[ref];
|
|
12726
|
+
const unpeeled = revs.refs[ref.replace(/\^\{\}$/, "")];
|
|
12727
|
+
if (unpeeled) {
|
|
12728
|
+
unpeeled.sha = peeled.sha;
|
|
12729
|
+
delete revs.refs[ref];
|
|
12730
|
+
}
|
|
12731
|
+
});
|
|
12732
|
+
return revs;
|
|
12733
|
+
}, "peelTags");
|
|
12734
|
+
var distTags = /* @__PURE__ */ __name((revs) => {
|
|
12735
|
+
const HEAD = revs.refs.HEAD || /* istanbul ignore next */
|
|
12736
|
+
{};
|
|
12737
|
+
const versions = Object.keys(revs.versions);
|
|
12738
|
+
versions.forEach((v) => {
|
|
12739
|
+
const ver = revs.versions[v];
|
|
12740
|
+
if (revs.refs.latest && ver.sha === revs.refs.latest.sha) {
|
|
12741
|
+
revs["dist-tags"].latest = v;
|
|
12742
|
+
} else if (ver.sha === HEAD.sha) {
|
|
12743
|
+
revs["dist-tags"].HEAD = v;
|
|
12744
|
+
if (!revs.refs.latest) {
|
|
12745
|
+
revs["dist-tags"].latest = v;
|
|
12746
|
+
}
|
|
12747
|
+
}
|
|
12748
|
+
});
|
|
12749
|
+
return revs;
|
|
12750
|
+
}, "distTags");
|
|
12751
|
+
var refType = /* @__PURE__ */ __name((ref) => {
|
|
12752
|
+
if (ref.startsWith("refs/tags/")) {
|
|
12753
|
+
return "tag";
|
|
12754
|
+
}
|
|
12755
|
+
if (ref.startsWith("refs/heads/")) {
|
|
12756
|
+
return "branch";
|
|
12757
|
+
}
|
|
12758
|
+
if (ref.startsWith("refs/pull/")) {
|
|
12759
|
+
return "pull";
|
|
12760
|
+
}
|
|
12761
|
+
if (ref === "HEAD") {
|
|
12762
|
+
return "head";
|
|
12763
|
+
}
|
|
12764
|
+
return "other";
|
|
12765
|
+
}, "refType");
|
|
12766
|
+
var lineToRevDoc = /* @__PURE__ */ __name((line) => {
|
|
12767
|
+
const split = line.trim().split(/\s+/, 2);
|
|
12768
|
+
if (split.length < 2) {
|
|
12769
|
+
return null;
|
|
12770
|
+
}
|
|
12771
|
+
const sha = split[0].trim();
|
|
12772
|
+
const rawRef = split[1].trim();
|
|
12773
|
+
const type = refType(rawRef);
|
|
12774
|
+
if (type === "tag") {
|
|
12775
|
+
const ref = rawRef.slice("refs/tags/".length);
|
|
12776
|
+
return { sha, ref, rawRef, type };
|
|
12777
|
+
}
|
|
12778
|
+
if (type === "branch") {
|
|
12779
|
+
const ref = rawRef.slice("refs/heads/".length);
|
|
12780
|
+
return { sha, ref, rawRef, type };
|
|
12781
|
+
}
|
|
12782
|
+
if (type === "pull") {
|
|
12783
|
+
const ref = rawRef.slice("refs/".length).replace(/\/head$/, "");
|
|
12784
|
+
return { sha, ref, rawRef, type };
|
|
12785
|
+
}
|
|
12786
|
+
if (type === "head") {
|
|
12787
|
+
const ref = "HEAD";
|
|
12788
|
+
return { sha, ref, rawRef, type };
|
|
12789
|
+
}
|
|
12790
|
+
return { sha, ref: rawRef, rawRef, type };
|
|
12791
|
+
}, "lineToRevDoc");
|
|
12792
|
+
var linesToRevsReducer = /* @__PURE__ */ __name((revs, line) => {
|
|
12793
|
+
const doc = lineToRevDoc(line);
|
|
12794
|
+
if (!doc) {
|
|
12795
|
+
return revs;
|
|
12796
|
+
}
|
|
12797
|
+
revs.refs[doc.ref] = doc;
|
|
12798
|
+
revs.refs[doc.rawRef] = doc;
|
|
12799
|
+
if (doc.type === "tag") {
|
|
12800
|
+
const match = !doc.ref.endsWith("^{}") && doc.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);
|
|
12801
|
+
if (match && semver.valid(match[1], true)) {
|
|
12802
|
+
revs.versions[semver.clean(match[1], true)] = doc;
|
|
12803
|
+
}
|
|
12804
|
+
}
|
|
12805
|
+
return revs;
|
|
12806
|
+
}, "linesToRevsReducer");
|
|
12807
|
+
}
|
|
12808
|
+
});
|
|
12809
|
+
|
|
12810
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/revs.js
|
|
12811
|
+
var require_revs = __commonJS({
|
|
12812
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/revs.js"(exports2, module2) {
|
|
12813
|
+
var spawn = require_spawn();
|
|
12814
|
+
var { LRUCache } = require_commonjs();
|
|
12815
|
+
var linesToRevs = require_lines_to_revs();
|
|
12816
|
+
var revsCache = new LRUCache({
|
|
12817
|
+
max: 100,
|
|
12818
|
+
ttl: 5 * 60 * 1e3
|
|
12819
|
+
});
|
|
12820
|
+
module2.exports = async (repo, opts = {}) => {
|
|
12821
|
+
if (!opts.noGitRevCache) {
|
|
12822
|
+
const cached = revsCache.get(repo);
|
|
12823
|
+
if (cached) {
|
|
12824
|
+
return cached;
|
|
12825
|
+
}
|
|
12826
|
+
}
|
|
12827
|
+
const { stdout } = await spawn(["ls-remote", repo], opts);
|
|
12828
|
+
const revs = linesToRevs(stdout.trim().split("\n"));
|
|
12829
|
+
revsCache.set(repo, revs);
|
|
12830
|
+
return revs;
|
|
12831
|
+
};
|
|
12832
|
+
}
|
|
12833
|
+
});
|
|
12834
|
+
|
|
12835
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/utils.js
|
|
12836
|
+
var require_utils = __commonJS({
|
|
12837
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/utils.js"(exports2) {
|
|
12838
|
+
var isWindows = /* @__PURE__ */ __name((opts) => (opts.fakePlatform || process.platform) === "win32", "isWindows");
|
|
12839
|
+
exports2.isWindows = isWindows;
|
|
12840
|
+
}
|
|
12841
|
+
});
|
|
12842
|
+
|
|
12843
|
+
// node_modules/.pnpm/validate-npm-package-name@6.0.2/node_modules/validate-npm-package-name/lib/index.js
|
|
12844
|
+
var require_lib6 = __commonJS({
|
|
12845
|
+
"node_modules/.pnpm/validate-npm-package-name@6.0.2/node_modules/validate-npm-package-name/lib/index.js"(exports2, module2) {
|
|
12846
|
+
"use strict";
|
|
12847
|
+
var { builtinModules: builtins } = require("module");
|
|
12848
|
+
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
|
|
12849
|
+
var exclusionList = [
|
|
12850
|
+
"node_modules",
|
|
12851
|
+
"favicon.ico"
|
|
12852
|
+
];
|
|
12853
|
+
function validate(name) {
|
|
12854
|
+
var warnings = [];
|
|
12855
|
+
var errors = [];
|
|
12856
|
+
if (name === null) {
|
|
12857
|
+
errors.push("name cannot be null");
|
|
12858
|
+
return done(warnings, errors);
|
|
12859
|
+
}
|
|
12860
|
+
if (name === void 0) {
|
|
12861
|
+
errors.push("name cannot be undefined");
|
|
12862
|
+
return done(warnings, errors);
|
|
12863
|
+
}
|
|
12864
|
+
if (typeof name !== "string") {
|
|
12865
|
+
errors.push("name must be a string");
|
|
12866
|
+
return done(warnings, errors);
|
|
12867
|
+
}
|
|
12868
|
+
if (!name.length) {
|
|
12869
|
+
errors.push("name length must be greater than zero");
|
|
12870
|
+
}
|
|
12871
|
+
if (name.startsWith(".")) {
|
|
12872
|
+
errors.push("name cannot start with a period");
|
|
12873
|
+
}
|
|
12874
|
+
if (name.match(/^_/)) {
|
|
12875
|
+
errors.push("name cannot start with an underscore");
|
|
12876
|
+
}
|
|
12877
|
+
if (name.trim() !== name) {
|
|
12878
|
+
errors.push("name cannot contain leading or trailing spaces");
|
|
12879
|
+
}
|
|
12880
|
+
exclusionList.forEach(function(excludedName) {
|
|
12881
|
+
if (name.toLowerCase() === excludedName) {
|
|
12882
|
+
errors.push(excludedName + " is not a valid package name");
|
|
12883
|
+
}
|
|
12884
|
+
});
|
|
12885
|
+
if (builtins.includes(name.toLowerCase())) {
|
|
12886
|
+
warnings.push(name + " is a core module name");
|
|
12887
|
+
}
|
|
12888
|
+
if (name.length > 214) {
|
|
12889
|
+
warnings.push("name can no longer contain more than 214 characters");
|
|
12890
|
+
}
|
|
12891
|
+
if (name.toLowerCase() !== name) {
|
|
12892
|
+
warnings.push("name can no longer contain capital letters");
|
|
12893
|
+
}
|
|
12894
|
+
if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) {
|
|
12895
|
+
warnings.push(`name can no longer contain special characters ("~'!()*")`);
|
|
12896
|
+
}
|
|
12897
|
+
if (encodeURIComponent(name) !== name) {
|
|
12898
|
+
var nameMatch = name.match(scopedPackagePattern);
|
|
12899
|
+
if (nameMatch) {
|
|
12900
|
+
var user = nameMatch[1];
|
|
12901
|
+
var pkg = nameMatch[2];
|
|
12902
|
+
if (pkg.startsWith(".")) {
|
|
12903
|
+
errors.push("name cannot start with a period");
|
|
12904
|
+
}
|
|
12905
|
+
if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
|
|
12906
|
+
return done(warnings, errors);
|
|
12907
|
+
}
|
|
12908
|
+
}
|
|
12909
|
+
errors.push("name can only contain URL-friendly characters");
|
|
12910
|
+
}
|
|
12911
|
+
return done(warnings, errors);
|
|
12912
|
+
}
|
|
12913
|
+
__name(validate, "validate");
|
|
12914
|
+
var done = /* @__PURE__ */ __name(function(warnings, errors) {
|
|
12915
|
+
var result = {
|
|
12916
|
+
validForNewPackages: errors.length === 0 && warnings.length === 0,
|
|
12917
|
+
validForOldPackages: errors.length === 0,
|
|
12918
|
+
warnings,
|
|
12919
|
+
errors
|
|
12920
|
+
};
|
|
12921
|
+
if (!result.warnings.length) {
|
|
12922
|
+
delete result.warnings;
|
|
12923
|
+
}
|
|
12924
|
+
if (!result.errors.length) {
|
|
12925
|
+
delete result.errors;
|
|
12926
|
+
}
|
|
12927
|
+
return result;
|
|
12928
|
+
}, "done");
|
|
12929
|
+
module2.exports = validate;
|
|
12930
|
+
}
|
|
12931
|
+
});
|
|
12932
|
+
|
|
12933
|
+
// node_modules/.pnpm/npm-package-arg@12.0.2/node_modules/npm-package-arg/lib/npa.js
|
|
12934
|
+
var require_npa = __commonJS({
|
|
12935
|
+
"node_modules/.pnpm/npm-package-arg@12.0.2/node_modules/npm-package-arg/lib/npa.js"(exports2, module2) {
|
|
12936
|
+
"use strict";
|
|
12937
|
+
var isWindows = process.platform === "win32";
|
|
12938
|
+
var { URL: URL2 } = require("node:url");
|
|
12939
|
+
var path = isWindows ? require("node:path/win32") : require("node:path");
|
|
12940
|
+
var { homedir } = require("node:os");
|
|
12941
|
+
var HostedGit = require_lib3();
|
|
12942
|
+
var semver = require_semver2();
|
|
12943
|
+
var validatePackageName = require_lib6();
|
|
12944
|
+
var { log } = require_lib2();
|
|
12945
|
+
var hasSlashes = isWindows ? /\\|[/]/ : /[/]/;
|
|
12946
|
+
var isURL = /^(?:git[+])?[a-z]+:/i;
|
|
12947
|
+
var isGit = /^[^@]+@[^:.]+\.[^:]+:.+$/i;
|
|
12948
|
+
var isFileType = /[.](?:tgz|tar.gz|tar)$/i;
|
|
12949
|
+
var isPortNumber = /:[0-9]+(\/|$)/i;
|
|
12950
|
+
var isWindowsFile = /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/;
|
|
12951
|
+
var isPosixFile = /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/;
|
|
12952
|
+
var defaultRegistry = "https://registry.npmjs.org";
|
|
12953
|
+
function npa(arg, where) {
|
|
12954
|
+
let name;
|
|
12955
|
+
let spec;
|
|
12956
|
+
if (typeof arg === "object") {
|
|
12957
|
+
if (arg instanceof Result && (!where || where === arg.where)) {
|
|
12958
|
+
return arg;
|
|
12959
|
+
} else if (arg.name && arg.rawSpec) {
|
|
12960
|
+
return npa.resolve(arg.name, arg.rawSpec, where || arg.where);
|
|
12961
|
+
} else {
|
|
12962
|
+
return npa(arg.raw, where || arg.where);
|
|
12963
|
+
}
|
|
12964
|
+
}
|
|
12965
|
+
const nameEndsAt = arg.indexOf("@", 1);
|
|
12966
|
+
const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg;
|
|
12967
|
+
if (isURL.test(arg)) {
|
|
12968
|
+
spec = arg;
|
|
12969
|
+
} else if (isGit.test(arg)) {
|
|
12970
|
+
spec = `git+ssh://${arg}`;
|
|
12971
|
+
} else if (!namePart.startsWith("@") && (hasSlashes.test(namePart) || isFileType.test(namePart))) {
|
|
12972
|
+
spec = arg;
|
|
12973
|
+
} else if (nameEndsAt > 0) {
|
|
12974
|
+
name = namePart;
|
|
12975
|
+
spec = arg.slice(nameEndsAt + 1) || "*";
|
|
12976
|
+
} else {
|
|
12977
|
+
const valid = validatePackageName(arg);
|
|
12978
|
+
if (valid.validForOldPackages) {
|
|
12979
|
+
name = arg;
|
|
12980
|
+
spec = "*";
|
|
12981
|
+
} else {
|
|
12982
|
+
spec = arg;
|
|
12983
|
+
}
|
|
12984
|
+
}
|
|
12985
|
+
return resolve(name, spec, where, arg);
|
|
12986
|
+
}
|
|
12987
|
+
__name(npa, "npa");
|
|
12988
|
+
function isFileSpec(spec) {
|
|
12989
|
+
if (!spec) {
|
|
12990
|
+
return false;
|
|
12991
|
+
}
|
|
12992
|
+
if (spec.toLowerCase().startsWith("file:")) {
|
|
12993
|
+
return true;
|
|
12994
|
+
}
|
|
12995
|
+
if (isWindows) {
|
|
12996
|
+
return isWindowsFile.test(spec);
|
|
12997
|
+
}
|
|
12998
|
+
return isPosixFile.test(spec);
|
|
12999
|
+
}
|
|
13000
|
+
__name(isFileSpec, "isFileSpec");
|
|
13001
|
+
function isAliasSpec(spec) {
|
|
13002
|
+
if (!spec) {
|
|
13003
|
+
return false;
|
|
13004
|
+
}
|
|
13005
|
+
return spec.toLowerCase().startsWith("npm:");
|
|
13006
|
+
}
|
|
13007
|
+
__name(isAliasSpec, "isAliasSpec");
|
|
13008
|
+
function resolve(name, spec, where, arg) {
|
|
13009
|
+
const res = new Result({
|
|
13010
|
+
raw: arg,
|
|
13011
|
+
name,
|
|
13012
|
+
rawSpec: spec,
|
|
13013
|
+
fromArgument: arg != null
|
|
13014
|
+
});
|
|
13015
|
+
if (name) {
|
|
13016
|
+
res.name = name;
|
|
13017
|
+
}
|
|
13018
|
+
if (!where) {
|
|
13019
|
+
where = process.cwd();
|
|
13020
|
+
}
|
|
13021
|
+
if (isFileSpec(spec)) {
|
|
13022
|
+
return fromFile(res, where);
|
|
13023
|
+
} else if (isAliasSpec(spec)) {
|
|
13024
|
+
return fromAlias(res, where);
|
|
13025
|
+
}
|
|
13026
|
+
const hosted = HostedGit.fromUrl(spec, {
|
|
13027
|
+
noGitPlus: true,
|
|
13028
|
+
noCommittish: true
|
|
13029
|
+
});
|
|
13030
|
+
if (hosted) {
|
|
13031
|
+
return fromHostedGit(res, hosted);
|
|
13032
|
+
} else if (spec && isURL.test(spec)) {
|
|
13033
|
+
return fromURL(res);
|
|
13034
|
+
} else if (spec && (hasSlashes.test(spec) || isFileType.test(spec))) {
|
|
13035
|
+
return fromFile(res, where);
|
|
13036
|
+
} else {
|
|
13037
|
+
return fromRegistry(res);
|
|
13038
|
+
}
|
|
13039
|
+
}
|
|
13040
|
+
__name(resolve, "resolve");
|
|
13041
|
+
function toPurl(arg, reg = defaultRegistry) {
|
|
13042
|
+
const res = npa(arg);
|
|
13043
|
+
if (res.type !== "version") {
|
|
13044
|
+
throw invalidPurlType(res.type, res.raw);
|
|
13045
|
+
}
|
|
13046
|
+
let purl = "pkg:npm/" + res.name.replace(/^@/, "%40") + "@" + res.rawSpec;
|
|
13047
|
+
if (reg !== defaultRegistry) {
|
|
13048
|
+
purl += "?repository_url=" + reg;
|
|
13049
|
+
}
|
|
13050
|
+
return purl;
|
|
13051
|
+
}
|
|
13052
|
+
__name(toPurl, "toPurl");
|
|
13053
|
+
function invalidPackageName(name, valid, raw) {
|
|
13054
|
+
const err = new Error(`Invalid package name "${name}" of package "${raw}": ${valid.errors.join("; ")}.`);
|
|
13055
|
+
err.code = "EINVALIDPACKAGENAME";
|
|
13056
|
+
return err;
|
|
13057
|
+
}
|
|
13058
|
+
__name(invalidPackageName, "invalidPackageName");
|
|
13059
|
+
function invalidTagName(name, raw) {
|
|
13060
|
+
const err = new Error(`Invalid tag name "${name}" of package "${raw}": Tags may not have any characters that encodeURIComponent encodes.`);
|
|
13061
|
+
err.code = "EINVALIDTAGNAME";
|
|
13062
|
+
return err;
|
|
13063
|
+
}
|
|
13064
|
+
__name(invalidTagName, "invalidTagName");
|
|
13065
|
+
function invalidPurlType(type, raw) {
|
|
13066
|
+
const err = new Error(`Invalid type "${type}" of package "${raw}": Purl can only be generated for "version" types.`);
|
|
13067
|
+
err.code = "EINVALIDPURLTYPE";
|
|
13068
|
+
return err;
|
|
13069
|
+
}
|
|
13070
|
+
__name(invalidPurlType, "invalidPurlType");
|
|
13071
|
+
var Result = class {
|
|
13072
|
+
static {
|
|
13073
|
+
__name(this, "Result");
|
|
13074
|
+
}
|
|
13075
|
+
constructor(opts) {
|
|
13076
|
+
this.type = opts.type;
|
|
13077
|
+
this.registry = opts.registry;
|
|
13078
|
+
this.where = opts.where;
|
|
13079
|
+
if (opts.raw == null) {
|
|
13080
|
+
this.raw = opts.name ? `${opts.name}@${opts.rawSpec}` : opts.rawSpec;
|
|
13081
|
+
} else {
|
|
13082
|
+
this.raw = opts.raw;
|
|
13083
|
+
}
|
|
13084
|
+
this.name = void 0;
|
|
13085
|
+
this.escapedName = void 0;
|
|
13086
|
+
this.scope = void 0;
|
|
13087
|
+
this.rawSpec = opts.rawSpec || "";
|
|
13088
|
+
this.saveSpec = opts.saveSpec;
|
|
13089
|
+
this.fetchSpec = opts.fetchSpec;
|
|
13090
|
+
if (opts.name) {
|
|
13091
|
+
this.setName(opts.name);
|
|
13092
|
+
}
|
|
13093
|
+
this.gitRange = opts.gitRange;
|
|
13094
|
+
this.gitCommittish = opts.gitCommittish;
|
|
13095
|
+
this.gitSubdir = opts.gitSubdir;
|
|
13096
|
+
this.hosted = opts.hosted;
|
|
13097
|
+
}
|
|
13098
|
+
// TODO move this to a getter/setter in a semver major
|
|
13099
|
+
setName(name) {
|
|
13100
|
+
const valid = validatePackageName(name);
|
|
13101
|
+
if (!valid.validForOldPackages) {
|
|
13102
|
+
throw invalidPackageName(name, valid, this.raw);
|
|
13103
|
+
}
|
|
13104
|
+
this.name = name;
|
|
13105
|
+
this.scope = name[0] === "@" ? name.slice(0, name.indexOf("/")) : void 0;
|
|
13106
|
+
this.escapedName = name.replace("/", "%2f");
|
|
13107
|
+
return this;
|
|
13108
|
+
}
|
|
13109
|
+
toString() {
|
|
13110
|
+
const full = [];
|
|
13111
|
+
if (this.name != null && this.name !== "") {
|
|
13112
|
+
full.push(this.name);
|
|
13113
|
+
}
|
|
13114
|
+
const spec = this.saveSpec || this.fetchSpec || this.rawSpec;
|
|
13115
|
+
if (spec != null && spec !== "") {
|
|
13116
|
+
full.push(spec);
|
|
13117
|
+
}
|
|
13118
|
+
return full.length ? full.join("@") : this.raw;
|
|
13119
|
+
}
|
|
13120
|
+
toJSON() {
|
|
13121
|
+
const result = Object.assign({}, this);
|
|
13122
|
+
delete result.hosted;
|
|
13123
|
+
return result;
|
|
13124
|
+
}
|
|
13125
|
+
};
|
|
13126
|
+
function setGitAttrs(res, committish) {
|
|
13127
|
+
if (!committish) {
|
|
13128
|
+
res.gitCommittish = null;
|
|
13129
|
+
return;
|
|
13130
|
+
}
|
|
13131
|
+
for (const part of committish.split("::")) {
|
|
13132
|
+
if (!part.includes(":")) {
|
|
13133
|
+
if (res.gitRange) {
|
|
13134
|
+
throw new Error("cannot override existing semver range with a committish");
|
|
13135
|
+
}
|
|
13136
|
+
if (res.gitCommittish) {
|
|
13137
|
+
throw new Error("cannot override existing committish with a second committish");
|
|
13138
|
+
}
|
|
13139
|
+
res.gitCommittish = part;
|
|
13140
|
+
continue;
|
|
13141
|
+
}
|
|
13142
|
+
const [name, value] = part.split(":");
|
|
13143
|
+
if (name === "semver") {
|
|
13144
|
+
if (res.gitCommittish) {
|
|
13145
|
+
throw new Error("cannot override existing committish with a semver range");
|
|
13146
|
+
}
|
|
13147
|
+
if (res.gitRange) {
|
|
13148
|
+
throw new Error("cannot override existing semver range with a second semver range");
|
|
13149
|
+
}
|
|
13150
|
+
res.gitRange = decodeURIComponent(value);
|
|
13151
|
+
continue;
|
|
13152
|
+
}
|
|
13153
|
+
if (name === "path") {
|
|
13154
|
+
if (res.gitSubdir) {
|
|
13155
|
+
throw new Error("cannot override existing path with a second path");
|
|
13156
|
+
}
|
|
13157
|
+
res.gitSubdir = `/${value}`;
|
|
13158
|
+
continue;
|
|
13159
|
+
}
|
|
13160
|
+
log.warn("npm-package-arg", `ignoring unknown key "${name}"`);
|
|
13161
|
+
}
|
|
13162
|
+
}
|
|
13163
|
+
__name(setGitAttrs, "setGitAttrs");
|
|
13164
|
+
var encodedPathChars = /* @__PURE__ */ new Map([
|
|
13165
|
+
["\0", "%00"],
|
|
13166
|
+
[" ", "%09"],
|
|
13167
|
+
["\n", "%0A"],
|
|
13168
|
+
["\r", "%0D"],
|
|
13169
|
+
[" ", "%20"],
|
|
13170
|
+
['"', "%22"],
|
|
13171
|
+
["#", "%23"],
|
|
13172
|
+
["%", "%25"],
|
|
13173
|
+
["?", "%3F"],
|
|
13174
|
+
["[", "%5B"],
|
|
13175
|
+
["\\", isWindows ? "/" : "%5C"],
|
|
13176
|
+
["]", "%5D"],
|
|
13177
|
+
["^", "%5E"],
|
|
13178
|
+
["|", "%7C"],
|
|
13179
|
+
["~", "%7E"]
|
|
13180
|
+
]);
|
|
13181
|
+
function pathToFileURL(str) {
|
|
13182
|
+
let result = "";
|
|
13183
|
+
for (let i = 0; i < str.length; i++) {
|
|
13184
|
+
result = `${result}${encodedPathChars.get(str[i]) ?? str[i]}`;
|
|
13185
|
+
}
|
|
13186
|
+
if (result.startsWith("file:")) {
|
|
13187
|
+
return result;
|
|
13188
|
+
}
|
|
13189
|
+
return `file:${result}`;
|
|
13190
|
+
}
|
|
13191
|
+
__name(pathToFileURL, "pathToFileURL");
|
|
13192
|
+
function fromFile(res, where) {
|
|
13193
|
+
res.type = isFileType.test(res.rawSpec) ? "file" : "directory";
|
|
13194
|
+
res.where = where;
|
|
13195
|
+
let rawSpec = pathToFileURL(res.rawSpec);
|
|
13196
|
+
if (rawSpec.startsWith("file:/")) {
|
|
13197
|
+
if (/^file:\/\/[^/]/.test(rawSpec)) {
|
|
13198
|
+
rawSpec = `file:/${rawSpec.slice(5)}`;
|
|
13199
|
+
}
|
|
13200
|
+
if (/^\/{1,3}\.\.?(\/|$)/.test(rawSpec.slice(5))) {
|
|
13201
|
+
rawSpec = rawSpec.replace(/^file:\/{1,3}/, "file:");
|
|
13202
|
+
}
|
|
13203
|
+
}
|
|
13204
|
+
let resolvedUrl;
|
|
13205
|
+
let specUrl;
|
|
13206
|
+
try {
|
|
13207
|
+
resolvedUrl = new URL2(rawSpec, `${pathToFileURL(path.resolve(where))}/`);
|
|
13208
|
+
specUrl = new URL2(rawSpec);
|
|
13209
|
+
} catch (originalError) {
|
|
13210
|
+
const er = new Error("Invalid file: URL, must comply with RFC 8089");
|
|
13211
|
+
throw Object.assign(er, {
|
|
13212
|
+
raw: res.rawSpec,
|
|
13213
|
+
spec: res,
|
|
13214
|
+
where,
|
|
13215
|
+
originalError
|
|
13216
|
+
});
|
|
13217
|
+
}
|
|
13218
|
+
let specPath = decodeURIComponent(specUrl.pathname);
|
|
13219
|
+
let resolvedPath = decodeURIComponent(resolvedUrl.pathname);
|
|
13220
|
+
if (isWindows) {
|
|
13221
|
+
specPath = specPath.replace(/^\/+([a-z]:\/)/i, "$1");
|
|
13222
|
+
resolvedPath = resolvedPath.replace(/^\/+([a-z]:\/)/i, "$1");
|
|
13223
|
+
}
|
|
13224
|
+
if (/^\/~(\/|$)/.test(specPath)) {
|
|
13225
|
+
res.saveSpec = `file:${specPath.substr(1)}`;
|
|
13226
|
+
resolvedPath = path.resolve(homedir(), specPath.substr(3));
|
|
13227
|
+
} else if (!path.isAbsolute(rawSpec.slice(5))) {
|
|
13228
|
+
res.saveSpec = `file:${path.relative(where, resolvedPath)}`;
|
|
13229
|
+
} else {
|
|
13230
|
+
res.saveSpec = `file:${path.resolve(resolvedPath)}`;
|
|
13231
|
+
}
|
|
13232
|
+
res.fetchSpec = path.resolve(where, resolvedPath);
|
|
13233
|
+
res.saveSpec = res.saveSpec.split("\\").join("/");
|
|
13234
|
+
if (res.saveSpec.startsWith("file://")) {
|
|
13235
|
+
res.saveSpec = `file:/${res.saveSpec.slice(7)}`;
|
|
13236
|
+
}
|
|
13237
|
+
return res;
|
|
13238
|
+
}
|
|
13239
|
+
__name(fromFile, "fromFile");
|
|
13240
|
+
function fromHostedGit(res, hosted) {
|
|
13241
|
+
res.type = "git";
|
|
13242
|
+
res.hosted = hosted;
|
|
13243
|
+
res.saveSpec = hosted.toString({ noGitPlus: false, noCommittish: false });
|
|
13244
|
+
res.fetchSpec = hosted.getDefaultRepresentation() === "shortcut" ? null : hosted.toString();
|
|
13245
|
+
setGitAttrs(res, hosted.committish);
|
|
13246
|
+
return res;
|
|
13247
|
+
}
|
|
13248
|
+
__name(fromHostedGit, "fromHostedGit");
|
|
13249
|
+
function unsupportedURLType(protocol, spec) {
|
|
13250
|
+
const err = new Error(`Unsupported URL Type "${protocol}": ${spec}`);
|
|
13251
|
+
err.code = "EUNSUPPORTEDPROTOCOL";
|
|
13252
|
+
return err;
|
|
13253
|
+
}
|
|
13254
|
+
__name(unsupportedURLType, "unsupportedURLType");
|
|
13255
|
+
function fromURL(res) {
|
|
13256
|
+
let rawSpec = res.rawSpec;
|
|
13257
|
+
res.saveSpec = rawSpec;
|
|
13258
|
+
if (rawSpec.startsWith("git+ssh:")) {
|
|
13259
|
+
const matched = rawSpec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);
|
|
13260
|
+
if (matched && !matched[1].match(isPortNumber)) {
|
|
13261
|
+
res.type = "git";
|
|
13262
|
+
setGitAttrs(res, matched[2]);
|
|
13263
|
+
res.fetchSpec = matched[1];
|
|
13264
|
+
return res;
|
|
13265
|
+
}
|
|
13266
|
+
} else if (rawSpec.startsWith("git+file://")) {
|
|
13267
|
+
rawSpec = rawSpec.replace(/\\/g, "/");
|
|
13268
|
+
}
|
|
13269
|
+
const parsedUrl = new URL2(rawSpec);
|
|
13270
|
+
switch (parsedUrl.protocol) {
|
|
13271
|
+
case "git:":
|
|
13272
|
+
case "git+http:":
|
|
13273
|
+
case "git+https:":
|
|
13274
|
+
case "git+rsync:":
|
|
13275
|
+
case "git+ftp:":
|
|
13276
|
+
case "git+file:":
|
|
13277
|
+
case "git+ssh:":
|
|
13278
|
+
res.type = "git";
|
|
13279
|
+
setGitAttrs(res, parsedUrl.hash.slice(1));
|
|
13280
|
+
if (parsedUrl.protocol === "git+file:" && /^git\+file:\/\/[a-z]:/i.test(rawSpec)) {
|
|
13281
|
+
res.fetchSpec = `git+file://${parsedUrl.host.toLowerCase()}:${parsedUrl.pathname}`;
|
|
13282
|
+
} else {
|
|
13283
|
+
parsedUrl.hash = "";
|
|
13284
|
+
res.fetchSpec = parsedUrl.toString();
|
|
13285
|
+
}
|
|
13286
|
+
if (res.fetchSpec.startsWith("git+")) {
|
|
13287
|
+
res.fetchSpec = res.fetchSpec.slice(4);
|
|
13288
|
+
}
|
|
13289
|
+
break;
|
|
13290
|
+
case "http:":
|
|
13291
|
+
case "https:":
|
|
13292
|
+
res.type = "remote";
|
|
13293
|
+
res.fetchSpec = res.saveSpec;
|
|
13294
|
+
break;
|
|
13295
|
+
default:
|
|
13296
|
+
throw unsupportedURLType(parsedUrl.protocol, rawSpec);
|
|
13297
|
+
}
|
|
13298
|
+
return res;
|
|
13299
|
+
}
|
|
13300
|
+
__name(fromURL, "fromURL");
|
|
13301
|
+
function fromAlias(res, where) {
|
|
13302
|
+
const subSpec = npa(res.rawSpec.substr(4), where);
|
|
13303
|
+
if (subSpec.type === "alias") {
|
|
13304
|
+
throw new Error("nested aliases not supported");
|
|
13305
|
+
}
|
|
13306
|
+
if (!subSpec.registry) {
|
|
13307
|
+
throw new Error("aliases only work for registry deps");
|
|
13308
|
+
}
|
|
13309
|
+
if (!subSpec.name) {
|
|
13310
|
+
throw new Error("aliases must have a name");
|
|
13311
|
+
}
|
|
13312
|
+
res.subSpec = subSpec;
|
|
13313
|
+
res.registry = true;
|
|
13314
|
+
res.type = "alias";
|
|
13315
|
+
res.saveSpec = null;
|
|
13316
|
+
res.fetchSpec = null;
|
|
13317
|
+
return res;
|
|
13318
|
+
}
|
|
13319
|
+
__name(fromAlias, "fromAlias");
|
|
13320
|
+
function fromRegistry(res) {
|
|
13321
|
+
res.registry = true;
|
|
13322
|
+
const spec = res.rawSpec.trim();
|
|
13323
|
+
res.saveSpec = null;
|
|
13324
|
+
res.fetchSpec = spec;
|
|
13325
|
+
const version = semver.valid(spec, true);
|
|
13326
|
+
const range = semver.validRange(spec, true);
|
|
13327
|
+
if (version) {
|
|
13328
|
+
res.type = "version";
|
|
13329
|
+
} else if (range) {
|
|
13330
|
+
res.type = "range";
|
|
13331
|
+
} else {
|
|
13332
|
+
if (encodeURIComponent(spec) !== spec) {
|
|
13333
|
+
throw invalidTagName(spec, res.raw);
|
|
13334
|
+
}
|
|
13335
|
+
res.type = "tag";
|
|
13336
|
+
}
|
|
13337
|
+
return res;
|
|
13338
|
+
}
|
|
13339
|
+
__name(fromRegistry, "fromRegistry");
|
|
13340
|
+
module2.exports = npa;
|
|
13341
|
+
module2.exports.resolve = resolve;
|
|
13342
|
+
module2.exports.toPurl = toPurl;
|
|
13343
|
+
module2.exports.Result = Result;
|
|
13344
|
+
}
|
|
13345
|
+
});
|
|
13346
|
+
|
|
13347
|
+
// node_modules/.pnpm/npm-install-checks@7.1.2/node_modules/npm-install-checks/lib/current-env.js
|
|
13348
|
+
var require_current_env = __commonJS({
|
|
13349
|
+
"node_modules/.pnpm/npm-install-checks@7.1.2/node_modules/npm-install-checks/lib/current-env.js"(exports2, module2) {
|
|
13350
|
+
var process2 = require("node:process");
|
|
13351
|
+
var nodeOs = require("node:os");
|
|
13352
|
+
var fs = require("node:fs");
|
|
13353
|
+
function isMusl(file) {
|
|
13354
|
+
return file.includes("libc.musl-") || file.includes("ld-musl-");
|
|
13355
|
+
}
|
|
13356
|
+
__name(isMusl, "isMusl");
|
|
13357
|
+
function os() {
|
|
13358
|
+
return process2.platform;
|
|
13359
|
+
}
|
|
13360
|
+
__name(os, "os");
|
|
13361
|
+
function cpu() {
|
|
13362
|
+
return process2.arch;
|
|
13363
|
+
}
|
|
13364
|
+
__name(cpu, "cpu");
|
|
13365
|
+
var LDD_PATH = "/usr/bin/ldd";
|
|
13366
|
+
function getFamilyFromFilesystem() {
|
|
13367
|
+
try {
|
|
13368
|
+
const content = fs.readFileSync(LDD_PATH, "utf-8");
|
|
13369
|
+
if (content.includes("musl")) {
|
|
13370
|
+
return "musl";
|
|
13371
|
+
}
|
|
13372
|
+
if (content.includes("GNU C Library")) {
|
|
13373
|
+
return "glibc";
|
|
13374
|
+
}
|
|
13375
|
+
return null;
|
|
13376
|
+
} catch {
|
|
13377
|
+
return void 0;
|
|
13378
|
+
}
|
|
13379
|
+
}
|
|
13380
|
+
__name(getFamilyFromFilesystem, "getFamilyFromFilesystem");
|
|
13381
|
+
function getFamilyFromReport() {
|
|
13382
|
+
const originalExclude = process2.report.excludeNetwork;
|
|
13383
|
+
process2.report.excludeNetwork = true;
|
|
13384
|
+
const report = process2.report.getReport();
|
|
13385
|
+
process2.report.excludeNetwork = originalExclude;
|
|
13386
|
+
if (report.header?.glibcVersionRuntime) {
|
|
13387
|
+
family = "glibc";
|
|
13388
|
+
} else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) {
|
|
13389
|
+
family = "musl";
|
|
13390
|
+
} else {
|
|
13391
|
+
family = null;
|
|
13392
|
+
}
|
|
13393
|
+
return family;
|
|
13394
|
+
}
|
|
13395
|
+
__name(getFamilyFromReport, "getFamilyFromReport");
|
|
13396
|
+
var family;
|
|
13397
|
+
function libc(osName) {
|
|
13398
|
+
if (osName !== "linux") {
|
|
13399
|
+
return void 0;
|
|
13400
|
+
}
|
|
13401
|
+
if (family === void 0) {
|
|
13402
|
+
family = getFamilyFromFilesystem();
|
|
13403
|
+
if (family === void 0) {
|
|
13404
|
+
family = getFamilyFromReport();
|
|
13405
|
+
}
|
|
13406
|
+
}
|
|
13407
|
+
return family;
|
|
13408
|
+
}
|
|
13409
|
+
__name(libc, "libc");
|
|
13410
|
+
function devEngines(env = {}) {
|
|
13411
|
+
const osName = env.os || os();
|
|
13412
|
+
return {
|
|
13413
|
+
cpu: {
|
|
13414
|
+
name: env.cpu || cpu()
|
|
13415
|
+
},
|
|
13416
|
+
libc: {
|
|
13417
|
+
name: env.libc || libc(osName)
|
|
13418
|
+
},
|
|
13419
|
+
os: {
|
|
13420
|
+
name: osName,
|
|
13421
|
+
version: env.osVersion || nodeOs.release()
|
|
13422
|
+
},
|
|
13423
|
+
packageManager: {
|
|
13424
|
+
name: "npm",
|
|
13425
|
+
version: env.npmVersion
|
|
13426
|
+
},
|
|
13427
|
+
runtime: {
|
|
13428
|
+
name: "node",
|
|
13429
|
+
version: env.nodeVersion || process2.version
|
|
13430
|
+
}
|
|
13431
|
+
};
|
|
13432
|
+
}
|
|
13433
|
+
__name(devEngines, "devEngines");
|
|
13434
|
+
module2.exports = {
|
|
13435
|
+
cpu,
|
|
13436
|
+
libc,
|
|
13437
|
+
os,
|
|
13438
|
+
devEngines
|
|
13439
|
+
};
|
|
13440
|
+
}
|
|
13441
|
+
});
|
|
13442
|
+
|
|
13443
|
+
// node_modules/.pnpm/npm-install-checks@7.1.2/node_modules/npm-install-checks/lib/dev-engines.js
|
|
13444
|
+
var require_dev_engines = __commonJS({
|
|
13445
|
+
"node_modules/.pnpm/npm-install-checks@7.1.2/node_modules/npm-install-checks/lib/dev-engines.js"(exports2, module2) {
|
|
13446
|
+
var satisfies = require_satisfies();
|
|
13447
|
+
var validRange = require_valid2();
|
|
13448
|
+
var recognizedOnFail = [
|
|
13449
|
+
"ignore",
|
|
13450
|
+
"warn",
|
|
13451
|
+
"error",
|
|
13452
|
+
"download"
|
|
13453
|
+
];
|
|
13454
|
+
var recognizedProperties = [
|
|
13455
|
+
"name",
|
|
13456
|
+
"version",
|
|
13457
|
+
"onFail"
|
|
13458
|
+
];
|
|
13459
|
+
var recognizedEngines = [
|
|
13460
|
+
"packageManager",
|
|
13461
|
+
"runtime",
|
|
13462
|
+
"cpu",
|
|
13463
|
+
"libc",
|
|
13464
|
+
"os"
|
|
13465
|
+
];
|
|
13466
|
+
function checkDependency(wanted, current, opts) {
|
|
13467
|
+
const { engine } = opts;
|
|
13468
|
+
if (typeof wanted !== "object" || wanted === null || Array.isArray(wanted)) {
|
|
13469
|
+
throw new Error(`Invalid non-object value for "${engine}"`);
|
|
13470
|
+
}
|
|
13471
|
+
const properties = Object.keys(wanted);
|
|
13472
|
+
for (const prop of properties) {
|
|
13473
|
+
if (!recognizedProperties.includes(prop)) {
|
|
13474
|
+
throw new Error(`Invalid property "${prop}" for "${engine}"`);
|
|
13475
|
+
}
|
|
13476
|
+
}
|
|
13477
|
+
if (!properties.includes("name")) {
|
|
13478
|
+
throw new Error(`Missing "name" property for "${engine}"`);
|
|
13479
|
+
}
|
|
13480
|
+
if (typeof wanted.name !== "string") {
|
|
13481
|
+
throw new Error(`Invalid non-string value for "name" within "${engine}"`);
|
|
13482
|
+
}
|
|
13483
|
+
if (typeof current.name !== "string" || current.name === "") {
|
|
13484
|
+
throw new Error(`Unable to determine "name" for "${engine}"`);
|
|
13485
|
+
}
|
|
13486
|
+
if (properties.includes("onFail")) {
|
|
13487
|
+
if (typeof wanted.onFail !== "string") {
|
|
13488
|
+
throw new Error(`Invalid non-string value for "onFail" within "${engine}"`);
|
|
13489
|
+
}
|
|
13490
|
+
if (!recognizedOnFail.includes(wanted.onFail)) {
|
|
13491
|
+
throw new Error(`Invalid onFail value "${wanted.onFail}" for "${engine}"`);
|
|
13492
|
+
}
|
|
13493
|
+
}
|
|
13494
|
+
if (wanted.name !== current.name) {
|
|
13495
|
+
return new Error(
|
|
13496
|
+
`Invalid name "${wanted.name}" does not match "${current.name}" for "${engine}"`
|
|
13497
|
+
);
|
|
13498
|
+
}
|
|
13499
|
+
if (properties.includes("version")) {
|
|
13500
|
+
if (typeof wanted.version !== "string") {
|
|
13501
|
+
throw new Error(`Invalid non-string value for "version" within "${engine}"`);
|
|
13502
|
+
}
|
|
13503
|
+
if (typeof current.version !== "string" || current.version === "") {
|
|
13504
|
+
throw new Error(`Unable to determine "version" for "${engine}" "${wanted.name}"`);
|
|
13505
|
+
}
|
|
13506
|
+
if (validRange(wanted.version)) {
|
|
13507
|
+
if (!satisfies(current.version, wanted.version, opts.semver)) {
|
|
13508
|
+
return new Error(
|
|
13509
|
+
// eslint-disable-next-line max-len
|
|
13510
|
+
`Invalid semver version "${wanted.version}" does not match "${current.version}" for "${engine}"`
|
|
13511
|
+
);
|
|
13512
|
+
}
|
|
13513
|
+
} else if (wanted.version !== current.version) {
|
|
13514
|
+
return new Error(
|
|
13515
|
+
`Invalid version "${wanted.version}" does not match "${current.version}" for "${engine}"`
|
|
13516
|
+
);
|
|
13517
|
+
}
|
|
13518
|
+
}
|
|
13519
|
+
}
|
|
13520
|
+
__name(checkDependency, "checkDependency");
|
|
13521
|
+
function checkDevEngines(wanted, current = {}, opts = {}) {
|
|
13522
|
+
if (typeof wanted !== "object" || wanted === null || Array.isArray(wanted)) {
|
|
13523
|
+
throw new Error(`Invalid non-object value for "devEngines"`);
|
|
13524
|
+
}
|
|
13525
|
+
const errors = [];
|
|
13526
|
+
for (const engine of Object.keys(wanted)) {
|
|
13527
|
+
if (!recognizedEngines.includes(engine)) {
|
|
13528
|
+
throw new Error(`Invalid property "devEngines.${engine}"`);
|
|
13529
|
+
}
|
|
13530
|
+
const dependencyAsAuthored = wanted[engine];
|
|
13531
|
+
const dependencies = [dependencyAsAuthored].flat();
|
|
13532
|
+
const currentEngine = current[engine] || {};
|
|
13533
|
+
if (dependencies.length === 0) {
|
|
13534
|
+
continue;
|
|
13535
|
+
}
|
|
13536
|
+
const depErrors = [];
|
|
13537
|
+
for (const dep of dependencies) {
|
|
13538
|
+
const result = checkDependency(dep, currentEngine, { ...opts, engine });
|
|
13539
|
+
if (result) {
|
|
13540
|
+
depErrors.push(result);
|
|
13541
|
+
}
|
|
13542
|
+
}
|
|
13543
|
+
const invalid = depErrors.length === dependencies.length;
|
|
13544
|
+
if (invalid) {
|
|
13545
|
+
const lastDependency = dependencies[dependencies.length - 1];
|
|
13546
|
+
let onFail = lastDependency.onFail || "error";
|
|
13547
|
+
if (onFail === "download") {
|
|
13548
|
+
onFail = "error";
|
|
13549
|
+
}
|
|
13550
|
+
const err = Object.assign(new Error(`Invalid devEngines.${engine}`), {
|
|
13551
|
+
errors: depErrors,
|
|
13552
|
+
engine,
|
|
13553
|
+
isWarn: onFail === "warn",
|
|
13554
|
+
isError: onFail === "error",
|
|
13555
|
+
current: currentEngine,
|
|
13556
|
+
required: dependencyAsAuthored
|
|
13557
|
+
});
|
|
13558
|
+
errors.push(err);
|
|
13559
|
+
}
|
|
13560
|
+
}
|
|
13561
|
+
return errors;
|
|
13562
|
+
}
|
|
13563
|
+
__name(checkDevEngines, "checkDevEngines");
|
|
13564
|
+
module2.exports = {
|
|
13565
|
+
checkDevEngines
|
|
13566
|
+
};
|
|
13567
|
+
}
|
|
13568
|
+
});
|
|
13569
|
+
|
|
13570
|
+
// node_modules/.pnpm/npm-install-checks@7.1.2/node_modules/npm-install-checks/lib/index.js
|
|
13571
|
+
var require_lib7 = __commonJS({
|
|
13572
|
+
"node_modules/.pnpm/npm-install-checks@7.1.2/node_modules/npm-install-checks/lib/index.js"(exports2, module2) {
|
|
13573
|
+
var semver = require_semver2();
|
|
13574
|
+
var currentEnv = require_current_env();
|
|
13575
|
+
var { checkDevEngines } = require_dev_engines();
|
|
13576
|
+
var checkEngine = /* @__PURE__ */ __name((target, npmVer, nodeVer, force = false) => {
|
|
13577
|
+
const nodev = force ? null : nodeVer;
|
|
13578
|
+
const eng = target.engines;
|
|
13579
|
+
const opt = { includePrerelease: true };
|
|
13580
|
+
if (!eng) {
|
|
13581
|
+
return;
|
|
13582
|
+
}
|
|
13583
|
+
const nodeFail = nodev && eng.node && !semver.satisfies(nodev, eng.node, opt);
|
|
13584
|
+
const npmFail = npmVer && eng.npm && !semver.satisfies(npmVer, eng.npm, opt);
|
|
13585
|
+
if (nodeFail || npmFail) {
|
|
13586
|
+
throw Object.assign(new Error("Unsupported engine"), {
|
|
13587
|
+
pkgid: target._id,
|
|
13588
|
+
current: { node: nodeVer, npm: npmVer },
|
|
13589
|
+
required: eng,
|
|
13590
|
+
code: "EBADENGINE"
|
|
13591
|
+
});
|
|
13592
|
+
}
|
|
13593
|
+
}, "checkEngine");
|
|
13594
|
+
var checkPlatform = /* @__PURE__ */ __name((target, force = false, environment = {}) => {
|
|
13595
|
+
if (force) {
|
|
13596
|
+
return;
|
|
13597
|
+
}
|
|
13598
|
+
const os = environment.os || currentEnv.os();
|
|
13599
|
+
const cpu = environment.cpu || currentEnv.cpu();
|
|
13600
|
+
const libc = environment.libc || currentEnv.libc(os);
|
|
13601
|
+
const osOk = target.os ? checkList(os, target.os) : true;
|
|
13602
|
+
const cpuOk = target.cpu ? checkList(cpu, target.cpu) : true;
|
|
13603
|
+
let libcOk = target.libc ? checkList(libc, target.libc) : true;
|
|
13604
|
+
if (target.libc && !libc) {
|
|
13605
|
+
libcOk = false;
|
|
13606
|
+
}
|
|
13607
|
+
if (!osOk || !cpuOk || !libcOk) {
|
|
13608
|
+
throw Object.assign(new Error("Unsupported platform"), {
|
|
13609
|
+
pkgid: target._id,
|
|
13610
|
+
current: {
|
|
13611
|
+
os,
|
|
13612
|
+
cpu,
|
|
13613
|
+
libc
|
|
13614
|
+
},
|
|
13615
|
+
required: {
|
|
13616
|
+
os: target.os,
|
|
13617
|
+
cpu: target.cpu,
|
|
13618
|
+
libc: target.libc
|
|
13619
|
+
},
|
|
13620
|
+
code: "EBADPLATFORM"
|
|
13621
|
+
});
|
|
13622
|
+
}
|
|
13623
|
+
}, "checkPlatform");
|
|
13624
|
+
var checkList = /* @__PURE__ */ __name((value, list) => {
|
|
13625
|
+
if (typeof list === "string") {
|
|
13626
|
+
list = [list];
|
|
13627
|
+
}
|
|
13628
|
+
if (list.length === 1 && list[0] === "any") {
|
|
13629
|
+
return true;
|
|
13630
|
+
}
|
|
13631
|
+
let negated = 0;
|
|
13632
|
+
let match = false;
|
|
13633
|
+
for (const entry of list) {
|
|
13634
|
+
const negate = entry.charAt(0) === "!";
|
|
13635
|
+
const test = negate ? entry.slice(1) : entry;
|
|
13636
|
+
if (negate) {
|
|
13637
|
+
negated++;
|
|
13638
|
+
if (value === test) {
|
|
13639
|
+
return false;
|
|
13640
|
+
}
|
|
13641
|
+
} else {
|
|
13642
|
+
match = match || value === test;
|
|
13643
|
+
}
|
|
13644
|
+
}
|
|
13645
|
+
return match || negated === list.length;
|
|
13646
|
+
}, "checkList");
|
|
13647
|
+
module2.exports = {
|
|
13648
|
+
checkEngine,
|
|
13649
|
+
checkPlatform,
|
|
13650
|
+
checkDevEngines,
|
|
13651
|
+
currentEnv
|
|
13652
|
+
};
|
|
13653
|
+
}
|
|
13654
|
+
});
|
|
13655
|
+
|
|
13656
|
+
// node_modules/.pnpm/npm-normalize-package-bin@5.0.0/node_modules/npm-normalize-package-bin/lib/index.js
|
|
13657
|
+
var require_lib8 = __commonJS({
|
|
13658
|
+
"node_modules/.pnpm/npm-normalize-package-bin@5.0.0/node_modules/npm-normalize-package-bin/lib/index.js"(exports2, module2) {
|
|
13659
|
+
var { join, basename } = require("path");
|
|
13660
|
+
var normalize = /* @__PURE__ */ __name((pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg), "normalize");
|
|
13661
|
+
var normalizeString = /* @__PURE__ */ __name((pkg) => {
|
|
13662
|
+
if (!pkg.name) {
|
|
13663
|
+
return removeBin(pkg);
|
|
13664
|
+
}
|
|
13665
|
+
pkg.bin = { [pkg.name]: pkg.bin };
|
|
13666
|
+
return normalizeObject(pkg);
|
|
13667
|
+
}, "normalizeString");
|
|
13668
|
+
var normalizeArray = /* @__PURE__ */ __name((pkg) => {
|
|
13669
|
+
pkg.bin = pkg.bin.reduce((acc, k) => {
|
|
13670
|
+
acc[basename(k)] = k;
|
|
13671
|
+
return acc;
|
|
13672
|
+
}, {});
|
|
13673
|
+
return normalizeObject(pkg);
|
|
13674
|
+
}, "normalizeArray");
|
|
13675
|
+
var removeBin = /* @__PURE__ */ __name((pkg) => {
|
|
13676
|
+
delete pkg.bin;
|
|
13677
|
+
return pkg;
|
|
13678
|
+
}, "removeBin");
|
|
13679
|
+
var normalizeObject = /* @__PURE__ */ __name((pkg) => {
|
|
13680
|
+
const orig = pkg.bin;
|
|
13681
|
+
const clean = {};
|
|
13682
|
+
let hasBins = false;
|
|
13683
|
+
Object.keys(orig).forEach((binKey) => {
|
|
13684
|
+
const base = join("/", basename(binKey.replace(/\\|:/g, "/"))).slice(1);
|
|
13685
|
+
if (typeof orig[binKey] !== "string" || !base) {
|
|
13686
|
+
return;
|
|
13687
|
+
}
|
|
13688
|
+
const binTarget = join("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
|
|
13689
|
+
if (!binTarget) {
|
|
13690
|
+
return;
|
|
13691
|
+
}
|
|
13692
|
+
clean[base] = binTarget;
|
|
13693
|
+
hasBins = true;
|
|
13694
|
+
});
|
|
13695
|
+
if (hasBins) {
|
|
13696
|
+
pkg.bin = clean;
|
|
13697
|
+
} else {
|
|
13698
|
+
delete pkg.bin;
|
|
13699
|
+
}
|
|
13700
|
+
return pkg;
|
|
13701
|
+
}, "normalizeObject");
|
|
13702
|
+
module2.exports = normalize;
|
|
13703
|
+
}
|
|
13704
|
+
});
|
|
13705
|
+
|
|
13706
|
+
// node_modules/.pnpm/npm-pick-manifest@10.0.0/node_modules/npm-pick-manifest/lib/index.js
|
|
13707
|
+
var require_lib9 = __commonJS({
|
|
13708
|
+
"node_modules/.pnpm/npm-pick-manifest@10.0.0/node_modules/npm-pick-manifest/lib/index.js"(exports2, module2) {
|
|
13709
|
+
"use strict";
|
|
13710
|
+
var npa = require_npa();
|
|
13711
|
+
var semver = require_semver2();
|
|
13712
|
+
var { checkEngine } = require_lib7();
|
|
13713
|
+
var normalizeBin = require_lib8();
|
|
13714
|
+
var engineOk = /* @__PURE__ */ __name((manifest, npmVersion, nodeVersion) => {
|
|
13715
|
+
try {
|
|
13716
|
+
checkEngine(manifest, npmVersion, nodeVersion);
|
|
13717
|
+
return true;
|
|
13718
|
+
} catch (_) {
|
|
13719
|
+
return false;
|
|
13720
|
+
}
|
|
13721
|
+
}, "engineOk");
|
|
13722
|
+
var isBefore = /* @__PURE__ */ __name((verTimes, ver, time) => !verTimes || !verTimes[ver] || Date.parse(verTimes[ver]) <= time, "isBefore");
|
|
13723
|
+
var avoidSemverOpt = { includePrerelease: true, loose: true };
|
|
13724
|
+
var shouldAvoid = /* @__PURE__ */ __name((ver, avoid) => avoid && semver.satisfies(ver, avoid, avoidSemverOpt), "shouldAvoid");
|
|
13725
|
+
var decorateAvoid = /* @__PURE__ */ __name((result, avoid) => result && shouldAvoid(result.version, avoid) ? { ...result, _shouldAvoid: true } : result, "decorateAvoid");
|
|
13726
|
+
var pickManifest = /* @__PURE__ */ __name((packument, wanted, opts) => {
|
|
13727
|
+
const {
|
|
13728
|
+
defaultTag = "latest",
|
|
13729
|
+
before = null,
|
|
13730
|
+
nodeVersion = process.version,
|
|
13731
|
+
npmVersion = null,
|
|
13732
|
+
includeStaged = false,
|
|
13733
|
+
avoid = null,
|
|
13734
|
+
avoidStrict = false
|
|
13735
|
+
} = opts;
|
|
13736
|
+
const { name, time: verTimes } = packument;
|
|
13737
|
+
const versions = packument.versions || {};
|
|
13738
|
+
if (avoidStrict) {
|
|
13739
|
+
const looseOpts = {
|
|
13740
|
+
...opts,
|
|
13741
|
+
avoidStrict: false
|
|
13742
|
+
};
|
|
13743
|
+
const result = pickManifest(packument, wanted, looseOpts);
|
|
13744
|
+
if (!result || !result._shouldAvoid) {
|
|
13745
|
+
return result;
|
|
13746
|
+
}
|
|
13747
|
+
const caret = pickManifest(packument, `^${result.version}`, looseOpts);
|
|
13748
|
+
if (!caret || !caret._shouldAvoid) {
|
|
13749
|
+
return {
|
|
13750
|
+
...caret,
|
|
13751
|
+
_outsideDependencyRange: true,
|
|
13752
|
+
_isSemVerMajor: false
|
|
13753
|
+
};
|
|
13754
|
+
}
|
|
13755
|
+
const star = pickManifest(packument, "*", looseOpts);
|
|
13756
|
+
if (!star || !star._shouldAvoid) {
|
|
13757
|
+
return {
|
|
13758
|
+
...star,
|
|
13759
|
+
_outsideDependencyRange: true,
|
|
13760
|
+
_isSemVerMajor: true
|
|
13761
|
+
};
|
|
13762
|
+
}
|
|
13763
|
+
throw Object.assign(new Error(`No avoidable versions for ${name}`), {
|
|
13764
|
+
code: "ETARGET",
|
|
13765
|
+
name,
|
|
13766
|
+
wanted,
|
|
13767
|
+
avoid,
|
|
13768
|
+
before,
|
|
13769
|
+
versions: Object.keys(versions)
|
|
13770
|
+
});
|
|
13771
|
+
}
|
|
13772
|
+
const staged = includeStaged && packument.stagedVersions && packument.stagedVersions.versions || {};
|
|
13773
|
+
const restricted = packument.policyRestrictions && packument.policyRestrictions.versions || {};
|
|
13774
|
+
const time = before && verTimes ? +new Date(before) : Infinity;
|
|
13775
|
+
const spec = npa.resolve(name, wanted || defaultTag);
|
|
13776
|
+
const type = spec.type;
|
|
13777
|
+
const distTags = packument["dist-tags"] || {};
|
|
13778
|
+
if (type !== "tag" && type !== "version" && type !== "range") {
|
|
13779
|
+
throw new Error("Only tag, version, and range are supported");
|
|
13780
|
+
}
|
|
13781
|
+
if (wanted && type === "tag") {
|
|
13782
|
+
const ver = distTags[wanted];
|
|
13783
|
+
if (isBefore(verTimes, ver, time)) {
|
|
13784
|
+
return decorateAvoid(versions[ver] || staged[ver] || restricted[ver], avoid);
|
|
13785
|
+
} else {
|
|
13786
|
+
return pickManifest(packument, `<=${ver}`, opts);
|
|
13787
|
+
}
|
|
13788
|
+
}
|
|
13789
|
+
if (wanted && type === "version") {
|
|
13790
|
+
const ver = semver.clean(wanted, { loose: true });
|
|
13791
|
+
const mani = versions[ver] || staged[ver] || restricted[ver];
|
|
13792
|
+
return isBefore(verTimes, ver, time) ? decorateAvoid(mani, avoid) : null;
|
|
13793
|
+
}
|
|
13794
|
+
const range = type === "range" ? wanted : "*";
|
|
13795
|
+
const defaultVer = distTags[defaultTag];
|
|
13796
|
+
if (defaultVer && (range === "*" || semver.satisfies(defaultVer, range, { loose: true })) && !restricted[defaultVer] && !shouldAvoid(defaultVer, avoid)) {
|
|
13797
|
+
const mani = versions[defaultVer];
|
|
13798
|
+
const ok = mani && isBefore(verTimes, defaultVer, time) && engineOk(mani, npmVersion, nodeVersion) && !mani.deprecated && !staged[defaultVer];
|
|
13799
|
+
if (ok) {
|
|
13800
|
+
return mani;
|
|
13801
|
+
}
|
|
13802
|
+
}
|
|
13803
|
+
const allEntries = Object.entries(versions).concat(Object.entries(staged)).concat(Object.entries(restricted)).filter(([ver]) => isBefore(verTimes, ver, time));
|
|
13804
|
+
if (!allEntries.length) {
|
|
13805
|
+
throw Object.assign(new Error(`No versions available for ${name}`), {
|
|
13806
|
+
code: "ENOVERSIONS",
|
|
13807
|
+
name,
|
|
13808
|
+
type,
|
|
13809
|
+
wanted,
|
|
13810
|
+
before,
|
|
13811
|
+
versions: Object.keys(versions)
|
|
13812
|
+
});
|
|
13813
|
+
}
|
|
13814
|
+
const sortSemverOpt = { loose: true };
|
|
13815
|
+
const entries = allEntries.filter(([ver]) => semver.satisfies(ver, range, { loose: true })).sort((a, b) => {
|
|
13816
|
+
const [vera, mania] = a;
|
|
13817
|
+
const [verb, manib] = b;
|
|
13818
|
+
const notavoida = !shouldAvoid(vera, avoid);
|
|
13819
|
+
const notavoidb = !shouldAvoid(verb, avoid);
|
|
13820
|
+
const notrestra = !restricted[vera];
|
|
13821
|
+
const notrestrb = !restricted[verb];
|
|
13822
|
+
const notstagea = !staged[vera];
|
|
13823
|
+
const notstageb = !staged[verb];
|
|
13824
|
+
const notdepra = !mania.deprecated;
|
|
13825
|
+
const notdeprb = !manib.deprecated;
|
|
13826
|
+
const enginea = engineOk(mania, npmVersion, nodeVersion);
|
|
13827
|
+
const engineb = engineOk(manib, npmVersion, nodeVersion);
|
|
13828
|
+
return notavoidb - notavoida || notrestrb - notrestra || notstageb - notstagea || (notdeprb && engineb) - (notdepra && enginea) || engineb - enginea || notdeprb - notdepra || semver.rcompare(vera, verb, sortSemverOpt);
|
|
13829
|
+
});
|
|
13830
|
+
return decorateAvoid(entries[0] && entries[0][1], avoid);
|
|
13831
|
+
}, "pickManifest");
|
|
13832
|
+
module2.exports = (packument, wanted, opts = {}) => {
|
|
13833
|
+
const mani = pickManifest(packument, wanted, opts);
|
|
13834
|
+
const picked = mani && normalizeBin(mani);
|
|
13835
|
+
const policyRestrictions = packument.policyRestrictions;
|
|
13836
|
+
const restricted = policyRestrictions && policyRestrictions.versions || {};
|
|
13837
|
+
if (picked && !restricted[picked.version]) {
|
|
13838
|
+
return picked;
|
|
13839
|
+
}
|
|
13840
|
+
const { before = null, defaultTag = "latest" } = opts;
|
|
13841
|
+
const bstr = before ? new Date(before).toLocaleString() : "";
|
|
13842
|
+
const { name } = packument;
|
|
13843
|
+
const pckg = `${name}@${wanted}` + (before ? ` with a date before ${bstr}` : "");
|
|
13844
|
+
const isForbidden = picked && !!restricted[picked.version];
|
|
13845
|
+
const polMsg = isForbidden ? policyRestrictions.message : "";
|
|
13846
|
+
const msg = !isForbidden ? `No matching version found for ${pckg}.` : `Could not download ${pckg} due to policy violations:
|
|
13847
|
+
${polMsg}`;
|
|
13848
|
+
const code = isForbidden ? "E403" : "ETARGET";
|
|
13849
|
+
throw Object.assign(new Error(msg), {
|
|
13850
|
+
code,
|
|
13851
|
+
type: npa.resolve(packument.name, wanted).type,
|
|
13852
|
+
wanted,
|
|
13853
|
+
versions: Object.keys(packument.versions ?? {}),
|
|
13854
|
+
name,
|
|
13855
|
+
distTags: packument["dist-tags"],
|
|
13856
|
+
defaultTag
|
|
13857
|
+
});
|
|
13858
|
+
};
|
|
13859
|
+
}
|
|
13860
|
+
});
|
|
13861
|
+
|
|
13862
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/clone.js
|
|
13863
|
+
var require_clone = __commonJS({
|
|
13864
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/clone.js"(exports2, module2) {
|
|
13865
|
+
var shallowHosts = /* @__PURE__ */ new Set([
|
|
13866
|
+
"github.com",
|
|
13867
|
+
"gist.github.com",
|
|
13868
|
+
"gitlab.com",
|
|
13869
|
+
"bitbucket.com",
|
|
13870
|
+
"bitbucket.org"
|
|
13871
|
+
]);
|
|
13872
|
+
var { parse } = require("url");
|
|
13873
|
+
var path = require("path");
|
|
13874
|
+
var getRevs = require_revs();
|
|
13875
|
+
var spawn = require_spawn();
|
|
13876
|
+
var { isWindows } = require_utils();
|
|
13877
|
+
var pickManifest = require_lib9();
|
|
13878
|
+
var fs = require("fs/promises");
|
|
13879
|
+
module2.exports = (repo, ref = "HEAD", target = null, opts = {}) => getRevs(repo, opts).then((revs) => clone(
|
|
13880
|
+
repo,
|
|
13881
|
+
revs,
|
|
13882
|
+
ref,
|
|
13883
|
+
resolveRef(revs, ref, opts),
|
|
13884
|
+
target || defaultTarget(repo, opts.cwd),
|
|
13885
|
+
opts
|
|
13886
|
+
));
|
|
13887
|
+
var maybeShallow = /* @__PURE__ */ __name((repo, opts) => {
|
|
13888
|
+
if (opts.gitShallow === false || opts.gitShallow) {
|
|
13889
|
+
return opts.gitShallow;
|
|
13890
|
+
}
|
|
13891
|
+
return shallowHosts.has(parse(repo).host);
|
|
13892
|
+
}, "maybeShallow");
|
|
13893
|
+
var defaultTarget = /* @__PURE__ */ __name((repo, cwd = process.cwd()) => path.resolve(cwd, path.basename(repo.replace(/[/\\]?\.git$/, ""))), "defaultTarget");
|
|
13894
|
+
var clone = /* @__PURE__ */ __name((repo, revs, ref, revDoc, target, opts) => {
|
|
13895
|
+
if (!revDoc) {
|
|
13896
|
+
return unresolved(repo, ref, target, opts);
|
|
13897
|
+
}
|
|
13898
|
+
if (revDoc.sha === revs.refs.HEAD.sha) {
|
|
13899
|
+
return plain(repo, revDoc, target, opts);
|
|
13900
|
+
}
|
|
13901
|
+
if (revDoc.type === "tag" || revDoc.type === "branch") {
|
|
13902
|
+
return branch(repo, revDoc, target, opts);
|
|
13903
|
+
}
|
|
13904
|
+
return other(repo, revDoc, target, opts);
|
|
13905
|
+
}, "clone");
|
|
13906
|
+
var resolveRef = /* @__PURE__ */ __name((revs, ref, opts) => {
|
|
13907
|
+
const { spec = {} } = opts;
|
|
13908
|
+
ref = spec.gitCommittish || ref;
|
|
13909
|
+
if (!revs) {
|
|
13910
|
+
return null;
|
|
13911
|
+
}
|
|
13912
|
+
if (spec.gitRange) {
|
|
13913
|
+
return pickManifest(revs, spec.gitRange, opts);
|
|
13914
|
+
}
|
|
13915
|
+
if (!ref) {
|
|
13916
|
+
return revs.refs.HEAD;
|
|
13917
|
+
}
|
|
13918
|
+
if (revs.refs[ref]) {
|
|
13919
|
+
return revs.refs[ref];
|
|
13920
|
+
}
|
|
13921
|
+
if (revs.shas[ref]) {
|
|
13922
|
+
return revs.refs[revs.shas[ref][0]];
|
|
13923
|
+
}
|
|
13924
|
+
return null;
|
|
13925
|
+
}, "resolveRef");
|
|
13926
|
+
var other = /* @__PURE__ */ __name((repo, revDoc, target, opts) => {
|
|
13927
|
+
const shallow = maybeShallow(repo, opts);
|
|
13928
|
+
const fetchOrigin = ["fetch", "origin", revDoc.rawRef].concat(shallow ? ["--depth=1"] : []);
|
|
13929
|
+
const git = /* @__PURE__ */ __name((args) => spawn(args, { ...opts, cwd: target }), "git");
|
|
13930
|
+
return fs.mkdir(target, { recursive: true }).then(() => git(["init"])).then(() => isWindows(opts) ? git(["config", "--local", "--add", "core.longpaths", "true"]) : null).then(() => git(["remote", "add", "origin", repo])).then(() => git(fetchOrigin)).then(() => git(["checkout", revDoc.sha])).then(() => updateSubmodules(target, opts)).then(() => revDoc.sha);
|
|
13931
|
+
}, "other");
|
|
13932
|
+
var branch = /* @__PURE__ */ __name((repo, revDoc, target, opts) => {
|
|
13933
|
+
const args = [
|
|
13934
|
+
"clone",
|
|
13935
|
+
"-b",
|
|
13936
|
+
revDoc.ref,
|
|
13937
|
+
repo,
|
|
13938
|
+
target,
|
|
13939
|
+
"--recurse-submodules"
|
|
13940
|
+
];
|
|
13941
|
+
if (maybeShallow(repo, opts)) {
|
|
13942
|
+
args.push("--depth=1");
|
|
13943
|
+
}
|
|
13944
|
+
if (isWindows(opts)) {
|
|
13945
|
+
args.push("--config", "core.longpaths=true");
|
|
13946
|
+
}
|
|
13947
|
+
return spawn(args, opts).then(() => revDoc.sha);
|
|
13948
|
+
}, "branch");
|
|
13949
|
+
var plain = /* @__PURE__ */ __name((repo, revDoc, target, opts) => {
|
|
13950
|
+
const args = [
|
|
13951
|
+
"clone",
|
|
13952
|
+
repo,
|
|
13953
|
+
target,
|
|
13954
|
+
"--recurse-submodules"
|
|
13955
|
+
];
|
|
13956
|
+
if (maybeShallow(repo, opts)) {
|
|
13957
|
+
args.push("--depth=1");
|
|
13958
|
+
}
|
|
13959
|
+
if (isWindows(opts)) {
|
|
13960
|
+
args.push("--config", "core.longpaths=true");
|
|
13961
|
+
}
|
|
13962
|
+
return spawn(args, opts).then(() => revDoc.sha);
|
|
13963
|
+
}, "plain");
|
|
13964
|
+
var updateSubmodules = /* @__PURE__ */ __name(async (target, opts) => {
|
|
13965
|
+
const hasSubmodules = await fs.stat(`${target}/.gitmodules`).then(() => true).catch(() => false);
|
|
13966
|
+
if (!hasSubmodules) {
|
|
13967
|
+
return null;
|
|
13968
|
+
}
|
|
13969
|
+
return spawn([
|
|
13970
|
+
"submodule",
|
|
13971
|
+
"update",
|
|
13972
|
+
"-q",
|
|
13973
|
+
"--init",
|
|
13974
|
+
"--recursive"
|
|
13975
|
+
], { ...opts, cwd: target });
|
|
13976
|
+
}, "updateSubmodules");
|
|
13977
|
+
var unresolved = /* @__PURE__ */ __name((repo, ref, target, opts) => {
|
|
13978
|
+
const lp = isWindows(opts) ? ["--config", "core.longpaths=true"] : [];
|
|
13979
|
+
const cloneArgs = ["clone", "--mirror", "-q", repo, target + "/.git"];
|
|
13980
|
+
const git = /* @__PURE__ */ __name((args) => spawn(args, { ...opts, cwd: target }), "git");
|
|
13981
|
+
return fs.mkdir(target, { recursive: true }).then(() => git(cloneArgs.concat(lp))).then(() => git(["init"])).then(() => git(["checkout", ref])).then(() => updateSubmodules(target, opts)).then(() => git(["rev-parse", "--revs-only", "HEAD"])).then(({ stdout }) => stdout.trim());
|
|
13982
|
+
}, "unresolved");
|
|
13983
|
+
}
|
|
13984
|
+
});
|
|
13985
|
+
|
|
13986
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/is.js
|
|
13987
|
+
var require_is = __commonJS({
|
|
13988
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/is.js"(exports2, module2) {
|
|
13989
|
+
var { stat } = require("fs/promises");
|
|
13990
|
+
module2.exports = ({ cwd = process.cwd() } = {}) => stat(cwd + "/.git").then(() => true, () => false);
|
|
13991
|
+
}
|
|
13992
|
+
});
|
|
13993
|
+
|
|
13994
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/find.js
|
|
13995
|
+
var require_find = __commonJS({
|
|
13996
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/find.js"(exports2, module2) {
|
|
13997
|
+
var is = require_is();
|
|
13998
|
+
var { dirname } = require("path");
|
|
13999
|
+
module2.exports = async ({ cwd = process.cwd(), root } = {}) => {
|
|
14000
|
+
while (true) {
|
|
14001
|
+
if (await is({ cwd })) {
|
|
14002
|
+
return cwd;
|
|
14003
|
+
}
|
|
14004
|
+
const next = dirname(cwd);
|
|
14005
|
+
if (cwd === root || cwd === next) {
|
|
14006
|
+
return null;
|
|
14007
|
+
}
|
|
14008
|
+
cwd = next;
|
|
14009
|
+
}
|
|
14010
|
+
};
|
|
14011
|
+
}
|
|
14012
|
+
});
|
|
14013
|
+
|
|
14014
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/is-clean.js
|
|
14015
|
+
var require_is_clean = __commonJS({
|
|
14016
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/is-clean.js"(exports2, module2) {
|
|
14017
|
+
var spawn = require_spawn();
|
|
14018
|
+
module2.exports = (opts = {}) => spawn(["status", "--porcelain=v1", "-uno"], opts).then((res) => !res.stdout.trim().split(/\r?\n+/).map((l) => l.trim()).filter((l) => l).length);
|
|
14019
|
+
}
|
|
14020
|
+
});
|
|
14021
|
+
|
|
14022
|
+
// node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/index.js
|
|
14023
|
+
var require_lib10 = __commonJS({
|
|
14024
|
+
"node_modules/.pnpm/@npmcli+git@6.0.3/node_modules/@npmcli/git/lib/index.js"(exports2, module2) {
|
|
14025
|
+
module2.exports = {
|
|
14026
|
+
clone: require_clone(),
|
|
14027
|
+
revs: require_revs(),
|
|
14028
|
+
spawn: require_spawn(),
|
|
14029
|
+
is: require_is(),
|
|
14030
|
+
find: require_find(),
|
|
14031
|
+
isClean: require_is_clean(),
|
|
14032
|
+
errors: require_errors()
|
|
14033
|
+
};
|
|
10075
14034
|
}
|
|
10076
14035
|
});
|
|
10077
14036
|
|
|
@@ -10484,7 +14443,7 @@ var require_normalize = __commonJS({
|
|
|
10484
14443
|
normalizePackageBin(data, changes);
|
|
10485
14444
|
}
|
|
10486
14445
|
if (steps.includes("gitHead") && !data.gitHead) {
|
|
10487
|
-
const git =
|
|
14446
|
+
const git = require_lib10();
|
|
10488
14447
|
const gitRoot = await git.find({ cwd: pkg.path, root });
|
|
10489
14448
|
let head;
|
|
10490
14449
|
if (gitRoot) {
|
|
@@ -10611,7 +14570,7 @@ var require_read_package = __commonJS({
|
|
|
10611
14570
|
});
|
|
10612
14571
|
|
|
10613
14572
|
// node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/sort.js
|
|
10614
|
-
var
|
|
14573
|
+
var require_sort2 = __commonJS({
|
|
10615
14574
|
"node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/sort.js"(exports2, module2) {
|
|
10616
14575
|
function packageSort(json) {
|
|
10617
14576
|
const {
|
|
@@ -10709,7 +14668,7 @@ var require_sort = __commonJS({
|
|
|
10709
14668
|
});
|
|
10710
14669
|
|
|
10711
14670
|
// node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/index.js
|
|
10712
|
-
var
|
|
14671
|
+
var require_lib11 = __commonJS({
|
|
10713
14672
|
"node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/index.js"(exports2, module2) {
|
|
10714
14673
|
var { readFile, writeFile } = require("node:fs/promises");
|
|
10715
14674
|
var { resolve } = require("node:path");
|
|
@@ -10719,7 +14678,7 @@ var require_lib4 = __commonJS({
|
|
|
10719
14678
|
var updateWorkspaces = require_update_workspaces();
|
|
10720
14679
|
var { normalize, syncNormalize } = require_normalize();
|
|
10721
14680
|
var { read, parse } = require_read_package();
|
|
10722
|
-
var { packageSort } =
|
|
14681
|
+
var { packageSort } = require_sort2();
|
|
10723
14682
|
var knownSteps = /* @__PURE__ */ new Set([
|
|
10724
14683
|
updateDeps,
|
|
10725
14684
|
updateScripts,
|
|
@@ -10965,4 +14924,4 @@ var require_lib4 = __commonJS({
|
|
|
10965
14924
|
});
|
|
10966
14925
|
|
|
10967
14926
|
// src/external/@npmcli/package-json.js
|
|
10968
|
-
module.exports =
|
|
14927
|
+
module.exports = require_lib11();
|