@sanity/cli 4.19.1-next.9 → 4.20.0-next.40
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/bin/dev.js +2 -0
- package/lib/_chunks-cjs/cli.js +301 -1955
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/_chunks-cjs/getCliConfig.js +6 -3
- package/lib/_chunks-cjs/getCliConfig.js.map +1 -1
- package/package.json +12 -15
- package/lib/index.d.mts +0 -512
- package/lib/index.mjs +0 -393
- package/lib/index.mjs.map +0 -1
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
18
18
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
19
19
|
mod
|
|
20
20
|
));
|
|
21
|
-
var os = require("node:os"), chalk = require("chalk"), loadEnv = require("./loadEnv.js"), require$$0$5 = require("path"), require$$1$2 = require("module"), require$$0$4 = require("fs"), semver = require("semver"), telemetry = require("@sanity/telemetry"), childProcess = require("node:child_process"), fs$1 = require("node:fs"), path$3 = require("node:path"), fs = require("node:fs/promises"), util$
|
|
21
|
+
var os = require("node:os"), chalk = require("chalk"), loadEnv = require("./loadEnv.js"), require$$0$5 = require("path"), require$$1$2 = require("module"), require$$0$4 = require("fs"), semver = require("semver"), telemetry = require("@sanity/telemetry"), childProcess = require("node:child_process"), fs$1 = require("node:fs"), path$3 = require("node:path"), fs = require("node:fs/promises"), util$3 = require("node:util"), require$$0$6 = require("os"), getLatestVersion = require("get-latest-version"), pkgDir = require("pkg-dir"), client$1 = require("@sanity/client"), require$$0$7 = require("constants"), require$$0$8 = require("stream"), require$$0$9 = require("util"), require$$0$a = require("assert"), require$$0$b = require("events"), require$$3$1 = require("crypto"), require$$1$3 = require("child_process"), getCliConfig = require("./getCliConfig.js"), require$$0$c = require("fs/promises"), require$$0$d = require("buffer"), journeyConfig = require("./journeyConfig.js"), Stream = require("node:stream"), promises$1 = require("node:stream/promises"), templateValidator = require("@sanity/template-validator"), require$$2$1 = require("string_decoder"), require$$0$e = require("zlib"), require$$7$1 = require("process"), http = require("node:http"), traverse = require("@babel/traverse"), node_url = require("node:url"), node_events = require("node:events"), node_string_decoder = require("node:string_decoder"), process$2 = require("node:process"), require$$2$2 = require("readline"), require$$0$f = require("tty");
|
|
22
22
|
function _interopDefaultCompat(e) {
|
|
23
23
|
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
24
24
|
}
|
|
@@ -52,7 +52,7 @@ function _mergeNamespaces(n, m) {
|
|
|
52
52
|
});
|
|
53
53
|
}), Object.freeze(n);
|
|
54
54
|
}
|
|
55
|
-
var os__default = /* @__PURE__ */ _interopDefaultCompat(os), chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk), require$$0__default$1 = /* @__PURE__ */ _interopDefaultCompat(require$$0$5), require$$1__default = /* @__PURE__ */ _interopDefaultCompat(require$$1$2), require$$0__default = /* @__PURE__ */ _interopDefaultCompat(require$$0$4), semver__default = /* @__PURE__ */ _interopDefaultCompat(semver), childProcess__default = /* @__PURE__ */ _interopDefaultCompat(childProcess), fs__namespace = /* @__PURE__ */ _interopNamespaceCompat(fs$1), path__default = /* @__PURE__ */ _interopDefaultCompat(path$3), fs__default = /* @__PURE__ */ _interopDefaultCompat(fs), util__default = /* @__PURE__ */ _interopDefaultCompat(util$
|
|
55
|
+
var os__default = /* @__PURE__ */ _interopDefaultCompat(os), chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk), require$$0__default$1 = /* @__PURE__ */ _interopDefaultCompat(require$$0$5), require$$1__default = /* @__PURE__ */ _interopDefaultCompat(require$$1$2), require$$0__default = /* @__PURE__ */ _interopDefaultCompat(require$$0$4), semver__default = /* @__PURE__ */ _interopDefaultCompat(semver), childProcess__default = /* @__PURE__ */ _interopDefaultCompat(childProcess), fs__namespace = /* @__PURE__ */ _interopNamespaceCompat(fs$1), path__default = /* @__PURE__ */ _interopDefaultCompat(path$3), fs__default = /* @__PURE__ */ _interopDefaultCompat(fs), util__default = /* @__PURE__ */ _interopDefaultCompat(util$3), require$$0__default$2 = /* @__PURE__ */ _interopDefaultCompat(require$$0$6), getLatestVersion__default = /* @__PURE__ */ _interopDefaultCompat(getLatestVersion), pkgDir__default = /* @__PURE__ */ _interopDefaultCompat(pkgDir), require$$0__default$3 = /* @__PURE__ */ _interopDefaultCompat(require$$0$7), require$$0__default$4 = /* @__PURE__ */ _interopDefaultCompat(require$$0$8), require$$0__default$5 = /* @__PURE__ */ _interopDefaultCompat(require$$0$9), require$$0__default$6 = /* @__PURE__ */ _interopDefaultCompat(require$$0$a), require$$0__default$7 = /* @__PURE__ */ _interopDefaultCompat(require$$0$b), require$$3__default = /* @__PURE__ */ _interopDefaultCompat(require$$3$1), require$$1__default$1 = /* @__PURE__ */ _interopDefaultCompat(require$$1$3), require$$0__default$8 = /* @__PURE__ */ _interopDefaultCompat(require$$0$c), require$$0__default$9 = /* @__PURE__ */ _interopDefaultCompat(require$$0$d), Stream__default = /* @__PURE__ */ _interopDefaultCompat(Stream), require$$2__default = /* @__PURE__ */ _interopDefaultCompat(require$$2$1), require$$0__default$a = /* @__PURE__ */ _interopDefaultCompat(require$$0$e), require$$7__default = /* @__PURE__ */ _interopDefaultCompat(require$$7$1), http__default = /* @__PURE__ */ _interopDefaultCompat(http), traverse__default = /* @__PURE__ */ _interopDefaultCompat(traverse), process__default = /* @__PURE__ */ _interopDefaultCompat(process$2), require$$2__default$1 = /* @__PURE__ */ _interopDefaultCompat(require$$2$2), require$$0__default$b = /* @__PURE__ */ _interopDefaultCompat(require$$0$f), resolveFrom$1 = { exports: {} }, hasRequiredResolveFrom;
|
|
56
56
|
function requireResolveFrom() {
|
|
57
57
|
if (hasRequiredResolveFrom) return resolveFrom$1.exports;
|
|
58
58
|
hasRequiredResolveFrom = 1;
|
|
@@ -4472,1885 +4472,7 @@ function requireXdgBasedir() {
|
|
|
4472
4472
|
exports$1.data = env.XDG_DATA_HOME || (homeDirectory ? path2.join(homeDirectory, ".local", "share") : void 0), exports$1.config = env.XDG_CONFIG_HOME || (homeDirectory ? path2.join(homeDirectory, ".config") : void 0), exports$1.cache = env.XDG_CACHE_HOME || (homeDirectory ? path2.join(homeDirectory, ".cache") : void 0), exports$1.runtime = env.XDG_RUNTIME_DIR || void 0, exports$1.dataDirs = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":"), exports$1.data && exports$1.dataDirs.unshift(exports$1.data), exports$1.configDirs = (env.XDG_CONFIG_DIRS || "/etc/xdg").split(":"), exports$1.config && exports$1.configDirs.unshift(exports$1.config);
|
|
4473
4473
|
})(xdgBasedir$1)), xdgBasedir$1;
|
|
4474
4474
|
}
|
|
4475
|
-
var xdgBasedirExports = requireXdgBasedir(), xdgBasedir = /* @__PURE__ */ loadEnv.getDefaultExportFromCjs(xdgBasedirExports)
|
|
4476
|
-
function requireIni$1() {
|
|
4477
|
-
if (hasRequiredIni$1) return ini$1;
|
|
4478
|
-
hasRequiredIni$1 = 1, ini$1.parse = ini$1.decode = decode, ini$1.stringify = ini$1.encode = encode, ini$1.safe = safe, ini$1.unsafe = unsafe;
|
|
4479
|
-
var eol = typeof process < "u" && process.platform === "win32" ? `\r
|
|
4480
|
-
` : `
|
|
4481
|
-
`;
|
|
4482
|
-
function encode(obj, opt) {
|
|
4483
|
-
var children = [], out = "";
|
|
4484
|
-
typeof opt == "string" ? opt = {
|
|
4485
|
-
section: opt,
|
|
4486
|
-
whitespace: !1
|
|
4487
|
-
} : (opt = opt || {}, opt.whitespace = opt.whitespace === !0);
|
|
4488
|
-
var separator2 = opt.whitespace ? " = " : "=";
|
|
4489
|
-
return Object.keys(obj).forEach(function(k, _, __) {
|
|
4490
|
-
var val = obj[k];
|
|
4491
|
-
val && Array.isArray(val) ? val.forEach(function(item) {
|
|
4492
|
-
out += safe(k + "[]") + separator2 + safe(item) + `
|
|
4493
|
-
`;
|
|
4494
|
-
}) : val && typeof val == "object" ? children.push(k) : out += safe(k) + separator2 + safe(val) + eol;
|
|
4495
|
-
}), opt.section && out.length && (out = "[" + safe(opt.section) + "]" + eol + out), children.forEach(function(k, _, __) {
|
|
4496
|
-
var nk = dotSplit(k).join("\\."), section = (opt.section ? opt.section + "." : "") + nk, child = encode(obj[k], {
|
|
4497
|
-
section,
|
|
4498
|
-
whitespace: opt.whitespace
|
|
4499
|
-
});
|
|
4500
|
-
out.length && child.length && (out += eol), out += child;
|
|
4501
|
-
}), out;
|
|
4502
|
-
}
|
|
4503
|
-
function dotSplit(str2) {
|
|
4504
|
-
return str2.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) {
|
|
4505
|
-
return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "");
|
|
4506
|
-
});
|
|
4507
|
-
}
|
|
4508
|
-
function decode(str2) {
|
|
4509
|
-
var out = {}, p = out, section = null, re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i, lines2 = str2.split(/[\r\n]+/g);
|
|
4510
|
-
return lines2.forEach(function(line3, _, __) {
|
|
4511
|
-
if (!(!line3 || line3.match(/^\s*[;#]/))) {
|
|
4512
|
-
var match2 = line3.match(re);
|
|
4513
|
-
if (match2) {
|
|
4514
|
-
if (match2[1] !== void 0) {
|
|
4515
|
-
if (section = unsafe(match2[1]), section === "__proto__") {
|
|
4516
|
-
p = {};
|
|
4517
|
-
return;
|
|
4518
|
-
}
|
|
4519
|
-
p = out[section] = out[section] || {};
|
|
4520
|
-
return;
|
|
4521
|
-
}
|
|
4522
|
-
var key2 = unsafe(match2[2]);
|
|
4523
|
-
if (key2 !== "__proto__") {
|
|
4524
|
-
var value = match2[3] ? unsafe(match2[4]) : !0;
|
|
4525
|
-
switch (value) {
|
|
4526
|
-
case "true":
|
|
4527
|
-
case "false":
|
|
4528
|
-
case "null":
|
|
4529
|
-
value = JSON.parse(value);
|
|
4530
|
-
}
|
|
4531
|
-
if (key2.length > 2 && key2.slice(-2) === "[]") {
|
|
4532
|
-
if (key2 = key2.substring(0, key2.length - 2), key2 === "__proto__")
|
|
4533
|
-
return;
|
|
4534
|
-
p[key2] ? Array.isArray(p[key2]) || (p[key2] = [p[key2]]) : p[key2] = [];
|
|
4535
|
-
}
|
|
4536
|
-
Array.isArray(p[key2]) ? p[key2].push(value) : p[key2] = value;
|
|
4537
|
-
}
|
|
4538
|
-
}
|
|
4539
|
-
}
|
|
4540
|
-
}), Object.keys(out).filter(function(k, _, __) {
|
|
4541
|
-
if (!out[k] || typeof out[k] != "object" || Array.isArray(out[k]))
|
|
4542
|
-
return !1;
|
|
4543
|
-
var parts = dotSplit(k), p2 = out, l = parts.pop(), nl = l.replace(/\\\./g, ".");
|
|
4544
|
-
return parts.forEach(function(part, _2, __2) {
|
|
4545
|
-
part !== "__proto__" && ((!p2[part] || typeof p2[part] != "object") && (p2[part] = {}), p2 = p2[part]);
|
|
4546
|
-
}), p2 === out && nl === l ? !1 : (p2[nl] = out[k], !0);
|
|
4547
|
-
}).forEach(function(del, _, __) {
|
|
4548
|
-
delete out[del];
|
|
4549
|
-
}), out;
|
|
4550
|
-
}
|
|
4551
|
-
function isQuoted(val) {
|
|
4552
|
-
return val.charAt(0) === '"' && val.slice(-1) === '"' || val.charAt(0) === "'" && val.slice(-1) === "'";
|
|
4553
|
-
}
|
|
4554
|
-
function safe(val) {
|
|
4555
|
-
return typeof val != "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#");
|
|
4556
|
-
}
|
|
4557
|
-
function unsafe(val, doUnesc) {
|
|
4558
|
-
if (val = (val || "").trim(), isQuoted(val)) {
|
|
4559
|
-
val.charAt(0) === "'" && (val = val.substr(1, val.length - 2));
|
|
4560
|
-
try {
|
|
4561
|
-
val = JSON.parse(val);
|
|
4562
|
-
} catch {
|
|
4563
|
-
}
|
|
4564
|
-
} else {
|
|
4565
|
-
for (var esc = !1, unesc = "", i = 0, l = val.length; i < l; i++) {
|
|
4566
|
-
var c2 = val.charAt(i);
|
|
4567
|
-
if (esc)
|
|
4568
|
-
"\\;#".indexOf(c2) !== -1 ? unesc += c2 : unesc += "\\" + c2, esc = !1;
|
|
4569
|
-
else {
|
|
4570
|
-
if (";#".indexOf(c2) !== -1)
|
|
4571
|
-
break;
|
|
4572
|
-
c2 === "\\" ? esc = !0 : unesc += c2;
|
|
4573
|
-
}
|
|
4574
|
-
}
|
|
4575
|
-
return esc && (unesc += "\\"), unesc.trim();
|
|
4576
|
-
}
|
|
4577
|
-
return val;
|
|
4578
|
-
}
|
|
4579
|
-
return ini$1;
|
|
4580
|
-
}
|
|
4581
|
-
var stripJsonComments, hasRequiredStripJsonComments;
|
|
4582
|
-
function requireStripJsonComments() {
|
|
4583
|
-
if (hasRequiredStripJsonComments) return stripJsonComments;
|
|
4584
|
-
hasRequiredStripJsonComments = 1;
|
|
4585
|
-
var singleComment = 1, multiComment = 2;
|
|
4586
|
-
function stripWithoutWhitespace() {
|
|
4587
|
-
return "";
|
|
4588
|
-
}
|
|
4589
|
-
function stripWithWhitespace(str2, start, end) {
|
|
4590
|
-
return str2.slice(start, end).replace(/\S/g, " ");
|
|
4591
|
-
}
|
|
4592
|
-
return stripJsonComments = function(str2, opts) {
|
|
4593
|
-
opts = opts || {};
|
|
4594
|
-
for (var currentChar, nextChar, insideString = !1, insideComment = !1, offset = 0, ret = "", strip = opts.whitespace === !1 ? stripWithoutWhitespace : stripWithWhitespace, i = 0; i < str2.length; i++) {
|
|
4595
|
-
if (currentChar = str2[i], nextChar = str2[i + 1], !insideComment && currentChar === '"') {
|
|
4596
|
-
var escaped = str2[i - 1] === "\\" && str2[i - 2] !== "\\";
|
|
4597
|
-
escaped || (insideString = !insideString);
|
|
4598
|
-
}
|
|
4599
|
-
if (!insideString) {
|
|
4600
|
-
if (!insideComment && currentChar + nextChar === "//")
|
|
4601
|
-
ret += str2.slice(offset, i), offset = i, insideComment = singleComment, i++;
|
|
4602
|
-
else if (insideComment === singleComment && currentChar + nextChar === `\r
|
|
4603
|
-
`) {
|
|
4604
|
-
i++, insideComment = !1, ret += strip(str2, offset, i), offset = i;
|
|
4605
|
-
continue;
|
|
4606
|
-
} else if (insideComment === singleComment && currentChar === `
|
|
4607
|
-
`)
|
|
4608
|
-
insideComment = !1, ret += strip(str2, offset, i), offset = i;
|
|
4609
|
-
else if (!insideComment && currentChar + nextChar === "/*") {
|
|
4610
|
-
ret += str2.slice(offset, i), offset = i, insideComment = multiComment, i++;
|
|
4611
|
-
continue;
|
|
4612
|
-
} else if (insideComment === multiComment && currentChar + nextChar === "*/") {
|
|
4613
|
-
i++, insideComment = !1, ret += strip(str2, offset, i + 1), offset = i + 1;
|
|
4614
|
-
continue;
|
|
4615
|
-
}
|
|
4616
|
-
}
|
|
4617
|
-
}
|
|
4618
|
-
return ret + (insideComment ? strip(str2.substr(offset)) : str2.substr(offset));
|
|
4619
|
-
}, stripJsonComments;
|
|
4620
|
-
}
|
|
4621
|
-
var hasRequiredUtils$3;
|
|
4622
|
-
function requireUtils$3() {
|
|
4623
|
-
if (hasRequiredUtils$3) return utils$3;
|
|
4624
|
-
hasRequiredUtils$3 = 1;
|
|
4625
|
-
var fs2 = require$$0__default.default, ini2 = requireIni$1(), path2 = require$$0__default$1.default, stripJsonComments2 = requireStripJsonComments(), parse3 = utils$3.parse = function(content) {
|
|
4626
|
-
return /^\s*{/.test(content) ? JSON.parse(stripJsonComments2(content)) : ini2.parse(content);
|
|
4627
|
-
}, file = utils$3.file = function() {
|
|
4628
|
-
var args = [].slice.call(arguments).filter(function(arg) {
|
|
4629
|
-
return arg != null;
|
|
4630
|
-
});
|
|
4631
|
-
for (var i in args)
|
|
4632
|
-
if (typeof args[i] != "string")
|
|
4633
|
-
return;
|
|
4634
|
-
var file2 = path2.join.apply(null, args);
|
|
4635
|
-
try {
|
|
4636
|
-
return fs2.readFileSync(file2, "utf-8");
|
|
4637
|
-
} catch {
|
|
4638
|
-
return;
|
|
4639
|
-
}
|
|
4640
|
-
};
|
|
4641
|
-
return utils$3.json = function() {
|
|
4642
|
-
var content = file.apply(null, arguments);
|
|
4643
|
-
return content ? parse3(content) : null;
|
|
4644
|
-
}, utils$3.env = function(prefix, env) {
|
|
4645
|
-
env = env || process.env;
|
|
4646
|
-
var obj = {}, l = prefix.length;
|
|
4647
|
-
for (var k in env)
|
|
4648
|
-
if (k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
|
|
4649
|
-
for (var keypath = k.substring(l).split("__"), _emptyStringIndex; (_emptyStringIndex = keypath.indexOf("")) > -1; )
|
|
4650
|
-
keypath.splice(_emptyStringIndex, 1);
|
|
4651
|
-
var cursor = obj;
|
|
4652
|
-
keypath.forEach(function(_subkey, i) {
|
|
4653
|
-
!_subkey || typeof cursor != "object" || (i === keypath.length - 1 && (cursor[_subkey] = env[k]), cursor[_subkey] === void 0 && (cursor[_subkey] = {}), cursor = cursor[_subkey]);
|
|
4654
|
-
});
|
|
4655
|
-
}
|
|
4656
|
-
return obj;
|
|
4657
|
-
}, utils$3.find = function() {
|
|
4658
|
-
var rel = path2.join.apply(null, [].slice.call(arguments));
|
|
4659
|
-
function find2(start, rel2) {
|
|
4660
|
-
var file2 = path2.join(start, rel2);
|
|
4661
|
-
try {
|
|
4662
|
-
return fs2.statSync(file2), file2;
|
|
4663
|
-
} catch {
|
|
4664
|
-
if (path2.dirname(start) !== start)
|
|
4665
|
-
return find2(path2.dirname(start), rel2);
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4668
|
-
return find2(process.cwd(), rel);
|
|
4669
|
-
}, utils$3;
|
|
4670
|
-
}
|
|
4671
|
-
var deepExtend = { exports: {} };
|
|
4672
|
-
/*!
|
|
4673
|
-
* @description Recursive object extending
|
|
4674
|
-
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
|
4675
|
-
* @license MIT
|
|
4676
|
-
*
|
|
4677
|
-
* The MIT License (MIT)
|
|
4678
|
-
*
|
|
4679
|
-
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
|
4680
|
-
*
|
|
4681
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4682
|
-
* this software and associated documentation files (the "Software"), to deal in
|
|
4683
|
-
* the Software without restriction, including without limitation the rights to
|
|
4684
|
-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
4685
|
-
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
4686
|
-
* subject to the following conditions:
|
|
4687
|
-
*
|
|
4688
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
4689
|
-
* copies or substantial portions of the Software.
|
|
4690
|
-
*
|
|
4691
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
4692
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
4693
|
-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
4694
|
-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
4695
|
-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
4696
|
-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
4697
|
-
*/
|
|
4698
|
-
var hasRequiredDeepExtend;
|
|
4699
|
-
function requireDeepExtend() {
|
|
4700
|
-
if (hasRequiredDeepExtend) return deepExtend.exports;
|
|
4701
|
-
hasRequiredDeepExtend = 1;
|
|
4702
|
-
function isSpecificValue(val) {
|
|
4703
|
-
return val instanceof Buffer || val instanceof Date || val instanceof RegExp;
|
|
4704
|
-
}
|
|
4705
|
-
function cloneSpecificValue(val) {
|
|
4706
|
-
if (val instanceof Buffer) {
|
|
4707
|
-
var x = Buffer.alloc ? Buffer.alloc(val.length) : new Buffer(val.length);
|
|
4708
|
-
return val.copy(x), x;
|
|
4709
|
-
} else {
|
|
4710
|
-
if (val instanceof Date)
|
|
4711
|
-
return new Date(val.getTime());
|
|
4712
|
-
if (val instanceof RegExp)
|
|
4713
|
-
return new RegExp(val);
|
|
4714
|
-
throw new Error("Unexpected situation");
|
|
4715
|
-
}
|
|
4716
|
-
}
|
|
4717
|
-
function deepCloneArray(arr) {
|
|
4718
|
-
var clone = [];
|
|
4719
|
-
return arr.forEach(function(item, index) {
|
|
4720
|
-
typeof item == "object" && item !== null ? Array.isArray(item) ? clone[index] = deepCloneArray(item) : isSpecificValue(item) ? clone[index] = cloneSpecificValue(item) : clone[index] = deepExtend$1({}, item) : clone[index] = item;
|
|
4721
|
-
}), clone;
|
|
4722
|
-
}
|
|
4723
|
-
function safeGetProperty(object, property) {
|
|
4724
|
-
return property === "__proto__" ? void 0 : object[property];
|
|
4725
|
-
}
|
|
4726
|
-
var deepExtend$1 = deepExtend.exports = function() {
|
|
4727
|
-
if (arguments.length < 1 || typeof arguments[0] != "object")
|
|
4728
|
-
return !1;
|
|
4729
|
-
if (arguments.length < 2)
|
|
4730
|
-
return arguments[0];
|
|
4731
|
-
var target = arguments[0], args = Array.prototype.slice.call(arguments, 1), val, src2;
|
|
4732
|
-
return args.forEach(function(obj) {
|
|
4733
|
-
typeof obj != "object" || obj === null || Array.isArray(obj) || Object.keys(obj).forEach(function(key2) {
|
|
4734
|
-
if (src2 = safeGetProperty(target, key2), val = safeGetProperty(obj, key2), val !== target)
|
|
4735
|
-
if (typeof val != "object" || val === null) {
|
|
4736
|
-
target[key2] = val;
|
|
4737
|
-
return;
|
|
4738
|
-
} else if (Array.isArray(val)) {
|
|
4739
|
-
target[key2] = deepCloneArray(val);
|
|
4740
|
-
return;
|
|
4741
|
-
} else if (isSpecificValue(val)) {
|
|
4742
|
-
target[key2] = cloneSpecificValue(val);
|
|
4743
|
-
return;
|
|
4744
|
-
} else if (typeof src2 != "object" || src2 === null || Array.isArray(src2)) {
|
|
4745
|
-
target[key2] = deepExtend$1({}, val);
|
|
4746
|
-
return;
|
|
4747
|
-
} else {
|
|
4748
|
-
target[key2] = deepExtend$1(src2, val);
|
|
4749
|
-
return;
|
|
4750
|
-
}
|
|
4751
|
-
});
|
|
4752
|
-
}), target;
|
|
4753
|
-
};
|
|
4754
|
-
return deepExtend.exports;
|
|
4755
|
-
}
|
|
4756
|
-
var minimist$1, hasRequiredMinimist;
|
|
4757
|
-
function requireMinimist() {
|
|
4758
|
-
if (hasRequiredMinimist) return minimist$1;
|
|
4759
|
-
hasRequiredMinimist = 1;
|
|
4760
|
-
function hasKey2(obj, keys) {
|
|
4761
|
-
var o = obj;
|
|
4762
|
-
keys.slice(0, -1).forEach(function(key3) {
|
|
4763
|
-
o = o[key3] || {};
|
|
4764
|
-
});
|
|
4765
|
-
var key2 = keys[keys.length - 1];
|
|
4766
|
-
return key2 in o;
|
|
4767
|
-
}
|
|
4768
|
-
function isNumber2(x) {
|
|
4769
|
-
return typeof x == "number" || /^0x[0-9a-f]+$/i.test(x) ? !0 : /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
4770
|
-
}
|
|
4771
|
-
function isConstructorOrProto(obj, key2) {
|
|
4772
|
-
return key2 === "constructor" && typeof obj[key2] == "function" || key2 === "__proto__";
|
|
4773
|
-
}
|
|
4774
|
-
return minimist$1 = function(args, opts) {
|
|
4775
|
-
opts || (opts = {});
|
|
4776
|
-
var flags = {
|
|
4777
|
-
bools: {},
|
|
4778
|
-
strings: {},
|
|
4779
|
-
unknownFn: null
|
|
4780
|
-
};
|
|
4781
|
-
typeof opts.unknown == "function" && (flags.unknownFn = opts.unknown), typeof opts.boolean == "boolean" && opts.boolean ? flags.allBools = !0 : [].concat(opts.boolean).filter(Boolean).forEach(function(key3) {
|
|
4782
|
-
flags.bools[key3] = !0;
|
|
4783
|
-
});
|
|
4784
|
-
var aliases = {};
|
|
4785
|
-
function aliasIsBoolean(key3) {
|
|
4786
|
-
return aliases[key3].some(function(x) {
|
|
4787
|
-
return flags.bools[x];
|
|
4788
|
-
});
|
|
4789
|
-
}
|
|
4790
|
-
Object.keys(opts.alias || {}).forEach(function(key3) {
|
|
4791
|
-
aliases[key3] = [].concat(opts.alias[key3]), aliases[key3].forEach(function(x) {
|
|
4792
|
-
aliases[x] = [key3].concat(aliases[key3].filter(function(y) {
|
|
4793
|
-
return x !== y;
|
|
4794
|
-
}));
|
|
4795
|
-
});
|
|
4796
|
-
}), [].concat(opts.string).filter(Boolean).forEach(function(key3) {
|
|
4797
|
-
flags.strings[key3] = !0, aliases[key3] && [].concat(aliases[key3]).forEach(function(k) {
|
|
4798
|
-
flags.strings[k] = !0;
|
|
4799
|
-
});
|
|
4800
|
-
});
|
|
4801
|
-
var defaults2 = opts.default || {}, argv = { _: [] };
|
|
4802
|
-
function argDefined(key3, arg2) {
|
|
4803
|
-
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key3] || flags.bools[key3] || aliases[key3];
|
|
4804
|
-
}
|
|
4805
|
-
function setKey(obj, keys, value2) {
|
|
4806
|
-
for (var o = obj, i2 = 0; i2 < keys.length - 1; i2++) {
|
|
4807
|
-
var key3 = keys[i2];
|
|
4808
|
-
if (isConstructorOrProto(o, key3))
|
|
4809
|
-
return;
|
|
4810
|
-
o[key3] === void 0 && (o[key3] = {}), (o[key3] === Object.prototype || o[key3] === Number.prototype || o[key3] === String.prototype) && (o[key3] = {}), o[key3] === Array.prototype && (o[key3] = []), o = o[key3];
|
|
4811
|
-
}
|
|
4812
|
-
var lastKey = keys[keys.length - 1];
|
|
4813
|
-
isConstructorOrProto(o, lastKey) || ((o === Object.prototype || o === Number.prototype || o === String.prototype) && (o = {}), o === Array.prototype && (o = []), o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] == "boolean" ? o[lastKey] = value2 : Array.isArray(o[lastKey]) ? o[lastKey].push(value2) : o[lastKey] = [o[lastKey], value2]);
|
|
4814
|
-
}
|
|
4815
|
-
function setArg(key3, val, arg2) {
|
|
4816
|
-
if (!(arg2 && flags.unknownFn && !argDefined(key3, arg2) && flags.unknownFn(arg2) === !1)) {
|
|
4817
|
-
var value2 = !flags.strings[key3] && isNumber2(val) ? Number(val) : val;
|
|
4818
|
-
setKey(argv, key3.split("."), value2), (aliases[key3] || []).forEach(function(x) {
|
|
4819
|
-
setKey(argv, x.split("."), value2);
|
|
4820
|
-
});
|
|
4821
|
-
}
|
|
4822
|
-
}
|
|
4823
|
-
Object.keys(flags.bools).forEach(function(key3) {
|
|
4824
|
-
setArg(key3, defaults2[key3] === void 0 ? !1 : defaults2[key3]);
|
|
4825
|
-
});
|
|
4826
|
-
var notFlags = [];
|
|
4827
|
-
args.indexOf("--") !== -1 && (notFlags = args.slice(args.indexOf("--") + 1), args = args.slice(0, args.indexOf("--")));
|
|
4828
|
-
for (var i = 0; i < args.length; i++) {
|
|
4829
|
-
var arg = args[i], key2, next;
|
|
4830
|
-
if (/^--.+=/.test(arg)) {
|
|
4831
|
-
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
4832
|
-
key2 = m[1];
|
|
4833
|
-
var value = m[2];
|
|
4834
|
-
flags.bools[key2] && (value = value !== "false"), setArg(key2, value, arg);
|
|
4835
|
-
} else if (/^--no-.+/.test(arg))
|
|
4836
|
-
key2 = arg.match(/^--no-(.+)/)[1], setArg(key2, !1, arg);
|
|
4837
|
-
else if (/^--.+/.test(arg))
|
|
4838
|
-
key2 = arg.match(/^--(.+)/)[1], next = args[i + 1], next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key2] && !flags.allBools && (!aliases[key2] || !aliasIsBoolean(key2)) ? (setArg(key2, next, arg), i += 1) : /^(true|false)$/.test(next) ? (setArg(key2, next === "true", arg), i += 1) : setArg(key2, flags.strings[key2] ? "" : !0, arg);
|
|
4839
|
-
else if (/^-[^-]+/.test(arg)) {
|
|
4840
|
-
for (var letters = arg.slice(1, -1).split(""), broken = !1, j = 0; j < letters.length; j++) {
|
|
4841
|
-
if (next = arg.slice(j + 2), next === "-") {
|
|
4842
|
-
setArg(letters[j], next, arg);
|
|
4843
|
-
continue;
|
|
4844
|
-
}
|
|
4845
|
-
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
4846
|
-
setArg(letters[j], next.slice(1), arg), broken = !0;
|
|
4847
|
-
break;
|
|
4848
|
-
}
|
|
4849
|
-
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
4850
|
-
setArg(letters[j], next, arg), broken = !0;
|
|
4851
|
-
break;
|
|
4852
|
-
}
|
|
4853
|
-
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
4854
|
-
setArg(letters[j], arg.slice(j + 2), arg), broken = !0;
|
|
4855
|
-
break;
|
|
4856
|
-
} else
|
|
4857
|
-
setArg(letters[j], flags.strings[letters[j]] ? "" : !0, arg);
|
|
4858
|
-
}
|
|
4859
|
-
key2 = arg.slice(-1)[0], !broken && key2 !== "-" && (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key2] && (!aliases[key2] || !aliasIsBoolean(key2)) ? (setArg(key2, args[i + 1], arg), i += 1) : args[i + 1] && /^(true|false)$/.test(args[i + 1]) ? (setArg(key2, args[i + 1] === "true", arg), i += 1) : setArg(key2, flags.strings[key2] ? "" : !0, arg));
|
|
4860
|
-
} else if ((!flags.unknownFn || flags.unknownFn(arg) !== !1) && argv._.push(flags.strings._ || !isNumber2(arg) ? arg : Number(arg)), opts.stopEarly) {
|
|
4861
|
-
argv._.push.apply(argv._, args.slice(i + 1));
|
|
4862
|
-
break;
|
|
4863
|
-
}
|
|
4864
|
-
}
|
|
4865
|
-
return Object.keys(defaults2).forEach(function(k) {
|
|
4866
|
-
hasKey2(argv, k.split(".")) || (setKey(argv, k.split("."), defaults2[k]), (aliases[k] || []).forEach(function(x) {
|
|
4867
|
-
setKey(argv, x.split("."), defaults2[k]);
|
|
4868
|
-
}));
|
|
4869
|
-
}), opts["--"] ? argv["--"] = notFlags.slice() : notFlags.forEach(function(k) {
|
|
4870
|
-
argv._.push(k);
|
|
4871
|
-
}), argv;
|
|
4872
|
-
}, minimist$1;
|
|
4873
|
-
}
|
|
4874
|
-
var rc, hasRequiredRc;
|
|
4875
|
-
function requireRc() {
|
|
4876
|
-
if (hasRequiredRc) return rc;
|
|
4877
|
-
hasRequiredRc = 1;
|
|
4878
|
-
var cc = requireUtils$3(), join = require$$0__default$1.default.join, deepExtend2 = requireDeepExtend(), etc = "/etc", win = process.platform === "win32", home = win ? process.env.USERPROFILE : process.env.HOME;
|
|
4879
|
-
return rc = function(name, defaults2, argv, parse3) {
|
|
4880
|
-
if (typeof name != "string")
|
|
4881
|
-
throw new Error("rc(name): name *must* be string");
|
|
4882
|
-
argv || (argv = requireMinimist()(process.argv.slice(2))), defaults2 = (typeof defaults2 == "string" ? cc.json(defaults2) : defaults2) || {}, parse3 = parse3 || cc.parse;
|
|
4883
|
-
var env = cc.env(name + "_"), configs = [defaults2], configFiles = [];
|
|
4884
|
-
function addConfigFile(file) {
|
|
4885
|
-
if (!(configFiles.indexOf(file) >= 0)) {
|
|
4886
|
-
var fileConfig = cc.file(file);
|
|
4887
|
-
fileConfig && (configs.push(parse3(fileConfig)), configFiles.push(file));
|
|
4888
|
-
}
|
|
4889
|
-
}
|
|
4890
|
-
return win || [
|
|
4891
|
-
join(etc, name, "config"),
|
|
4892
|
-
join(etc, name + "rc")
|
|
4893
|
-
].forEach(addConfigFile), home && [
|
|
4894
|
-
join(home, ".config", name, "config"),
|
|
4895
|
-
join(home, ".config", name),
|
|
4896
|
-
join(home, "." + name, "config"),
|
|
4897
|
-
join(home, "." + name + "rc")
|
|
4898
|
-
].forEach(addConfigFile), addConfigFile(cc.find("." + name + "rc")), env.config && addConfigFile(env.config), argv.config && addConfigFile(argv.config), deepExtend2.apply(null, configs.concat([
|
|
4899
|
-
env,
|
|
4900
|
-
argv,
|
|
4901
|
-
configFiles.length ? { configs: configFiles, config: configFiles[configFiles.length - 1] } : void 0
|
|
4902
|
-
]));
|
|
4903
|
-
}, rc;
|
|
4904
|
-
}
|
|
4905
|
-
var hasRequiredRegistryUrl;
|
|
4906
|
-
function requireRegistryUrl() {
|
|
4907
|
-
if (hasRequiredRegistryUrl) return registryUrl.exports;
|
|
4908
|
-
hasRequiredRegistryUrl = 1;
|
|
4909
|
-
const rc2 = requireRc(), registryUrl$1 = (scope2) => {
|
|
4910
|
-
const result = rc2("npm", { registry: "https://registry.npmjs.org/" }), url = result[`${scope2}:registry`] || result.config_registry || result.registry;
|
|
4911
|
-
return url.slice(-1) === "/" ? url : `${url}/`;
|
|
4912
|
-
};
|
|
4913
|
-
return registryUrl.exports = registryUrl$1, registryUrl.exports.default = registryUrl$1, registryUrl.exports;
|
|
4914
|
-
}
|
|
4915
|
-
var npmConf = { exports: {} }, dist$4 = {}, caFile = {}, polyfills$1, hasRequiredPolyfills$1;
|
|
4916
|
-
function requirePolyfills$1() {
|
|
4917
|
-
if (hasRequiredPolyfills$1) return polyfills$1;
|
|
4918
|
-
hasRequiredPolyfills$1 = 1;
|
|
4919
|
-
var constants2 = require$$0__default$3.default, origCwd = process.cwd, cwd = null, platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
4920
|
-
process.cwd = function() {
|
|
4921
|
-
return cwd || (cwd = origCwd.call(process)), cwd;
|
|
4922
|
-
};
|
|
4923
|
-
try {
|
|
4924
|
-
process.cwd();
|
|
4925
|
-
} catch {
|
|
4926
|
-
}
|
|
4927
|
-
if (typeof process.chdir == "function") {
|
|
4928
|
-
var chdir = process.chdir;
|
|
4929
|
-
process.chdir = function(d) {
|
|
4930
|
-
cwd = null, chdir.call(process, d);
|
|
4931
|
-
}, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, chdir);
|
|
4932
|
-
}
|
|
4933
|
-
polyfills$1 = patch;
|
|
4934
|
-
function patch(fs2) {
|
|
4935
|
-
constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && patchLchmod(fs2), fs2.lutimes || patchLutimes(fs2), fs2.chown = chownFix(fs2.chown), fs2.fchown = chownFix(fs2.fchown), fs2.lchown = chownFix(fs2.lchown), fs2.chmod = chmodFix(fs2.chmod), fs2.fchmod = chmodFix(fs2.fchmod), fs2.lchmod = chmodFix(fs2.lchmod), fs2.chownSync = chownFixSync(fs2.chownSync), fs2.fchownSync = chownFixSync(fs2.fchownSync), fs2.lchownSync = chownFixSync(fs2.lchownSync), fs2.chmodSync = chmodFixSync(fs2.chmodSync), fs2.fchmodSync = chmodFixSync(fs2.fchmodSync), fs2.lchmodSync = chmodFixSync(fs2.lchmodSync), fs2.stat = statFix(fs2.stat), fs2.fstat = statFix(fs2.fstat), fs2.lstat = statFix(fs2.lstat), fs2.statSync = statFixSync(fs2.statSync), fs2.fstatSync = statFixSync(fs2.fstatSync), fs2.lstatSync = statFixSync(fs2.lstatSync), fs2.chmod && !fs2.lchmod && (fs2.lchmod = function(path2, mode2, cb) {
|
|
4936
|
-
cb && process.nextTick(cb);
|
|
4937
|
-
}, fs2.lchmodSync = function() {
|
|
4938
|
-
}), fs2.chown && !fs2.lchown && (fs2.lchown = function(path2, uid, gid, cb) {
|
|
4939
|
-
cb && process.nextTick(cb);
|
|
4940
|
-
}, fs2.lchownSync = function() {
|
|
4941
|
-
}), platform2 === "win32" && (fs2.rename = typeof fs2.rename != "function" ? fs2.rename : (function(fs$rename) {
|
|
4942
|
-
function rename2(from2, to, cb) {
|
|
4943
|
-
var start = Date.now(), backoff = 0;
|
|
4944
|
-
fs$rename(from2, to, function CB(er) {
|
|
4945
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
|
|
4946
|
-
setTimeout(function() {
|
|
4947
|
-
fs2.stat(to, function(stater, st) {
|
|
4948
|
-
stater && stater.code === "ENOENT" ? fs$rename(from2, to, CB) : cb(er);
|
|
4949
|
-
});
|
|
4950
|
-
}, backoff), backoff < 100 && (backoff += 10);
|
|
4951
|
-
return;
|
|
4952
|
-
}
|
|
4953
|
-
cb && cb(er);
|
|
4954
|
-
});
|
|
4955
|
-
}
|
|
4956
|
-
return Object.setPrototypeOf && Object.setPrototypeOf(rename2, fs$rename), rename2;
|
|
4957
|
-
})(fs2.rename)), fs2.read = typeof fs2.read != "function" ? fs2.read : (function(fs$read) {
|
|
4958
|
-
function read2(fd, buffer2, offset, length, position, callback_) {
|
|
4959
|
-
var callback;
|
|
4960
|
-
if (callback_ && typeof callback_ == "function") {
|
|
4961
|
-
var eagCounter = 0;
|
|
4962
|
-
callback = function(er, _, __) {
|
|
4963
|
-
if (er && er.code === "EAGAIN" && eagCounter < 10)
|
|
4964
|
-
return eagCounter++, fs$read.call(fs2, fd, buffer2, offset, length, position, callback);
|
|
4965
|
-
callback_.apply(this, arguments);
|
|
4966
|
-
};
|
|
4967
|
-
}
|
|
4968
|
-
return fs$read.call(fs2, fd, buffer2, offset, length, position, callback);
|
|
4969
|
-
}
|
|
4970
|
-
return Object.setPrototypeOf && Object.setPrototypeOf(read2, fs$read), read2;
|
|
4971
|
-
})(fs2.read), fs2.readSync = typeof fs2.readSync != "function" ? fs2.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
4972
|
-
return function(fd, buffer2, offset, length, position) {
|
|
4973
|
-
for (var eagCounter = 0; ; )
|
|
4974
|
-
try {
|
|
4975
|
-
return fs$readSync.call(fs2, fd, buffer2, offset, length, position);
|
|
4976
|
-
} catch (er) {
|
|
4977
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
4978
|
-
eagCounter++;
|
|
4979
|
-
continue;
|
|
4980
|
-
}
|
|
4981
|
-
throw er;
|
|
4982
|
-
}
|
|
4983
|
-
};
|
|
4984
|
-
})(fs2.readSync);
|
|
4985
|
-
function patchLchmod(fs3) {
|
|
4986
|
-
fs3.lchmod = function(path2, mode2, callback) {
|
|
4987
|
-
fs3.open(
|
|
4988
|
-
path2,
|
|
4989
|
-
constants2.O_WRONLY | constants2.O_SYMLINK,
|
|
4990
|
-
mode2,
|
|
4991
|
-
function(err, fd) {
|
|
4992
|
-
if (err) {
|
|
4993
|
-
callback && callback(err);
|
|
4994
|
-
return;
|
|
4995
|
-
}
|
|
4996
|
-
fs3.fchmod(fd, mode2, function(err2) {
|
|
4997
|
-
fs3.close(fd, function(err22) {
|
|
4998
|
-
callback && callback(err2 || err22);
|
|
4999
|
-
});
|
|
5000
|
-
});
|
|
5001
|
-
}
|
|
5002
|
-
);
|
|
5003
|
-
}, fs3.lchmodSync = function(path2, mode2) {
|
|
5004
|
-
var fd = fs3.openSync(path2, constants2.O_WRONLY | constants2.O_SYMLINK, mode2), threw = !0, ret;
|
|
5005
|
-
try {
|
|
5006
|
-
ret = fs3.fchmodSync(fd, mode2), threw = !1;
|
|
5007
|
-
} finally {
|
|
5008
|
-
if (threw)
|
|
5009
|
-
try {
|
|
5010
|
-
fs3.closeSync(fd);
|
|
5011
|
-
} catch {
|
|
5012
|
-
}
|
|
5013
|
-
else
|
|
5014
|
-
fs3.closeSync(fd);
|
|
5015
|
-
}
|
|
5016
|
-
return ret;
|
|
5017
|
-
};
|
|
5018
|
-
}
|
|
5019
|
-
function patchLutimes(fs3) {
|
|
5020
|
-
constants2.hasOwnProperty("O_SYMLINK") && fs3.futimes ? (fs3.lutimes = function(path2, at, mt, cb) {
|
|
5021
|
-
fs3.open(path2, constants2.O_SYMLINK, function(er, fd) {
|
|
5022
|
-
if (er) {
|
|
5023
|
-
cb && cb(er);
|
|
5024
|
-
return;
|
|
5025
|
-
}
|
|
5026
|
-
fs3.futimes(fd, at, mt, function(er2) {
|
|
5027
|
-
fs3.close(fd, function(er22) {
|
|
5028
|
-
cb && cb(er2 || er22);
|
|
5029
|
-
});
|
|
5030
|
-
});
|
|
5031
|
-
});
|
|
5032
|
-
}, fs3.lutimesSync = function(path2, at, mt) {
|
|
5033
|
-
var fd = fs3.openSync(path2, constants2.O_SYMLINK), ret, threw = !0;
|
|
5034
|
-
try {
|
|
5035
|
-
ret = fs3.futimesSync(fd, at, mt), threw = !1;
|
|
5036
|
-
} finally {
|
|
5037
|
-
if (threw)
|
|
5038
|
-
try {
|
|
5039
|
-
fs3.closeSync(fd);
|
|
5040
|
-
} catch {
|
|
5041
|
-
}
|
|
5042
|
-
else
|
|
5043
|
-
fs3.closeSync(fd);
|
|
5044
|
-
}
|
|
5045
|
-
return ret;
|
|
5046
|
-
}) : fs3.futimes && (fs3.lutimes = function(_a, _b, _c, cb) {
|
|
5047
|
-
cb && process.nextTick(cb);
|
|
5048
|
-
}, fs3.lutimesSync = function() {
|
|
5049
|
-
});
|
|
5050
|
-
}
|
|
5051
|
-
function chmodFix(orig) {
|
|
5052
|
-
return orig && function(target, mode2, cb) {
|
|
5053
|
-
return orig.call(fs2, target, mode2, function(er) {
|
|
5054
|
-
chownErOk(er) && (er = null), cb && cb.apply(this, arguments);
|
|
5055
|
-
});
|
|
5056
|
-
};
|
|
5057
|
-
}
|
|
5058
|
-
function chmodFixSync(orig) {
|
|
5059
|
-
return orig && function(target, mode2) {
|
|
5060
|
-
try {
|
|
5061
|
-
return orig.call(fs2, target, mode2);
|
|
5062
|
-
} catch (er) {
|
|
5063
|
-
if (!chownErOk(er)) throw er;
|
|
5064
|
-
}
|
|
5065
|
-
};
|
|
5066
|
-
}
|
|
5067
|
-
function chownFix(orig) {
|
|
5068
|
-
return orig && function(target, uid, gid, cb) {
|
|
5069
|
-
return orig.call(fs2, target, uid, gid, function(er) {
|
|
5070
|
-
chownErOk(er) && (er = null), cb && cb.apply(this, arguments);
|
|
5071
|
-
});
|
|
5072
|
-
};
|
|
5073
|
-
}
|
|
5074
|
-
function chownFixSync(orig) {
|
|
5075
|
-
return orig && function(target, uid, gid) {
|
|
5076
|
-
try {
|
|
5077
|
-
return orig.call(fs2, target, uid, gid);
|
|
5078
|
-
} catch (er) {
|
|
5079
|
-
if (!chownErOk(er)) throw er;
|
|
5080
|
-
}
|
|
5081
|
-
};
|
|
5082
|
-
}
|
|
5083
|
-
function statFix(orig) {
|
|
5084
|
-
return orig && function(target, options2, cb) {
|
|
5085
|
-
typeof options2 == "function" && (cb = options2, options2 = null);
|
|
5086
|
-
function callback(er, stats) {
|
|
5087
|
-
stats && (stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296)), cb && cb.apply(this, arguments);
|
|
5088
|
-
}
|
|
5089
|
-
return options2 ? orig.call(fs2, target, options2, callback) : orig.call(fs2, target, callback);
|
|
5090
|
-
};
|
|
5091
|
-
}
|
|
5092
|
-
function statFixSync(orig) {
|
|
5093
|
-
return orig && function(target, options2) {
|
|
5094
|
-
var stats = options2 ? orig.call(fs2, target, options2) : orig.call(fs2, target);
|
|
5095
|
-
return stats && (stats.uid < 0 && (stats.uid += 4294967296), stats.gid < 0 && (stats.gid += 4294967296)), stats;
|
|
5096
|
-
};
|
|
5097
|
-
}
|
|
5098
|
-
function chownErOk(er) {
|
|
5099
|
-
if (!er || er.code === "ENOSYS")
|
|
5100
|
-
return !0;
|
|
5101
|
-
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
5102
|
-
return !!(nonroot && (er.code === "EINVAL" || er.code === "EPERM"));
|
|
5103
|
-
}
|
|
5104
|
-
}
|
|
5105
|
-
return polyfills$1;
|
|
5106
|
-
}
|
|
5107
|
-
var legacyStreams$1, hasRequiredLegacyStreams$1;
|
|
5108
|
-
function requireLegacyStreams$1() {
|
|
5109
|
-
if (hasRequiredLegacyStreams$1) return legacyStreams$1;
|
|
5110
|
-
hasRequiredLegacyStreams$1 = 1;
|
|
5111
|
-
var Stream2 = require$$0__default$4.default.Stream;
|
|
5112
|
-
legacyStreams$1 = legacy;
|
|
5113
|
-
function legacy(fs2) {
|
|
5114
|
-
return {
|
|
5115
|
-
ReadStream,
|
|
5116
|
-
WriteStream
|
|
5117
|
-
};
|
|
5118
|
-
function ReadStream(path2, options2) {
|
|
5119
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path2, options2);
|
|
5120
|
-
Stream2.call(this);
|
|
5121
|
-
var self2 = this;
|
|
5122
|
-
this.path = path2, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, options2 = options2 || {};
|
|
5123
|
-
for (var keys = Object.keys(options2), index = 0, length = keys.length; index < length; index++) {
|
|
5124
|
-
var key2 = keys[index];
|
|
5125
|
-
this[key2] = options2[key2];
|
|
5126
|
-
}
|
|
5127
|
-
if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {
|
|
5128
|
-
if (typeof this.start != "number")
|
|
5129
|
-
throw TypeError("start must be a Number");
|
|
5130
|
-
if (this.end === void 0)
|
|
5131
|
-
this.end = 1 / 0;
|
|
5132
|
-
else if (typeof this.end != "number")
|
|
5133
|
-
throw TypeError("end must be a Number");
|
|
5134
|
-
if (this.start > this.end)
|
|
5135
|
-
throw new Error("start must be <= end");
|
|
5136
|
-
this.pos = this.start;
|
|
5137
|
-
}
|
|
5138
|
-
if (this.fd !== null) {
|
|
5139
|
-
process.nextTick(function() {
|
|
5140
|
-
self2._read();
|
|
5141
|
-
});
|
|
5142
|
-
return;
|
|
5143
|
-
}
|
|
5144
|
-
fs2.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
5145
|
-
if (err) {
|
|
5146
|
-
self2.emit("error", err), self2.readable = !1;
|
|
5147
|
-
return;
|
|
5148
|
-
}
|
|
5149
|
-
self2.fd = fd, self2.emit("open", fd), self2._read();
|
|
5150
|
-
});
|
|
5151
|
-
}
|
|
5152
|
-
function WriteStream(path2, options2) {
|
|
5153
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path2, options2);
|
|
5154
|
-
Stream2.call(this), this.path = path2, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, options2 = options2 || {};
|
|
5155
|
-
for (var keys = Object.keys(options2), index = 0, length = keys.length; index < length; index++) {
|
|
5156
|
-
var key2 = keys[index];
|
|
5157
|
-
this[key2] = options2[key2];
|
|
5158
|
-
}
|
|
5159
|
-
if (this.start !== void 0) {
|
|
5160
|
-
if (typeof this.start != "number")
|
|
5161
|
-
throw TypeError("start must be a Number");
|
|
5162
|
-
if (this.start < 0)
|
|
5163
|
-
throw new Error("start must be >= zero");
|
|
5164
|
-
this.pos = this.start;
|
|
5165
|
-
}
|
|
5166
|
-
this.busy = !1, this._queue = [], this.fd === null && (this._open = fs2.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
|
|
5167
|
-
}
|
|
5168
|
-
}
|
|
5169
|
-
return legacyStreams$1;
|
|
5170
|
-
}
|
|
5171
|
-
var clone_1$1, hasRequiredClone$1;
|
|
5172
|
-
function requireClone$1() {
|
|
5173
|
-
if (hasRequiredClone$1) return clone_1$1;
|
|
5174
|
-
hasRequiredClone$1 = 1, clone_1$1 = clone;
|
|
5175
|
-
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
5176
|
-
return obj.__proto__;
|
|
5177
|
-
};
|
|
5178
|
-
function clone(obj) {
|
|
5179
|
-
if (obj === null || typeof obj != "object")
|
|
5180
|
-
return obj;
|
|
5181
|
-
if (obj instanceof Object)
|
|
5182
|
-
var copy2 = { __proto__: getPrototypeOf(obj) };
|
|
5183
|
-
else
|
|
5184
|
-
var copy2 = /* @__PURE__ */ Object.create(null);
|
|
5185
|
-
return Object.getOwnPropertyNames(obj).forEach(function(key2) {
|
|
5186
|
-
Object.defineProperty(copy2, key2, Object.getOwnPropertyDescriptor(obj, key2));
|
|
5187
|
-
}), copy2;
|
|
5188
|
-
}
|
|
5189
|
-
return clone_1$1;
|
|
5190
|
-
}
|
|
5191
|
-
var gracefulFs$1, hasRequiredGracefulFs$1;
|
|
5192
|
-
function requireGracefulFs$1() {
|
|
5193
|
-
if (hasRequiredGracefulFs$1) return gracefulFs$1;
|
|
5194
|
-
hasRequiredGracefulFs$1 = 1;
|
|
5195
|
-
var fs2 = require$$0__default.default, polyfills2 = requirePolyfills$1(), legacy = requireLegacyStreams$1(), clone = requireClone$1(), util2 = require$$0__default$5.default, gracefulQueue, previousSymbol;
|
|
5196
|
-
typeof Symbol == "function" && typeof Symbol.for == "function" ? (gracefulQueue = Symbol.for("graceful-fs.queue"), previousSymbol = Symbol.for("graceful-fs.previous")) : (gracefulQueue = "___graceful-fs.queue", previousSymbol = "___graceful-fs.previous");
|
|
5197
|
-
function noop2() {
|
|
5198
|
-
}
|
|
5199
|
-
function publishQueue(context, queue3) {
|
|
5200
|
-
Object.defineProperty(context, gracefulQueue, {
|
|
5201
|
-
get: function() {
|
|
5202
|
-
return queue3;
|
|
5203
|
-
}
|
|
5204
|
-
});
|
|
5205
|
-
}
|
|
5206
|
-
var debug2 = noop2;
|
|
5207
|
-
if (util2.debuglog ? debug2 = util2.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (debug2 = function() {
|
|
5208
|
-
var m = util2.format.apply(util2, arguments);
|
|
5209
|
-
m = "GFS4: " + m.split(/\n/).join(`
|
|
5210
|
-
GFS4: `), console.error(m);
|
|
5211
|
-
}), !fs2[gracefulQueue]) {
|
|
5212
|
-
var queue2 = loadEnv.commonjsGlobal[gracefulQueue] || [];
|
|
5213
|
-
publishQueue(fs2, queue2), fs2.close = (function(fs$close) {
|
|
5214
|
-
function close(fd, cb) {
|
|
5215
|
-
return fs$close.call(fs2, fd, function(err) {
|
|
5216
|
-
err || resetQueue(), typeof cb == "function" && cb.apply(this, arguments);
|
|
5217
|
-
});
|
|
5218
|
-
}
|
|
5219
|
-
return Object.defineProperty(close, previousSymbol, {
|
|
5220
|
-
value: fs$close
|
|
5221
|
-
}), close;
|
|
5222
|
-
})(fs2.close), fs2.closeSync = (function(fs$closeSync) {
|
|
5223
|
-
function closeSync(fd) {
|
|
5224
|
-
fs$closeSync.apply(fs2, arguments), resetQueue();
|
|
5225
|
-
}
|
|
5226
|
-
return Object.defineProperty(closeSync, previousSymbol, {
|
|
5227
|
-
value: fs$closeSync
|
|
5228
|
-
}), closeSync;
|
|
5229
|
-
})(fs2.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
|
|
5230
|
-
debug2(fs2[gracefulQueue]), require$$0__default$6.default.equal(fs2[gracefulQueue].length, 0);
|
|
5231
|
-
});
|
|
5232
|
-
}
|
|
5233
|
-
loadEnv.commonjsGlobal[gracefulQueue] || publishQueue(loadEnv.commonjsGlobal, fs2[gracefulQueue]), gracefulFs$1 = patch(clone(fs2)), process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched && (gracefulFs$1 = patch(fs2), fs2.__patched = !0);
|
|
5234
|
-
function patch(fs3) {
|
|
5235
|
-
polyfills2(fs3), fs3.gracefulify = patch, fs3.createReadStream = createReadStream, fs3.createWriteStream = createWriteStream;
|
|
5236
|
-
var fs$readFile = fs3.readFile;
|
|
5237
|
-
fs3.readFile = readFile;
|
|
5238
|
-
function readFile(path2, options2, cb) {
|
|
5239
|
-
return typeof options2 == "function" && (cb = options2, options2 = null), go$readFile(path2, options2, cb);
|
|
5240
|
-
function go$readFile(path3, options3, cb2, startTime) {
|
|
5241
|
-
return fs$readFile(path3, options3, function(err) {
|
|
5242
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$readFile, [path3, options3, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
|
|
5243
|
-
});
|
|
5244
|
-
}
|
|
5245
|
-
}
|
|
5246
|
-
var fs$writeFile = fs3.writeFile;
|
|
5247
|
-
fs3.writeFile = writeFile;
|
|
5248
|
-
function writeFile(path2, data, options2, cb) {
|
|
5249
|
-
return typeof options2 == "function" && (cb = options2, options2 = null), go$writeFile(path2, data, options2, cb);
|
|
5250
|
-
function go$writeFile(path3, data2, options3, cb2, startTime) {
|
|
5251
|
-
return fs$writeFile(path3, data2, options3, function(err) {
|
|
5252
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$writeFile, [path3, data2, options3, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
|
|
5253
|
-
});
|
|
5254
|
-
}
|
|
5255
|
-
}
|
|
5256
|
-
var fs$appendFile = fs3.appendFile;
|
|
5257
|
-
fs$appendFile && (fs3.appendFile = appendFile);
|
|
5258
|
-
function appendFile(path2, data, options2, cb) {
|
|
5259
|
-
return typeof options2 == "function" && (cb = options2, options2 = null), go$appendFile(path2, data, options2, cb);
|
|
5260
|
-
function go$appendFile(path3, data2, options3, cb2, startTime) {
|
|
5261
|
-
return fs$appendFile(path3, data2, options3, function(err) {
|
|
5262
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$appendFile, [path3, data2, options3, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
|
|
5263
|
-
});
|
|
5264
|
-
}
|
|
5265
|
-
}
|
|
5266
|
-
var fs$copyFile = fs3.copyFile;
|
|
5267
|
-
fs$copyFile && (fs3.copyFile = copyFile);
|
|
5268
|
-
function copyFile(src2, dest, flags, cb) {
|
|
5269
|
-
return typeof flags == "function" && (cb = flags, flags = 0), go$copyFile(src2, dest, flags, cb);
|
|
5270
|
-
function go$copyFile(src3, dest2, flags2, cb2, startTime) {
|
|
5271
|
-
return fs$copyFile(src3, dest2, flags2, function(err) {
|
|
5272
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$copyFile, [src3, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
|
|
5273
|
-
});
|
|
5274
|
-
}
|
|
5275
|
-
}
|
|
5276
|
-
var fs$readdir = fs3.readdir;
|
|
5277
|
-
fs3.readdir = readdir2;
|
|
5278
|
-
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
5279
|
-
function readdir2(path2, options2, cb) {
|
|
5280
|
-
typeof options2 == "function" && (cb = options2, options2 = null);
|
|
5281
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function(path3, options3, cb2, startTime) {
|
|
5282
|
-
return fs$readdir(path3, fs$readdirCallback(
|
|
5283
|
-
path3,
|
|
5284
|
-
options3,
|
|
5285
|
-
cb2,
|
|
5286
|
-
startTime
|
|
5287
|
-
));
|
|
5288
|
-
} : function(path3, options3, cb2, startTime) {
|
|
5289
|
-
return fs$readdir(path3, options3, fs$readdirCallback(
|
|
5290
|
-
path3,
|
|
5291
|
-
options3,
|
|
5292
|
-
cb2,
|
|
5293
|
-
startTime
|
|
5294
|
-
));
|
|
5295
|
-
};
|
|
5296
|
-
return go$readdir(path2, options2, cb);
|
|
5297
|
-
function fs$readdirCallback(path3, options3, cb2, startTime) {
|
|
5298
|
-
return function(err, files) {
|
|
5299
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([
|
|
5300
|
-
go$readdir,
|
|
5301
|
-
[path3, options3, cb2],
|
|
5302
|
-
err,
|
|
5303
|
-
startTime || Date.now(),
|
|
5304
|
-
Date.now()
|
|
5305
|
-
]) : (files && files.sort && files.sort(), typeof cb2 == "function" && cb2.call(this, err, files));
|
|
5306
|
-
};
|
|
5307
|
-
}
|
|
5308
|
-
}
|
|
5309
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
|
5310
|
-
var legStreams = legacy(fs3);
|
|
5311
|
-
ReadStream = legStreams.ReadStream, WriteStream = legStreams.WriteStream;
|
|
5312
|
-
}
|
|
5313
|
-
var fs$ReadStream = fs3.ReadStream;
|
|
5314
|
-
fs$ReadStream && (ReadStream.prototype = Object.create(fs$ReadStream.prototype), ReadStream.prototype.open = ReadStream$open);
|
|
5315
|
-
var fs$WriteStream = fs3.WriteStream;
|
|
5316
|
-
fs$WriteStream && (WriteStream.prototype = Object.create(fs$WriteStream.prototype), WriteStream.prototype.open = WriteStream$open), Object.defineProperty(fs3, "ReadStream", {
|
|
5317
|
-
get: function() {
|
|
5318
|
-
return ReadStream;
|
|
5319
|
-
},
|
|
5320
|
-
set: function(val) {
|
|
5321
|
-
ReadStream = val;
|
|
5322
|
-
},
|
|
5323
|
-
enumerable: !0,
|
|
5324
|
-
configurable: !0
|
|
5325
|
-
}), Object.defineProperty(fs3, "WriteStream", {
|
|
5326
|
-
get: function() {
|
|
5327
|
-
return WriteStream;
|
|
5328
|
-
},
|
|
5329
|
-
set: function(val) {
|
|
5330
|
-
WriteStream = val;
|
|
5331
|
-
},
|
|
5332
|
-
enumerable: !0,
|
|
5333
|
-
configurable: !0
|
|
5334
|
-
});
|
|
5335
|
-
var FileReadStream = ReadStream;
|
|
5336
|
-
Object.defineProperty(fs3, "FileReadStream", {
|
|
5337
|
-
get: function() {
|
|
5338
|
-
return FileReadStream;
|
|
5339
|
-
},
|
|
5340
|
-
set: function(val) {
|
|
5341
|
-
FileReadStream = val;
|
|
5342
|
-
},
|
|
5343
|
-
enumerable: !0,
|
|
5344
|
-
configurable: !0
|
|
5345
|
-
});
|
|
5346
|
-
var FileWriteStream = WriteStream;
|
|
5347
|
-
Object.defineProperty(fs3, "FileWriteStream", {
|
|
5348
|
-
get: function() {
|
|
5349
|
-
return FileWriteStream;
|
|
5350
|
-
},
|
|
5351
|
-
set: function(val) {
|
|
5352
|
-
FileWriteStream = val;
|
|
5353
|
-
},
|
|
5354
|
-
enumerable: !0,
|
|
5355
|
-
configurable: !0
|
|
5356
|
-
});
|
|
5357
|
-
function ReadStream(path2, options2) {
|
|
5358
|
-
return this instanceof ReadStream ? (fs$ReadStream.apply(this, arguments), this) : ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
5359
|
-
}
|
|
5360
|
-
function ReadStream$open() {
|
|
5361
|
-
var that = this;
|
|
5362
|
-
open2(that.path, that.flags, that.mode, function(err, fd) {
|
|
5363
|
-
err ? (that.autoClose && that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd), that.read());
|
|
5364
|
-
});
|
|
5365
|
-
}
|
|
5366
|
-
function WriteStream(path2, options2) {
|
|
5367
|
-
return this instanceof WriteStream ? (fs$WriteStream.apply(this, arguments), this) : WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
5368
|
-
}
|
|
5369
|
-
function WriteStream$open() {
|
|
5370
|
-
var that = this;
|
|
5371
|
-
open2(that.path, that.flags, that.mode, function(err, fd) {
|
|
5372
|
-
err ? (that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd));
|
|
5373
|
-
});
|
|
5374
|
-
}
|
|
5375
|
-
function createReadStream(path2, options2) {
|
|
5376
|
-
return new fs3.ReadStream(path2, options2);
|
|
5377
|
-
}
|
|
5378
|
-
function createWriteStream(path2, options2) {
|
|
5379
|
-
return new fs3.WriteStream(path2, options2);
|
|
5380
|
-
}
|
|
5381
|
-
var fs$open = fs3.open;
|
|
5382
|
-
fs3.open = open2;
|
|
5383
|
-
function open2(path2, flags, mode2, cb) {
|
|
5384
|
-
return typeof mode2 == "function" && (cb = mode2, mode2 = null), go$open(path2, flags, mode2, cb);
|
|
5385
|
-
function go$open(path3, flags2, mode3, cb2, startTime) {
|
|
5386
|
-
return fs$open(path3, flags2, mode3, function(err, fd) {
|
|
5387
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$open, [path3, flags2, mode3, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
|
|
5388
|
-
});
|
|
5389
|
-
}
|
|
5390
|
-
}
|
|
5391
|
-
return fs3;
|
|
5392
|
-
}
|
|
5393
|
-
function enqueue(elem) {
|
|
5394
|
-
debug2("ENQUEUE", elem[0].name, elem[1]), fs2[gracefulQueue].push(elem), retry2();
|
|
5395
|
-
}
|
|
5396
|
-
var retryTimer;
|
|
5397
|
-
function resetQueue() {
|
|
5398
|
-
for (var now = Date.now(), i = 0; i < fs2[gracefulQueue].length; ++i)
|
|
5399
|
-
fs2[gracefulQueue][i].length > 2 && (fs2[gracefulQueue][i][3] = now, fs2[gracefulQueue][i][4] = now);
|
|
5400
|
-
retry2();
|
|
5401
|
-
}
|
|
5402
|
-
function retry2() {
|
|
5403
|
-
if (clearTimeout(retryTimer), retryTimer = void 0, fs2[gracefulQueue].length !== 0) {
|
|
5404
|
-
var elem = fs2[gracefulQueue].shift(), fn = elem[0], args = elem[1], err = elem[2], startTime = elem[3], lastTime = elem[4];
|
|
5405
|
-
if (startTime === void 0)
|
|
5406
|
-
debug2("RETRY", fn.name, args), fn.apply(null, args);
|
|
5407
|
-
else if (Date.now() - startTime >= 6e4) {
|
|
5408
|
-
debug2("TIMEOUT", fn.name, args);
|
|
5409
|
-
var cb = args.pop();
|
|
5410
|
-
typeof cb == "function" && cb.call(null, err);
|
|
5411
|
-
} else {
|
|
5412
|
-
var sinceAttempt = Date.now() - lastTime, sinceStart = Math.max(lastTime - startTime, 1), desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
5413
|
-
sinceAttempt >= desiredDelay ? (debug2("RETRY", fn.name, args), fn.apply(null, args.concat([startTime]))) : fs2[gracefulQueue].push(elem);
|
|
5414
|
-
}
|
|
5415
|
-
retryTimer === void 0 && (retryTimer = setTimeout(retry2, 0));
|
|
5416
|
-
}
|
|
5417
|
-
}
|
|
5418
|
-
return gracefulFs$1;
|
|
5419
|
-
}
|
|
5420
|
-
var hasRequiredCaFile;
|
|
5421
|
-
function requireCaFile() {
|
|
5422
|
-
if (hasRequiredCaFile) return caFile;
|
|
5423
|
-
hasRequiredCaFile = 1;
|
|
5424
|
-
var __importDefault2 = caFile && caFile.__importDefault || function(mod) {
|
|
5425
|
-
return mod && mod.__esModule ? mod : { default: mod };
|
|
5426
|
-
};
|
|
5427
|
-
Object.defineProperty(caFile, "__esModule", { value: !0 }), caFile.readCAFileSync = void 0;
|
|
5428
|
-
const graceful_fs_1 = __importDefault2(requireGracefulFs$1());
|
|
5429
|
-
function readCAFileSync(filePath) {
|
|
5430
|
-
try {
|
|
5431
|
-
const contents = graceful_fs_1.default.readFileSync(filePath, "utf8"), delim = "-----END CERTIFICATE-----";
|
|
5432
|
-
return contents.split(delim).filter((ca) => !!ca.trim()).map((ca) => `${ca.trimLeft()}${delim}`);
|
|
5433
|
-
} catch (err) {
|
|
5434
|
-
if (err.code === "ENOENT")
|
|
5435
|
-
return;
|
|
5436
|
-
throw err;
|
|
5437
|
-
}
|
|
5438
|
-
}
|
|
5439
|
-
return caFile.readCAFileSync = readCAFileSync, caFile;
|
|
5440
|
-
}
|
|
5441
|
-
var hasRequiredDist$3;
|
|
5442
|
-
function requireDist$3() {
|
|
5443
|
-
return hasRequiredDist$3 || (hasRequiredDist$3 = 1, (function(exports$1) {
|
|
5444
|
-
var __createBinding2 = dist$4 && dist$4.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
5445
|
-
k2 === void 0 && (k2 = k);
|
|
5446
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5447
|
-
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
|
|
5448
|
-
return m[k];
|
|
5449
|
-
} }), Object.defineProperty(o, k2, desc);
|
|
5450
|
-
}) : (function(o, m, k, k2) {
|
|
5451
|
-
k2 === void 0 && (k2 = k), o[k2] = m[k];
|
|
5452
|
-
})), __exportStar2 = dist$4 && dist$4.__exportStar || function(m, exports$12) {
|
|
5453
|
-
for (var p in m) p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p) && __createBinding2(exports$12, m, p);
|
|
5454
|
-
};
|
|
5455
|
-
Object.defineProperty(exports$1, "__esModule", { value: !0 }), __exportStar2(requireCaFile(), exports$1);
|
|
5456
|
-
})(dist$4)), dist$4;
|
|
5457
|
-
}
|
|
5458
|
-
var configChain = { exports: {} }, protoList, hasRequiredProtoList;
|
|
5459
|
-
function requireProtoList() {
|
|
5460
|
-
if (hasRequiredProtoList) return protoList;
|
|
5461
|
-
hasRequiredProtoList = 1, protoList = ProtoList;
|
|
5462
|
-
function setProto(obj, proto) {
|
|
5463
|
-
if (typeof Object.setPrototypeOf == "function")
|
|
5464
|
-
return Object.setPrototypeOf(obj, proto);
|
|
5465
|
-
obj.__proto__ = proto;
|
|
5466
|
-
}
|
|
5467
|
-
function ProtoList() {
|
|
5468
|
-
this.list = [];
|
|
5469
|
-
var root2 = null;
|
|
5470
|
-
Object.defineProperty(this, "root", {
|
|
5471
|
-
get: function() {
|
|
5472
|
-
return root2;
|
|
5473
|
-
},
|
|
5474
|
-
set: function(r) {
|
|
5475
|
-
root2 = r, this.list.length && setProto(this.list[this.list.length - 1], r);
|
|
5476
|
-
},
|
|
5477
|
-
enumerable: !0,
|
|
5478
|
-
configurable: !0
|
|
5479
|
-
});
|
|
5480
|
-
}
|
|
5481
|
-
return ProtoList.prototype = {
|
|
5482
|
-
get length() {
|
|
5483
|
-
return this.list.length;
|
|
5484
|
-
},
|
|
5485
|
-
get keys() {
|
|
5486
|
-
var k = [];
|
|
5487
|
-
for (var i in this.list[0]) k.push(i);
|
|
5488
|
-
return k;
|
|
5489
|
-
},
|
|
5490
|
-
get snapshot() {
|
|
5491
|
-
var o = {};
|
|
5492
|
-
return this.keys.forEach(function(k) {
|
|
5493
|
-
o[k] = this.get(k);
|
|
5494
|
-
}, this), o;
|
|
5495
|
-
},
|
|
5496
|
-
get store() {
|
|
5497
|
-
return this.list[0];
|
|
5498
|
-
},
|
|
5499
|
-
push: function(obj) {
|
|
5500
|
-
return typeof obj != "object" && (obj = { valueOf: obj }), this.list.length >= 1 && setProto(this.list[this.list.length - 1], obj), setProto(obj, this.root), this.list.push(obj);
|
|
5501
|
-
},
|
|
5502
|
-
pop: function() {
|
|
5503
|
-
return this.list.length >= 2 && setProto(this.list[this.list.length - 2], this.root), this.list.pop();
|
|
5504
|
-
},
|
|
5505
|
-
unshift: function(obj) {
|
|
5506
|
-
return setProto(obj, this.list[0] || this.root), this.list.unshift(obj);
|
|
5507
|
-
},
|
|
5508
|
-
shift: function() {
|
|
5509
|
-
return this.list.length === 1 && setProto(this.list[0], this.root), this.list.shift();
|
|
5510
|
-
},
|
|
5511
|
-
get: function(key2) {
|
|
5512
|
-
return this.list[0][key2];
|
|
5513
|
-
},
|
|
5514
|
-
set: function(key2, val, save) {
|
|
5515
|
-
return this.length || this.push({}), save && this.list[0].hasOwnProperty(key2) && this.push({}), this.list[0][key2] = val;
|
|
5516
|
-
},
|
|
5517
|
-
forEach: function(fn, thisp) {
|
|
5518
|
-
for (var key2 in this.list[0]) fn.call(thisp, key2, this.list[0][key2]);
|
|
5519
|
-
},
|
|
5520
|
-
slice: function() {
|
|
5521
|
-
return this.list.slice.apply(this.list, arguments);
|
|
5522
|
-
},
|
|
5523
|
-
splice: function() {
|
|
5524
|
-
for (var ret = this.list.splice.apply(this.list, arguments), i = 0, l = this.list.length; i < l; i++)
|
|
5525
|
-
setProto(this.list[i], this.list[i + 1] || this.root);
|
|
5526
|
-
return ret;
|
|
5527
|
-
}
|
|
5528
|
-
}, protoList;
|
|
5529
|
-
}
|
|
5530
|
-
var hasRequiredConfigChain;
|
|
5531
|
-
function requireConfigChain() {
|
|
5532
|
-
if (hasRequiredConfigChain) return configChain.exports;
|
|
5533
|
-
hasRequiredConfigChain = 1;
|
|
5534
|
-
var ProtoList = requireProtoList(), path2 = require$$0__default$1.default, fs2 = require$$0__default.default, ini2 = requireIni$1(), EE = require$$0__default$7.default.EventEmitter, url = require$$5__default.default, http2 = require$$6__default.default, exports$1 = configChain.exports = function() {
|
|
5535
|
-
for (var args = [].slice.call(arguments), conf2 = new ConfigChain(); args.length; ) {
|
|
5536
|
-
var a = args.shift();
|
|
5537
|
-
a && conf2.push(typeof a == "string" ? json2(a) : a);
|
|
5538
|
-
}
|
|
5539
|
-
return conf2;
|
|
5540
|
-
};
|
|
5541
|
-
exports$1.find = function() {
|
|
5542
|
-
var rel = path2.join.apply(null, [].slice.call(arguments));
|
|
5543
|
-
function find2(start, rel2) {
|
|
5544
|
-
var file = path2.join(start, rel2);
|
|
5545
|
-
try {
|
|
5546
|
-
return fs2.statSync(file), file;
|
|
5547
|
-
} catch {
|
|
5548
|
-
if (path2.dirname(start) !== start)
|
|
5549
|
-
return find2(path2.dirname(start), rel2);
|
|
5550
|
-
}
|
|
5551
|
-
}
|
|
5552
|
-
return find2(__dirname, rel);
|
|
5553
|
-
};
|
|
5554
|
-
var parse3 = exports$1.parse = function(content, file, type2) {
|
|
5555
|
-
if (content = "" + content, type2)
|
|
5556
|
-
if (type2 === "json")
|
|
5557
|
-
if (this.emit)
|
|
5558
|
-
try {
|
|
5559
|
-
return JSON.parse(content);
|
|
5560
|
-
} catch (er) {
|
|
5561
|
-
this.emit("error", er);
|
|
5562
|
-
}
|
|
5563
|
-
else
|
|
5564
|
-
return JSON.parse(content);
|
|
5565
|
-
else
|
|
5566
|
-
return ini2.parse(content);
|
|
5567
|
-
else try {
|
|
5568
|
-
return JSON.parse(content);
|
|
5569
|
-
} catch {
|
|
5570
|
-
return ini2.parse(content);
|
|
5571
|
-
}
|
|
5572
|
-
}, json2 = exports$1.json = function() {
|
|
5573
|
-
var args = [].slice.call(arguments).filter(function(arg) {
|
|
5574
|
-
return arg != null;
|
|
5575
|
-
}), file = path2.join.apply(null, args), content;
|
|
5576
|
-
try {
|
|
5577
|
-
content = fs2.readFileSync(file, "utf-8");
|
|
5578
|
-
} catch {
|
|
5579
|
-
return;
|
|
5580
|
-
}
|
|
5581
|
-
return parse3(content, file, "json");
|
|
5582
|
-
};
|
|
5583
|
-
exports$1.env = function(prefix, env) {
|
|
5584
|
-
env = env || process.env;
|
|
5585
|
-
var obj = {}, l = prefix.length;
|
|
5586
|
-
for (var k in env)
|
|
5587
|
-
k.indexOf(prefix) === 0 && (obj[k.substring(l)] = env[k]);
|
|
5588
|
-
return obj;
|
|
5589
|
-
}, exports$1.ConfigChain = ConfigChain;
|
|
5590
|
-
function ConfigChain() {
|
|
5591
|
-
EE.apply(this), ProtoList.apply(this, arguments), this._awaiting = 0, this._saving = 0, this.sources = {};
|
|
5592
|
-
}
|
|
5593
|
-
var extras = {
|
|
5594
|
-
constructor: { value: ConfigChain }
|
|
5595
|
-
};
|
|
5596
|
-
return Object.keys(EE.prototype).forEach(function(k) {
|
|
5597
|
-
extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k);
|
|
5598
|
-
}), ConfigChain.prototype = Object.create(ProtoList.prototype, extras), ConfigChain.prototype.del = function(key2, where) {
|
|
5599
|
-
if (where) {
|
|
5600
|
-
var target = this.sources[where];
|
|
5601
|
-
if (target = target && target.data, !target)
|
|
5602
|
-
return this.emit("error", new Error("not found " + where));
|
|
5603
|
-
delete target[key2];
|
|
5604
|
-
} else
|
|
5605
|
-
for (var i = 0, l = this.list.length; i < l; i++)
|
|
5606
|
-
delete this.list[i][key2];
|
|
5607
|
-
return this;
|
|
5608
|
-
}, ConfigChain.prototype.set = function(key2, value, where) {
|
|
5609
|
-
var target;
|
|
5610
|
-
if (where) {
|
|
5611
|
-
if (target = this.sources[where], target = target && target.data, !target)
|
|
5612
|
-
return this.emit("error", new Error("not found " + where));
|
|
5613
|
-
} else if (target = this.list[0], !target)
|
|
5614
|
-
return this.emit("error", new Error("cannot set, no confs!"));
|
|
5615
|
-
return target[key2] = value, this;
|
|
5616
|
-
}, ConfigChain.prototype.get = function(key2, where) {
|
|
5617
|
-
return where ? (where = this.sources[where], where && (where = where.data), where && Object.hasOwnProperty.call(where, key2) ? where[key2] : void 0) : this.list[0][key2];
|
|
5618
|
-
}, ConfigChain.prototype.save = function(where, type2, cb) {
|
|
5619
|
-
typeof type2 == "function" && (cb = type2, type2 = null);
|
|
5620
|
-
var target = this.sources[where];
|
|
5621
|
-
if (!target || !(target.path || target.source) || !target.data)
|
|
5622
|
-
return this.emit("error", new Error("bad save target: " + where));
|
|
5623
|
-
if (target.source) {
|
|
5624
|
-
var pref = target.prefix || "";
|
|
5625
|
-
return Object.keys(target.data).forEach(function(k) {
|
|
5626
|
-
target.source[pref + k] = target.data[k];
|
|
5627
|
-
}), this;
|
|
5628
|
-
}
|
|
5629
|
-
var type2 = type2 || target.type, data = target.data;
|
|
5630
|
-
return target.type === "json" ? data = JSON.stringify(data) : data = ini2.stringify(data), this._saving++, fs2.writeFile(target.path, data, "utf8", function(er) {
|
|
5631
|
-
if (this._saving--, er)
|
|
5632
|
-
return cb ? cb(er) : this.emit("error", er);
|
|
5633
|
-
this._saving === 0 && (cb && cb(), this.emit("save"));
|
|
5634
|
-
}.bind(this)), this;
|
|
5635
|
-
}, ConfigChain.prototype.addFile = function(file, type2, name) {
|
|
5636
|
-
name = name || file;
|
|
5637
|
-
var marker = { __source__: name };
|
|
5638
|
-
return this.sources[name] = { path: file, type: type2 }, this.push(marker), this._await(), fs2.readFile(file, "utf8", function(er, data) {
|
|
5639
|
-
er && this.emit("error", er), this.addString(data, file, type2, marker);
|
|
5640
|
-
}.bind(this)), this;
|
|
5641
|
-
}, ConfigChain.prototype.addEnv = function(prefix, env, name) {
|
|
5642
|
-
name = name || "env";
|
|
5643
|
-
var data = exports$1.env(prefix, env);
|
|
5644
|
-
return this.sources[name] = { data, source: env, prefix }, this.add(data, name);
|
|
5645
|
-
}, ConfigChain.prototype.addUrl = function(req, type2, name) {
|
|
5646
|
-
this._await();
|
|
5647
|
-
var href = url.format(req);
|
|
5648
|
-
name = name || href;
|
|
5649
|
-
var marker = { __source__: name };
|
|
5650
|
-
return this.sources[name] = { href, type: type2 }, this.push(marker), http2.request(req, function(res) {
|
|
5651
|
-
var c2 = [], ct = res.headers["content-type"];
|
|
5652
|
-
type2 || (type2 = ct.indexOf("json") !== -1 ? "json" : ct.indexOf("ini") !== -1 ? "ini" : href.match(/\.json$/) ? "json" : href.match(/\.ini$/) ? "ini" : null, marker.type = type2), res.on("data", c2.push.bind(c2)).on("end", function() {
|
|
5653
|
-
this.addString(Buffer.concat(c2), href, type2, marker);
|
|
5654
|
-
}.bind(this)).on("error", this.emit.bind(this, "error"));
|
|
5655
|
-
}.bind(this)).on("error", this.emit.bind(this, "error")).end(), this;
|
|
5656
|
-
}, ConfigChain.prototype.addString = function(data, file, type2, marker) {
|
|
5657
|
-
return data = this.parse(data, file, type2), this.add(data, marker), this;
|
|
5658
|
-
}, ConfigChain.prototype.add = function(data, marker) {
|
|
5659
|
-
if (marker && typeof marker == "object") {
|
|
5660
|
-
var i = this.list.indexOf(marker);
|
|
5661
|
-
if (i === -1)
|
|
5662
|
-
return this.emit("error", new Error("bad marker"));
|
|
5663
|
-
this.splice(i, 1, data), marker = marker.__source__, this.sources[marker] = this.sources[marker] || {}, this.sources[marker].data = data, this._resolve();
|
|
5664
|
-
} else
|
|
5665
|
-
typeof marker == "string" && (this.sources[marker] = this.sources[marker] || {}, this.sources[marker].data = data), this._await(), this.push(data), process.nextTick(this._resolve.bind(this));
|
|
5666
|
-
return this;
|
|
5667
|
-
}, ConfigChain.prototype.parse = exports$1.parse, ConfigChain.prototype._await = function() {
|
|
5668
|
-
this._awaiting++;
|
|
5669
|
-
}, ConfigChain.prototype._resolve = function() {
|
|
5670
|
-
this._awaiting--, this._awaiting === 0 && this.emit("load", this);
|
|
5671
|
-
}, configChain.exports;
|
|
5672
|
-
}
|
|
5673
|
-
var envKeyToSetting, hasRequiredEnvKeyToSetting;
|
|
5674
|
-
function requireEnvKeyToSetting() {
|
|
5675
|
-
if (hasRequiredEnvKeyToSetting) return envKeyToSetting;
|
|
5676
|
-
hasRequiredEnvKeyToSetting = 1, envKeyToSetting = function(x) {
|
|
5677
|
-
const colonIndex = x.indexOf(":");
|
|
5678
|
-
if (colonIndex === -1)
|
|
5679
|
-
return normalize2(x);
|
|
5680
|
-
const firstPart = x.substr(0, colonIndex), secondPart = x.substr(colonIndex + 1);
|
|
5681
|
-
return `${normalize2(firstPart)}:${normalize2(secondPart)}`;
|
|
5682
|
-
};
|
|
5683
|
-
function normalize2(s) {
|
|
5684
|
-
if (s = s.toLowerCase(), s === "_authtoken") return "_authToken";
|
|
5685
|
-
let r = s[0];
|
|
5686
|
-
for (let i = 1; i < s.length; i++)
|
|
5687
|
-
r += s[i] === "_" ? "-" : s[i];
|
|
5688
|
-
return r;
|
|
5689
|
-
}
|
|
5690
|
-
return envKeyToSetting;
|
|
5691
|
-
}
|
|
5692
|
-
var util$3 = {}, dist$3 = {}, envReplace = {}, hasRequiredEnvReplace;
|
|
5693
|
-
function requireEnvReplace() {
|
|
5694
|
-
if (hasRequiredEnvReplace) return envReplace;
|
|
5695
|
-
hasRequiredEnvReplace = 1, Object.defineProperty(envReplace, "__esModule", { value: !0 }), envReplace.envReplace = void 0;
|
|
5696
|
-
const ENV_EXPR = /(?<!\\)(\\*)\$\{([^${}]+)\}/g;
|
|
5697
|
-
function envReplace$1(settingValue, env) {
|
|
5698
|
-
return settingValue.replace(ENV_EXPR, replaceEnvMatch.bind(null, env));
|
|
5699
|
-
}
|
|
5700
|
-
envReplace.envReplace = envReplace$1;
|
|
5701
|
-
function replaceEnvMatch(env, orig, escape2, name) {
|
|
5702
|
-
if (escape2.length % 2)
|
|
5703
|
-
return orig.slice((escape2.length + 1) / 2);
|
|
5704
|
-
const envValue = getEnvValue(env, name);
|
|
5705
|
-
if (envValue === void 0)
|
|
5706
|
-
throw new Error(`Failed to replace env in config: ${orig}`);
|
|
5707
|
-
return `${escape2.slice(escape2.length / 2)}${envValue}`;
|
|
5708
|
-
}
|
|
5709
|
-
const ENV_VALUE = /([^:-]+)(:?)-(.+)/;
|
|
5710
|
-
function getEnvValue(env, name) {
|
|
5711
|
-
const matched = name.match(ENV_VALUE);
|
|
5712
|
-
if (!matched)
|
|
5713
|
-
return env[name];
|
|
5714
|
-
const [, variableName, colon, fallback] = matched;
|
|
5715
|
-
return Object.prototype.hasOwnProperty.call(env, variableName) ? !env[variableName] && colon ? fallback : env[variableName] : fallback;
|
|
5716
|
-
}
|
|
5717
|
-
return envReplace;
|
|
5718
|
-
}
|
|
5719
|
-
var hasRequiredDist$2;
|
|
5720
|
-
function requireDist$2() {
|
|
5721
|
-
return hasRequiredDist$2 || (hasRequiredDist$2 = 1, (function(exports$1) {
|
|
5722
|
-
Object.defineProperty(exports$1, "__esModule", { value: !0 }), exports$1.envReplace = void 0;
|
|
5723
|
-
var env_replace_1 = requireEnvReplace();
|
|
5724
|
-
Object.defineProperty(exports$1, "envReplace", { enumerable: !0, get: function() {
|
|
5725
|
-
return env_replace_1.envReplace;
|
|
5726
|
-
} });
|
|
5727
|
-
})(dist$3)), dist$3;
|
|
5728
|
-
}
|
|
5729
|
-
var hasRequiredUtil$2;
|
|
5730
|
-
function requireUtil$2() {
|
|
5731
|
-
if (hasRequiredUtil$2) return util$3;
|
|
5732
|
-
hasRequiredUtil$2 = 1;
|
|
5733
|
-
const fs2 = require$$0__default.default, path2 = require$$0__default$1.default, { envReplace: envReplace2 } = requireDist$2(), parseKey = (key2) => typeof key2 != "string" ? key2 : envReplace2(key2, process.env), parseField = (types2, field, key2) => {
|
|
5734
|
-
if (typeof field != "string")
|
|
5735
|
-
return field;
|
|
5736
|
-
const typeList = [].concat(types2[key2]), isPath = typeList.indexOf(path2) !== -1, isBool = typeList.indexOf(Boolean) !== -1, isString = typeList.indexOf(String) !== -1, isNumber2 = typeList.indexOf(Number) !== -1;
|
|
5737
|
-
if (field = `${field}`.trim(), /^".*"$/.test(field))
|
|
5738
|
-
try {
|
|
5739
|
-
field = JSON.parse(field);
|
|
5740
|
-
} catch {
|
|
5741
|
-
throw new Error(`Failed parsing JSON config key ${key2}: ${field}`);
|
|
5742
|
-
}
|
|
5743
|
-
if (isBool && !isString && field === "")
|
|
5744
|
-
return !0;
|
|
5745
|
-
switch (field) {
|
|
5746
|
-
// eslint-disable-line default-case
|
|
5747
|
-
case "true":
|
|
5748
|
-
return !0;
|
|
5749
|
-
case "false":
|
|
5750
|
-
return !1;
|
|
5751
|
-
case "null":
|
|
5752
|
-
return null;
|
|
5753
|
-
case "undefined":
|
|
5754
|
-
return;
|
|
5755
|
-
}
|
|
5756
|
-
return field = envReplace2(field, process.env), isPath && ((process.platform === "win32" ? /^~(\/|\\)/ : /^~\//).test(field) && process.env.HOME && (field = path2.resolve(process.env.HOME, field.substr(2))), field = path2.resolve(field)), isNumber2 && !isNaN(field) && (field = Number(field)), field;
|
|
5757
|
-
}, findPrefix = (name) => {
|
|
5758
|
-
name = path2.resolve(name);
|
|
5759
|
-
let walkedUp = !1;
|
|
5760
|
-
for (; path2.basename(name) === "node_modules"; )
|
|
5761
|
-
name = path2.dirname(name), walkedUp = !0;
|
|
5762
|
-
if (walkedUp)
|
|
5763
|
-
return name;
|
|
5764
|
-
const find2 = (name2, original) => {
|
|
5765
|
-
const regex2 = /^[a-zA-Z]:(\\|\/)?$/;
|
|
5766
|
-
if (name2 === "/" || process.platform === "win32" && regex2.test(name2))
|
|
5767
|
-
return original;
|
|
5768
|
-
try {
|
|
5769
|
-
const files = fs2.readdirSync(name2);
|
|
5770
|
-
if (files.includes("node_modules") || files.includes("package.json") || files.includes("package.json5") || files.includes("package.yaml") || files.includes("pnpm-workspace.yaml"))
|
|
5771
|
-
return name2;
|
|
5772
|
-
const dirname = path2.dirname(name2);
|
|
5773
|
-
return dirname === name2 ? original : find2(dirname, original);
|
|
5774
|
-
} catch (error2) {
|
|
5775
|
-
if (name2 === original) {
|
|
5776
|
-
if (error2.code === "ENOENT")
|
|
5777
|
-
return original;
|
|
5778
|
-
throw error2;
|
|
5779
|
-
}
|
|
5780
|
-
return original;
|
|
5781
|
-
}
|
|
5782
|
-
};
|
|
5783
|
-
return find2(name, name);
|
|
5784
|
-
};
|
|
5785
|
-
return util$3.envReplace = envReplace2, util$3.findPrefix = findPrefix, util$3.parseField = parseField, util$3.parseKey = parseKey, util$3;
|
|
5786
|
-
}
|
|
5787
|
-
var types$4 = {}, hasRequiredTypes$3;
|
|
5788
|
-
function requireTypes$3() {
|
|
5789
|
-
if (hasRequiredTypes$3) return types$4;
|
|
5790
|
-
hasRequiredTypes$3 = 1;
|
|
5791
|
-
const path2 = require$$0__default$1.default, Stream2 = require$$0__default$4.default.Stream, url = require$$5__default.default, Umask = () => {
|
|
5792
|
-
}, getLocalAddresses = () => [], semver2 = () => {
|
|
5793
|
-
};
|
|
5794
|
-
return types$4.types = {
|
|
5795
|
-
access: [null, "restricted", "public"],
|
|
5796
|
-
"allow-same-version": Boolean,
|
|
5797
|
-
"always-auth": Boolean,
|
|
5798
|
-
also: [null, "dev", "development"],
|
|
5799
|
-
audit: Boolean,
|
|
5800
|
-
"auth-type": ["legacy", "sso", "saml", "oauth"],
|
|
5801
|
-
"bin-links": Boolean,
|
|
5802
|
-
browser: [null, String],
|
|
5803
|
-
ca: [null, String, Array],
|
|
5804
|
-
cafile: path2,
|
|
5805
|
-
cache: path2,
|
|
5806
|
-
"cache-lock-stale": Number,
|
|
5807
|
-
"cache-lock-retries": Number,
|
|
5808
|
-
"cache-lock-wait": Number,
|
|
5809
|
-
"cache-max": Number,
|
|
5810
|
-
"cache-min": Number,
|
|
5811
|
-
cert: [null, String],
|
|
5812
|
-
cidr: [null, String, Array],
|
|
5813
|
-
color: ["always", Boolean],
|
|
5814
|
-
depth: Number,
|
|
5815
|
-
description: Boolean,
|
|
5816
|
-
dev: Boolean,
|
|
5817
|
-
"dry-run": Boolean,
|
|
5818
|
-
editor: String,
|
|
5819
|
-
"engine-strict": Boolean,
|
|
5820
|
-
force: Boolean,
|
|
5821
|
-
"fetch-retries": Number,
|
|
5822
|
-
"fetch-retry-factor": Number,
|
|
5823
|
-
"fetch-retry-mintimeout": Number,
|
|
5824
|
-
"fetch-retry-maxtimeout": Number,
|
|
5825
|
-
git: String,
|
|
5826
|
-
"git-tag-version": Boolean,
|
|
5827
|
-
"commit-hooks": Boolean,
|
|
5828
|
-
global: Boolean,
|
|
5829
|
-
globalconfig: path2,
|
|
5830
|
-
"global-style": Boolean,
|
|
5831
|
-
group: [Number, String],
|
|
5832
|
-
"https-proxy": [null, url],
|
|
5833
|
-
"user-agent": String,
|
|
5834
|
-
"ham-it-up": Boolean,
|
|
5835
|
-
heading: String,
|
|
5836
|
-
"if-present": Boolean,
|
|
5837
|
-
"ignore-prepublish": Boolean,
|
|
5838
|
-
"ignore-scripts": Boolean,
|
|
5839
|
-
"init-module": path2,
|
|
5840
|
-
"init-author-name": String,
|
|
5841
|
-
"init-author-email": String,
|
|
5842
|
-
"init-author-url": ["", url],
|
|
5843
|
-
"init-license": String,
|
|
5844
|
-
"init-version": semver2,
|
|
5845
|
-
json: Boolean,
|
|
5846
|
-
key: [null, String],
|
|
5847
|
-
"legacy-bundling": Boolean,
|
|
5848
|
-
link: Boolean,
|
|
5849
|
-
// local-address must be listed as an IP for a local network interface
|
|
5850
|
-
// must be IPv4 due to node bug
|
|
5851
|
-
"local-address": getLocalAddresses(),
|
|
5852
|
-
loglevel: ["silent", "error", "warn", "notice", "http", "timing", "info", "verbose", "silly"],
|
|
5853
|
-
logstream: Stream2,
|
|
5854
|
-
"logs-max": Number,
|
|
5855
|
-
long: Boolean,
|
|
5856
|
-
maxsockets: Number,
|
|
5857
|
-
message: String,
|
|
5858
|
-
"metrics-registry": [null, String],
|
|
5859
|
-
"node-options": [null, String],
|
|
5860
|
-
"node-version": [null, semver2],
|
|
5861
|
-
"no-proxy": [null, String, Array],
|
|
5862
|
-
offline: Boolean,
|
|
5863
|
-
"onload-script": [null, String],
|
|
5864
|
-
only: [null, "dev", "development", "prod", "production"],
|
|
5865
|
-
optional: Boolean,
|
|
5866
|
-
"package-lock": Boolean,
|
|
5867
|
-
otp: [null, String],
|
|
5868
|
-
"package-lock-only": Boolean,
|
|
5869
|
-
parseable: Boolean,
|
|
5870
|
-
"prefer-offline": Boolean,
|
|
5871
|
-
"prefer-online": Boolean,
|
|
5872
|
-
prefix: path2,
|
|
5873
|
-
production: Boolean,
|
|
5874
|
-
progress: Boolean,
|
|
5875
|
-
proxy: [null, !1, url],
|
|
5876
|
-
provenance: Boolean,
|
|
5877
|
-
// allow proxy to be disabled explicitly
|
|
5878
|
-
"read-only": Boolean,
|
|
5879
|
-
"rebuild-bundle": Boolean,
|
|
5880
|
-
registry: [null, url],
|
|
5881
|
-
rollback: Boolean,
|
|
5882
|
-
save: Boolean,
|
|
5883
|
-
"save-bundle": Boolean,
|
|
5884
|
-
"save-dev": Boolean,
|
|
5885
|
-
"save-exact": Boolean,
|
|
5886
|
-
"save-optional": Boolean,
|
|
5887
|
-
"save-prefix": String,
|
|
5888
|
-
"save-prod": Boolean,
|
|
5889
|
-
scope: String,
|
|
5890
|
-
"script-shell": [null, String],
|
|
5891
|
-
"scripts-prepend-node-path": [!1, !0, "auto", "warn-only"],
|
|
5892
|
-
searchopts: String,
|
|
5893
|
-
searchexclude: [null, String],
|
|
5894
|
-
searchlimit: Number,
|
|
5895
|
-
searchstaleness: Number,
|
|
5896
|
-
"send-metrics": Boolean,
|
|
5897
|
-
shell: String,
|
|
5898
|
-
shrinkwrap: Boolean,
|
|
5899
|
-
"sign-git-tag": Boolean,
|
|
5900
|
-
"sso-poll-frequency": Number,
|
|
5901
|
-
"sso-type": [null, "oauth", "saml"],
|
|
5902
|
-
"strict-ssl": Boolean,
|
|
5903
|
-
tag: String,
|
|
5904
|
-
timing: Boolean,
|
|
5905
|
-
tmp: path2,
|
|
5906
|
-
unicode: Boolean,
|
|
5907
|
-
"unsafe-perm": Boolean,
|
|
5908
|
-
usage: Boolean,
|
|
5909
|
-
user: [Number, String],
|
|
5910
|
-
userconfig: path2,
|
|
5911
|
-
umask: Umask,
|
|
5912
|
-
version: Boolean,
|
|
5913
|
-
"tag-version-prefix": String,
|
|
5914
|
-
versions: Boolean,
|
|
5915
|
-
viewer: String,
|
|
5916
|
-
_exit: Boolean
|
|
5917
|
-
}, types$4;
|
|
5918
|
-
}
|
|
5919
|
-
var conf, hasRequiredConf;
|
|
5920
|
-
function requireConf() {
|
|
5921
|
-
if (hasRequiredConf) return conf;
|
|
5922
|
-
hasRequiredConf = 1;
|
|
5923
|
-
const { readCAFileSync } = requireDist$3(), fs2 = require$$0__default.default, path2 = require$$0__default$1.default, { ConfigChain } = requireConfigChain(), envKeyToSetting2 = requireEnvKeyToSetting(), util2 = requireUtil$2();
|
|
5924
|
-
class Conf extends ConfigChain {
|
|
5925
|
-
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L203-L217
|
|
5926
|
-
constructor(base2, types2) {
|
|
5927
|
-
super(base2), this.root = base2, this._parseField = util2.parseField.bind(null, types2 || requireTypes$3());
|
|
5928
|
-
}
|
|
5929
|
-
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L326-L338
|
|
5930
|
-
add(data, marker) {
|
|
5931
|
-
try {
|
|
5932
|
-
for (const [key2, value] of Object.entries(data)) {
|
|
5933
|
-
const substKey = util2.parseKey(key2);
|
|
5934
|
-
substKey !== key2 && delete data[key2], data[substKey] = this._parseField(value, substKey);
|
|
5935
|
-
}
|
|
5936
|
-
} catch (error2) {
|
|
5937
|
-
throw error2;
|
|
5938
|
-
}
|
|
5939
|
-
return super.add(data, marker);
|
|
5940
|
-
}
|
|
5941
|
-
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L306-L319
|
|
5942
|
-
addFile(file, name) {
|
|
5943
|
-
name = name || file;
|
|
5944
|
-
const marker = { __source__: name };
|
|
5945
|
-
this.sources[name] = { path: file, type: "ini" }, this.push(marker), this._await();
|
|
5946
|
-
try {
|
|
5947
|
-
const contents = fs2.readFileSync(file, "utf8");
|
|
5948
|
-
this.addString(contents, file, "ini", marker);
|
|
5949
|
-
} catch (error2) {
|
|
5950
|
-
if (error2.code === "ENOENT")
|
|
5951
|
-
this.add({}, marker);
|
|
5952
|
-
else if (error2.code !== "EISDIR")
|
|
5953
|
-
return `Issue while reading "${file}". ${error2.message}`;
|
|
5954
|
-
}
|
|
5955
|
-
}
|
|
5956
|
-
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L341-L357
|
|
5957
|
-
addEnv(env) {
|
|
5958
|
-
env = env || process.env;
|
|
5959
|
-
const conf2 = {};
|
|
5960
|
-
return Object.keys(env).filter((x) => /^npm_config_/i.test(x)).forEach((x) => {
|
|
5961
|
-
if (!env[x])
|
|
5962
|
-
return;
|
|
5963
|
-
const key2 = envKeyToSetting2(x.substr(11)), rawVal = env[x];
|
|
5964
|
-
conf2[key2] = deserializeEnvVal(key2, rawVal);
|
|
5965
|
-
}), super.addEnv("", conf2, "env");
|
|
5966
|
-
}
|
|
5967
|
-
// https://github.com/npm/cli/blob/latest/lib/config/load-prefix.js
|
|
5968
|
-
loadPrefix() {
|
|
5969
|
-
const cli = this.list[0];
|
|
5970
|
-
Object.defineProperty(this, "prefix", {
|
|
5971
|
-
enumerable: !0,
|
|
5972
|
-
set: (prefix) => {
|
|
5973
|
-
const g = this.get("global");
|
|
5974
|
-
this[g ? "globalPrefix" : "localPrefix"] = prefix;
|
|
5975
|
-
},
|
|
5976
|
-
get: () => this.get("global") ? this.globalPrefix : this.localPrefix
|
|
5977
|
-
}), Object.defineProperty(this, "globalPrefix", {
|
|
5978
|
-
enumerable: !0,
|
|
5979
|
-
set: (prefix) => {
|
|
5980
|
-
this.set("prefix", prefix);
|
|
5981
|
-
},
|
|
5982
|
-
get: () => path2.resolve(this.get("prefix"))
|
|
5983
|
-
});
|
|
5984
|
-
let p;
|
|
5985
|
-
if (Object.defineProperty(this, "localPrefix", {
|
|
5986
|
-
enumerable: !0,
|
|
5987
|
-
set: (prefix) => {
|
|
5988
|
-
p = prefix;
|
|
5989
|
-
},
|
|
5990
|
-
get: () => p
|
|
5991
|
-
}), Object.prototype.hasOwnProperty.call(cli, "prefix"))
|
|
5992
|
-
p = path2.resolve(cli.prefix);
|
|
5993
|
-
else
|
|
5994
|
-
try {
|
|
5995
|
-
p = util2.findPrefix(process.cwd());
|
|
5996
|
-
} catch (error2) {
|
|
5997
|
-
throw error2;
|
|
5998
|
-
}
|
|
5999
|
-
return p;
|
|
6000
|
-
}
|
|
6001
|
-
// https://github.com/npm/cli/blob/latest/lib/config/load-cafile.js
|
|
6002
|
-
loadCAFile(file) {
|
|
6003
|
-
if (!file)
|
|
6004
|
-
return;
|
|
6005
|
-
const ca = readCAFileSync(file);
|
|
6006
|
-
ca && this.set("ca", ca);
|
|
6007
|
-
}
|
|
6008
|
-
// https://github.com/npm/cli/blob/latest/lib/config/set-user.js
|
|
6009
|
-
loadUser() {
|
|
6010
|
-
const defConf = this.root;
|
|
6011
|
-
if (this.get("global"))
|
|
6012
|
-
return;
|
|
6013
|
-
if (process.env.SUDO_UID) {
|
|
6014
|
-
defConf.user = Number(process.env.SUDO_UID);
|
|
6015
|
-
return;
|
|
6016
|
-
}
|
|
6017
|
-
const prefix = path2.resolve(this.get("prefix"));
|
|
6018
|
-
try {
|
|
6019
|
-
const stats = fs2.statSync(prefix);
|
|
6020
|
-
defConf.user = stats.uid;
|
|
6021
|
-
} catch (error2) {
|
|
6022
|
-
if (error2.code === "ENOENT")
|
|
6023
|
-
return;
|
|
6024
|
-
throw error2;
|
|
6025
|
-
}
|
|
6026
|
-
}
|
|
6027
|
-
}
|
|
6028
|
-
function deserializeEnvVal(envKey, envValue) {
|
|
6029
|
-
function deserializeList(envValue2) {
|
|
6030
|
-
return envValue2.indexOf(`
|
|
6031
|
-
|
|
6032
|
-
`) ? envValue2.split(`
|
|
6033
|
-
|
|
6034
|
-
`) : envValue2.split(",");
|
|
6035
|
-
}
|
|
6036
|
-
switch (envKey) {
|
|
6037
|
-
case "hoist-pattern":
|
|
6038
|
-
case "public-hoist-pattern":
|
|
6039
|
-
return deserializeList(envValue);
|
|
6040
|
-
}
|
|
6041
|
-
return envValue;
|
|
6042
|
-
}
|
|
6043
|
-
return conf = Conf, conf;
|
|
6044
|
-
}
|
|
6045
|
-
var defaults$3 = {}, hasRequiredDefaults;
|
|
6046
|
-
function requireDefaults() {
|
|
6047
|
-
return hasRequiredDefaults || (hasRequiredDefaults = 1, (function(exports$1) {
|
|
6048
|
-
const os2 = require$$0__default$2.default, path2 = require$$0__default$1.default, temp = os2.tmpdir(), uidOrPid = process.getuid ? process.getuid() : process.pid, hasUnicode = () => !0, isWindows = process.platform === "win32", osenv = {
|
|
6049
|
-
editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? "notepad.exe" : "vi"),
|
|
6050
|
-
shell: () => isWindows ? process.env.COMSPEC || "cmd.exe" : process.env.SHELL || "/bin/bash"
|
|
6051
|
-
}, umask = {
|
|
6052
|
-
fromString: () => process.umask()
|
|
6053
|
-
};
|
|
6054
|
-
let home = os2.homedir();
|
|
6055
|
-
home ? process.env.HOME = home : home = path2.resolve(temp, "npm-" + uidOrPid);
|
|
6056
|
-
const cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm", cacheRoot = process.platform === "win32" && process.env.APPDATA || home, cache = path2.resolve(cacheRoot, cacheExtra);
|
|
6057
|
-
let defaults2, globalPrefix;
|
|
6058
|
-
Object.defineProperty(exports$1, "defaults", {
|
|
6059
|
-
get: function() {
|
|
6060
|
-
return defaults2 || (process.env.PREFIX ? globalPrefix = process.env.PREFIX : process.platform === "win32" ? globalPrefix = path2.dirname(process.execPath) : (globalPrefix = path2.dirname(path2.dirname(process.execPath)), process.env.DESTDIR && (globalPrefix = path2.join(process.env.DESTDIR, globalPrefix))), defaults2 = {
|
|
6061
|
-
access: null,
|
|
6062
|
-
"allow-same-version": !1,
|
|
6063
|
-
"always-auth": !1,
|
|
6064
|
-
also: null,
|
|
6065
|
-
audit: !0,
|
|
6066
|
-
"auth-type": "legacy",
|
|
6067
|
-
"bin-links": !0,
|
|
6068
|
-
browser: null,
|
|
6069
|
-
ca: null,
|
|
6070
|
-
cafile: null,
|
|
6071
|
-
cache,
|
|
6072
|
-
"cache-lock-stale": 6e4,
|
|
6073
|
-
"cache-lock-retries": 10,
|
|
6074
|
-
"cache-lock-wait": 1e4,
|
|
6075
|
-
"cache-max": 1 / 0,
|
|
6076
|
-
"cache-min": 10,
|
|
6077
|
-
cert: null,
|
|
6078
|
-
cidr: null,
|
|
6079
|
-
color: process.env.NO_COLOR == null,
|
|
6080
|
-
depth: 1 / 0,
|
|
6081
|
-
description: !0,
|
|
6082
|
-
dev: !1,
|
|
6083
|
-
"dry-run": !1,
|
|
6084
|
-
editor: osenv.editor(),
|
|
6085
|
-
"engine-strict": !1,
|
|
6086
|
-
force: !1,
|
|
6087
|
-
"fetch-retries": 2,
|
|
6088
|
-
"fetch-retry-factor": 10,
|
|
6089
|
-
"fetch-retry-mintimeout": 1e4,
|
|
6090
|
-
"fetch-retry-maxtimeout": 6e4,
|
|
6091
|
-
git: "git",
|
|
6092
|
-
"git-tag-version": !0,
|
|
6093
|
-
"commit-hooks": !0,
|
|
6094
|
-
global: !1,
|
|
6095
|
-
globalconfig: path2.resolve(globalPrefix, "etc", "npmrc"),
|
|
6096
|
-
"global-style": !1,
|
|
6097
|
-
group: process.platform === "win32" ? 0 : process.env.SUDO_GID || process.getgid && process.getgid(),
|
|
6098
|
-
"ham-it-up": !1,
|
|
6099
|
-
heading: "npm",
|
|
6100
|
-
"if-present": !1,
|
|
6101
|
-
"ignore-prepublish": !1,
|
|
6102
|
-
"ignore-scripts": !1,
|
|
6103
|
-
"init-module": path2.resolve(home, ".npm-init.js"),
|
|
6104
|
-
"init-author-name": "",
|
|
6105
|
-
"init-author-email": "",
|
|
6106
|
-
"init-author-url": "",
|
|
6107
|
-
"init-version": "1.0.0",
|
|
6108
|
-
"init-license": "ISC",
|
|
6109
|
-
json: !1,
|
|
6110
|
-
key: null,
|
|
6111
|
-
"legacy-bundling": !1,
|
|
6112
|
-
link: !1,
|
|
6113
|
-
"local-address": void 0,
|
|
6114
|
-
loglevel: "notice",
|
|
6115
|
-
logstream: process.stderr,
|
|
6116
|
-
"logs-max": 10,
|
|
6117
|
-
long: !1,
|
|
6118
|
-
maxsockets: 50,
|
|
6119
|
-
message: "%s",
|
|
6120
|
-
"metrics-registry": null,
|
|
6121
|
-
"node-options": null,
|
|
6122
|
-
// We remove node-version to fix the issue described here: https://github.com/pnpm/pnpm/issues/4203#issuecomment-1133872769
|
|
6123
|
-
offline: !1,
|
|
6124
|
-
"onload-script": !1,
|
|
6125
|
-
only: null,
|
|
6126
|
-
optional: !0,
|
|
6127
|
-
otp: null,
|
|
6128
|
-
"package-lock": !0,
|
|
6129
|
-
"package-lock-only": !1,
|
|
6130
|
-
parseable: !1,
|
|
6131
|
-
"prefer-offline": !1,
|
|
6132
|
-
"prefer-online": !1,
|
|
6133
|
-
prefix: globalPrefix,
|
|
6134
|
-
production: process.env.NODE_ENV === "production",
|
|
6135
|
-
progress: !process.env.TRAVIS && !process.env.CI,
|
|
6136
|
-
provenance: !1,
|
|
6137
|
-
proxy: null,
|
|
6138
|
-
"https-proxy": null,
|
|
6139
|
-
"no-proxy": null,
|
|
6140
|
-
"user-agent": "npm/{npm-version} node/{node-version} {platform} {arch}",
|
|
6141
|
-
"read-only": !1,
|
|
6142
|
-
"rebuild-bundle": !0,
|
|
6143
|
-
registry: "https://registry.npmjs.org/",
|
|
6144
|
-
rollback: !0,
|
|
6145
|
-
save: !0,
|
|
6146
|
-
"save-bundle": !1,
|
|
6147
|
-
"save-dev": !1,
|
|
6148
|
-
"save-exact": !1,
|
|
6149
|
-
"save-optional": !1,
|
|
6150
|
-
"save-prefix": "^",
|
|
6151
|
-
"save-prod": !1,
|
|
6152
|
-
scope: "",
|
|
6153
|
-
"script-shell": null,
|
|
6154
|
-
"scripts-prepend-node-path": "warn-only",
|
|
6155
|
-
searchopts: "",
|
|
6156
|
-
searchexclude: null,
|
|
6157
|
-
searchlimit: 20,
|
|
6158
|
-
searchstaleness: 900,
|
|
6159
|
-
"send-metrics": !1,
|
|
6160
|
-
shell: osenv.shell(),
|
|
6161
|
-
shrinkwrap: !0,
|
|
6162
|
-
"sign-git-tag": !1,
|
|
6163
|
-
"sso-poll-frequency": 500,
|
|
6164
|
-
"sso-type": "oauth",
|
|
6165
|
-
"strict-ssl": !0,
|
|
6166
|
-
tag: "latest",
|
|
6167
|
-
"tag-version-prefix": "v",
|
|
6168
|
-
timing: !1,
|
|
6169
|
-
tmp: temp,
|
|
6170
|
-
unicode: hasUnicode(),
|
|
6171
|
-
"unsafe-perm": process.platform === "win32" || process.platform === "cygwin" || !(process.getuid && process.setuid && process.getgid && process.setgid) || process.getuid() !== 0,
|
|
6172
|
-
usage: !1,
|
|
6173
|
-
user: process.platform === "win32" ? 0 : "nobody",
|
|
6174
|
-
userconfig: path2.resolve(home, ".npmrc"),
|
|
6175
|
-
umask: process.umask ? process.umask() : umask.fromString("022"),
|
|
6176
|
-
version: !1,
|
|
6177
|
-
versions: !1,
|
|
6178
|
-
viewer: process.platform === "win32" ? "browser" : "man",
|
|
6179
|
-
_exit: !0
|
|
6180
|
-
}, defaults2);
|
|
6181
|
-
}
|
|
6182
|
-
});
|
|
6183
|
-
})(defaults$3)), defaults$3;
|
|
6184
|
-
}
|
|
6185
|
-
var hasRequiredNpmConf;
|
|
6186
|
-
function requireNpmConf() {
|
|
6187
|
-
return hasRequiredNpmConf || (hasRequiredNpmConf = 1, (function(module2) {
|
|
6188
|
-
const path2 = require$$0__default$1.default, Conf = requireConf(), _defaults = requireDefaults();
|
|
6189
|
-
module2.exports = (opts, types2, defaults2) => {
|
|
6190
|
-
const conf2 = new Conf(Object.assign({}, _defaults.defaults, defaults2), types2);
|
|
6191
|
-
conf2.add(Object.assign({}, opts), "cli");
|
|
6192
|
-
const warnings = [];
|
|
6193
|
-
let failedToLoadBuiltInConfig = !1;
|
|
6194
|
-
if (require.resolve.paths) {
|
|
6195
|
-
const paths = require.resolve.paths("npm");
|
|
6196
|
-
let npmPath;
|
|
6197
|
-
try {
|
|
6198
|
-
npmPath = require.resolve("npm", { paths: paths.slice(-1) });
|
|
6199
|
-
} catch {
|
|
6200
|
-
failedToLoadBuiltInConfig = !0;
|
|
6201
|
-
}
|
|
6202
|
-
npmPath && warnings.push(conf2.addFile(path2.resolve(path2.dirname(npmPath), "..", "npmrc"), "builtin"));
|
|
6203
|
-
}
|
|
6204
|
-
conf2.addEnv(), conf2.loadPrefix();
|
|
6205
|
-
const projectConf = path2.resolve(conf2.localPrefix, ".npmrc"), userConf = conf2.get("userconfig");
|
|
6206
|
-
if (!conf2.get("global") && projectConf !== userConf ? warnings.push(conf2.addFile(projectConf, "project")) : conf2.add({}, "project"), conf2.get("workspace-prefix") && conf2.get("workspace-prefix") !== projectConf) {
|
|
6207
|
-
const workspaceConf = path2.resolve(conf2.get("workspace-prefix"), ".npmrc");
|
|
6208
|
-
warnings.push(conf2.addFile(workspaceConf, "workspace"));
|
|
6209
|
-
}
|
|
6210
|
-
if (warnings.push(conf2.addFile(conf2.get("userconfig"), "user")), conf2.get("prefix")) {
|
|
6211
|
-
const etc = path2.resolve(conf2.get("prefix"), "etc");
|
|
6212
|
-
conf2.root.globalconfig = path2.resolve(etc, "npmrc"), conf2.root.globalignorefile = path2.resolve(etc, "npmignore");
|
|
6213
|
-
}
|
|
6214
|
-
warnings.push(conf2.addFile(conf2.get("globalconfig"), "global")), conf2.loadUser();
|
|
6215
|
-
const caFile2 = conf2.get("cafile");
|
|
6216
|
-
return caFile2 && conf2.loadCAFile(caFile2), {
|
|
6217
|
-
config: conf2,
|
|
6218
|
-
warnings: warnings.filter(Boolean),
|
|
6219
|
-
failedToLoadBuiltInConfig
|
|
6220
|
-
};
|
|
6221
|
-
}, Object.defineProperty(module2.exports, "defaults", {
|
|
6222
|
-
get() {
|
|
6223
|
-
return _defaults.defaults;
|
|
6224
|
-
},
|
|
6225
|
-
enumerable: !0
|
|
6226
|
-
});
|
|
6227
|
-
})(npmConf)), npmConf.exports;
|
|
6228
|
-
}
|
|
6229
|
-
var registryAuthToken, hasRequiredRegistryAuthToken;
|
|
6230
|
-
function requireRegistryAuthToken() {
|
|
6231
|
-
if (hasRequiredRegistryAuthToken) return registryAuthToken;
|
|
6232
|
-
hasRequiredRegistryAuthToken = 1;
|
|
6233
|
-
const npmConf2 = requireNpmConf(), tokenKey = ":_authToken", legacyTokenKey = ":_auth", userKey = ":username", passwordKey = ":_password";
|
|
6234
|
-
registryAuthToken = function() {
|
|
6235
|
-
let checkUrl, options2;
|
|
6236
|
-
arguments.length >= 2 ? (checkUrl = arguments[0], options2 = Object.assign({}, arguments[1])) : typeof arguments[0] == "string" ? checkUrl = arguments[0] : options2 = Object.assign({}, arguments[0]), options2 = options2 || {};
|
|
6237
|
-
const providedNpmrc = options2.npmrc;
|
|
6238
|
-
return options2.npmrc = (options2.npmrc ? {
|
|
6239
|
-
config: {
|
|
6240
|
-
get: (key2) => providedNpmrc[key2]
|
|
6241
|
-
}
|
|
6242
|
-
} : npmConf2()).config, checkUrl = checkUrl || options2.npmrc.get("registry") || npmConf2.defaults.registry, getRegistryAuthInfo(checkUrl, options2) || getLegacyAuthInfo(options2.npmrc);
|
|
6243
|
-
};
|
|
6244
|
-
function urlResolve(from2, to) {
|
|
6245
|
-
const resolvedUrl = new URL(to, new URL(from2.startsWith("//") ? `./${from2}` : from2, "resolve://"));
|
|
6246
|
-
if (resolvedUrl.protocol === "resolve:") {
|
|
6247
|
-
const { pathname, search, hash } = resolvedUrl;
|
|
6248
|
-
return pathname + search + hash;
|
|
6249
|
-
}
|
|
6250
|
-
return resolvedUrl.toString();
|
|
6251
|
-
}
|
|
6252
|
-
function getRegistryAuthInfo(checkUrl, options2) {
|
|
6253
|
-
let parsed = checkUrl instanceof URL ? checkUrl : new URL(checkUrl.startsWith("//") ? `http:${checkUrl}` : checkUrl), pathname;
|
|
6254
|
-
for (; pathname !== "/" && parsed.pathname !== pathname; ) {
|
|
6255
|
-
pathname = parsed.pathname || "/";
|
|
6256
|
-
const regUrl = "//" + parsed.host + pathname.replace(/\/$/, ""), authInfo = getAuthInfoForUrl(regUrl, options2.npmrc);
|
|
6257
|
-
if (authInfo)
|
|
6258
|
-
return authInfo;
|
|
6259
|
-
if (!options2.recursive)
|
|
6260
|
-
return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(new URL("./", parsed), options2);
|
|
6261
|
-
parsed.pathname = urlResolve(normalizePath2(pathname), "..") || "/";
|
|
6262
|
-
}
|
|
6263
|
-
}
|
|
6264
|
-
function getLegacyAuthInfo(npmrc) {
|
|
6265
|
-
return npmrc.get("_auth") ? { token: replaceEnvironmentVariable(npmrc.get("_auth")), type: "Basic" } : void 0;
|
|
6266
|
-
}
|
|
6267
|
-
function normalizePath2(path2) {
|
|
6268
|
-
return path2[path2.length - 1] === "/" ? path2 : path2 + "/";
|
|
6269
|
-
}
|
|
6270
|
-
function getAuthInfoForUrl(regUrl, npmrc) {
|
|
6271
|
-
const bearerAuth = getBearerToken(npmrc.get(regUrl + tokenKey) || npmrc.get(regUrl + "/" + tokenKey));
|
|
6272
|
-
if (bearerAuth)
|
|
6273
|
-
return bearerAuth;
|
|
6274
|
-
const username = npmrc.get(regUrl + userKey) || npmrc.get(regUrl + "/" + userKey), password2 = npmrc.get(regUrl + passwordKey) || npmrc.get(regUrl + "/" + passwordKey), basicAuth = getTokenForUsernameAndPassword(username, password2);
|
|
6275
|
-
if (basicAuth)
|
|
6276
|
-
return basicAuth;
|
|
6277
|
-
const basicAuthWithToken = getLegacyAuthToken(npmrc.get(regUrl + legacyTokenKey) || npmrc.get(regUrl + "/" + legacyTokenKey));
|
|
6278
|
-
if (basicAuthWithToken)
|
|
6279
|
-
return basicAuthWithToken;
|
|
6280
|
-
}
|
|
6281
|
-
function replaceEnvironmentVariable(token2) {
|
|
6282
|
-
return token2.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
|
|
6283
|
-
return process.env[envVar];
|
|
6284
|
-
});
|
|
6285
|
-
}
|
|
6286
|
-
function getBearerToken(tok) {
|
|
6287
|
-
return tok ? { token: replaceEnvironmentVariable(tok), type: "Bearer" } : void 0;
|
|
6288
|
-
}
|
|
6289
|
-
function getTokenForUsernameAndPassword(username, password2) {
|
|
6290
|
-
if (!username || !password2)
|
|
6291
|
-
return;
|
|
6292
|
-
const pass = Buffer.from(replaceEnvironmentVariable(password2), "base64").toString("utf8");
|
|
6293
|
-
return {
|
|
6294
|
-
token: Buffer.from(username + ":" + pass, "utf8").toString("base64"),
|
|
6295
|
-
type: "Basic",
|
|
6296
|
-
password: pass,
|
|
6297
|
-
username
|
|
6298
|
-
};
|
|
6299
|
-
}
|
|
6300
|
-
function getLegacyAuthToken(tok) {
|
|
6301
|
-
return tok ? { token: replaceEnvironmentVariable(tok), type: "Basic" } : void 0;
|
|
6302
|
-
}
|
|
6303
|
-
return registryAuthToken;
|
|
6304
|
-
}
|
|
6305
|
-
var src, hasRequiredSrc;
|
|
6306
|
-
function requireSrc() {
|
|
6307
|
-
if (hasRequiredSrc) return src;
|
|
6308
|
-
hasRequiredSrc = 1;
|
|
6309
|
-
const url = require$$5__default.default, { getIt } = require$$1__default$1.default, { debug: debug2, retry: retry2, promise: promise2, httpErrors, jsonResponse } = require$$2__default.default, registryUrl2 = requireRegistryUrl(), registryAuthToken2 = requireRegistryAuthToken(), semver2 = semver__default.default, isJson = (contentType) => /(application\/json|\+json)/.test(contentType || "");
|
|
6310
|
-
function shouldRetry(err, num, options2) {
|
|
6311
|
-
const response = err.response || { statusCode: 500, headers: {} };
|
|
6312
|
-
return (
|
|
6313
|
-
// allow retries on low-level errors (socket errors et al)
|
|
6314
|
-
retry2.shouldRetry(err, num, options2) || // npm registry routinely fails, giving 503 and similar
|
|
6315
|
-
response && response.statusCode >= 500 || // npm registry sometimes returns 2xx with HTML content
|
|
6316
|
-
response.statusCode < 300 && !isJson(response.headers["content-type"])
|
|
6317
|
-
);
|
|
6318
|
-
}
|
|
6319
|
-
function resolveRegistryUrl(pkgName, options2) {
|
|
6320
|
-
if (options2.registryUrl)
|
|
6321
|
-
return options2.registryUrl;
|
|
6322
|
-
const scope2 = pkgName.split("/")[0];
|
|
6323
|
-
return registryUrl2(scope2);
|
|
6324
|
-
}
|
|
6325
|
-
const httpRequest = getIt([
|
|
6326
|
-
jsonResponse({ force: !0 }),
|
|
6327
|
-
httpErrors(),
|
|
6328
|
-
debug2({ namespace: "get-latest-version" }),
|
|
6329
|
-
promise2(),
|
|
6330
|
-
retry2({ shouldRetry })
|
|
6331
|
-
]);
|
|
6332
|
-
async function getLatestVersion(pkgName, opts) {
|
|
6333
|
-
const options2 = typeof opts == "string" ? { range: opts, auth: !0 } : Object.assign({ range: "latest", auth: !0 }, opts), regUrl = resolveRegistryUrl(pkgName, options2), pkgUrl = url.resolve(regUrl, encodeURIComponent(pkgName).replace(/^%40/, "@")), authInfo = options2.auth && registryAuthToken2(regUrl, { recursive: !0 }), request = options2.request || httpRequest, headers = {
|
|
6334
|
-
accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"
|
|
6335
|
-
};
|
|
6336
|
-
authInfo && (headers.authorization = `${authInfo.type} ${authInfo.token}`);
|
|
6337
|
-
let res;
|
|
6338
|
-
try {
|
|
6339
|
-
res = await request({ url: pkgUrl, headers });
|
|
6340
|
-
} catch (err) {
|
|
6341
|
-
throw err.response && err.response.statusCode === 404 ? new Error(`Package \`${pkgName}\` doesn't exist`) : err;
|
|
6342
|
-
}
|
|
6343
|
-
const data = res.body, range2 = options2.range, latest = data["dist-tags"].latest;
|
|
6344
|
-
if (data["dist-tags"][range2])
|
|
6345
|
-
return options2.includeLatest ? { latest, inRange: data["dist-tags"][range2] } : data["dist-tags"][range2];
|
|
6346
|
-
if (data.versions[range2])
|
|
6347
|
-
return options2.includeLatest ? { latest, inRange: range2 } : range2;
|
|
6348
|
-
const versions = Object.keys(data.versions), version2 = semver2.maxSatisfying(versions, range2);
|
|
6349
|
-
return version2 ? options2.includeLatest ? { latest, inRange: version2 } : version2 : options2.includeLatest ? { latest, inRange: void 0 } : void 0;
|
|
6350
|
-
}
|
|
6351
|
-
return getLatestVersion.request = httpRequest, src = getLatestVersion, src;
|
|
6352
|
-
}
|
|
6353
|
-
var srcExports = requireSrc(), latestVersion = /* @__PURE__ */ loadEnv.getDefaultExportFromCjs(srcExports);
|
|
4475
|
+
var xdgBasedirExports = requireXdgBasedir(), xdgBasedir = /* @__PURE__ */ loadEnv.getDefaultExportFromCjs(xdgBasedirExports);
|
|
6354
4476
|
async function getCliPkg() {
|
|
6355
4477
|
const cliPath = pkgDir__default.default.sync(__dirname);
|
|
6356
4478
|
if (!cliPath)
|
|
@@ -6450,12 +4572,12 @@ function buildPackageArray(packages, workDir, options2 = {}, cliVersion) {
|
|
|
6450
4572
|
}
|
|
6451
4573
|
async function tryFindLatestVersion(pkgName, range2) {
|
|
6452
4574
|
try {
|
|
6453
|
-
const { latest, inRange } = await
|
|
4575
|
+
const { latest, inRange } = await getLatestVersion__default.default(pkgName, { range: range2, includeLatest: !0 });
|
|
6454
4576
|
return { latest, latestInRange: inRange };
|
|
6455
4577
|
} catch (err) {
|
|
6456
4578
|
if (!(err instanceof Error) || !err.message.includes("No version exists"))
|
|
6457
4579
|
throw err;
|
|
6458
|
-
return { latest: await
|
|
4580
|
+
return { latest: await getLatestVersion__default.default(pkgName), latestInRange: void 0 };
|
|
6459
4581
|
}
|
|
6460
4582
|
}
|
|
6461
4583
|
function isPinnedVersion(version2) {
|
|
@@ -6821,11 +4943,11 @@ GFS4: `), console.error(m);
|
|
|
6821
4943
|
}
|
|
6822
4944
|
var fs$copyFile = fs3.copyFile;
|
|
6823
4945
|
fs$copyFile && (fs3.copyFile = copyFile);
|
|
6824
|
-
function copyFile(
|
|
6825
|
-
return typeof flags == "function" && (cb = flags, flags = 0), go$copyFile(
|
|
6826
|
-
function go$copyFile(
|
|
6827
|
-
return fs$copyFile(
|
|
6828
|
-
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$copyFile, [
|
|
4946
|
+
function copyFile(src, dest, flags, cb) {
|
|
4947
|
+
return typeof flags == "function" && (cb = flags, flags = 0), go$copyFile(src, dest, flags, cb);
|
|
4948
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
4949
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
4950
|
+
err && (err.code === "EMFILE" || err.code === "ENFILE") ? enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]) : typeof cb2 == "function" && cb2.apply(this, arguments);
|
|
6829
4951
|
});
|
|
6830
4952
|
}
|
|
6831
4953
|
}
|
|
@@ -7777,7 +5899,7 @@ var open_1, hasRequiredOpen;
|
|
|
7777
5899
|
function requireOpen() {
|
|
7778
5900
|
if (hasRequiredOpen) return open_1;
|
|
7779
5901
|
hasRequiredOpen = 1;
|
|
7780
|
-
const path2 = require$$0__default$1.default, childProcess2 = require$$1__default$
|
|
5902
|
+
const path2 = require$$0__default$1.default, childProcess2 = require$$1__default$1.default, { promises: fs2, constants: fsConstants } = require$$0__default.default, isWsl2 = requireIsWsl(), isDocker = requireIsDocker(), defineLazyProperty = requireDefineLazyProp(), localXdgOpenPath = path2.join(__dirname, "xdg-open"), { platform: platform2, arch } = process, hasContainerEnv = () => {
|
|
7781
5903
|
try {
|
|
7782
5904
|
return fs2.statSync("/run/.containerenv"), !0;
|
|
7783
5905
|
} catch {
|
|
@@ -14068,7 +12190,7 @@ function requireDetectBuilders() {
|
|
|
14068
12190
|
const middleware = fileName === "middleware.js" || fileName === "middleware.ts";
|
|
14069
12191
|
if (middleware && options2.projectSettings?.framework === "nextjs" || !(fileName.startsWith("api/") || middleware) || fileName.includes("/.") || fileName.includes("/_") || fileName.includes("/node_modules/") || fileName.endsWith(".d.ts"))
|
|
14070
12192
|
return null;
|
|
14071
|
-
const match2 = apiMatches.find(({ src
|
|
12193
|
+
const match2 = apiMatches.find(({ src = "**" }) => src === fileName || (0, minimatch_12.default)(fileName, src)), { fnPattern, func } = getFunction(fileName, options2), use = func?.runtime || match2?.use;
|
|
14072
12194
|
if (!use)
|
|
14073
12195
|
return null;
|
|
14074
12196
|
const config2 = { zeroConfig: !0 };
|
|
@@ -14117,8 +12239,8 @@ function requireDetectBuilders() {
|
|
|
14117
12239
|
});
|
|
14118
12240
|
const f = slugToFramework.get(framework || "");
|
|
14119
12241
|
if (f && f.useRuntime) {
|
|
14120
|
-
const { src
|
|
14121
|
-
return { src
|
|
12242
|
+
const { src, use } = f.useRuntime;
|
|
12243
|
+
return { src, use: `${use}${withTag}`, config: config2 };
|
|
14122
12244
|
}
|
|
14123
12245
|
const entrypoints = /* @__PURE__ */ new Set([
|
|
14124
12246
|
"package.json",
|
|
@@ -14326,18 +12448,18 @@ function requireDetectBuilders() {
|
|
|
14326
12448
|
].filter(Boolean).join("|")})${isIndex2 ? "?" : ""}`;
|
|
14327
12449
|
}
|
|
14328
12450
|
return segment;
|
|
14329
|
-
}), { name: fileName, ext: ext2 } = (0, path_1.parse)(filePath), isIndex = fileName === "index", queryString = `${query.length ? "?" : ""}${query.join("&")}`,
|
|
12451
|
+
}), { name: fileName, ext: ext2 } = (0, path_1.parse)(filePath), isIndex = fileName === "index", queryString = `${query.length ? "?" : ""}${query.join("&")}`, src = isIndex ? `^/${srcParts.slice(0, -1).join("/")}${srcParts.slice(-1)[0]}$` : `^/${srcParts.join("/")}$`;
|
|
14330
12452
|
let route;
|
|
14331
12453
|
if (featHandleMiss) {
|
|
14332
12454
|
const extensionless = ext2 ? filePath.slice(0, -ext2.length) : filePath;
|
|
14333
12455
|
route = {
|
|
14334
|
-
src
|
|
12456
|
+
src,
|
|
14335
12457
|
dest: `/${extensionless}${queryString}`,
|
|
14336
12458
|
check: !0
|
|
14337
12459
|
};
|
|
14338
12460
|
} else
|
|
14339
12461
|
route = {
|
|
14340
|
-
src
|
|
12462
|
+
src,
|
|
14341
12463
|
dest: `/${filePath}${queryString}`
|
|
14342
12464
|
};
|
|
14343
12465
|
return { route, isDynamic };
|
|
@@ -14527,7 +12649,7 @@ var detectFramework = {}, hasRequiredDetectFramework;
|
|
|
14527
12649
|
function requireDetectFramework() {
|
|
14528
12650
|
if (hasRequiredDetectFramework) return detectFramework;
|
|
14529
12651
|
hasRequiredDetectFramework = 1, Object.defineProperty(detectFramework, "__esModule", { value: !0 }), detectFramework.detectFrameworkVersion = detectFramework.detectFrameworkRecord = detectFramework.detectFrameworks = detectFramework.detectFramework = void 0;
|
|
14530
|
-
const child_process_1 = require$$1__default$
|
|
12652
|
+
const child_process_1 = require$$1__default$1.default;
|
|
14531
12653
|
async function matches(fs2, framework) {
|
|
14532
12654
|
const { detectors } = framework;
|
|
14533
12655
|
if (!detectors)
|
|
@@ -19241,7 +17363,7 @@ var hasRequiredCrossSpawn;
|
|
|
19241
17363
|
function requireCrossSpawn() {
|
|
19242
17364
|
if (hasRequiredCrossSpawn) return crossSpawn.exports;
|
|
19243
17365
|
hasRequiredCrossSpawn = 1;
|
|
19244
|
-
const cp = require$$1__default$
|
|
17366
|
+
const cp = require$$1__default$1.default, parse3 = requireParse$3(), enoent2 = requireEnoent();
|
|
19245
17367
|
function spawn(command2, args, options2) {
|
|
19246
17368
|
const parsed = parse3(command2, args, options2), spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
19247
17369
|
return enoent2.hookChildProcess(spawned, parsed), spawned;
|
|
@@ -19699,7 +17821,7 @@ var hasRequiredExeca;
|
|
|
19699
17821
|
function requireExeca() {
|
|
19700
17822
|
if (hasRequiredExeca) return execa$1.exports;
|
|
19701
17823
|
hasRequiredExeca = 1;
|
|
19702
|
-
const path2 = require$$0__default$1.default, childProcess2 = require$$1__default$
|
|
17824
|
+
const path2 = require$$0__default$1.default, childProcess2 = require$$1__default$1.default, crossSpawn2 = requireCrossSpawn(), stripFinalNewline2 = requireStripFinalNewline(), npmRunPath2 = requireNpmRunPath(), onetime2 = requireOnetime$1(), makeError = requireError(), normalizeStdio = requireStdio(), { spawnedKill, spawnedCancel, setupTimeout, setExitHandler } = requireKill(), { handleInput, getSpawnedResult, makeAllStream, validateInputSync } = requireStream(), { mergePromise, getSpawnedPromise } = requirePromise(), { joinCommand, parseCommand } = requireCommand(), DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100, getEnv = ({ env: envOption, extendEnv, preferLocal, localDir }) => {
|
|
19703
17825
|
const env = extendEnv ? { ...process.env, ...envOption } : envOption;
|
|
19704
17826
|
return preferLocal ? npmRunPath2.env({ env, cwd: localDir }) : env;
|
|
19705
17827
|
}, handleArgs = (file, args, options2 = {}) => {
|
|
@@ -23389,10 +21511,10 @@ async function getInstallCommand(options2) {
|
|
|
23389
21511
|
return `pnpm add ${pkgNameString} --save-${depType}`;
|
|
23390
21512
|
return `npm install ${pkgNameString} --save-${depType}`;
|
|
23391
21513
|
}
|
|
23392
|
-
var globalDirs = {}, ini, hasRequiredIni;
|
|
23393
|
-
function requireIni() {
|
|
23394
|
-
if (hasRequiredIni) return ini;
|
|
23395
|
-
hasRequiredIni = 1;
|
|
21514
|
+
var globalDirs = {}, ini$1, hasRequiredIni$1;
|
|
21515
|
+
function requireIni$1() {
|
|
21516
|
+
if (hasRequiredIni$1) return ini$1;
|
|
21517
|
+
hasRequiredIni$1 = 1;
|
|
23396
21518
|
const { hasOwnProperty: hasOwnProperty2 } = Object.prototype, eol = typeof process < "u" && process.platform === "win32" ? `\r
|
|
23397
21519
|
` : `
|
|
23398
21520
|
`, encode = (obj, opt) => {
|
|
@@ -23481,19 +21603,19 @@ function requireIni() {
|
|
|
23481
21603
|
}
|
|
23482
21604
|
return val;
|
|
23483
21605
|
};
|
|
23484
|
-
return ini = {
|
|
21606
|
+
return ini$1 = {
|
|
23485
21607
|
parse: decode,
|
|
23486
21608
|
decode,
|
|
23487
21609
|
stringify: encode,
|
|
23488
21610
|
encode,
|
|
23489
21611
|
safe,
|
|
23490
21612
|
unsafe
|
|
23491
|
-
}, ini;
|
|
21613
|
+
}, ini$1;
|
|
23492
21614
|
}
|
|
23493
21615
|
var hasRequiredGlobalDirs;
|
|
23494
21616
|
function requireGlobalDirs() {
|
|
23495
21617
|
return hasRequiredGlobalDirs || (hasRequiredGlobalDirs = 1, (function(exports$1) {
|
|
23496
|
-
const path2 = require$$0__default$1.default, os2 = require$$0__default$2.default, fs2 = require$$0__default.default, ini2 = requireIni(), isWindows = process.platform === "win32", readRc = (filePath) => {
|
|
21618
|
+
const path2 = require$$0__default$1.default, os2 = require$$0__default$2.default, fs2 = require$$0__default.default, ini2 = requireIni$1(), isWindows = process.platform === "win32", readRc = (filePath) => {
|
|
23497
21619
|
try {
|
|
23498
21620
|
return ini2.parse(fs2.readFileSync(filePath, "utf8")).prefix;
|
|
23499
21621
|
} catch {
|
|
@@ -23644,11 +21766,117 @@ const cliPackageManager = {
|
|
|
23644
21766
|
getPackageManagerChoice,
|
|
23645
21767
|
installNewPackages
|
|
23646
21768
|
};
|
|
21769
|
+
var ini = {}, hasRequiredIni;
|
|
21770
|
+
function requireIni() {
|
|
21771
|
+
if (hasRequiredIni) return ini;
|
|
21772
|
+
hasRequiredIni = 1, ini.parse = ini.decode = decode, ini.stringify = ini.encode = encode, ini.safe = safe, ini.unsafe = unsafe;
|
|
21773
|
+
var eol = typeof process < "u" && process.platform === "win32" ? `\r
|
|
21774
|
+
` : `
|
|
21775
|
+
`;
|
|
21776
|
+
function encode(obj, opt) {
|
|
21777
|
+
var children = [], out = "";
|
|
21778
|
+
typeof opt == "string" ? opt = {
|
|
21779
|
+
section: opt,
|
|
21780
|
+
whitespace: !1
|
|
21781
|
+
} : (opt = opt || {}, opt.whitespace = opt.whitespace === !0);
|
|
21782
|
+
var separator2 = opt.whitespace ? " = " : "=";
|
|
21783
|
+
return Object.keys(obj).forEach(function(k, _, __) {
|
|
21784
|
+
var val = obj[k];
|
|
21785
|
+
val && Array.isArray(val) ? val.forEach(function(item) {
|
|
21786
|
+
out += safe(k + "[]") + separator2 + safe(item) + `
|
|
21787
|
+
`;
|
|
21788
|
+
}) : val && typeof val == "object" ? children.push(k) : out += safe(k) + separator2 + safe(val) + eol;
|
|
21789
|
+
}), opt.section && out.length && (out = "[" + safe(opt.section) + "]" + eol + out), children.forEach(function(k, _, __) {
|
|
21790
|
+
var nk = dotSplit(k).join("\\."), section = (opt.section ? opt.section + "." : "") + nk, child = encode(obj[k], {
|
|
21791
|
+
section,
|
|
21792
|
+
whitespace: opt.whitespace
|
|
21793
|
+
});
|
|
21794
|
+
out.length && child.length && (out += eol), out += child;
|
|
21795
|
+
}), out;
|
|
21796
|
+
}
|
|
21797
|
+
function dotSplit(str2) {
|
|
21798
|
+
return str2.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) {
|
|
21799
|
+
return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "");
|
|
21800
|
+
});
|
|
21801
|
+
}
|
|
21802
|
+
function decode(str2) {
|
|
21803
|
+
var out = {}, p = out, section = null, re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i, lines2 = str2.split(/[\r\n]+/g);
|
|
21804
|
+
return lines2.forEach(function(line3, _, __) {
|
|
21805
|
+
if (!(!line3 || line3.match(/^\s*[;#]/))) {
|
|
21806
|
+
var match2 = line3.match(re);
|
|
21807
|
+
if (match2) {
|
|
21808
|
+
if (match2[1] !== void 0) {
|
|
21809
|
+
if (section = unsafe(match2[1]), section === "__proto__") {
|
|
21810
|
+
p = {};
|
|
21811
|
+
return;
|
|
21812
|
+
}
|
|
21813
|
+
p = out[section] = out[section] || {};
|
|
21814
|
+
return;
|
|
21815
|
+
}
|
|
21816
|
+
var key2 = unsafe(match2[2]);
|
|
21817
|
+
if (key2 !== "__proto__") {
|
|
21818
|
+
var value = match2[3] ? unsafe(match2[4]) : !0;
|
|
21819
|
+
switch (value) {
|
|
21820
|
+
case "true":
|
|
21821
|
+
case "false":
|
|
21822
|
+
case "null":
|
|
21823
|
+
value = JSON.parse(value);
|
|
21824
|
+
}
|
|
21825
|
+
if (key2.length > 2 && key2.slice(-2) === "[]") {
|
|
21826
|
+
if (key2 = key2.substring(0, key2.length - 2), key2 === "__proto__")
|
|
21827
|
+
return;
|
|
21828
|
+
p[key2] ? Array.isArray(p[key2]) || (p[key2] = [p[key2]]) : p[key2] = [];
|
|
21829
|
+
}
|
|
21830
|
+
Array.isArray(p[key2]) ? p[key2].push(value) : p[key2] = value;
|
|
21831
|
+
}
|
|
21832
|
+
}
|
|
21833
|
+
}
|
|
21834
|
+
}), Object.keys(out).filter(function(k, _, __) {
|
|
21835
|
+
if (!out[k] || typeof out[k] != "object" || Array.isArray(out[k]))
|
|
21836
|
+
return !1;
|
|
21837
|
+
var parts = dotSplit(k), p2 = out, l = parts.pop(), nl = l.replace(/\\\./g, ".");
|
|
21838
|
+
return parts.forEach(function(part, _2, __2) {
|
|
21839
|
+
part !== "__proto__" && ((!p2[part] || typeof p2[part] != "object") && (p2[part] = {}), p2 = p2[part]);
|
|
21840
|
+
}), p2 === out && nl === l ? !1 : (p2[nl] = out[k], !0);
|
|
21841
|
+
}).forEach(function(del, _, __) {
|
|
21842
|
+
delete out[del];
|
|
21843
|
+
}), out;
|
|
21844
|
+
}
|
|
21845
|
+
function isQuoted(val) {
|
|
21846
|
+
return val.charAt(0) === '"' && val.slice(-1) === '"' || val.charAt(0) === "'" && val.slice(-1) === "'";
|
|
21847
|
+
}
|
|
21848
|
+
function safe(val) {
|
|
21849
|
+
return typeof val != "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#");
|
|
21850
|
+
}
|
|
21851
|
+
function unsafe(val, doUnesc) {
|
|
21852
|
+
if (val = (val || "").trim(), isQuoted(val)) {
|
|
21853
|
+
val.charAt(0) === "'" && (val = val.substr(1, val.length - 2));
|
|
21854
|
+
try {
|
|
21855
|
+
val = JSON.parse(val);
|
|
21856
|
+
} catch {
|
|
21857
|
+
}
|
|
21858
|
+
} else {
|
|
21859
|
+
for (var esc = !1, unesc = "", i = 0, l = val.length; i < l; i++) {
|
|
21860
|
+
var c2 = val.charAt(i);
|
|
21861
|
+
if (esc)
|
|
21862
|
+
"\\;#".indexOf(c2) !== -1 ? unesc += c2 : unesc += "\\" + c2, esc = !1;
|
|
21863
|
+
else {
|
|
21864
|
+
if (";#".indexOf(c2) !== -1)
|
|
21865
|
+
break;
|
|
21866
|
+
c2 === "\\" ? esc = !0 : unesc += c2;
|
|
21867
|
+
}
|
|
21868
|
+
}
|
|
21869
|
+
return esc && (unesc += "\\"), unesc.trim();
|
|
21870
|
+
}
|
|
21871
|
+
return val;
|
|
21872
|
+
}
|
|
21873
|
+
return ini;
|
|
21874
|
+
}
|
|
23647
21875
|
var gitconfiglocal, hasRequiredGitconfiglocal;
|
|
23648
21876
|
function requireGitconfiglocal() {
|
|
23649
21877
|
if (hasRequiredGitconfiglocal) return gitconfiglocal;
|
|
23650
21878
|
hasRequiredGitconfiglocal = 1;
|
|
23651
|
-
const fs2 = require$$0__default.default.promises, ini2 = requireIni
|
|
21879
|
+
const fs2 = require$$0__default.default.promises, ini2 = requireIni(), path2 = require$$0__default$1.default;
|
|
23652
21880
|
gitconfiglocal = async function(dir, options2 = {}) {
|
|
23653
21881
|
const config2 = await findGit(dir, options2);
|
|
23654
21882
|
if (!config2) throw new Error("no gitconfig to be found at " + dir);
|
|
@@ -23835,7 +22063,7 @@ var parseGitConfig, hasRequiredParseGitConfig;
|
|
|
23835
22063
|
function requireParseGitConfig() {
|
|
23836
22064
|
if (hasRequiredParseGitConfig) return parseGitConfig;
|
|
23837
22065
|
hasRequiredParseGitConfig = 1;
|
|
23838
|
-
var fs2 = require$$0__default.default, path2 = require$$0__default$1.default, exists = requireFsExistsSync(), extend = requireExtendShallow(), configPath = requireGitConfigPath(), ini2 = requireIni
|
|
22066
|
+
var fs2 = require$$0__default.default, path2 = require$$0__default$1.default, exists = requireFsExistsSync(), extend = requireExtendShallow(), configPath = requireGitConfigPath(), ini2 = requireIni();
|
|
23839
22067
|
function parse3(options2, cb) {
|
|
23840
22068
|
if (typeof options2 == "function" && (cb = options2, options2 = {}), typeof cb != "function")
|
|
23841
22069
|
throw new TypeError("parse-git-config async expects a callback function.");
|
|
@@ -23995,10 +22223,10 @@ function requireMinipass$1() {
|
|
|
23995
22223
|
const proc2 = typeof process == "object" && process ? process : {
|
|
23996
22224
|
stdout: null,
|
|
23997
22225
|
stderr: null
|
|
23998
|
-
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default
|
|
22226
|
+
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default.default.StringDecoder, EOF2 = Symbol("EOF"), MAYBE_EMIT_END2 = Symbol("maybeEmitEnd"), EMITTED_END2 = Symbol("emittedEnd"), EMITTING_END2 = Symbol("emittingEnd"), EMITTED_ERROR2 = Symbol("emittedError"), CLOSED2 = Symbol("closed"), READ2 = Symbol("read"), FLUSH2 = Symbol("flush"), FLUSHCHUNK2 = Symbol("flushChunk"), ENCODING2 = Symbol("encoding"), DECODER2 = Symbol("decoder"), FLOWING2 = Symbol("flowing"), PAUSED2 = Symbol("paused"), RESUME2 = Symbol("resume"), BUFFER2 = Symbol("buffer"), PIPES2 = Symbol("pipes"), BUFFERLENGTH2 = Symbol("bufferLength"), BUFFERPUSH2 = Symbol("bufferPush"), BUFFERSHIFT2 = Symbol("bufferShift"), OBJECTMODE2 = Symbol("objectMode"), DESTROYED2 = Symbol("destroyed"), ERROR2 = Symbol("error"), EMITDATA2 = Symbol("emitData"), EMITEND3 = Symbol("emitEnd"), EMITEND22 = Symbol("emitEnd2"), ASYNC2 = Symbol("async"), ABORT2 = Symbol("abort"), ABORTED2 = Symbol("aborted"), SIGNAL2 = Symbol("signal"), defer2 = (fn) => Promise.resolve().then(fn), doIter = loadEnv.commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"), isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
23999
22227
|
class Pipe2 {
|
|
24000
|
-
constructor(
|
|
24001
|
-
this.src =
|
|
22228
|
+
constructor(src, dest, opts) {
|
|
22229
|
+
this.src = src, this.dest = dest, this.opts = opts, this.ondrain = () => src[RESUME2](), dest.on("drain", this.ondrain);
|
|
24002
22230
|
}
|
|
24003
22231
|
unpipe() {
|
|
24004
22232
|
this.dest.removeListener("drain", this.ondrain);
|
|
@@ -24014,8 +22242,8 @@ function requireMinipass$1() {
|
|
|
24014
22242
|
unpipe() {
|
|
24015
22243
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
24016
22244
|
}
|
|
24017
|
-
constructor(
|
|
24018
|
-
super(
|
|
22245
|
+
constructor(src, dest, opts) {
|
|
22246
|
+
super(src, dest, opts), this.proxyErrors = (er) => dest.emit("error", er), src.on("error", this.proxyErrors);
|
|
24019
22247
|
}
|
|
24020
22248
|
}
|
|
24021
22249
|
class Minipass2 extends Stream2 {
|
|
@@ -24394,10 +22622,10 @@ function requireMinipass() {
|
|
|
24394
22622
|
const proc2 = typeof process == "object" && process ? process : {
|
|
24395
22623
|
stdout: null,
|
|
24396
22624
|
stderr: null
|
|
24397
|
-
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default
|
|
22625
|
+
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default.default.StringDecoder, EOF2 = Symbol("EOF"), MAYBE_EMIT_END2 = Symbol("maybeEmitEnd"), EMITTED_END2 = Symbol("emittedEnd"), EMITTING_END2 = Symbol("emittingEnd"), EMITTED_ERROR2 = Symbol("emittedError"), CLOSED2 = Symbol("closed"), READ2 = Symbol("read"), FLUSH2 = Symbol("flush"), FLUSHCHUNK2 = Symbol("flushChunk"), ENCODING2 = Symbol("encoding"), DECODER2 = Symbol("decoder"), FLOWING2 = Symbol("flowing"), PAUSED2 = Symbol("paused"), RESUME2 = Symbol("resume"), BUFFERLENGTH2 = Symbol("bufferLength"), BUFFERPUSH2 = Symbol("bufferPush"), BUFFERSHIFT2 = Symbol("bufferShift"), OBJECTMODE2 = Symbol("objectMode"), DESTROYED2 = Symbol("destroyed"), EMITDATA2 = Symbol("emitData"), EMITEND3 = Symbol("emitEnd"), EMITEND22 = Symbol("emitEnd2"), ASYNC2 = Symbol("async"), defer2 = (fn) => Promise.resolve().then(fn), doIter = loadEnv.commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"), isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
24398
22626
|
class Pipe2 {
|
|
24399
|
-
constructor(
|
|
24400
|
-
this.src =
|
|
22627
|
+
constructor(src, dest, opts) {
|
|
22628
|
+
this.src = src, this.dest = dest, this.opts = opts, this.ondrain = () => src[RESUME2](), dest.on("drain", this.ondrain);
|
|
24401
22629
|
}
|
|
24402
22630
|
unpipe() {
|
|
24403
22631
|
this.dest.removeListener("drain", this.ondrain);
|
|
@@ -24413,8 +22641,8 @@ function requireMinipass() {
|
|
|
24413
22641
|
unpipe() {
|
|
24414
22642
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
24415
22643
|
}
|
|
24416
|
-
constructor(
|
|
24417
|
-
super(
|
|
22644
|
+
constructor(src, dest, opts) {
|
|
22645
|
+
super(src, dest, opts), this.proxyErrors = (er) => dest.emit("error", er), src.on("error", this.proxyErrors);
|
|
24418
22646
|
}
|
|
24419
22647
|
}
|
|
24420
22648
|
return minipass = class Minipass2 extends Stream2 {
|
|
@@ -27923,7 +26151,7 @@ async function copy(srcPath, dstPath, options2) {
|
|
|
27923
26151
|
function resolveLatestVersions(pkgs) {
|
|
27924
26152
|
const lookups = {};
|
|
27925
26153
|
for (const [packageName, range2] of Object.entries(pkgs))
|
|
27926
|
-
lookups[packageName] = range2 === "latest" ?
|
|
26154
|
+
lookups[packageName] = range2 === "latest" ? getLatestVersion__default.default(packageName, { range: range2 }).then(caretify) : range2;
|
|
27927
26155
|
return promiseProps(lookups);
|
|
27928
26156
|
}
|
|
27929
26157
|
function caretify(version2) {
|
|
@@ -34139,17 +32367,17 @@ function requireEsprima$1() {
|
|
|
34139
32367
|
this.context.inFunctionBody && this.throwError(messages_1.Messages.IllegalImportDeclaration);
|
|
34140
32368
|
var node = this.createNode();
|
|
34141
32369
|
this.expectKeyword("import");
|
|
34142
|
-
var
|
|
32370
|
+
var src, specifiers = [];
|
|
34143
32371
|
if (this.lookahead.type === 8)
|
|
34144
|
-
|
|
32372
|
+
src = this.parseModuleSpecifier();
|
|
34145
32373
|
else {
|
|
34146
32374
|
if (this.match("{") ? specifiers = specifiers.concat(this.parseNamedImports()) : this.match("*") ? specifiers.push(this.parseImportNamespaceSpecifier()) : this.isIdentifierName(this.lookahead) && !this.matchKeyword("default") ? (specifiers.push(this.parseImportDefaultSpecifier()), this.match(",") && (this.nextToken(), this.match("*") ? specifiers.push(this.parseImportNamespaceSpecifier()) : this.match("{") ? specifiers = specifiers.concat(this.parseNamedImports()) : this.throwUnexpectedToken(this.lookahead))) : this.throwUnexpectedToken(this.nextToken()), !this.matchContextualKeyword("from")) {
|
|
34147
32375
|
var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
|
|
34148
32376
|
this.throwError(message, this.lookahead.value);
|
|
34149
32377
|
}
|
|
34150
|
-
this.nextToken(),
|
|
32378
|
+
this.nextToken(), src = this.parseModuleSpecifier();
|
|
34151
32379
|
}
|
|
34152
|
-
return this.consumeSemicolon(), this.finalize(node, new Node.ImportDeclaration(specifiers,
|
|
32380
|
+
return this.consumeSemicolon(), this.finalize(node, new Node.ImportDeclaration(specifiers, src));
|
|
34153
32381
|
}, Parser2.prototype.parseExportSpecifier = function() {
|
|
34154
32382
|
var node = this.createNode(), local = this.parseIdentifierName(), exported = local;
|
|
34155
32383
|
return this.matchContextualKeyword("as") && (this.nextToken(), exported = this.parseIdentifierName()), this.finalize(node, new Node.ExportSpecifier(local, exported));
|
|
@@ -34179,8 +32407,8 @@ function requireEsprima$1() {
|
|
|
34179
32407
|
this.throwError(message, this.lookahead.value);
|
|
34180
32408
|
}
|
|
34181
32409
|
this.nextToken();
|
|
34182
|
-
var
|
|
34183
|
-
this.consumeSemicolon(), exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(
|
|
32410
|
+
var src = this.parseModuleSpecifier();
|
|
32411
|
+
this.consumeSemicolon(), exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
|
|
34184
32412
|
} else if (this.lookahead.type === 4) {
|
|
34185
32413
|
var declaration = void 0;
|
|
34186
32414
|
switch (this.lookahead.value) {
|
|
@@ -38252,13 +36480,13 @@ function requireDeepSortObject() {
|
|
|
38252
36480
|
function defaultSortFn(a, b) {
|
|
38253
36481
|
return a.localeCompare(b);
|
|
38254
36482
|
}
|
|
38255
|
-
function sort(
|
|
36483
|
+
function sort(src, comparator) {
|
|
38256
36484
|
var out;
|
|
38257
|
-
return Array.isArray(
|
|
36485
|
+
return Array.isArray(src) ? src.map(function(item) {
|
|
38258
36486
|
return sort(item, comparator);
|
|
38259
|
-
}) : isPlainObject2(
|
|
38260
|
-
out[key2] = sort(
|
|
38261
|
-
}), out) :
|
|
36487
|
+
}) : isPlainObject2(src) ? (out = {}, Object.keys(src).sort(comparator || defaultSortFn).forEach(function(key2) {
|
|
36488
|
+
out[key2] = sort(src[key2], comparator);
|
|
36489
|
+
}), out) : src;
|
|
38262
36490
|
}
|
|
38263
36491
|
return deepSortObject = sort, deepSortObject;
|
|
38264
36492
|
}
|
|
@@ -38315,10 +36543,10 @@ function getCommonManifest(data) {
|
|
|
38315
36543
|
url: data.gitRemote
|
|
38316
36544
|
}), pkg;
|
|
38317
36545
|
}
|
|
38318
|
-
function serializeManifest(
|
|
38319
|
-
const ordered = manifestPropOrder.concat(Object.keys(
|
|
36546
|
+
function serializeManifest(src) {
|
|
36547
|
+
const ordered = manifestPropOrder.concat(Object.keys(src)).reduce(
|
|
38320
36548
|
(target, prop) => {
|
|
38321
|
-
const source2 =
|
|
36549
|
+
const source2 = src;
|
|
38322
36550
|
return typeof source2[prop] < "u" && typeof target[prop] > "u" && (target[prop] = source2[prop]), target;
|
|
38323
36551
|
},
|
|
38324
36552
|
{}
|
|
@@ -39060,7 +37288,7 @@ class AST {
|
|
|
39060
37288
|
toRegExpSource(allowDot) {
|
|
39061
37289
|
const dot = allowDot ?? !!this.#options.dot;
|
|
39062
37290
|
if (this.#root === this && this.#fillNegs(), !this.type) {
|
|
39063
|
-
const noEmpty = this.isStart() && this.isEnd(),
|
|
37291
|
+
const noEmpty = this.isStart() && this.isEnd(), src = this.#parts.map((p) => {
|
|
39064
37292
|
const [re, _, hasMagic2, uflag] = typeof p == "string" ? AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
39065
37293
|
return this.#hasMagic = this.#hasMagic || hasMagic2, this.#uflag = this.#uflag || uflag, re;
|
|
39066
37294
|
}).join("");
|
|
@@ -39068,16 +37296,16 @@ class AST {
|
|
|
39068
37296
|
if (this.isStart() && typeof this.#parts[0] == "string" && !(this.#parts.length === 1 && justDots.has(this.#parts[0]))) {
|
|
39069
37297
|
const aps = addPatternStart, needNoTrav = (
|
|
39070
37298
|
// dots are allowed, and the pattern starts with [ or .
|
|
39071
|
-
dot && aps.has(
|
|
39072
|
-
|
|
39073
|
-
|
|
39074
|
-
), needNoDot = !dot && !allowDot && aps.has(
|
|
37299
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
37300
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
37301
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
37302
|
+
), needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
39075
37303
|
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
39076
37304
|
}
|
|
39077
37305
|
let end = "";
|
|
39078
37306
|
return this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!" && (end = "(?:$|\\/)"), [
|
|
39079
|
-
start2 +
|
|
39080
|
-
unescape(
|
|
37307
|
+
start2 + src + end,
|
|
37308
|
+
unescape(src),
|
|
39081
37309
|
this.#hasMagic = !!this.#hasMagic,
|
|
39082
37310
|
this.#uflag
|
|
39083
37311
|
];
|
|
@@ -39128,9 +37356,9 @@ class AST {
|
|
|
39128
37356
|
continue;
|
|
39129
37357
|
}
|
|
39130
37358
|
if (c2 === "[") {
|
|
39131
|
-
const [
|
|
37359
|
+
const [src, needUflag, consumed, magic] = parseClass(glob2, i);
|
|
39132
37360
|
if (consumed) {
|
|
39133
|
-
re +=
|
|
37361
|
+
re += src, uflag = uflag || needUflag, i += consumed - 1, hasMagic2 = hasMagic2 || magic;
|
|
39134
37362
|
continue;
|
|
39135
37363
|
}
|
|
39136
37364
|
}
|
|
@@ -40496,8 +38724,8 @@ class Pipe {
|
|
|
40496
38724
|
dest;
|
|
40497
38725
|
opts;
|
|
40498
38726
|
ondrain;
|
|
40499
|
-
constructor(
|
|
40500
|
-
this.src =
|
|
38727
|
+
constructor(src, dest, opts) {
|
|
38728
|
+
this.src = src, this.dest = dest, this.opts = opts, this.ondrain = () => src[RESUME](), this.dest.on("drain", this.ondrain);
|
|
40501
38729
|
}
|
|
40502
38730
|
unpipe() {
|
|
40503
38731
|
this.dest.removeListener("drain", this.ondrain);
|
|
@@ -40515,8 +38743,8 @@ class PipeProxyErrors extends Pipe {
|
|
|
40515
38743
|
unpipe() {
|
|
40516
38744
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
40517
38745
|
}
|
|
40518
|
-
constructor(
|
|
40519
|
-
super(
|
|
38746
|
+
constructor(src, dest, opts) {
|
|
38747
|
+
super(src, dest, opts), this.proxyErrors = (er) => dest.emit("error", er), src.on("error", this.proxyErrors);
|
|
40520
38748
|
}
|
|
40521
38749
|
}
|
|
40522
38750
|
const isObjectModeOptions = (o) => !!o.objectMode, isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== "buffer";
|
|
@@ -48238,8 +46466,8 @@ function requireMute() {
|
|
|
48238
46466
|
writable: !0,
|
|
48239
46467
|
configurable: !0
|
|
48240
46468
|
});
|
|
48241
|
-
function onPipe(
|
|
48242
|
-
this._src =
|
|
46469
|
+
function onPipe(src) {
|
|
46470
|
+
this._src = src;
|
|
48243
46471
|
}
|
|
48244
46472
|
Object.defineProperty(MuteStream.prototype, "isTTY", {
|
|
48245
46473
|
get: getIsTTY,
|
|
@@ -48299,7 +46527,7 @@ var baseUI, hasRequiredBaseUI;
|
|
|
48299
46527
|
function requireBaseUI() {
|
|
48300
46528
|
if (hasRequiredBaseUI) return baseUI;
|
|
48301
46529
|
hasRequiredBaseUI = 1;
|
|
48302
|
-
var _ = requireLodash(), MuteStream = requireMute(), readline2 = require$$2__default$
|
|
46530
|
+
var _ = requireLodash(), MuteStream = requireMute(), readline2 = require$$2__default$1.default;
|
|
48303
46531
|
class UI {
|
|
48304
46532
|
constructor(opt) {
|
|
48305
46533
|
this.rl || (this.rl = readline2.createInterface(setupReadlineOptions(opt))), this.rl.resume(), this.onForceClose = this.onForceClose.bind(this), process.on("exit", this.onForceClose), this.rl.on("SIGINT", this.onForceClose);
|
|
@@ -59776,7 +58004,7 @@ function requireInternal() {
|
|
|
59776
58004
|
this.enc = codecOptions.encodingName, this.bomAware = codecOptions.bomAware, this.enc === "base64" ? this.encoder = InternalEncoderBase64 : this.enc === "cesu8" && (this.enc = "utf8", this.encoder = InternalEncoderCesu8, Buffer2.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}" && (this.decoder = InternalDecoderCesu8, this.defaultCharUnicode = iconv.defaultCharUnicode));
|
|
59777
58005
|
}
|
|
59778
58006
|
InternalCodec.prototype.encoder = InternalEncoder, InternalCodec.prototype.decoder = InternalDecoder;
|
|
59779
|
-
var StringDecoder = require$$2__default
|
|
58007
|
+
var StringDecoder = require$$2__default.default.StringDecoder;
|
|
59780
58008
|
StringDecoder.prototype.end || (StringDecoder.prototype.end = function() {
|
|
59781
58009
|
});
|
|
59782
58010
|
function InternalDecoder(options2, codec) {
|
|
@@ -69879,7 +68107,7 @@ var hasRequiredMain;
|
|
|
69879
68107
|
function requireMain() {
|
|
69880
68108
|
if (hasRequiredMain) return main;
|
|
69881
68109
|
hasRequiredMain = 1, Object.defineProperty(main, "__esModule", { value: !0 });
|
|
69882
|
-
var chardet_1 = requireChardet(), child_process_1 = require$$1__default$
|
|
68110
|
+
var chardet_1 = requireChardet(), child_process_1 = require$$1__default$1.default, fs_1 = require$$0__default.default, iconv_lite_1 = requireLib(), tmp_1 = requireTmp(), CreateFileError_1 = requireCreateFileError();
|
|
69883
68111
|
main.CreateFileError = CreateFileError_1.CreateFileError;
|
|
69884
68112
|
var LaunchEditorError_1 = requireLaunchEditorError();
|
|
69885
68113
|
main.LaunchEditorError = LaunchEditorError_1.LaunchEditorError;
|
|
@@ -70231,11 +68459,129 @@ var cleanStackExports = requireCleanStack(), cleanStack = /* @__PURE__ */ loadEn
|
|
|
70231
68459
|
const options = { pretty: process.platform !== "win32" };
|
|
70232
68460
|
function neatStack(error2) {
|
|
70233
68461
|
if (typeof error2 == "string")
|
|
70234
|
-
return
|
|
68462
|
+
return chalk__default.default.red(cleanStack(error2, options));
|
|
70235
68463
|
if (error2 === null || typeof error2 != "object" || typeof error2.stack != "string")
|
|
70236
|
-
return
|
|
68464
|
+
return chalk__default.default.red(util$3.inspect(error2));
|
|
70237
68465
|
const title = error2.toString(), stack2 = cleanStack(error2.stack, options);
|
|
70238
|
-
return stack2.startsWith(title) ?
|
|
68466
|
+
return stack2.startsWith(title) ? chalk__default.default.red(`${title}${chalk__default.default.dim(cleanStack(error2.stack, options).slice(title.length))}`) : chalk__default.default.red(stack2);
|
|
68467
|
+
}
|
|
68468
|
+
var minimist$1, hasRequiredMinimist;
|
|
68469
|
+
function requireMinimist() {
|
|
68470
|
+
if (hasRequiredMinimist) return minimist$1;
|
|
68471
|
+
hasRequiredMinimist = 1;
|
|
68472
|
+
function hasKey2(obj, keys) {
|
|
68473
|
+
var o = obj;
|
|
68474
|
+
keys.slice(0, -1).forEach(function(key3) {
|
|
68475
|
+
o = o[key3] || {};
|
|
68476
|
+
});
|
|
68477
|
+
var key2 = keys[keys.length - 1];
|
|
68478
|
+
return key2 in o;
|
|
68479
|
+
}
|
|
68480
|
+
function isNumber2(x) {
|
|
68481
|
+
return typeof x == "number" || /^0x[0-9a-f]+$/i.test(x) ? !0 : /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
68482
|
+
}
|
|
68483
|
+
function isConstructorOrProto(obj, key2) {
|
|
68484
|
+
return key2 === "constructor" && typeof obj[key2] == "function" || key2 === "__proto__";
|
|
68485
|
+
}
|
|
68486
|
+
return minimist$1 = function(args, opts) {
|
|
68487
|
+
opts || (opts = {});
|
|
68488
|
+
var flags = {
|
|
68489
|
+
bools: {},
|
|
68490
|
+
strings: {},
|
|
68491
|
+
unknownFn: null
|
|
68492
|
+
};
|
|
68493
|
+
typeof opts.unknown == "function" && (flags.unknownFn = opts.unknown), typeof opts.boolean == "boolean" && opts.boolean ? flags.allBools = !0 : [].concat(opts.boolean).filter(Boolean).forEach(function(key3) {
|
|
68494
|
+
flags.bools[key3] = !0;
|
|
68495
|
+
});
|
|
68496
|
+
var aliases = {};
|
|
68497
|
+
function aliasIsBoolean(key3) {
|
|
68498
|
+
return aliases[key3].some(function(x) {
|
|
68499
|
+
return flags.bools[x];
|
|
68500
|
+
});
|
|
68501
|
+
}
|
|
68502
|
+
Object.keys(opts.alias || {}).forEach(function(key3) {
|
|
68503
|
+
aliases[key3] = [].concat(opts.alias[key3]), aliases[key3].forEach(function(x) {
|
|
68504
|
+
aliases[x] = [key3].concat(aliases[key3].filter(function(y) {
|
|
68505
|
+
return x !== y;
|
|
68506
|
+
}));
|
|
68507
|
+
});
|
|
68508
|
+
}), [].concat(opts.string).filter(Boolean).forEach(function(key3) {
|
|
68509
|
+
flags.strings[key3] = !0, aliases[key3] && [].concat(aliases[key3]).forEach(function(k) {
|
|
68510
|
+
flags.strings[k] = !0;
|
|
68511
|
+
});
|
|
68512
|
+
});
|
|
68513
|
+
var defaults2 = opts.default || {}, argv = { _: [] };
|
|
68514
|
+
function argDefined(key3, arg2) {
|
|
68515
|
+
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key3] || flags.bools[key3] || aliases[key3];
|
|
68516
|
+
}
|
|
68517
|
+
function setKey(obj, keys, value2) {
|
|
68518
|
+
for (var o = obj, i2 = 0; i2 < keys.length - 1; i2++) {
|
|
68519
|
+
var key3 = keys[i2];
|
|
68520
|
+
if (isConstructorOrProto(o, key3))
|
|
68521
|
+
return;
|
|
68522
|
+
o[key3] === void 0 && (o[key3] = {}), (o[key3] === Object.prototype || o[key3] === Number.prototype || o[key3] === String.prototype) && (o[key3] = {}), o[key3] === Array.prototype && (o[key3] = []), o = o[key3];
|
|
68523
|
+
}
|
|
68524
|
+
var lastKey = keys[keys.length - 1];
|
|
68525
|
+
isConstructorOrProto(o, lastKey) || ((o === Object.prototype || o === Number.prototype || o === String.prototype) && (o = {}), o === Array.prototype && (o = []), o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] == "boolean" ? o[lastKey] = value2 : Array.isArray(o[lastKey]) ? o[lastKey].push(value2) : o[lastKey] = [o[lastKey], value2]);
|
|
68526
|
+
}
|
|
68527
|
+
function setArg(key3, val, arg2) {
|
|
68528
|
+
if (!(arg2 && flags.unknownFn && !argDefined(key3, arg2) && flags.unknownFn(arg2) === !1)) {
|
|
68529
|
+
var value2 = !flags.strings[key3] && isNumber2(val) ? Number(val) : val;
|
|
68530
|
+
setKey(argv, key3.split("."), value2), (aliases[key3] || []).forEach(function(x) {
|
|
68531
|
+
setKey(argv, x.split("."), value2);
|
|
68532
|
+
});
|
|
68533
|
+
}
|
|
68534
|
+
}
|
|
68535
|
+
Object.keys(flags.bools).forEach(function(key3) {
|
|
68536
|
+
setArg(key3, defaults2[key3] === void 0 ? !1 : defaults2[key3]);
|
|
68537
|
+
});
|
|
68538
|
+
var notFlags = [];
|
|
68539
|
+
args.indexOf("--") !== -1 && (notFlags = args.slice(args.indexOf("--") + 1), args = args.slice(0, args.indexOf("--")));
|
|
68540
|
+
for (var i = 0; i < args.length; i++) {
|
|
68541
|
+
var arg = args[i], key2, next;
|
|
68542
|
+
if (/^--.+=/.test(arg)) {
|
|
68543
|
+
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
68544
|
+
key2 = m[1];
|
|
68545
|
+
var value = m[2];
|
|
68546
|
+
flags.bools[key2] && (value = value !== "false"), setArg(key2, value, arg);
|
|
68547
|
+
} else if (/^--no-.+/.test(arg))
|
|
68548
|
+
key2 = arg.match(/^--no-(.+)/)[1], setArg(key2, !1, arg);
|
|
68549
|
+
else if (/^--.+/.test(arg))
|
|
68550
|
+
key2 = arg.match(/^--(.+)/)[1], next = args[i + 1], next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key2] && !flags.allBools && (!aliases[key2] || !aliasIsBoolean(key2)) ? (setArg(key2, next, arg), i += 1) : /^(true|false)$/.test(next) ? (setArg(key2, next === "true", arg), i += 1) : setArg(key2, flags.strings[key2] ? "" : !0, arg);
|
|
68551
|
+
else if (/^-[^-]+/.test(arg)) {
|
|
68552
|
+
for (var letters = arg.slice(1, -1).split(""), broken = !1, j = 0; j < letters.length; j++) {
|
|
68553
|
+
if (next = arg.slice(j + 2), next === "-") {
|
|
68554
|
+
setArg(letters[j], next, arg);
|
|
68555
|
+
continue;
|
|
68556
|
+
}
|
|
68557
|
+
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
68558
|
+
setArg(letters[j], next.slice(1), arg), broken = !0;
|
|
68559
|
+
break;
|
|
68560
|
+
}
|
|
68561
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
68562
|
+
setArg(letters[j], next, arg), broken = !0;
|
|
68563
|
+
break;
|
|
68564
|
+
}
|
|
68565
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
68566
|
+
setArg(letters[j], arg.slice(j + 2), arg), broken = !0;
|
|
68567
|
+
break;
|
|
68568
|
+
} else
|
|
68569
|
+
setArg(letters[j], flags.strings[letters[j]] ? "" : !0, arg);
|
|
68570
|
+
}
|
|
68571
|
+
key2 = arg.slice(-1)[0], !broken && key2 !== "-" && (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key2] && (!aliases[key2] || !aliasIsBoolean(key2)) ? (setArg(key2, args[i + 1], arg), i += 1) : args[i + 1] && /^(true|false)$/.test(args[i + 1]) ? (setArg(key2, args[i + 1] === "true", arg), i += 1) : setArg(key2, flags.strings[key2] ? "" : !0, arg));
|
|
68572
|
+
} else if ((!flags.unknownFn || flags.unknownFn(arg) !== !1) && argv._.push(flags.strings._ || !isNumber2(arg) ? arg : Number(arg)), opts.stopEarly) {
|
|
68573
|
+
argv._.push.apply(argv._, args.slice(i + 1));
|
|
68574
|
+
break;
|
|
68575
|
+
}
|
|
68576
|
+
}
|
|
68577
|
+
return Object.keys(defaults2).forEach(function(k) {
|
|
68578
|
+
hasKey2(argv, k.split(".")) || (setKey(argv, k.split("."), defaults2[k]), (aliases[k] || []).forEach(function(x) {
|
|
68579
|
+
setKey(argv, x.split("."), defaults2[k]);
|
|
68580
|
+
}));
|
|
68581
|
+
}), opts["--"] ? argv["--"] = notFlags.slice() : notFlags.forEach(function(k) {
|
|
68582
|
+
argv._.push(k);
|
|
68583
|
+
}), argv;
|
|
68584
|
+
}, minimist$1;
|
|
70239
68585
|
}
|
|
70240
68586
|
var minimistExports = requireMinimist(), minimist = /* @__PURE__ */ loadEnv.getDefaultExportFromCjs(minimistExports);
|
|
70241
68587
|
function parseArguments(argv = process.argv) {
|
|
@@ -70475,7 +68821,7 @@ var termSize, hasRequiredTermSize;
|
|
|
70475
68821
|
function requireTermSize() {
|
|
70476
68822
|
if (hasRequiredTermSize) return termSize;
|
|
70477
68823
|
hasRequiredTermSize = 1;
|
|
70478
|
-
const { execFileSync } = require$$1__default$
|
|
68824
|
+
const { execFileSync } = require$$1__default$1.default, path2 = require$$0__default$1.default, exec = (command2, arguments_, shell) => execFileSync(command2, arguments_, { encoding: "utf8", shell }).trim(), create = (columns, rows) => ({
|
|
70479
68825
|
columns: parseInt(columns, 10),
|
|
70480
68826
|
rows: parseInt(rows, 10)
|
|
70481
68827
|
});
|
|
@@ -70735,7 +69081,7 @@ ${boxen(message, {
|
|
|
70735
69081
|
return getCliConfig.debug("Less than 12 hours since last check, skipping update check"), userConfig.get("cliHasUpdate") || !1;
|
|
70736
69082
|
let latestRemote;
|
|
70737
69083
|
try {
|
|
70738
|
-
getCliConfig.debug("Checking for latest remote version"), latestRemote = await
|
|
69084
|
+
getCliConfig.debug("Checking for latest remote version"), latestRemote = await getLatestVersion__default.default(name), getCliConfig.debug("Latest remote version is %s", latestRemote);
|
|
70739
69085
|
} catch (err) {
|
|
70740
69086
|
return getCliConfig.debug(`Failed to fetch latest version of ${name} from npm:
|
|
70741
69087
|
${err.stack}`), !1;
|