@plasmicapp/nextjs-app-router 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/with-plasmic-prepass.cjs.js +1979 -1770
- package/package.json +3 -3
|
@@ -334,17 +334,17 @@ var require_escape = __commonJS({
|
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
336
|
|
|
337
|
-
// ../../node_modules/shebang-regex/index.js
|
|
337
|
+
// ../../node_modules/cross-spawn/node_modules/shebang-regex/index.js
|
|
338
338
|
var require_shebang_regex = __commonJS({
|
|
339
|
-
"../../node_modules/shebang-regex/index.js"(exports, module2) {
|
|
339
|
+
"../../node_modules/cross-spawn/node_modules/shebang-regex/index.js"(exports, module2) {
|
|
340
340
|
"use strict";
|
|
341
341
|
module2.exports = /^#!(.*)/;
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
// ../../node_modules/shebang-command/index.js
|
|
345
|
+
// ../../node_modules/cross-spawn/node_modules/shebang-command/index.js
|
|
346
346
|
var require_shebang_command = __commonJS({
|
|
347
|
-
"../../node_modules/shebang-command/index.js"(exports, module2) {
|
|
347
|
+
"../../node_modules/cross-spawn/node_modules/shebang-command/index.js"(exports, module2) {
|
|
348
348
|
"use strict";
|
|
349
349
|
var shebangRegex = require_shebang_regex();
|
|
350
350
|
module2.exports = (string = "") => {
|
|
@@ -523,668 +523,1508 @@ var require_cross_spawn = __commonJS({
|
|
|
523
523
|
}
|
|
524
524
|
});
|
|
525
525
|
|
|
526
|
-
// ../../node_modules/
|
|
527
|
-
var
|
|
528
|
-
"../../node_modules/
|
|
529
|
-
"use strict";
|
|
530
|
-
module2.exports = (input) => {
|
|
531
|
-
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
532
|
-
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
533
|
-
if (input[input.length - 1] === LF) {
|
|
534
|
-
input = input.slice(0, input.length - 1);
|
|
535
|
-
}
|
|
536
|
-
if (input[input.length - 1] === CR) {
|
|
537
|
-
input = input.slice(0, input.length - 1);
|
|
538
|
-
}
|
|
539
|
-
return input;
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
// ../../node_modules/npm-run-path/node_modules/path-key/index.js
|
|
545
|
-
var require_path_key2 = __commonJS({
|
|
546
|
-
"../../node_modules/npm-run-path/node_modules/path-key/index.js"(exports, module2) {
|
|
526
|
+
// ../../node_modules/kill-port-process/dist/lib/helpers.js
|
|
527
|
+
var require_helpers = __commonJS({
|
|
528
|
+
"../../node_modules/kill-port-process/dist/lib/helpers.js"(exports) {
|
|
547
529
|
"use strict";
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
if (
|
|
552
|
-
return
|
|
530
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
531
|
+
exports.mergeOptions = exports.arrayifyInput = exports.isNullOrUndefined = void 0;
|
|
532
|
+
function isNullOrUndefined(input) {
|
|
533
|
+
if (input === void 0 || input === null) {
|
|
534
|
+
return true;
|
|
553
535
|
}
|
|
554
|
-
return
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
539
|
+
function arrayifyInput(input) {
|
|
540
|
+
return Array.isArray(input) ? input : [input];
|
|
541
|
+
}
|
|
542
|
+
exports.arrayifyInput = arrayifyInput;
|
|
543
|
+
function mergeOptions(options) {
|
|
544
|
+
const defaultOptions = {
|
|
545
|
+
signal: "SIGKILL"
|
|
546
|
+
};
|
|
547
|
+
return Object.assign(Object.assign({}, defaultOptions), options);
|
|
548
|
+
}
|
|
549
|
+
exports.mergeOptions = mergeOptions;
|
|
558
550
|
}
|
|
559
551
|
});
|
|
560
552
|
|
|
561
|
-
// ../../node_modules/
|
|
562
|
-
var
|
|
563
|
-
"../../node_modules/
|
|
564
|
-
|
|
553
|
+
// ../../node_modules/which/which.js
|
|
554
|
+
var require_which2 = __commonJS({
|
|
555
|
+
"../../node_modules/which/which.js"(exports, module2) {
|
|
556
|
+
module2.exports = which;
|
|
557
|
+
which.sync = whichSync;
|
|
558
|
+
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
565
559
|
var path = require("path");
|
|
566
|
-
var
|
|
567
|
-
var
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
560
|
+
var COLON = isWindows ? ";" : ":";
|
|
561
|
+
var isexe = require_isexe();
|
|
562
|
+
function getNotFoundError(cmd) {
|
|
563
|
+
var er = new Error("not found: " + cmd);
|
|
564
|
+
er.code = "ENOENT";
|
|
565
|
+
return er;
|
|
566
|
+
}
|
|
567
|
+
function getPathInfo(cmd, opt) {
|
|
568
|
+
var colon = opt.colon || COLON;
|
|
569
|
+
var pathEnv = opt.path || process.env.PATH || "";
|
|
570
|
+
var pathExt = [""];
|
|
571
|
+
pathEnv = pathEnv.split(colon);
|
|
572
|
+
var pathExtExe = "";
|
|
573
|
+
if (isWindows) {
|
|
574
|
+
pathEnv.unshift(process.cwd());
|
|
575
|
+
pathExtExe = opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM";
|
|
576
|
+
pathExt = pathExtExe.split(colon);
|
|
577
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
578
|
+
pathExt.unshift("");
|
|
579
|
+
}
|
|
580
|
+
if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
|
|
581
|
+
pathEnv = [""];
|
|
582
|
+
return {
|
|
583
|
+
env: pathEnv,
|
|
584
|
+
ext: pathExt,
|
|
585
|
+
extExe: pathExtExe
|
|
592
586
|
};
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
587
|
+
}
|
|
588
|
+
function which(cmd, opt, cb) {
|
|
589
|
+
if (typeof opt === "function") {
|
|
590
|
+
cb = opt;
|
|
591
|
+
opt = {};
|
|
592
|
+
}
|
|
593
|
+
var info = getPathInfo(cmd, opt);
|
|
594
|
+
var pathEnv = info.env;
|
|
595
|
+
var pathExt = info.ext;
|
|
596
|
+
var pathExtExe = info.extExe;
|
|
597
|
+
var found = [];
|
|
598
|
+
(function F(i, l) {
|
|
599
|
+
if (i === l) {
|
|
600
|
+
if (opt.all && found.length)
|
|
601
|
+
return cb(null, found);
|
|
602
|
+
else
|
|
603
|
+
return cb(getNotFoundError(cmd));
|
|
604
|
+
}
|
|
605
|
+
var pathPart = pathEnv[i];
|
|
606
|
+
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
|
|
607
|
+
pathPart = pathPart.slice(1, -1);
|
|
608
|
+
var p = path.join(pathPart, cmd);
|
|
609
|
+
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
610
|
+
p = cmd.slice(0, 2) + p;
|
|
611
|
+
}
|
|
612
|
+
;
|
|
613
|
+
(function E(ii, ll) {
|
|
614
|
+
if (ii === ll)
|
|
615
|
+
return F(i + 1, l);
|
|
616
|
+
var ext = pathExt[ii];
|
|
617
|
+
isexe(p + ext, { pathExt: pathExtExe }, function(er, is) {
|
|
618
|
+
if (!er && is) {
|
|
619
|
+
if (opt.all)
|
|
620
|
+
found.push(p + ext);
|
|
621
|
+
else
|
|
622
|
+
return cb(null, p + ext);
|
|
623
|
+
}
|
|
624
|
+
return E(ii + 1, ll);
|
|
625
|
+
});
|
|
626
|
+
})(0, pathExt.length);
|
|
627
|
+
})(0, pathEnv.length);
|
|
628
|
+
}
|
|
629
|
+
function whichSync(cmd, opt) {
|
|
630
|
+
opt = opt || {};
|
|
631
|
+
var info = getPathInfo(cmd, opt);
|
|
632
|
+
var pathEnv = info.env;
|
|
633
|
+
var pathExt = info.ext;
|
|
634
|
+
var pathExtExe = info.extExe;
|
|
635
|
+
var found = [];
|
|
636
|
+
for (var i = 0, l = pathEnv.length; i < l; i++) {
|
|
637
|
+
var pathPart = pathEnv[i];
|
|
638
|
+
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
|
|
639
|
+
pathPart = pathPart.slice(1, -1);
|
|
640
|
+
var p = path.join(pathPart, cmd);
|
|
641
|
+
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
642
|
+
p = cmd.slice(0, 2) + p;
|
|
643
|
+
}
|
|
644
|
+
for (var j = 0, ll = pathExt.length; j < ll; j++) {
|
|
645
|
+
var cur = p + pathExt[j];
|
|
646
|
+
var is;
|
|
647
|
+
try {
|
|
648
|
+
is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
649
|
+
if (is) {
|
|
650
|
+
if (opt.all)
|
|
651
|
+
found.push(cur);
|
|
652
|
+
else
|
|
653
|
+
return cur;
|
|
654
|
+
}
|
|
655
|
+
} catch (ex) {
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
if (opt.all && found.length)
|
|
660
|
+
return found;
|
|
661
|
+
if (opt.nothrow)
|
|
662
|
+
return null;
|
|
663
|
+
throw getNotFoundError(cmd);
|
|
664
|
+
}
|
|
599
665
|
}
|
|
600
666
|
});
|
|
601
667
|
|
|
602
|
-
// ../../node_modules/
|
|
603
|
-
var
|
|
604
|
-
"../../node_modules/
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
668
|
+
// ../../node_modules/pseudomap/pseudomap.js
|
|
669
|
+
var require_pseudomap = __commonJS({
|
|
670
|
+
"../../node_modules/pseudomap/pseudomap.js"(exports, module2) {
|
|
671
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
672
|
+
module2.exports = PseudoMap;
|
|
673
|
+
function PseudoMap(set2) {
|
|
674
|
+
if (!(this instanceof PseudoMap))
|
|
675
|
+
throw new TypeError("Constructor PseudoMap requires 'new'");
|
|
676
|
+
this.clear();
|
|
677
|
+
if (set2) {
|
|
678
|
+
if (set2 instanceof PseudoMap || typeof Map === "function" && set2 instanceof Map)
|
|
679
|
+
set2.forEach(function(value, key) {
|
|
680
|
+
this.set(key, value);
|
|
681
|
+
}, this);
|
|
682
|
+
else if (Array.isArray(set2))
|
|
683
|
+
set2.forEach(function(kv) {
|
|
684
|
+
this.set(kv[0], kv[1]);
|
|
685
|
+
}, this);
|
|
686
|
+
else
|
|
687
|
+
throw new TypeError("invalid argument");
|
|
609
688
|
}
|
|
610
|
-
|
|
689
|
+
}
|
|
690
|
+
PseudoMap.prototype.forEach = function(fn, thisp) {
|
|
691
|
+
thisp = thisp || this;
|
|
692
|
+
Object.keys(this._data).forEach(function(k) {
|
|
693
|
+
if (k !== "size")
|
|
694
|
+
fn.call(thisp, this._data[k].value, this._data[k].key);
|
|
695
|
+
}, this);
|
|
611
696
|
};
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
var mimicFn = require_mimic_fn();
|
|
622
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
623
|
-
var onetime = (function_, options = {}) => {
|
|
624
|
-
if (typeof function_ !== "function") {
|
|
625
|
-
throw new TypeError("Expected a function");
|
|
626
|
-
}
|
|
627
|
-
let returnValue;
|
|
628
|
-
let callCount = 0;
|
|
629
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
630
|
-
const onetime2 = function(...arguments_) {
|
|
631
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
632
|
-
if (callCount === 1) {
|
|
633
|
-
returnValue = function_.apply(this, arguments_);
|
|
634
|
-
function_ = null;
|
|
635
|
-
} else if (options.throw === true) {
|
|
636
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
637
|
-
}
|
|
638
|
-
return returnValue;
|
|
639
|
-
};
|
|
640
|
-
mimicFn(onetime2, function_);
|
|
641
|
-
calledFunctions.set(onetime2, callCount);
|
|
642
|
-
return onetime2;
|
|
697
|
+
PseudoMap.prototype.has = function(k) {
|
|
698
|
+
return !!find(this._data, k);
|
|
699
|
+
};
|
|
700
|
+
PseudoMap.prototype.get = function(k) {
|
|
701
|
+
var res = find(this._data, k);
|
|
702
|
+
return res && res.value;
|
|
703
|
+
};
|
|
704
|
+
PseudoMap.prototype.set = function(k, v) {
|
|
705
|
+
set(this._data, k, v);
|
|
643
706
|
};
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
707
|
+
PseudoMap.prototype.delete = function(k) {
|
|
708
|
+
var res = find(this._data, k);
|
|
709
|
+
if (res) {
|
|
710
|
+
delete this._data[res._index];
|
|
711
|
+
this._data.size--;
|
|
649
712
|
}
|
|
650
|
-
return calledFunctions.get(function_);
|
|
651
713
|
};
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
action: "terminate",
|
|
666
|
-
description: "Terminal closed",
|
|
667
|
-
standard: "posix"
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
name: "SIGINT",
|
|
671
|
-
number: 2,
|
|
672
|
-
action: "terminate",
|
|
673
|
-
description: "User interruption with CTRL-C",
|
|
674
|
-
standard: "ansi"
|
|
675
|
-
},
|
|
676
|
-
{
|
|
677
|
-
name: "SIGQUIT",
|
|
678
|
-
number: 3,
|
|
679
|
-
action: "core",
|
|
680
|
-
description: "User interruption with CTRL-\\",
|
|
681
|
-
standard: "posix"
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
name: "SIGILL",
|
|
685
|
-
number: 4,
|
|
686
|
-
action: "core",
|
|
687
|
-
description: "Invalid machine instruction",
|
|
688
|
-
standard: "ansi"
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
name: "SIGTRAP",
|
|
692
|
-
number: 5,
|
|
693
|
-
action: "core",
|
|
694
|
-
description: "Debugger breakpoint",
|
|
695
|
-
standard: "posix"
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
name: "SIGABRT",
|
|
699
|
-
number: 6,
|
|
700
|
-
action: "core",
|
|
701
|
-
description: "Aborted",
|
|
702
|
-
standard: "ansi"
|
|
703
|
-
},
|
|
704
|
-
{
|
|
705
|
-
name: "SIGIOT",
|
|
706
|
-
number: 6,
|
|
707
|
-
action: "core",
|
|
708
|
-
description: "Aborted",
|
|
709
|
-
standard: "bsd"
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
name: "SIGBUS",
|
|
713
|
-
number: 7,
|
|
714
|
-
action: "core",
|
|
715
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
716
|
-
standard: "bsd"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
name: "SIGEMT",
|
|
720
|
-
number: 7,
|
|
721
|
-
action: "terminate",
|
|
722
|
-
description: "Command should be emulated but is not implemented",
|
|
723
|
-
standard: "other"
|
|
724
|
-
},
|
|
725
|
-
{
|
|
726
|
-
name: "SIGFPE",
|
|
727
|
-
number: 8,
|
|
728
|
-
action: "core",
|
|
729
|
-
description: "Floating point arithmetic error",
|
|
730
|
-
standard: "ansi"
|
|
731
|
-
},
|
|
732
|
-
{
|
|
733
|
-
name: "SIGKILL",
|
|
734
|
-
number: 9,
|
|
735
|
-
action: "terminate",
|
|
736
|
-
description: "Forced termination",
|
|
737
|
-
standard: "posix",
|
|
738
|
-
forced: true
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
name: "SIGUSR1",
|
|
742
|
-
number: 10,
|
|
743
|
-
action: "terminate",
|
|
744
|
-
description: "Application-specific signal",
|
|
745
|
-
standard: "posix"
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
name: "SIGSEGV",
|
|
749
|
-
number: 11,
|
|
750
|
-
action: "core",
|
|
751
|
-
description: "Segmentation fault",
|
|
752
|
-
standard: "ansi"
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
name: "SIGUSR2",
|
|
756
|
-
number: 12,
|
|
757
|
-
action: "terminate",
|
|
758
|
-
description: "Application-specific signal",
|
|
759
|
-
standard: "posix"
|
|
760
|
-
},
|
|
761
|
-
{
|
|
762
|
-
name: "SIGPIPE",
|
|
763
|
-
number: 13,
|
|
764
|
-
action: "terminate",
|
|
765
|
-
description: "Broken pipe or socket",
|
|
766
|
-
standard: "posix"
|
|
767
|
-
},
|
|
768
|
-
{
|
|
769
|
-
name: "SIGALRM",
|
|
770
|
-
number: 14,
|
|
771
|
-
action: "terminate",
|
|
772
|
-
description: "Timeout or timer",
|
|
773
|
-
standard: "posix"
|
|
774
|
-
},
|
|
775
|
-
{
|
|
776
|
-
name: "SIGTERM",
|
|
777
|
-
number: 15,
|
|
778
|
-
action: "terminate",
|
|
779
|
-
description: "Termination",
|
|
780
|
-
standard: "ansi"
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
name: "SIGSTKFLT",
|
|
784
|
-
number: 16,
|
|
785
|
-
action: "terminate",
|
|
786
|
-
description: "Stack is empty or overflowed",
|
|
787
|
-
standard: "other"
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
name: "SIGCHLD",
|
|
791
|
-
number: 17,
|
|
792
|
-
action: "ignore",
|
|
793
|
-
description: "Child process terminated, paused or unpaused",
|
|
794
|
-
standard: "posix"
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
name: "SIGCLD",
|
|
798
|
-
number: 17,
|
|
799
|
-
action: "ignore",
|
|
800
|
-
description: "Child process terminated, paused or unpaused",
|
|
801
|
-
standard: "other"
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
name: "SIGCONT",
|
|
805
|
-
number: 18,
|
|
806
|
-
action: "unpause",
|
|
807
|
-
description: "Unpaused",
|
|
808
|
-
standard: "posix",
|
|
809
|
-
forced: true
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
name: "SIGSTOP",
|
|
813
|
-
number: 19,
|
|
814
|
-
action: "pause",
|
|
815
|
-
description: "Paused",
|
|
816
|
-
standard: "posix",
|
|
817
|
-
forced: true
|
|
818
|
-
},
|
|
819
|
-
{
|
|
820
|
-
name: "SIGTSTP",
|
|
821
|
-
number: 20,
|
|
822
|
-
action: "pause",
|
|
823
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
824
|
-
standard: "posix"
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
name: "SIGTTIN",
|
|
828
|
-
number: 21,
|
|
829
|
-
action: "pause",
|
|
830
|
-
description: "Background process cannot read terminal input",
|
|
831
|
-
standard: "posix"
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
name: "SIGBREAK",
|
|
835
|
-
number: 21,
|
|
836
|
-
action: "terminate",
|
|
837
|
-
description: "User interruption with CTRL-BREAK",
|
|
838
|
-
standard: "other"
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
name: "SIGTTOU",
|
|
842
|
-
number: 22,
|
|
843
|
-
action: "pause",
|
|
844
|
-
description: "Background process cannot write to terminal output",
|
|
845
|
-
standard: "posix"
|
|
846
|
-
},
|
|
847
|
-
{
|
|
848
|
-
name: "SIGURG",
|
|
849
|
-
number: 23,
|
|
850
|
-
action: "ignore",
|
|
851
|
-
description: "Socket received out-of-band data",
|
|
852
|
-
standard: "bsd"
|
|
853
|
-
},
|
|
854
|
-
{
|
|
855
|
-
name: "SIGXCPU",
|
|
856
|
-
number: 24,
|
|
857
|
-
action: "core",
|
|
858
|
-
description: "Process timed out",
|
|
859
|
-
standard: "bsd"
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
name: "SIGXFSZ",
|
|
863
|
-
number: 25,
|
|
864
|
-
action: "core",
|
|
865
|
-
description: "File too big",
|
|
866
|
-
standard: "bsd"
|
|
867
|
-
},
|
|
868
|
-
{
|
|
869
|
-
name: "SIGVTALRM",
|
|
870
|
-
number: 26,
|
|
871
|
-
action: "terminate",
|
|
872
|
-
description: "Timeout or timer",
|
|
873
|
-
standard: "bsd"
|
|
874
|
-
},
|
|
875
|
-
{
|
|
876
|
-
name: "SIGPROF",
|
|
877
|
-
number: 27,
|
|
878
|
-
action: "terminate",
|
|
879
|
-
description: "Timeout or timer",
|
|
880
|
-
standard: "bsd"
|
|
881
|
-
},
|
|
882
|
-
{
|
|
883
|
-
name: "SIGWINCH",
|
|
884
|
-
number: 28,
|
|
885
|
-
action: "ignore",
|
|
886
|
-
description: "Terminal window size changed",
|
|
887
|
-
standard: "bsd"
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
name: "SIGIO",
|
|
891
|
-
number: 29,
|
|
892
|
-
action: "terminate",
|
|
893
|
-
description: "I/O is available",
|
|
894
|
-
standard: "other"
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
name: "SIGPOLL",
|
|
898
|
-
number: 29,
|
|
899
|
-
action: "terminate",
|
|
900
|
-
description: "Watched event",
|
|
901
|
-
standard: "other"
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
name: "SIGINFO",
|
|
905
|
-
number: 29,
|
|
906
|
-
action: "ignore",
|
|
907
|
-
description: "Request for process information",
|
|
908
|
-
standard: "other"
|
|
909
|
-
},
|
|
910
|
-
{
|
|
911
|
-
name: "SIGPWR",
|
|
912
|
-
number: 30,
|
|
913
|
-
action: "terminate",
|
|
914
|
-
description: "Device running out of power",
|
|
915
|
-
standard: "systemv"
|
|
714
|
+
PseudoMap.prototype.clear = function() {
|
|
715
|
+
var data = /* @__PURE__ */ Object.create(null);
|
|
716
|
+
data.size = 0;
|
|
717
|
+
Object.defineProperty(this, "_data", {
|
|
718
|
+
value: data,
|
|
719
|
+
enumerable: false,
|
|
720
|
+
configurable: true,
|
|
721
|
+
writable: false
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
Object.defineProperty(PseudoMap.prototype, "size", {
|
|
725
|
+
get: function() {
|
|
726
|
+
return this._data.size;
|
|
916
727
|
},
|
|
917
|
-
{
|
|
918
|
-
name: "SIGSYS",
|
|
919
|
-
number: 31,
|
|
920
|
-
action: "core",
|
|
921
|
-
description: "Invalid system call",
|
|
922
|
-
standard: "other"
|
|
728
|
+
set: function(n) {
|
|
923
729
|
},
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
730
|
+
enumerable: true,
|
|
731
|
+
configurable: true
|
|
732
|
+
});
|
|
733
|
+
PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
|
|
734
|
+
throw new Error("iterators are not implemented in this version");
|
|
735
|
+
};
|
|
736
|
+
function same(a, b) {
|
|
737
|
+
return a === b || a !== a && b !== b;
|
|
738
|
+
}
|
|
739
|
+
function Entry(k, v, i) {
|
|
740
|
+
this.key = k;
|
|
741
|
+
this.value = v;
|
|
742
|
+
this._index = i;
|
|
743
|
+
}
|
|
744
|
+
function find(data, k) {
|
|
745
|
+
for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
|
|
746
|
+
if (same(data[key].key, k))
|
|
747
|
+
return data[key];
|
|
930
748
|
}
|
|
931
|
-
|
|
932
|
-
|
|
749
|
+
}
|
|
750
|
+
function set(data, k, v) {
|
|
751
|
+
for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
|
|
752
|
+
if (same(data[key].key, k)) {
|
|
753
|
+
data[key].value = v;
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
data.size++;
|
|
758
|
+
data[key] = new Entry(k, v, key);
|
|
759
|
+
}
|
|
933
760
|
}
|
|
934
761
|
});
|
|
935
762
|
|
|
936
|
-
// ../../node_modules/
|
|
937
|
-
var
|
|
938
|
-
"../../node_modules/
|
|
939
|
-
"
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
exports.getRealtimeSignals = getRealtimeSignals;
|
|
947
|
-
var getRealtimeSignal = function(value, index) {
|
|
948
|
-
return {
|
|
949
|
-
name: `SIGRT${index + 1}`,
|
|
950
|
-
number: SIGRTMIN + index,
|
|
951
|
-
action: "terminate",
|
|
952
|
-
description: "Application-specific signal (realtime)",
|
|
953
|
-
standard: "posix"
|
|
954
|
-
};
|
|
955
|
-
};
|
|
956
|
-
var SIGRTMIN = 34;
|
|
957
|
-
var SIGRTMAX = 64;
|
|
958
|
-
exports.SIGRTMAX = SIGRTMAX;
|
|
763
|
+
// ../../node_modules/pseudomap/map.js
|
|
764
|
+
var require_map = __commonJS({
|
|
765
|
+
"../../node_modules/pseudomap/map.js"(exports, module2) {
|
|
766
|
+
if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test")
|
|
767
|
+
process.env.TEST_PSEUDOMAP = "true";
|
|
768
|
+
if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) {
|
|
769
|
+
module2.exports = Map;
|
|
770
|
+
} else {
|
|
771
|
+
module2.exports = require_pseudomap();
|
|
772
|
+
}
|
|
959
773
|
}
|
|
960
774
|
});
|
|
961
775
|
|
|
962
|
-
// ../../node_modules/
|
|
963
|
-
var
|
|
964
|
-
"../../node_modules/
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
776
|
+
// ../../node_modules/pid-from-port/node_modules/yallist/yallist.js
|
|
777
|
+
var require_yallist = __commonJS({
|
|
778
|
+
"../../node_modules/pid-from-port/node_modules/yallist/yallist.js"(exports, module2) {
|
|
779
|
+
module2.exports = Yallist;
|
|
780
|
+
Yallist.Node = Node;
|
|
781
|
+
Yallist.create = Yallist;
|
|
782
|
+
function Yallist(list) {
|
|
783
|
+
var self = this;
|
|
784
|
+
if (!(self instanceof Yallist)) {
|
|
785
|
+
self = new Yallist();
|
|
786
|
+
}
|
|
787
|
+
self.tail = null;
|
|
788
|
+
self.head = null;
|
|
789
|
+
self.length = 0;
|
|
790
|
+
if (list && typeof list.forEach === "function") {
|
|
791
|
+
list.forEach(function(item) {
|
|
792
|
+
self.push(item);
|
|
793
|
+
});
|
|
794
|
+
} else if (arguments.length > 0) {
|
|
795
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
796
|
+
self.push(arguments[i]);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return self;
|
|
800
|
+
}
|
|
801
|
+
Yallist.prototype.removeNode = function(node) {
|
|
802
|
+
if (node.list !== this) {
|
|
803
|
+
throw new Error("removing node which does not belong to this list");
|
|
804
|
+
}
|
|
805
|
+
var next = node.next;
|
|
806
|
+
var prev = node.prev;
|
|
807
|
+
if (next) {
|
|
808
|
+
next.prev = prev;
|
|
809
|
+
}
|
|
810
|
+
if (prev) {
|
|
811
|
+
prev.next = next;
|
|
812
|
+
}
|
|
813
|
+
if (node === this.head) {
|
|
814
|
+
this.head = next;
|
|
815
|
+
}
|
|
816
|
+
if (node === this.tail) {
|
|
817
|
+
this.tail = prev;
|
|
818
|
+
}
|
|
819
|
+
node.list.length--;
|
|
820
|
+
node.next = null;
|
|
821
|
+
node.prev = null;
|
|
822
|
+
node.list = null;
|
|
975
823
|
};
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
824
|
+
Yallist.prototype.unshiftNode = function(node) {
|
|
825
|
+
if (node === this.head) {
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
if (node.list) {
|
|
829
|
+
node.list.removeNode(node);
|
|
830
|
+
}
|
|
831
|
+
var head = this.head;
|
|
832
|
+
node.list = this;
|
|
833
|
+
node.next = head;
|
|
834
|
+
if (head) {
|
|
835
|
+
head.prev = node;
|
|
836
|
+
}
|
|
837
|
+
this.head = node;
|
|
838
|
+
if (!this.tail) {
|
|
839
|
+
this.tail = node;
|
|
840
|
+
}
|
|
841
|
+
this.length++;
|
|
991
842
|
};
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
843
|
+
Yallist.prototype.pushNode = function(node) {
|
|
844
|
+
if (node === this.tail) {
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
if (node.list) {
|
|
848
|
+
node.list.removeNode(node);
|
|
849
|
+
}
|
|
850
|
+
var tail = this.tail;
|
|
851
|
+
node.list = this;
|
|
852
|
+
node.prev = tail;
|
|
853
|
+
if (tail) {
|
|
854
|
+
tail.next = node;
|
|
855
|
+
}
|
|
856
|
+
this.tail = node;
|
|
857
|
+
if (!this.head) {
|
|
858
|
+
this.head = node;
|
|
859
|
+
}
|
|
860
|
+
this.length++;
|
|
1007
861
|
};
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
862
|
+
Yallist.prototype.push = function() {
|
|
863
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
864
|
+
push(this, arguments[i]);
|
|
865
|
+
}
|
|
866
|
+
return this.length;
|
|
1013
867
|
};
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals));
|
|
1020
|
-
return Object.assign({}, ...signalsA);
|
|
868
|
+
Yallist.prototype.unshift = function() {
|
|
869
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
870
|
+
unshift(this, arguments[i]);
|
|
871
|
+
}
|
|
872
|
+
return this.length;
|
|
1021
873
|
};
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
874
|
+
Yallist.prototype.pop = function() {
|
|
875
|
+
if (!this.tail) {
|
|
876
|
+
return void 0;
|
|
877
|
+
}
|
|
878
|
+
var res = this.tail.value;
|
|
879
|
+
this.tail = this.tail.prev;
|
|
880
|
+
if (this.tail) {
|
|
881
|
+
this.tail.next = null;
|
|
882
|
+
} else {
|
|
883
|
+
this.head = null;
|
|
1026
884
|
}
|
|
1027
|
-
|
|
1028
|
-
return
|
|
1029
|
-
[number]: {
|
|
1030
|
-
name,
|
|
1031
|
-
number,
|
|
1032
|
-
description,
|
|
1033
|
-
supported,
|
|
1034
|
-
action,
|
|
1035
|
-
forced,
|
|
1036
|
-
standard
|
|
1037
|
-
}
|
|
1038
|
-
};
|
|
885
|
+
this.length--;
|
|
886
|
+
return res;
|
|
1039
887
|
};
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
888
|
+
Yallist.prototype.shift = function() {
|
|
889
|
+
if (!this.head) {
|
|
890
|
+
return void 0;
|
|
891
|
+
}
|
|
892
|
+
var res = this.head.value;
|
|
893
|
+
this.head = this.head.next;
|
|
894
|
+
if (this.head) {
|
|
895
|
+
this.head.prev = null;
|
|
896
|
+
} else {
|
|
897
|
+
this.tail = null;
|
|
1044
898
|
}
|
|
1045
|
-
|
|
899
|
+
this.length--;
|
|
900
|
+
return res;
|
|
1046
901
|
};
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
return `timed out after ${timeout2} milliseconds`;
|
|
902
|
+
Yallist.prototype.forEach = function(fn, thisp) {
|
|
903
|
+
thisp = thisp || this;
|
|
904
|
+
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
905
|
+
fn.call(thisp, walker.value, i, this);
|
|
906
|
+
walker = walker.next;
|
|
907
|
+
}
|
|
908
|
+
};
|
|
909
|
+
Yallist.prototype.forEachReverse = function(fn, thisp) {
|
|
910
|
+
thisp = thisp || this;
|
|
911
|
+
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
912
|
+
fn.call(thisp, walker.value, i, this);
|
|
913
|
+
walker = walker.prev;
|
|
1060
914
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
915
|
+
};
|
|
916
|
+
Yallist.prototype.get = function(n) {
|
|
917
|
+
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
918
|
+
walker = walker.next;
|
|
1063
919
|
}
|
|
1064
|
-
if (
|
|
1065
|
-
return
|
|
920
|
+
if (i === n && walker !== null) {
|
|
921
|
+
return walker.value;
|
|
1066
922
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
923
|
+
};
|
|
924
|
+
Yallist.prototype.getReverse = function(n) {
|
|
925
|
+
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
926
|
+
walker = walker.prev;
|
|
1069
927
|
}
|
|
1070
|
-
if (
|
|
1071
|
-
return
|
|
928
|
+
if (i === n && walker !== null) {
|
|
929
|
+
return walker.value;
|
|
1072
930
|
}
|
|
1073
|
-
return "failed";
|
|
1074
931
|
};
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
error.message = message;
|
|
932
|
+
Yallist.prototype.map = function(fn, thisp) {
|
|
933
|
+
thisp = thisp || this;
|
|
934
|
+
var res = new Yallist();
|
|
935
|
+
for (var walker = this.head; walker !== null; ) {
|
|
936
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
937
|
+
walker = walker.next;
|
|
938
|
+
}
|
|
939
|
+
return res;
|
|
940
|
+
};
|
|
941
|
+
Yallist.prototype.mapReverse = function(fn, thisp) {
|
|
942
|
+
thisp = thisp || this;
|
|
943
|
+
var res = new Yallist();
|
|
944
|
+
for (var walker = this.tail; walker !== null; ) {
|
|
945
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
946
|
+
walker = walker.prev;
|
|
947
|
+
}
|
|
948
|
+
return res;
|
|
949
|
+
};
|
|
950
|
+
Yallist.prototype.reduce = function(fn, initial) {
|
|
951
|
+
var acc;
|
|
952
|
+
var walker = this.head;
|
|
953
|
+
if (arguments.length > 1) {
|
|
954
|
+
acc = initial;
|
|
955
|
+
} else if (this.head) {
|
|
956
|
+
walker = this.head.next;
|
|
957
|
+
acc = this.head.value;
|
|
1102
958
|
} else {
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
error.signalDescription = signalDescription;
|
|
1111
|
-
error.stdout = stdout;
|
|
1112
|
-
error.stderr = stderr;
|
|
1113
|
-
if (all !== void 0) {
|
|
1114
|
-
error.all = all;
|
|
1115
|
-
}
|
|
1116
|
-
if ("bufferedData" in error) {
|
|
1117
|
-
delete error.bufferedData;
|
|
1118
|
-
}
|
|
1119
|
-
error.failed = true;
|
|
1120
|
-
error.timedOut = Boolean(timedOut);
|
|
1121
|
-
error.isCanceled = isCanceled;
|
|
1122
|
-
error.killed = killed && !timedOut;
|
|
1123
|
-
return error;
|
|
959
|
+
throw new TypeError("Reduce of empty list with no initial value");
|
|
960
|
+
}
|
|
961
|
+
for (var i = 0; walker !== null; i++) {
|
|
962
|
+
acc = fn(acc, walker.value, i);
|
|
963
|
+
walker = walker.next;
|
|
964
|
+
}
|
|
965
|
+
return acc;
|
|
1124
966
|
};
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
var normalizeStdio = (options) => {
|
|
1136
|
-
if (!options) {
|
|
1137
|
-
return;
|
|
967
|
+
Yallist.prototype.reduceReverse = function(fn, initial) {
|
|
968
|
+
var acc;
|
|
969
|
+
var walker = this.tail;
|
|
970
|
+
if (arguments.length > 1) {
|
|
971
|
+
acc = initial;
|
|
972
|
+
} else if (this.tail) {
|
|
973
|
+
walker = this.tail.prev;
|
|
974
|
+
acc = this.tail.value;
|
|
975
|
+
} else {
|
|
976
|
+
throw new TypeError("Reduce of empty list with no initial value");
|
|
1138
977
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
978
|
+
for (var i = this.length - 1; walker !== null; i--) {
|
|
979
|
+
acc = fn(acc, walker.value, i);
|
|
980
|
+
walker = walker.prev;
|
|
1142
981
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
982
|
+
return acc;
|
|
983
|
+
};
|
|
984
|
+
Yallist.prototype.toArray = function() {
|
|
985
|
+
var arr = new Array(this.length);
|
|
986
|
+
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
987
|
+
arr[i] = walker.value;
|
|
988
|
+
walker = walker.next;
|
|
1145
989
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
990
|
+
return arr;
|
|
991
|
+
};
|
|
992
|
+
Yallist.prototype.toArrayReverse = function() {
|
|
993
|
+
var arr = new Array(this.length);
|
|
994
|
+
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
995
|
+
arr[i] = walker.value;
|
|
996
|
+
walker = walker.prev;
|
|
1148
997
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
998
|
+
return arr;
|
|
999
|
+
};
|
|
1000
|
+
Yallist.prototype.slice = function(from, to) {
|
|
1001
|
+
to = to || this.length;
|
|
1002
|
+
if (to < 0) {
|
|
1003
|
+
to += this.length;
|
|
1004
|
+
}
|
|
1005
|
+
from = from || 0;
|
|
1006
|
+
if (from < 0) {
|
|
1007
|
+
from += this.length;
|
|
1008
|
+
}
|
|
1009
|
+
var ret = new Yallist();
|
|
1010
|
+
if (to < from || to < 0) {
|
|
1011
|
+
return ret;
|
|
1012
|
+
}
|
|
1013
|
+
if (from < 0) {
|
|
1014
|
+
from = 0;
|
|
1151
1015
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1016
|
+
if (to > this.length) {
|
|
1017
|
+
to = this.length;
|
|
1018
|
+
}
|
|
1019
|
+
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
1020
|
+
walker = walker.next;
|
|
1021
|
+
}
|
|
1022
|
+
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
1023
|
+
ret.push(walker.value);
|
|
1024
|
+
}
|
|
1025
|
+
return ret;
|
|
1154
1026
|
};
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
return "ipc";
|
|
1027
|
+
Yallist.prototype.sliceReverse = function(from, to) {
|
|
1028
|
+
to = to || this.length;
|
|
1029
|
+
if (to < 0) {
|
|
1030
|
+
to += this.length;
|
|
1160
1031
|
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1032
|
+
from = from || 0;
|
|
1033
|
+
if (from < 0) {
|
|
1034
|
+
from += this.length;
|
|
1163
1035
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1036
|
+
var ret = new Yallist();
|
|
1037
|
+
if (to < from || to < 0) {
|
|
1038
|
+
return ret;
|
|
1166
1039
|
}
|
|
1167
|
-
|
|
1040
|
+
if (from < 0) {
|
|
1041
|
+
from = 0;
|
|
1042
|
+
}
|
|
1043
|
+
if (to > this.length) {
|
|
1044
|
+
to = this.length;
|
|
1045
|
+
}
|
|
1046
|
+
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
1047
|
+
walker = walker.prev;
|
|
1048
|
+
}
|
|
1049
|
+
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
1050
|
+
ret.push(walker.value);
|
|
1051
|
+
}
|
|
1052
|
+
return ret;
|
|
1053
|
+
};
|
|
1054
|
+
Yallist.prototype.reverse = function() {
|
|
1055
|
+
var head = this.head;
|
|
1056
|
+
var tail = this.tail;
|
|
1057
|
+
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
1058
|
+
var p = walker.prev;
|
|
1059
|
+
walker.prev = walker.next;
|
|
1060
|
+
walker.next = p;
|
|
1061
|
+
}
|
|
1062
|
+
this.head = tail;
|
|
1063
|
+
this.tail = head;
|
|
1064
|
+
return this;
|
|
1168
1065
|
};
|
|
1066
|
+
function push(self, item) {
|
|
1067
|
+
self.tail = new Node(item, self.tail, null, self);
|
|
1068
|
+
if (!self.head) {
|
|
1069
|
+
self.head = self.tail;
|
|
1070
|
+
}
|
|
1071
|
+
self.length++;
|
|
1072
|
+
}
|
|
1073
|
+
function unshift(self, item) {
|
|
1074
|
+
self.head = new Node(item, null, self.head, self);
|
|
1075
|
+
if (!self.tail) {
|
|
1076
|
+
self.tail = self.head;
|
|
1077
|
+
}
|
|
1078
|
+
self.length++;
|
|
1079
|
+
}
|
|
1080
|
+
function Node(value, prev, next, list) {
|
|
1081
|
+
if (!(this instanceof Node)) {
|
|
1082
|
+
return new Node(value, prev, next, list);
|
|
1083
|
+
}
|
|
1084
|
+
this.list = list;
|
|
1085
|
+
this.value = value;
|
|
1086
|
+
if (prev) {
|
|
1087
|
+
prev.next = this;
|
|
1088
|
+
this.prev = prev;
|
|
1089
|
+
} else {
|
|
1090
|
+
this.prev = null;
|
|
1091
|
+
}
|
|
1092
|
+
if (next) {
|
|
1093
|
+
next.prev = this;
|
|
1094
|
+
this.next = next;
|
|
1095
|
+
} else {
|
|
1096
|
+
this.next = null;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1169
1099
|
}
|
|
1170
1100
|
});
|
|
1171
1101
|
|
|
1172
|
-
// ../../node_modules/
|
|
1173
|
-
var
|
|
1174
|
-
"../../node_modules/
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
if (
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1102
|
+
// ../../node_modules/pid-from-port/node_modules/lru-cache/index.js
|
|
1103
|
+
var require_lru_cache = __commonJS({
|
|
1104
|
+
"../../node_modules/pid-from-port/node_modules/lru-cache/index.js"(exports, module2) {
|
|
1105
|
+
"use strict";
|
|
1106
|
+
module2.exports = LRUCache;
|
|
1107
|
+
var Map2 = require_map();
|
|
1108
|
+
var util = require("util");
|
|
1109
|
+
var Yallist = require_yallist();
|
|
1110
|
+
var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1";
|
|
1111
|
+
var makeSymbol;
|
|
1112
|
+
if (hasSymbol) {
|
|
1113
|
+
makeSymbol = function(key) {
|
|
1114
|
+
return Symbol(key);
|
|
1115
|
+
};
|
|
1116
|
+
} else {
|
|
1117
|
+
makeSymbol = function(key) {
|
|
1118
|
+
return "_" + key;
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
var MAX = makeSymbol("max");
|
|
1122
|
+
var LENGTH = makeSymbol("length");
|
|
1123
|
+
var LENGTH_CALCULATOR = makeSymbol("lengthCalculator");
|
|
1124
|
+
var ALLOW_STALE = makeSymbol("allowStale");
|
|
1125
|
+
var MAX_AGE = makeSymbol("maxAge");
|
|
1126
|
+
var DISPOSE = makeSymbol("dispose");
|
|
1127
|
+
var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet");
|
|
1128
|
+
var LRU_LIST = makeSymbol("lruList");
|
|
1129
|
+
var CACHE = makeSymbol("cache");
|
|
1130
|
+
function naiveLength() {
|
|
1131
|
+
return 1;
|
|
1132
|
+
}
|
|
1133
|
+
function LRUCache(options) {
|
|
1134
|
+
if (!(this instanceof LRUCache)) {
|
|
1135
|
+
return new LRUCache(options);
|
|
1136
|
+
}
|
|
1137
|
+
if (typeof options === "number") {
|
|
1138
|
+
options = { max: options };
|
|
1139
|
+
}
|
|
1140
|
+
if (!options) {
|
|
1141
|
+
options = {};
|
|
1142
|
+
}
|
|
1143
|
+
var max = this[MAX] = options.max;
|
|
1144
|
+
if (!max || !(typeof max === "number") || max <= 0) {
|
|
1145
|
+
this[MAX] = Infinity;
|
|
1146
|
+
}
|
|
1147
|
+
var lc = options.length || naiveLength;
|
|
1148
|
+
if (typeof lc !== "function") {
|
|
1149
|
+
lc = naiveLength;
|
|
1150
|
+
}
|
|
1151
|
+
this[LENGTH_CALCULATOR] = lc;
|
|
1152
|
+
this[ALLOW_STALE] = options.stale || false;
|
|
1153
|
+
this[MAX_AGE] = options.maxAge || 0;
|
|
1154
|
+
this[DISPOSE] = options.dispose;
|
|
1155
|
+
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
1156
|
+
this.reset();
|
|
1157
|
+
}
|
|
1158
|
+
Object.defineProperty(LRUCache.prototype, "max", {
|
|
1159
|
+
set: function(mL) {
|
|
1160
|
+
if (!mL || !(typeof mL === "number") || mL <= 0) {
|
|
1161
|
+
mL = Infinity;
|
|
1162
|
+
}
|
|
1163
|
+
this[MAX] = mL;
|
|
1164
|
+
trim(this);
|
|
1165
|
+
},
|
|
1166
|
+
get: function() {
|
|
1167
|
+
return this[MAX];
|
|
1168
|
+
},
|
|
1169
|
+
enumerable: true
|
|
1170
|
+
});
|
|
1171
|
+
Object.defineProperty(LRUCache.prototype, "allowStale", {
|
|
1172
|
+
set: function(allowStale) {
|
|
1173
|
+
this[ALLOW_STALE] = !!allowStale;
|
|
1174
|
+
},
|
|
1175
|
+
get: function() {
|
|
1176
|
+
return this[ALLOW_STALE];
|
|
1177
|
+
},
|
|
1178
|
+
enumerable: true
|
|
1179
|
+
});
|
|
1180
|
+
Object.defineProperty(LRUCache.prototype, "maxAge", {
|
|
1181
|
+
set: function(mA) {
|
|
1182
|
+
if (!mA || !(typeof mA === "number") || mA < 0) {
|
|
1183
|
+
mA = 0;
|
|
1184
|
+
}
|
|
1185
|
+
this[MAX_AGE] = mA;
|
|
1186
|
+
trim(this);
|
|
1187
|
+
},
|
|
1188
|
+
get: function() {
|
|
1189
|
+
return this[MAX_AGE];
|
|
1190
|
+
},
|
|
1191
|
+
enumerable: true
|
|
1192
|
+
});
|
|
1193
|
+
Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
|
|
1194
|
+
set: function(lC) {
|
|
1195
|
+
if (typeof lC !== "function") {
|
|
1196
|
+
lC = naiveLength;
|
|
1197
|
+
}
|
|
1198
|
+
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
1199
|
+
this[LENGTH_CALCULATOR] = lC;
|
|
1200
|
+
this[LENGTH] = 0;
|
|
1201
|
+
this[LRU_LIST].forEach(function(hit) {
|
|
1202
|
+
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
1203
|
+
this[LENGTH] += hit.length;
|
|
1204
|
+
}, this);
|
|
1205
|
+
}
|
|
1206
|
+
trim(this);
|
|
1207
|
+
},
|
|
1208
|
+
get: function() {
|
|
1209
|
+
return this[LENGTH_CALCULATOR];
|
|
1210
|
+
},
|
|
1211
|
+
enumerable: true
|
|
1212
|
+
});
|
|
1213
|
+
Object.defineProperty(LRUCache.prototype, "length", {
|
|
1214
|
+
get: function() {
|
|
1215
|
+
return this[LENGTH];
|
|
1216
|
+
},
|
|
1217
|
+
enumerable: true
|
|
1218
|
+
});
|
|
1219
|
+
Object.defineProperty(LRUCache.prototype, "itemCount", {
|
|
1220
|
+
get: function() {
|
|
1221
|
+
return this[LRU_LIST].length;
|
|
1222
|
+
},
|
|
1223
|
+
enumerable: true
|
|
1224
|
+
});
|
|
1225
|
+
LRUCache.prototype.rforEach = function(fn, thisp) {
|
|
1226
|
+
thisp = thisp || this;
|
|
1227
|
+
for (var walker = this[LRU_LIST].tail; walker !== null; ) {
|
|
1228
|
+
var prev = walker.prev;
|
|
1229
|
+
forEachStep(this, fn, walker, thisp);
|
|
1230
|
+
walker = prev;
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
function forEachStep(self, fn, node, thisp) {
|
|
1234
|
+
var hit = node.value;
|
|
1235
|
+
if (isStale(self, hit)) {
|
|
1236
|
+
del(self, node);
|
|
1237
|
+
if (!self[ALLOW_STALE]) {
|
|
1238
|
+
hit = void 0;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
if (hit) {
|
|
1242
|
+
fn.call(thisp, hit.value, hit.key, self);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
LRUCache.prototype.forEach = function(fn, thisp) {
|
|
1246
|
+
thisp = thisp || this;
|
|
1247
|
+
for (var walker = this[LRU_LIST].head; walker !== null; ) {
|
|
1248
|
+
var next = walker.next;
|
|
1249
|
+
forEachStep(this, fn, walker, thisp);
|
|
1250
|
+
walker = next;
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
LRUCache.prototype.keys = function() {
|
|
1254
|
+
return this[LRU_LIST].toArray().map(function(k) {
|
|
1255
|
+
return k.key;
|
|
1256
|
+
}, this);
|
|
1257
|
+
};
|
|
1258
|
+
LRUCache.prototype.values = function() {
|
|
1259
|
+
return this[LRU_LIST].toArray().map(function(k) {
|
|
1260
|
+
return k.value;
|
|
1261
|
+
}, this);
|
|
1262
|
+
};
|
|
1263
|
+
LRUCache.prototype.reset = function() {
|
|
1264
|
+
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
|
1265
|
+
this[LRU_LIST].forEach(function(hit) {
|
|
1266
|
+
this[DISPOSE](hit.key, hit.value);
|
|
1267
|
+
}, this);
|
|
1268
|
+
}
|
|
1269
|
+
this[CACHE] = new Map2();
|
|
1270
|
+
this[LRU_LIST] = new Yallist();
|
|
1271
|
+
this[LENGTH] = 0;
|
|
1272
|
+
};
|
|
1273
|
+
LRUCache.prototype.dump = function() {
|
|
1274
|
+
return this[LRU_LIST].map(function(hit) {
|
|
1275
|
+
if (!isStale(this, hit)) {
|
|
1276
|
+
return {
|
|
1277
|
+
k: hit.key,
|
|
1278
|
+
v: hit.value,
|
|
1279
|
+
e: hit.now + (hit.maxAge || 0)
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
}, this).toArray().filter(function(h) {
|
|
1283
|
+
return h;
|
|
1284
|
+
});
|
|
1285
|
+
};
|
|
1286
|
+
LRUCache.prototype.dumpLru = function() {
|
|
1287
|
+
return this[LRU_LIST];
|
|
1288
|
+
};
|
|
1289
|
+
LRUCache.prototype.inspect = function(n, opts) {
|
|
1290
|
+
var str = "LRUCache {";
|
|
1291
|
+
var extras = false;
|
|
1292
|
+
var as = this[ALLOW_STALE];
|
|
1293
|
+
if (as) {
|
|
1294
|
+
str += "\n allowStale: true";
|
|
1295
|
+
extras = true;
|
|
1296
|
+
}
|
|
1297
|
+
var max = this[MAX];
|
|
1298
|
+
if (max && max !== Infinity) {
|
|
1299
|
+
if (extras) {
|
|
1300
|
+
str += ",";
|
|
1301
|
+
}
|
|
1302
|
+
str += "\n max: " + util.inspect(max, opts);
|
|
1303
|
+
extras = true;
|
|
1304
|
+
}
|
|
1305
|
+
var maxAge = this[MAX_AGE];
|
|
1306
|
+
if (maxAge) {
|
|
1307
|
+
if (extras) {
|
|
1308
|
+
str += ",";
|
|
1309
|
+
}
|
|
1310
|
+
str += "\n maxAge: " + util.inspect(maxAge, opts);
|
|
1311
|
+
extras = true;
|
|
1312
|
+
}
|
|
1313
|
+
var lc = this[LENGTH_CALCULATOR];
|
|
1314
|
+
if (lc && lc !== naiveLength) {
|
|
1315
|
+
if (extras) {
|
|
1316
|
+
str += ",";
|
|
1317
|
+
}
|
|
1318
|
+
str += "\n length: " + util.inspect(this[LENGTH], opts);
|
|
1319
|
+
extras = true;
|
|
1320
|
+
}
|
|
1321
|
+
var didFirst = false;
|
|
1322
|
+
this[LRU_LIST].forEach(function(item) {
|
|
1323
|
+
if (didFirst) {
|
|
1324
|
+
str += ",\n ";
|
|
1325
|
+
} else {
|
|
1326
|
+
if (extras) {
|
|
1327
|
+
str += ",\n";
|
|
1328
|
+
}
|
|
1329
|
+
didFirst = true;
|
|
1330
|
+
str += "\n ";
|
|
1331
|
+
}
|
|
1332
|
+
var key = util.inspect(item.key).split("\n").join("\n ");
|
|
1333
|
+
var val = { value: item.value };
|
|
1334
|
+
if (item.maxAge !== maxAge) {
|
|
1335
|
+
val.maxAge = item.maxAge;
|
|
1336
|
+
}
|
|
1337
|
+
if (lc !== naiveLength) {
|
|
1338
|
+
val.length = item.length;
|
|
1339
|
+
}
|
|
1340
|
+
if (isStale(this, item)) {
|
|
1341
|
+
val.stale = true;
|
|
1342
|
+
}
|
|
1343
|
+
val = util.inspect(val, opts).split("\n").join("\n ");
|
|
1344
|
+
str += key + " => " + val;
|
|
1345
|
+
});
|
|
1346
|
+
if (didFirst || extras) {
|
|
1347
|
+
str += "\n";
|
|
1348
|
+
}
|
|
1349
|
+
str += "}";
|
|
1350
|
+
return str;
|
|
1351
|
+
};
|
|
1352
|
+
LRUCache.prototype.set = function(key, value, maxAge) {
|
|
1353
|
+
maxAge = maxAge || this[MAX_AGE];
|
|
1354
|
+
var now = maxAge ? Date.now() : 0;
|
|
1355
|
+
var len = this[LENGTH_CALCULATOR](value, key);
|
|
1356
|
+
if (this[CACHE].has(key)) {
|
|
1357
|
+
if (len > this[MAX]) {
|
|
1358
|
+
del(this, this[CACHE].get(key));
|
|
1359
|
+
return false;
|
|
1360
|
+
}
|
|
1361
|
+
var node = this[CACHE].get(key);
|
|
1362
|
+
var item = node.value;
|
|
1363
|
+
if (this[DISPOSE]) {
|
|
1364
|
+
if (!this[NO_DISPOSE_ON_SET]) {
|
|
1365
|
+
this[DISPOSE](key, item.value);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
item.now = now;
|
|
1369
|
+
item.maxAge = maxAge;
|
|
1370
|
+
item.value = value;
|
|
1371
|
+
this[LENGTH] += len - item.length;
|
|
1372
|
+
item.length = len;
|
|
1373
|
+
this.get(key);
|
|
1374
|
+
trim(this);
|
|
1375
|
+
return true;
|
|
1376
|
+
}
|
|
1377
|
+
var hit = new Entry(key, value, len, now, maxAge);
|
|
1378
|
+
if (hit.length > this[MAX]) {
|
|
1379
|
+
if (this[DISPOSE]) {
|
|
1380
|
+
this[DISPOSE](key, value);
|
|
1381
|
+
}
|
|
1382
|
+
return false;
|
|
1383
|
+
}
|
|
1384
|
+
this[LENGTH] += hit.length;
|
|
1385
|
+
this[LRU_LIST].unshift(hit);
|
|
1386
|
+
this[CACHE].set(key, this[LRU_LIST].head);
|
|
1387
|
+
trim(this);
|
|
1388
|
+
return true;
|
|
1389
|
+
};
|
|
1390
|
+
LRUCache.prototype.has = function(key) {
|
|
1391
|
+
if (!this[CACHE].has(key))
|
|
1392
|
+
return false;
|
|
1393
|
+
var hit = this[CACHE].get(key).value;
|
|
1394
|
+
if (isStale(this, hit)) {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
return true;
|
|
1398
|
+
};
|
|
1399
|
+
LRUCache.prototype.get = function(key) {
|
|
1400
|
+
return get(this, key, true);
|
|
1401
|
+
};
|
|
1402
|
+
LRUCache.prototype.peek = function(key) {
|
|
1403
|
+
return get(this, key, false);
|
|
1404
|
+
};
|
|
1405
|
+
LRUCache.prototype.pop = function() {
|
|
1406
|
+
var node = this[LRU_LIST].tail;
|
|
1407
|
+
if (!node)
|
|
1408
|
+
return null;
|
|
1409
|
+
del(this, node);
|
|
1410
|
+
return node.value;
|
|
1411
|
+
};
|
|
1412
|
+
LRUCache.prototype.del = function(key) {
|
|
1413
|
+
del(this, this[CACHE].get(key));
|
|
1414
|
+
};
|
|
1415
|
+
LRUCache.prototype.load = function(arr) {
|
|
1416
|
+
this.reset();
|
|
1417
|
+
var now = Date.now();
|
|
1418
|
+
for (var l = arr.length - 1; l >= 0; l--) {
|
|
1419
|
+
var hit = arr[l];
|
|
1420
|
+
var expiresAt = hit.e || 0;
|
|
1421
|
+
if (expiresAt === 0) {
|
|
1422
|
+
this.set(hit.k, hit.v);
|
|
1423
|
+
} else {
|
|
1424
|
+
var maxAge = expiresAt - now;
|
|
1425
|
+
if (maxAge > 0) {
|
|
1426
|
+
this.set(hit.k, hit.v, maxAge);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
LRUCache.prototype.prune = function() {
|
|
1432
|
+
var self = this;
|
|
1433
|
+
this[CACHE].forEach(function(value, key) {
|
|
1434
|
+
get(self, key, false);
|
|
1435
|
+
});
|
|
1436
|
+
};
|
|
1437
|
+
function get(self, key, doUse) {
|
|
1438
|
+
var node = self[CACHE].get(key);
|
|
1439
|
+
if (node) {
|
|
1440
|
+
var hit = node.value;
|
|
1441
|
+
if (isStale(self, hit)) {
|
|
1442
|
+
del(self, node);
|
|
1443
|
+
if (!self[ALLOW_STALE])
|
|
1444
|
+
hit = void 0;
|
|
1445
|
+
} else {
|
|
1446
|
+
if (doUse) {
|
|
1447
|
+
self[LRU_LIST].unshiftNode(node);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
if (hit)
|
|
1451
|
+
hit = hit.value;
|
|
1452
|
+
}
|
|
1453
|
+
return hit;
|
|
1454
|
+
}
|
|
1455
|
+
function isStale(self, hit) {
|
|
1456
|
+
if (!hit || !hit.maxAge && !self[MAX_AGE]) {
|
|
1457
|
+
return false;
|
|
1458
|
+
}
|
|
1459
|
+
var stale = false;
|
|
1460
|
+
var diff = Date.now() - hit.now;
|
|
1461
|
+
if (hit.maxAge) {
|
|
1462
|
+
stale = diff > hit.maxAge;
|
|
1463
|
+
} else {
|
|
1464
|
+
stale = self[MAX_AGE] && diff > self[MAX_AGE];
|
|
1465
|
+
}
|
|
1466
|
+
return stale;
|
|
1467
|
+
}
|
|
1468
|
+
function trim(self) {
|
|
1469
|
+
if (self[LENGTH] > self[MAX]) {
|
|
1470
|
+
for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
|
|
1471
|
+
var prev = walker.prev;
|
|
1472
|
+
del(self, walker);
|
|
1473
|
+
walker = prev;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
function del(self, node) {
|
|
1478
|
+
if (node) {
|
|
1479
|
+
var hit = node.value;
|
|
1480
|
+
if (self[DISPOSE]) {
|
|
1481
|
+
self[DISPOSE](hit.key, hit.value);
|
|
1482
|
+
}
|
|
1483
|
+
self[LENGTH] -= hit.length;
|
|
1484
|
+
self[CACHE].delete(hit.key);
|
|
1485
|
+
self[LRU_LIST].removeNode(node);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
function Entry(key, value, length, now, maxAge) {
|
|
1489
|
+
this.key = key;
|
|
1490
|
+
this.value = value;
|
|
1491
|
+
this.length = length;
|
|
1492
|
+
this.now = now;
|
|
1493
|
+
this.maxAge = maxAge || 0;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
|
|
1498
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
1499
|
+
var require_resolveCommand2 = __commonJS({
|
|
1500
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
|
|
1501
|
+
"use strict";
|
|
1502
|
+
var path = require("path");
|
|
1503
|
+
var which = require_which2();
|
|
1504
|
+
var LRU = require_lru_cache();
|
|
1505
|
+
var commandCache = new LRU({ max: 50, maxAge: 30 * 1e3 });
|
|
1506
|
+
function resolveCommand(command2, noExtension) {
|
|
1507
|
+
var resolved;
|
|
1508
|
+
noExtension = !!noExtension;
|
|
1509
|
+
resolved = commandCache.get(command2 + "!" + noExtension);
|
|
1510
|
+
if (commandCache.has(command2)) {
|
|
1511
|
+
return commandCache.get(command2);
|
|
1512
|
+
}
|
|
1513
|
+
try {
|
|
1514
|
+
resolved = !noExtension ? which.sync(command2) : which.sync(command2, { pathExt: path.delimiter + (process.env.PATHEXT || "") });
|
|
1515
|
+
} catch (e) {
|
|
1516
|
+
}
|
|
1517
|
+
commandCache.set(command2 + "!" + noExtension, resolved);
|
|
1518
|
+
return resolved;
|
|
1519
|
+
}
|
|
1520
|
+
module2.exports = resolveCommand;
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1524
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js
|
|
1525
|
+
var require_hasEmptyArgumentBug = __commonJS({
|
|
1526
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js"(exports, module2) {
|
|
1527
|
+
"use strict";
|
|
1528
|
+
function hasEmptyArgumentBug() {
|
|
1529
|
+
var nodeVer;
|
|
1530
|
+
if (process.platform !== "win32") {
|
|
1531
|
+
return false;
|
|
1532
|
+
}
|
|
1533
|
+
nodeVer = process.version.substr(1).split(".").map(function(num) {
|
|
1534
|
+
return parseInt(num, 10);
|
|
1535
|
+
});
|
|
1536
|
+
return nodeVer[0] === 0 && nodeVer[1] < 12;
|
|
1537
|
+
}
|
|
1538
|
+
module2.exports = hasEmptyArgumentBug();
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
|
|
1542
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/escapeArgument.js
|
|
1543
|
+
var require_escapeArgument = __commonJS({
|
|
1544
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/escapeArgument.js"(exports, module2) {
|
|
1545
|
+
"use strict";
|
|
1546
|
+
function escapeArgument(arg, quote) {
|
|
1547
|
+
arg = "" + arg;
|
|
1548
|
+
if (!quote) {
|
|
1549
|
+
arg = arg.replace(/([()%!^<>&|;,"'\s])/g, "^$1");
|
|
1550
|
+
} else {
|
|
1551
|
+
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
1552
|
+
arg = arg.replace(/(\\*)$/, "$1$1");
|
|
1553
|
+
arg = '"' + arg + '"';
|
|
1554
|
+
}
|
|
1555
|
+
return arg;
|
|
1556
|
+
}
|
|
1557
|
+
module2.exports = escapeArgument;
|
|
1558
|
+
}
|
|
1559
|
+
});
|
|
1560
|
+
|
|
1561
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/escapeCommand.js
|
|
1562
|
+
var require_escapeCommand = __commonJS({
|
|
1563
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/escapeCommand.js"(exports, module2) {
|
|
1564
|
+
"use strict";
|
|
1565
|
+
var escapeArgument = require_escapeArgument();
|
|
1566
|
+
function escapeCommand(command2) {
|
|
1567
|
+
return /^[a-z0-9_-]+$/i.test(command2) ? command2 : escapeArgument(command2, true);
|
|
1568
|
+
}
|
|
1569
|
+
module2.exports = escapeCommand;
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
|
|
1573
|
+
// ../../node_modules/shebang-regex/index.js
|
|
1574
|
+
var require_shebang_regex2 = __commonJS({
|
|
1575
|
+
"../../node_modules/shebang-regex/index.js"(exports, module2) {
|
|
1576
|
+
"use strict";
|
|
1577
|
+
module2.exports = /^#!.*/;
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
|
|
1581
|
+
// ../../node_modules/shebang-command/index.js
|
|
1582
|
+
var require_shebang_command2 = __commonJS({
|
|
1583
|
+
"../../node_modules/shebang-command/index.js"(exports, module2) {
|
|
1584
|
+
"use strict";
|
|
1585
|
+
var shebangRegex = require_shebang_regex2();
|
|
1586
|
+
module2.exports = function(str) {
|
|
1587
|
+
var match = str.match(shebangRegex);
|
|
1588
|
+
if (!match) {
|
|
1589
|
+
return null;
|
|
1590
|
+
}
|
|
1591
|
+
var arr = match[0].replace(/#! ?/, "").split(" ");
|
|
1592
|
+
var bin = arr[0].split("/").pop();
|
|
1593
|
+
var arg = arr[1];
|
|
1594
|
+
return bin === "env" ? arg : bin + (arg ? " " + arg : "");
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
|
|
1599
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/readShebang.js
|
|
1600
|
+
var require_readShebang2 = __commonJS({
|
|
1601
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
|
|
1602
|
+
"use strict";
|
|
1603
|
+
var fs = require("fs");
|
|
1604
|
+
var LRU = require_lru_cache();
|
|
1605
|
+
var shebangCommand = require_shebang_command2();
|
|
1606
|
+
var shebangCache = new LRU({ max: 50, maxAge: 30 * 1e3 });
|
|
1607
|
+
function readShebang(command2) {
|
|
1608
|
+
var buffer;
|
|
1609
|
+
var fd;
|
|
1610
|
+
var shebang;
|
|
1611
|
+
if (shebangCache.has(command2)) {
|
|
1612
|
+
return shebangCache.get(command2);
|
|
1613
|
+
}
|
|
1614
|
+
buffer = new Buffer(150);
|
|
1615
|
+
try {
|
|
1616
|
+
fd = fs.openSync(command2, "r");
|
|
1617
|
+
fs.readSync(fd, buffer, 0, 150, 0);
|
|
1618
|
+
fs.closeSync(fd);
|
|
1619
|
+
} catch (e) {
|
|
1620
|
+
}
|
|
1621
|
+
shebang = shebangCommand(buffer.toString());
|
|
1622
|
+
shebangCache.set(command2, shebang);
|
|
1623
|
+
return shebang;
|
|
1624
|
+
}
|
|
1625
|
+
module2.exports = readShebang;
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
|
|
1629
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/parse.js
|
|
1630
|
+
var require_parse2 = __commonJS({
|
|
1631
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
|
|
1632
|
+
"use strict";
|
|
1633
|
+
var resolveCommand = require_resolveCommand2();
|
|
1634
|
+
var hasEmptyArgumentBug = require_hasEmptyArgumentBug();
|
|
1635
|
+
var escapeArgument = require_escapeArgument();
|
|
1636
|
+
var escapeCommand = require_escapeCommand();
|
|
1637
|
+
var readShebang = require_readShebang2();
|
|
1638
|
+
var isWin = process.platform === "win32";
|
|
1639
|
+
var skipShellRegExp = /\.(?:com|exe)$/i;
|
|
1640
|
+
var supportsShellOption = parseInt(process.version.substr(1).split(".")[0], 10) >= 6 || parseInt(process.version.substr(1).split(".")[0], 10) === 4 && parseInt(process.version.substr(1).split(".")[1], 10) >= 8;
|
|
1641
|
+
function parseNonShell(parsed) {
|
|
1642
|
+
var shebang;
|
|
1643
|
+
var needsShell;
|
|
1644
|
+
var applyQuotes;
|
|
1645
|
+
if (!isWin) {
|
|
1646
|
+
return parsed;
|
|
1647
|
+
}
|
|
1648
|
+
parsed.file = resolveCommand(parsed.command);
|
|
1649
|
+
parsed.file = parsed.file || resolveCommand(parsed.command, true);
|
|
1650
|
+
shebang = parsed.file && readShebang(parsed.file);
|
|
1651
|
+
if (shebang) {
|
|
1652
|
+
parsed.args.unshift(parsed.file);
|
|
1653
|
+
parsed.command = shebang;
|
|
1654
|
+
needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, true));
|
|
1655
|
+
} else {
|
|
1656
|
+
needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file);
|
|
1657
|
+
}
|
|
1658
|
+
if (needsShell) {
|
|
1659
|
+
applyQuotes = parsed.command !== "echo";
|
|
1660
|
+
parsed.command = escapeCommand(parsed.command);
|
|
1661
|
+
parsed.args = parsed.args.map(function(arg) {
|
|
1662
|
+
return escapeArgument(arg, applyQuotes);
|
|
1663
|
+
});
|
|
1664
|
+
parsed.args = ["/d", "/s", "/c", '"' + parsed.command + (parsed.args.length ? " " + parsed.args.join(" ") : "") + '"'];
|
|
1665
|
+
parsed.command = process.env.comspec || "cmd.exe";
|
|
1666
|
+
parsed.options.windowsVerbatimArguments = true;
|
|
1667
|
+
}
|
|
1668
|
+
return parsed;
|
|
1669
|
+
}
|
|
1670
|
+
function parseShell(parsed) {
|
|
1671
|
+
var shellCommand;
|
|
1672
|
+
if (supportsShellOption) {
|
|
1673
|
+
return parsed;
|
|
1674
|
+
}
|
|
1675
|
+
shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
1676
|
+
if (isWin) {
|
|
1677
|
+
parsed.command = typeof parsed.options.shell === "string" ? parsed.options.shell : process.env.comspec || "cmd.exe";
|
|
1678
|
+
parsed.args = ["/d", "/s", "/c", '"' + shellCommand + '"'];
|
|
1679
|
+
parsed.options.windowsVerbatimArguments = true;
|
|
1680
|
+
} else {
|
|
1681
|
+
if (typeof parsed.options.shell === "string") {
|
|
1682
|
+
parsed.command = parsed.options.shell;
|
|
1683
|
+
} else if (process.platform === "android") {
|
|
1684
|
+
parsed.command = "/system/bin/sh";
|
|
1685
|
+
} else {
|
|
1686
|
+
parsed.command = "/bin/sh";
|
|
1687
|
+
}
|
|
1688
|
+
parsed.args = ["-c", shellCommand];
|
|
1689
|
+
}
|
|
1690
|
+
return parsed;
|
|
1691
|
+
}
|
|
1692
|
+
function parse(command2, args, options) {
|
|
1693
|
+
var parsed;
|
|
1694
|
+
if (args && !Array.isArray(args)) {
|
|
1695
|
+
options = args;
|
|
1696
|
+
args = null;
|
|
1697
|
+
}
|
|
1698
|
+
args = args ? args.slice(0) : [];
|
|
1699
|
+
options = options || {};
|
|
1700
|
+
parsed = {
|
|
1701
|
+
command: command2,
|
|
1702
|
+
args,
|
|
1703
|
+
options,
|
|
1704
|
+
file: void 0,
|
|
1705
|
+
original: command2
|
|
1706
|
+
};
|
|
1707
|
+
return options.shell ? parseShell(parsed) : parseNonShell(parsed);
|
|
1708
|
+
}
|
|
1709
|
+
module2.exports = parse;
|
|
1710
|
+
}
|
|
1711
|
+
});
|
|
1712
|
+
|
|
1713
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/lib/enoent.js
|
|
1714
|
+
var require_enoent2 = __commonJS({
|
|
1715
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
|
|
1716
|
+
"use strict";
|
|
1717
|
+
var isWin = process.platform === "win32";
|
|
1718
|
+
var resolveCommand = require_resolveCommand2();
|
|
1719
|
+
var isNode10 = process.version.indexOf("v0.10.") === 0;
|
|
1720
|
+
function notFoundError(command2, syscall) {
|
|
1721
|
+
var err;
|
|
1722
|
+
err = new Error(syscall + " " + command2 + " ENOENT");
|
|
1723
|
+
err.code = err.errno = "ENOENT";
|
|
1724
|
+
err.syscall = syscall + " " + command2;
|
|
1725
|
+
return err;
|
|
1726
|
+
}
|
|
1727
|
+
function hookChildProcess(cp, parsed) {
|
|
1728
|
+
var originalEmit;
|
|
1729
|
+
if (!isWin) {
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
originalEmit = cp.emit;
|
|
1733
|
+
cp.emit = function(name, arg1) {
|
|
1734
|
+
var err;
|
|
1735
|
+
if (name === "exit") {
|
|
1736
|
+
err = verifyENOENT(arg1, parsed, "spawn");
|
|
1737
|
+
if (err) {
|
|
1738
|
+
return originalEmit.call(cp, "error", err);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
return originalEmit.apply(cp, arguments);
|
|
1742
|
+
};
|
|
1743
|
+
}
|
|
1744
|
+
function verifyENOENT(status, parsed) {
|
|
1745
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
1746
|
+
return notFoundError(parsed.original, "spawn");
|
|
1747
|
+
}
|
|
1748
|
+
return null;
|
|
1749
|
+
}
|
|
1750
|
+
function verifyENOENTSync(status, parsed) {
|
|
1751
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
1752
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
1753
|
+
}
|
|
1754
|
+
if (isNode10 && status === -1) {
|
|
1755
|
+
parsed.file = isWin ? parsed.file : resolveCommand(parsed.original);
|
|
1756
|
+
if (!parsed.file) {
|
|
1757
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
return null;
|
|
1761
|
+
}
|
|
1762
|
+
module2.exports.hookChildProcess = hookChildProcess;
|
|
1763
|
+
module2.exports.verifyENOENT = verifyENOENT;
|
|
1764
|
+
module2.exports.verifyENOENTSync = verifyENOENTSync;
|
|
1765
|
+
module2.exports.notFoundError = notFoundError;
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
|
|
1769
|
+
// ../../node_modules/pid-from-port/node_modules/cross-spawn/index.js
|
|
1770
|
+
var require_cross_spawn2 = __commonJS({
|
|
1771
|
+
"../../node_modules/pid-from-port/node_modules/cross-spawn/index.js"(exports, module2) {
|
|
1772
|
+
"use strict";
|
|
1773
|
+
var cp = require("child_process");
|
|
1774
|
+
var parse = require_parse2();
|
|
1775
|
+
var enoent = require_enoent2();
|
|
1776
|
+
var cpSpawnSync = cp.spawnSync;
|
|
1777
|
+
function spawn2(command2, args, options) {
|
|
1778
|
+
var parsed;
|
|
1779
|
+
var spawned;
|
|
1780
|
+
parsed = parse(command2, args, options);
|
|
1781
|
+
spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
1782
|
+
enoent.hookChildProcess(spawned, parsed);
|
|
1783
|
+
return spawned;
|
|
1784
|
+
}
|
|
1785
|
+
function spawnSync(command2, args, options) {
|
|
1786
|
+
var parsed;
|
|
1787
|
+
var result;
|
|
1788
|
+
if (!cpSpawnSync) {
|
|
1789
|
+
try {
|
|
1790
|
+
cpSpawnSync = require("spawn-sync");
|
|
1791
|
+
} catch (ex) {
|
|
1792
|
+
throw new Error(
|
|
1793
|
+
"In order to use spawnSync on node 0.10 or older, you must install spawn-sync:\n\n npm install spawn-sync --save"
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
parsed = parse(command2, args, options);
|
|
1798
|
+
result = cpSpawnSync(parsed.command, parsed.args, parsed.options);
|
|
1799
|
+
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
1800
|
+
return result;
|
|
1801
|
+
}
|
|
1802
|
+
module2.exports = spawn2;
|
|
1803
|
+
module2.exports.spawn = spawn2;
|
|
1804
|
+
module2.exports.sync = spawnSync;
|
|
1805
|
+
module2.exports._parse = parse;
|
|
1806
|
+
module2.exports._enoent = enoent;
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
|
|
1810
|
+
// ../../node_modules/strip-eof/index.js
|
|
1811
|
+
var require_strip_eof = __commonJS({
|
|
1812
|
+
"../../node_modules/strip-eof/index.js"(exports, module2) {
|
|
1813
|
+
"use strict";
|
|
1814
|
+
module2.exports = function(x) {
|
|
1815
|
+
var lf = typeof x === "string" ? "\n" : "\n".charCodeAt();
|
|
1816
|
+
var cr = typeof x === "string" ? "\r" : "\r".charCodeAt();
|
|
1817
|
+
if (x[x.length - 1] === lf) {
|
|
1818
|
+
x = x.slice(0, x.length - 1);
|
|
1819
|
+
}
|
|
1820
|
+
if (x[x.length - 1] === cr) {
|
|
1821
|
+
x = x.slice(0, x.length - 1);
|
|
1822
|
+
}
|
|
1823
|
+
return x;
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
});
|
|
1827
|
+
|
|
1828
|
+
// ../../node_modules/path-key/index.js
|
|
1829
|
+
var require_path_key2 = __commonJS({
|
|
1830
|
+
"../../node_modules/path-key/index.js"(exports, module2) {
|
|
1831
|
+
"use strict";
|
|
1832
|
+
module2.exports = (opts) => {
|
|
1833
|
+
opts = opts || {};
|
|
1834
|
+
const env2 = opts.env || process.env;
|
|
1835
|
+
const platform = opts.platform || process.platform;
|
|
1836
|
+
if (platform !== "win32") {
|
|
1837
|
+
return "PATH";
|
|
1838
|
+
}
|
|
1839
|
+
return Object.keys(env2).find((x) => x.toUpperCase() === "PATH") || "Path";
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
|
|
1844
|
+
// ../../node_modules/pid-from-port/node_modules/npm-run-path/index.js
|
|
1845
|
+
var require_npm_run_path = __commonJS({
|
|
1846
|
+
"../../node_modules/pid-from-port/node_modules/npm-run-path/index.js"(exports, module2) {
|
|
1847
|
+
"use strict";
|
|
1848
|
+
var path = require("path");
|
|
1849
|
+
var pathKey = require_path_key2();
|
|
1850
|
+
module2.exports = (opts) => {
|
|
1851
|
+
opts = Object.assign({
|
|
1852
|
+
cwd: process.cwd(),
|
|
1853
|
+
path: process.env[pathKey()]
|
|
1854
|
+
}, opts);
|
|
1855
|
+
let prev;
|
|
1856
|
+
let pth = path.resolve(opts.cwd);
|
|
1857
|
+
const ret = [];
|
|
1858
|
+
while (prev !== pth) {
|
|
1859
|
+
ret.push(path.join(pth, "node_modules/.bin"));
|
|
1860
|
+
prev = pth;
|
|
1861
|
+
pth = path.resolve(pth, "..");
|
|
1862
|
+
}
|
|
1863
|
+
ret.push(path.dirname(process.execPath));
|
|
1864
|
+
return ret.concat(opts.path).join(path.delimiter);
|
|
1865
|
+
};
|
|
1866
|
+
module2.exports.env = (opts) => {
|
|
1867
|
+
opts = Object.assign({
|
|
1868
|
+
env: process.env
|
|
1869
|
+
}, opts);
|
|
1870
|
+
const env2 = Object.assign({}, opts.env);
|
|
1871
|
+
const path2 = pathKey({ env: env2 });
|
|
1872
|
+
opts.path = env2[path2];
|
|
1873
|
+
env2[path2] = module2.exports(opts);
|
|
1874
|
+
return env2;
|
|
1875
|
+
};
|
|
1876
|
+
}
|
|
1877
|
+
});
|
|
1878
|
+
|
|
1879
|
+
// ../../node_modules/pid-from-port/node_modules/is-stream/index.js
|
|
1880
|
+
var require_is_stream = __commonJS({
|
|
1881
|
+
"../../node_modules/pid-from-port/node_modules/is-stream/index.js"(exports, module2) {
|
|
1882
|
+
"use strict";
|
|
1883
|
+
var isStream = module2.exports = function(stream) {
|
|
1884
|
+
return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
1885
|
+
};
|
|
1886
|
+
isStream.writable = function(stream) {
|
|
1887
|
+
return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
1888
|
+
};
|
|
1889
|
+
isStream.readable = function(stream) {
|
|
1890
|
+
return isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
|
|
1891
|
+
};
|
|
1892
|
+
isStream.duplex = function(stream) {
|
|
1893
|
+
return isStream.writable(stream) && isStream.readable(stream);
|
|
1894
|
+
};
|
|
1895
|
+
isStream.transform = function(stream) {
|
|
1896
|
+
return isStream.duplex(stream) && typeof stream._transform === "function" && typeof stream._transformState === "object";
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
|
|
1901
|
+
// ../../node_modules/pid-from-port/node_modules/get-stream/buffer-stream.js
|
|
1902
|
+
var require_buffer_stream = __commonJS({
|
|
1903
|
+
"../../node_modules/pid-from-port/node_modules/get-stream/buffer-stream.js"(exports, module2) {
|
|
1904
|
+
"use strict";
|
|
1905
|
+
var PassThrough = require("stream").PassThrough;
|
|
1906
|
+
module2.exports = (opts) => {
|
|
1907
|
+
opts = Object.assign({}, opts);
|
|
1908
|
+
const array = opts.array;
|
|
1909
|
+
let encoding = opts.encoding;
|
|
1910
|
+
const buffer = encoding === "buffer";
|
|
1911
|
+
let objectMode = false;
|
|
1912
|
+
if (array) {
|
|
1913
|
+
objectMode = !(encoding || buffer);
|
|
1914
|
+
} else {
|
|
1915
|
+
encoding = encoding || "utf8";
|
|
1916
|
+
}
|
|
1917
|
+
if (buffer) {
|
|
1918
|
+
encoding = null;
|
|
1919
|
+
}
|
|
1920
|
+
let len = 0;
|
|
1921
|
+
const ret = [];
|
|
1922
|
+
const stream = new PassThrough({ objectMode });
|
|
1923
|
+
if (encoding) {
|
|
1924
|
+
stream.setEncoding(encoding);
|
|
1925
|
+
}
|
|
1926
|
+
stream.on("data", (chunk) => {
|
|
1927
|
+
ret.push(chunk);
|
|
1928
|
+
if (objectMode) {
|
|
1929
|
+
len = ret.length;
|
|
1930
|
+
} else {
|
|
1931
|
+
len += chunk.length;
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
stream.getBufferedValue = () => {
|
|
1935
|
+
if (array) {
|
|
1936
|
+
return ret;
|
|
1937
|
+
}
|
|
1938
|
+
return buffer ? Buffer.concat(ret, len) : ret.join("");
|
|
1939
|
+
};
|
|
1940
|
+
stream.getBufferedLength = () => len;
|
|
1941
|
+
return stream;
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
|
|
1946
|
+
// ../../node_modules/pid-from-port/node_modules/get-stream/index.js
|
|
1947
|
+
var require_get_stream = __commonJS({
|
|
1948
|
+
"../../node_modules/pid-from-port/node_modules/get-stream/index.js"(exports, module2) {
|
|
1949
|
+
"use strict";
|
|
1950
|
+
var bufferStream = require_buffer_stream();
|
|
1951
|
+
function getStream(inputStream, opts) {
|
|
1952
|
+
if (!inputStream) {
|
|
1953
|
+
return Promise.reject(new Error("Expected a stream"));
|
|
1954
|
+
}
|
|
1955
|
+
opts = Object.assign({ maxBuffer: Infinity }, opts);
|
|
1956
|
+
const maxBuffer = opts.maxBuffer;
|
|
1957
|
+
let stream;
|
|
1958
|
+
let clean;
|
|
1959
|
+
const p = new Promise((resolve5, reject) => {
|
|
1960
|
+
const error = (err) => {
|
|
1961
|
+
if (err) {
|
|
1962
|
+
err.bufferedData = stream.getBufferedValue();
|
|
1963
|
+
}
|
|
1964
|
+
reject(err);
|
|
1965
|
+
};
|
|
1966
|
+
stream = bufferStream(opts);
|
|
1967
|
+
inputStream.once("error", error);
|
|
1968
|
+
inputStream.pipe(stream);
|
|
1969
|
+
stream.on("data", () => {
|
|
1970
|
+
if (stream.getBufferedLength() > maxBuffer) {
|
|
1971
|
+
reject(new Error("maxBuffer exceeded"));
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
stream.once("error", error);
|
|
1975
|
+
stream.on("end", resolve5);
|
|
1976
|
+
clean = () => {
|
|
1977
|
+
if (inputStream.unpipe) {
|
|
1978
|
+
inputStream.unpipe(stream);
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
});
|
|
1982
|
+
p.then(clean, clean);
|
|
1983
|
+
return p.then(() => stream.getBufferedValue());
|
|
1984
|
+
}
|
|
1985
|
+
module2.exports = getStream;
|
|
1986
|
+
module2.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, { encoding: "buffer" }));
|
|
1987
|
+
module2.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, { array: true }));
|
|
1988
|
+
}
|
|
1989
|
+
});
|
|
1990
|
+
|
|
1991
|
+
// ../../node_modules/p-finally/index.js
|
|
1992
|
+
var require_p_finally = __commonJS({
|
|
1993
|
+
"../../node_modules/p-finally/index.js"(exports, module2) {
|
|
1994
|
+
"use strict";
|
|
1995
|
+
module2.exports = (promise, onFinally) => {
|
|
1996
|
+
onFinally = onFinally || (() => {
|
|
1997
|
+
});
|
|
1998
|
+
return promise.then(
|
|
1999
|
+
(val) => new Promise((resolve5) => {
|
|
2000
|
+
resolve5(onFinally());
|
|
2001
|
+
}).then(() => val),
|
|
2002
|
+
(err) => new Promise((resolve5) => {
|
|
2003
|
+
resolve5(onFinally());
|
|
2004
|
+
}).then(() => {
|
|
2005
|
+
throw err;
|
|
2006
|
+
})
|
|
2007
|
+
);
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
});
|
|
2011
|
+
|
|
2012
|
+
// ../../node_modules/signal-exit/signals.js
|
|
2013
|
+
var require_signals = __commonJS({
|
|
2014
|
+
"../../node_modules/signal-exit/signals.js"(exports, module2) {
|
|
2015
|
+
module2.exports = [
|
|
2016
|
+
"SIGABRT",
|
|
2017
|
+
"SIGALRM",
|
|
2018
|
+
"SIGHUP",
|
|
2019
|
+
"SIGINT",
|
|
2020
|
+
"SIGTERM"
|
|
2021
|
+
];
|
|
2022
|
+
if (process.platform !== "win32") {
|
|
2023
|
+
module2.exports.push(
|
|
2024
|
+
"SIGVTALRM",
|
|
2025
|
+
"SIGXCPU",
|
|
2026
|
+
"SIGXFSZ",
|
|
2027
|
+
"SIGUSR2",
|
|
1188
2028
|
"SIGTRAP",
|
|
1189
2029
|
"SIGSYS",
|
|
1190
2030
|
"SIGQUIT",
|
|
@@ -1209,27 +2049,27 @@ var require_signals2 = __commonJS({
|
|
|
1209
2049
|
// ../../node_modules/signal-exit/index.js
|
|
1210
2050
|
var require_signal_exit = __commonJS({
|
|
1211
2051
|
"../../node_modules/signal-exit/index.js"(exports, module2) {
|
|
1212
|
-
var
|
|
1213
|
-
var processOk = function(
|
|
1214
|
-
return
|
|
2052
|
+
var process3 = global.process;
|
|
2053
|
+
var processOk = function(process4) {
|
|
2054
|
+
return process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
|
|
1215
2055
|
};
|
|
1216
|
-
if (!processOk(
|
|
2056
|
+
if (!processOk(process3)) {
|
|
1217
2057
|
module2.exports = function() {
|
|
1218
2058
|
return function() {
|
|
1219
2059
|
};
|
|
1220
2060
|
};
|
|
1221
2061
|
} else {
|
|
1222
2062
|
assert = require("assert");
|
|
1223
|
-
signals =
|
|
1224
|
-
isWin = /^win/i.test(
|
|
2063
|
+
signals = require_signals();
|
|
2064
|
+
isWin = /^win/i.test(process3.platform);
|
|
1225
2065
|
EE = require("events");
|
|
1226
2066
|
if (typeof EE !== "function") {
|
|
1227
2067
|
EE = EE.EventEmitter;
|
|
1228
2068
|
}
|
|
1229
|
-
if (
|
|
1230
|
-
emitter =
|
|
2069
|
+
if (process3.__signal_exit_emitter__) {
|
|
2070
|
+
emitter = process3.__signal_exit_emitter__;
|
|
1231
2071
|
} else {
|
|
1232
|
-
emitter =
|
|
2072
|
+
emitter = process3.__signal_exit_emitter__ = new EE();
|
|
1233
2073
|
emitter.count = 0;
|
|
1234
2074
|
emitter.emitted = {};
|
|
1235
2075
|
}
|
|
@@ -1266,12 +2106,12 @@ var require_signal_exit = __commonJS({
|
|
|
1266
2106
|
loaded = false;
|
|
1267
2107
|
signals.forEach(function(sig) {
|
|
1268
2108
|
try {
|
|
1269
|
-
|
|
2109
|
+
process3.removeListener(sig, sigListeners[sig]);
|
|
1270
2110
|
} catch (er) {
|
|
1271
2111
|
}
|
|
1272
2112
|
});
|
|
1273
|
-
|
|
1274
|
-
|
|
2113
|
+
process3.emit = originalProcessEmit;
|
|
2114
|
+
process3.reallyExit = originalProcessReallyExit;
|
|
1275
2115
|
emitter.count -= 1;
|
|
1276
2116
|
};
|
|
1277
2117
|
module2.exports.unload = unload;
|
|
@@ -1288,7 +2128,7 @@ var require_signal_exit = __commonJS({
|
|
|
1288
2128
|
if (!processOk(global.process)) {
|
|
1289
2129
|
return;
|
|
1290
2130
|
}
|
|
1291
|
-
var listeners =
|
|
2131
|
+
var listeners = process3.listeners(sig);
|
|
1292
2132
|
if (listeners.length === emitter.count) {
|
|
1293
2133
|
unload();
|
|
1294
2134
|
emit("exit", null, sig);
|
|
@@ -1296,7 +2136,7 @@ var require_signal_exit = __commonJS({
|
|
|
1296
2136
|
if (isWin && sig === "SIGHUP") {
|
|
1297
2137
|
sig = "SIGINT";
|
|
1298
2138
|
}
|
|
1299
|
-
|
|
2139
|
+
process3.kill(process3.pid, sig);
|
|
1300
2140
|
}
|
|
1301
2141
|
};
|
|
1302
2142
|
});
|
|
@@ -1312,36 +2152,36 @@ var require_signal_exit = __commonJS({
|
|
|
1312
2152
|
emitter.count += 1;
|
|
1313
2153
|
signals = signals.filter(function(sig) {
|
|
1314
2154
|
try {
|
|
1315
|
-
|
|
2155
|
+
process3.on(sig, sigListeners[sig]);
|
|
1316
2156
|
return true;
|
|
1317
2157
|
} catch (er) {
|
|
1318
2158
|
return false;
|
|
1319
2159
|
}
|
|
1320
2160
|
});
|
|
1321
|
-
|
|
1322
|
-
|
|
2161
|
+
process3.emit = processEmit;
|
|
2162
|
+
process3.reallyExit = processReallyExit;
|
|
1323
2163
|
};
|
|
1324
2164
|
module2.exports.load = load;
|
|
1325
|
-
originalProcessReallyExit =
|
|
2165
|
+
originalProcessReallyExit = process3.reallyExit;
|
|
1326
2166
|
processReallyExit = function processReallyExit2(code) {
|
|
1327
2167
|
if (!processOk(global.process)) {
|
|
1328
2168
|
return;
|
|
1329
2169
|
}
|
|
1330
|
-
|
|
2170
|
+
process3.exitCode = code || /* istanbul ignore next */
|
|
1331
2171
|
0;
|
|
1332
|
-
emit("exit",
|
|
1333
|
-
emit("afterexit",
|
|
1334
|
-
originalProcessReallyExit.call(
|
|
2172
|
+
emit("exit", process3.exitCode, null);
|
|
2173
|
+
emit("afterexit", process3.exitCode, null);
|
|
2174
|
+
originalProcessReallyExit.call(process3, process3.exitCode);
|
|
1335
2175
|
};
|
|
1336
|
-
originalProcessEmit =
|
|
2176
|
+
originalProcessEmit = process3.emit;
|
|
1337
2177
|
processEmit = function processEmit2(ev, arg) {
|
|
1338
2178
|
if (ev === "exit" && processOk(global.process)) {
|
|
1339
2179
|
if (arg !== void 0) {
|
|
1340
|
-
|
|
2180
|
+
process3.exitCode = arg;
|
|
1341
2181
|
}
|
|
1342
2182
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
1343
|
-
emit("exit",
|
|
1344
|
-
emit("afterexit",
|
|
2183
|
+
emit("exit", process3.exitCode, null);
|
|
2184
|
+
emit("afterexit", process3.exitCode, null);
|
|
1345
2185
|
return ret;
|
|
1346
2186
|
} else {
|
|
1347
2187
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -1365,1213 +2205,581 @@ var require_signal_exit = __commonJS({
|
|
|
1365
2205
|
}
|
|
1366
2206
|
});
|
|
1367
2207
|
|
|
1368
|
-
// ../../node_modules/execa/lib/
|
|
1369
|
-
var
|
|
1370
|
-
"../../node_modules/execa/lib/
|
|
1371
|
-
"use strict";
|
|
1372
|
-
var os3 = require("os");
|
|
1373
|
-
var onExit = require_signal_exit();
|
|
1374
|
-
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
1375
|
-
var spawnedKill = (kill2, signal = "SIGTERM", options = {}) => {
|
|
1376
|
-
const killResult = kill2(signal);
|
|
1377
|
-
setKillTimeout(kill2, signal, options, killResult);
|
|
1378
|
-
return killResult;
|
|
1379
|
-
};
|
|
1380
|
-
var setKillTimeout = (kill2, signal, options, killResult) => {
|
|
1381
|
-
if (!shouldForceKill(signal, options, killResult)) {
|
|
1382
|
-
return;
|
|
1383
|
-
}
|
|
1384
|
-
const timeout2 = getForceKillAfterTimeout(options);
|
|
1385
|
-
const t = setTimeout(() => {
|
|
1386
|
-
kill2("SIGKILL");
|
|
1387
|
-
}, timeout2);
|
|
1388
|
-
if (t.unref) {
|
|
1389
|
-
t.unref();
|
|
1390
|
-
}
|
|
1391
|
-
};
|
|
1392
|
-
var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => {
|
|
1393
|
-
return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
1394
|
-
};
|
|
1395
|
-
var isSigterm = (signal) => {
|
|
1396
|
-
return signal === os3.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
1397
|
-
};
|
|
1398
|
-
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
1399
|
-
if (forceKillAfterTimeout === true) {
|
|
1400
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
1401
|
-
}
|
|
1402
|
-
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
1403
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
1404
|
-
}
|
|
1405
|
-
return forceKillAfterTimeout;
|
|
1406
|
-
};
|
|
1407
|
-
var spawnedCancel = (spawned, context) => {
|
|
1408
|
-
const killResult = spawned.kill();
|
|
1409
|
-
if (killResult) {
|
|
1410
|
-
context.isCanceled = true;
|
|
1411
|
-
}
|
|
1412
|
-
};
|
|
1413
|
-
var timeoutKill = (spawned, signal, reject) => {
|
|
1414
|
-
spawned.kill(signal);
|
|
1415
|
-
reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
|
|
1416
|
-
};
|
|
1417
|
-
var setupTimeout = (spawned, { timeout: timeout2, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
1418
|
-
if (timeout2 === 0 || timeout2 === void 0) {
|
|
1419
|
-
return spawnedPromise;
|
|
1420
|
-
}
|
|
1421
|
-
let timeoutId;
|
|
1422
|
-
const timeoutPromise = new Promise((resolve5, reject) => {
|
|
1423
|
-
timeoutId = setTimeout(() => {
|
|
1424
|
-
timeoutKill(spawned, killSignal, reject);
|
|
1425
|
-
}, timeout2);
|
|
1426
|
-
});
|
|
1427
|
-
const safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
1428
|
-
clearTimeout(timeoutId);
|
|
1429
|
-
});
|
|
1430
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
1431
|
-
};
|
|
1432
|
-
var validateTimeout = ({ timeout: timeout2 }) => {
|
|
1433
|
-
if (timeout2 !== void 0 && (!Number.isFinite(timeout2) || timeout2 < 0)) {
|
|
1434
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout2}\` (${typeof timeout2})`);
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
1438
|
-
if (!cleanup || detached) {
|
|
1439
|
-
return timedPromise;
|
|
1440
|
-
}
|
|
1441
|
-
const removeExitHandler = onExit(() => {
|
|
1442
|
-
spawned.kill();
|
|
1443
|
-
});
|
|
1444
|
-
return timedPromise.finally(() => {
|
|
1445
|
-
removeExitHandler();
|
|
1446
|
-
});
|
|
1447
|
-
};
|
|
1448
|
-
module2.exports = {
|
|
1449
|
-
spawnedKill,
|
|
1450
|
-
spawnedCancel,
|
|
1451
|
-
setupTimeout,
|
|
1452
|
-
validateTimeout,
|
|
1453
|
-
setExitHandler
|
|
1454
|
-
};
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
|
|
1458
|
-
// ../../node_modules/is-stream/index.js
|
|
1459
|
-
var require_is_stream = __commonJS({
|
|
1460
|
-
"../../node_modules/is-stream/index.js"(exports, module2) {
|
|
1461
|
-
"use strict";
|
|
1462
|
-
var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
1463
|
-
isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
1464
|
-
isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
|
|
1465
|
-
isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream);
|
|
1466
|
-
isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function";
|
|
1467
|
-
module2.exports = isStream;
|
|
1468
|
-
}
|
|
1469
|
-
});
|
|
1470
|
-
|
|
1471
|
-
// ../../node_modules/get-stream/buffer-stream.js
|
|
1472
|
-
var require_buffer_stream = __commonJS({
|
|
1473
|
-
"../../node_modules/get-stream/buffer-stream.js"(exports, module2) {
|
|
1474
|
-
"use strict";
|
|
1475
|
-
var { PassThrough: PassThroughStream } = require("stream");
|
|
1476
|
-
module2.exports = (options) => {
|
|
1477
|
-
options = { ...options };
|
|
1478
|
-
const { array } = options;
|
|
1479
|
-
let { encoding } = options;
|
|
1480
|
-
const isBuffer = encoding === "buffer";
|
|
1481
|
-
let objectMode = false;
|
|
1482
|
-
if (array) {
|
|
1483
|
-
objectMode = !(encoding || isBuffer);
|
|
1484
|
-
} else {
|
|
1485
|
-
encoding = encoding || "utf8";
|
|
1486
|
-
}
|
|
1487
|
-
if (isBuffer) {
|
|
1488
|
-
encoding = null;
|
|
1489
|
-
}
|
|
1490
|
-
const stream = new PassThroughStream({ objectMode });
|
|
1491
|
-
if (encoding) {
|
|
1492
|
-
stream.setEncoding(encoding);
|
|
1493
|
-
}
|
|
1494
|
-
let length = 0;
|
|
1495
|
-
const chunks = [];
|
|
1496
|
-
stream.on("data", (chunk) => {
|
|
1497
|
-
chunks.push(chunk);
|
|
1498
|
-
if (objectMode) {
|
|
1499
|
-
length = chunks.length;
|
|
1500
|
-
} else {
|
|
1501
|
-
length += chunk.length;
|
|
1502
|
-
}
|
|
1503
|
-
});
|
|
1504
|
-
stream.getBufferedValue = () => {
|
|
1505
|
-
if (array) {
|
|
1506
|
-
return chunks;
|
|
1507
|
-
}
|
|
1508
|
-
return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
|
|
1509
|
-
};
|
|
1510
|
-
stream.getBufferedLength = () => length;
|
|
1511
|
-
return stream;
|
|
1512
|
-
};
|
|
1513
|
-
}
|
|
1514
|
-
});
|
|
1515
|
-
|
|
1516
|
-
// ../../node_modules/get-stream/index.js
|
|
1517
|
-
var require_get_stream = __commonJS({
|
|
1518
|
-
"../../node_modules/get-stream/index.js"(exports, module2) {
|
|
2208
|
+
// ../../node_modules/pid-from-port/node_modules/execa/lib/errname.js
|
|
2209
|
+
var require_errname = __commonJS({
|
|
2210
|
+
"../../node_modules/pid-from-port/node_modules/execa/lib/errname.js"(exports, module2) {
|
|
1519
2211
|
"use strict";
|
|
1520
|
-
var
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
var MaxBufferError = class extends Error {
|
|
1526
|
-
constructor() {
|
|
1527
|
-
super("maxBuffer exceeded");
|
|
1528
|
-
this.name = "MaxBufferError";
|
|
1529
|
-
}
|
|
1530
|
-
};
|
|
1531
|
-
async function getStream(inputStream, options) {
|
|
1532
|
-
if (!inputStream) {
|
|
1533
|
-
throw new Error("Expected a stream");
|
|
2212
|
+
var uv;
|
|
2213
|
+
try {
|
|
2214
|
+
uv = process.binding("uv");
|
|
2215
|
+
if (typeof uv.errname !== "function") {
|
|
2216
|
+
throw new TypeError("uv.errname is not a function");
|
|
1534
2217
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
};
|
|
1539
|
-
const { maxBuffer } = options;
|
|
1540
|
-
const stream2 = bufferStream(options);
|
|
1541
|
-
await new Promise((resolve5, reject) => {
|
|
1542
|
-
const rejectPromise = (error) => {
|
|
1543
|
-
if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
1544
|
-
error.bufferedData = stream2.getBufferedValue();
|
|
1545
|
-
}
|
|
1546
|
-
reject(error);
|
|
1547
|
-
};
|
|
1548
|
-
(async () => {
|
|
1549
|
-
try {
|
|
1550
|
-
await streamPipelinePromisified(inputStream, stream2);
|
|
1551
|
-
resolve5();
|
|
1552
|
-
} catch (error) {
|
|
1553
|
-
rejectPromise(error);
|
|
1554
|
-
}
|
|
1555
|
-
})();
|
|
1556
|
-
stream2.on("data", () => {
|
|
1557
|
-
if (stream2.getBufferedLength() > maxBuffer) {
|
|
1558
|
-
rejectPromise(new MaxBufferError());
|
|
1559
|
-
}
|
|
1560
|
-
});
|
|
1561
|
-
});
|
|
1562
|
-
return stream2.getBufferedValue();
|
|
2218
|
+
} catch (err) {
|
|
2219
|
+
console.error("execa/lib/errname: unable to establish process.binding('uv')", err);
|
|
2220
|
+
uv = null;
|
|
1563
2221
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
module2.exports.MaxBufferError = MaxBufferError;
|
|
1568
|
-
}
|
|
1569
|
-
});
|
|
1570
|
-
|
|
1571
|
-
// ../../node_modules/merge-stream/index.js
|
|
1572
|
-
var require_merge_stream = __commonJS({
|
|
1573
|
-
"../../node_modules/merge-stream/index.js"(exports, module2) {
|
|
1574
|
-
"use strict";
|
|
1575
|
-
var { PassThrough } = require("stream");
|
|
1576
|
-
module2.exports = function() {
|
|
1577
|
-
var sources = [];
|
|
1578
|
-
var output = new PassThrough({ objectMode: true });
|
|
1579
|
-
output.setMaxListeners(0);
|
|
1580
|
-
output.add = add;
|
|
1581
|
-
output.isEmpty = isEmpty;
|
|
1582
|
-
output.on("unpipe", remove);
|
|
1583
|
-
Array.prototype.slice.call(arguments).forEach(add);
|
|
1584
|
-
return output;
|
|
1585
|
-
function add(source) {
|
|
1586
|
-
if (Array.isArray(source)) {
|
|
1587
|
-
source.forEach(add);
|
|
1588
|
-
return this;
|
|
1589
|
-
}
|
|
1590
|
-
sources.push(source);
|
|
1591
|
-
source.once("end", remove.bind(null, source));
|
|
1592
|
-
source.once("error", output.emit.bind(output, "error"));
|
|
1593
|
-
source.pipe(output, { end: false });
|
|
1594
|
-
return this;
|
|
1595
|
-
}
|
|
1596
|
-
function isEmpty() {
|
|
1597
|
-
return sources.length == 0;
|
|
2222
|
+
function errname(uv2, code) {
|
|
2223
|
+
if (uv2) {
|
|
2224
|
+
return uv2.errname(code);
|
|
1598
2225
|
}
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
return it !== source;
|
|
1602
|
-
});
|
|
1603
|
-
if (!sources.length && output.readable) {
|
|
1604
|
-
output.end();
|
|
1605
|
-
}
|
|
2226
|
+
if (!(code < 0)) {
|
|
2227
|
+
throw new Error("err >= 0");
|
|
1606
2228
|
}
|
|
1607
|
-
|
|
2229
|
+
return `Unknown system error ${code}`;
|
|
2230
|
+
}
|
|
2231
|
+
module2.exports = (code) => errname(uv, code);
|
|
2232
|
+
module2.exports.__test__ = errname;
|
|
1608
2233
|
}
|
|
1609
2234
|
});
|
|
1610
2235
|
|
|
1611
|
-
// ../../node_modules/execa/lib/
|
|
1612
|
-
var
|
|
1613
|
-
"../../node_modules/execa/lib/
|
|
2236
|
+
// ../../node_modules/pid-from-port/node_modules/execa/lib/stdio.js
|
|
2237
|
+
var require_stdio = __commonJS({
|
|
2238
|
+
"../../node_modules/pid-from-port/node_modules/execa/lib/stdio.js"(exports, module2) {
|
|
1614
2239
|
"use strict";
|
|
1615
|
-
var
|
|
1616
|
-
var
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
return;
|
|
1621
|
-
}
|
|
1622
|
-
if (isStream(input)) {
|
|
1623
|
-
input.pipe(spawned.stdin);
|
|
1624
|
-
} else {
|
|
1625
|
-
spawned.stdin.end(input);
|
|
1626
|
-
}
|
|
1627
|
-
};
|
|
1628
|
-
var makeAllStream = (spawned, { all }) => {
|
|
1629
|
-
if (!all || !spawned.stdout && !spawned.stderr) {
|
|
1630
|
-
return;
|
|
1631
|
-
}
|
|
1632
|
-
const mixed = mergeStream();
|
|
1633
|
-
if (spawned.stdout) {
|
|
1634
|
-
mixed.add(spawned.stdout);
|
|
1635
|
-
}
|
|
1636
|
-
if (spawned.stderr) {
|
|
1637
|
-
mixed.add(spawned.stderr);
|
|
1638
|
-
}
|
|
1639
|
-
return mixed;
|
|
1640
|
-
};
|
|
1641
|
-
var getBufferedData = async (stream, streamPromise) => {
|
|
1642
|
-
if (!stream) {
|
|
1643
|
-
return;
|
|
1644
|
-
}
|
|
1645
|
-
stream.destroy();
|
|
1646
|
-
try {
|
|
1647
|
-
return await streamPromise;
|
|
1648
|
-
} catch (error) {
|
|
1649
|
-
return error.bufferedData;
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
1653
|
-
if (!stream || !buffer) {
|
|
1654
|
-
return;
|
|
1655
|
-
}
|
|
1656
|
-
if (encoding) {
|
|
1657
|
-
return getStream(stream, { encoding, maxBuffer });
|
|
1658
|
-
}
|
|
1659
|
-
return getStream.buffer(stream, { maxBuffer });
|
|
1660
|
-
};
|
|
1661
|
-
var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
1662
|
-
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
1663
|
-
const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
|
|
1664
|
-
const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
1665
|
-
try {
|
|
1666
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
1667
|
-
} catch (error) {
|
|
1668
|
-
return Promise.all([
|
|
1669
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
1670
|
-
getBufferedData(stdout, stdoutPromise),
|
|
1671
|
-
getBufferedData(stderr, stderrPromise),
|
|
1672
|
-
getBufferedData(all, allPromise)
|
|
1673
|
-
]);
|
|
1674
|
-
}
|
|
1675
|
-
};
|
|
1676
|
-
var validateInputSync = ({ input }) => {
|
|
1677
|
-
if (isStream(input)) {
|
|
1678
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
2240
|
+
var alias = ["stdin", "stdout", "stderr"];
|
|
2241
|
+
var hasAlias = (opts) => alias.some((x) => Boolean(opts[x]));
|
|
2242
|
+
module2.exports = (opts) => {
|
|
2243
|
+
if (!opts) {
|
|
2244
|
+
return null;
|
|
1679
2245
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
handleInput,
|
|
1683
|
-
makeAllStream,
|
|
1684
|
-
getSpawnedResult,
|
|
1685
|
-
validateInputSync
|
|
1686
|
-
};
|
|
1687
|
-
}
|
|
1688
|
-
});
|
|
1689
|
-
|
|
1690
|
-
// ../../node_modules/execa/lib/promise.js
|
|
1691
|
-
var require_promise = __commonJS({
|
|
1692
|
-
"../../node_modules/execa/lib/promise.js"(exports, module2) {
|
|
1693
|
-
"use strict";
|
|
1694
|
-
var nativePromisePrototype = (async () => {
|
|
1695
|
-
})().constructor.prototype;
|
|
1696
|
-
var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
1697
|
-
property,
|
|
1698
|
-
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
1699
|
-
]);
|
|
1700
|
-
var mergePromise = (spawned, promise) => {
|
|
1701
|
-
for (const [property, descriptor] of descriptors) {
|
|
1702
|
-
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
1703
|
-
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
2246
|
+
if (opts.stdio && hasAlias(opts)) {
|
|
2247
|
+
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map((x) => `\`${x}\``).join(", ")}`);
|
|
1704
2248
|
}
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
var getSpawnedPromise = (spawned) => {
|
|
1708
|
-
return new Promise((resolve5, reject) => {
|
|
1709
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
1710
|
-
resolve5({ exitCode, signal });
|
|
1711
|
-
});
|
|
1712
|
-
spawned.on("error", (error) => {
|
|
1713
|
-
reject(error);
|
|
1714
|
-
});
|
|
1715
|
-
if (spawned.stdin) {
|
|
1716
|
-
spawned.stdin.on("error", (error) => {
|
|
1717
|
-
reject(error);
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
});
|
|
1721
|
-
};
|
|
1722
|
-
module2.exports = {
|
|
1723
|
-
mergePromise,
|
|
1724
|
-
getSpawnedPromise
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
});
|
|
1728
|
-
|
|
1729
|
-
// ../../node_modules/execa/lib/command.js
|
|
1730
|
-
var require_command = __commonJS({
|
|
1731
|
-
"../../node_modules/execa/lib/command.js"(exports, module2) {
|
|
1732
|
-
"use strict";
|
|
1733
|
-
var normalizeArgs = (file, args = []) => {
|
|
1734
|
-
if (!Array.isArray(args)) {
|
|
1735
|
-
return [file];
|
|
2249
|
+
if (typeof opts.stdio === "string") {
|
|
2250
|
+
return opts.stdio;
|
|
1736
2251
|
}
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
var DOUBLE_QUOTES_REGEXP = /"/g;
|
|
1741
|
-
var escapeArg = (arg) => {
|
|
1742
|
-
if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
|
|
1743
|
-
return arg;
|
|
2252
|
+
const stdio = opts.stdio || [];
|
|
2253
|
+
if (!Array.isArray(stdio)) {
|
|
2254
|
+
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
1744
2255
|
}
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
var SPACES_REGEXP = / +/g;
|
|
1754
|
-
var parseCommand2 = (command2) => {
|
|
1755
|
-
const tokens = [];
|
|
1756
|
-
for (const token of command2.trim().split(SPACES_REGEXP)) {
|
|
1757
|
-
const previousToken = tokens[tokens.length - 1];
|
|
1758
|
-
if (previousToken && previousToken.endsWith("\\")) {
|
|
1759
|
-
tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
|
|
1760
|
-
} else {
|
|
1761
|
-
tokens.push(token);
|
|
2256
|
+
const result = [];
|
|
2257
|
+
const len = Math.max(stdio.length, alias.length);
|
|
2258
|
+
for (let i = 0; i < len; i++) {
|
|
2259
|
+
let value = null;
|
|
2260
|
+
if (stdio[i] !== void 0) {
|
|
2261
|
+
value = stdio[i];
|
|
2262
|
+
} else if (opts[alias[i]] !== void 0) {
|
|
2263
|
+
value = opts[alias[i]];
|
|
1762
2264
|
}
|
|
2265
|
+
result[i] = value;
|
|
1763
2266
|
}
|
|
1764
|
-
return
|
|
1765
|
-
};
|
|
1766
|
-
module2.exports = {
|
|
1767
|
-
joinCommand,
|
|
1768
|
-
getEscapedCommand,
|
|
1769
|
-
parseCommand: parseCommand2
|
|
2267
|
+
return result;
|
|
1770
2268
|
};
|
|
1771
2269
|
}
|
|
1772
2270
|
});
|
|
1773
2271
|
|
|
1774
|
-
// ../../node_modules/execa/index.js
|
|
2272
|
+
// ../../node_modules/pid-from-port/node_modules/execa/index.js
|
|
1775
2273
|
var require_execa = __commonJS({
|
|
1776
|
-
"../../node_modules/execa/index.js"(exports, module2) {
|
|
2274
|
+
"../../node_modules/pid-from-port/node_modules/execa/index.js"(exports, module2) {
|
|
1777
2275
|
"use strict";
|
|
1778
2276
|
var path = require("path");
|
|
1779
2277
|
var childProcess = require("child_process");
|
|
1780
|
-
var
|
|
1781
|
-
var
|
|
2278
|
+
var util = require("util");
|
|
2279
|
+
var crossSpawn = require_cross_spawn2();
|
|
2280
|
+
var stripEof = require_strip_eof();
|
|
1782
2281
|
var npmRunPath = require_npm_run_path();
|
|
1783
|
-
var
|
|
1784
|
-
var
|
|
1785
|
-
var
|
|
1786
|
-
var
|
|
1787
|
-
var
|
|
1788
|
-
var
|
|
1789
|
-
var
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
if (preferLocal) {
|
|
1794
|
-
return npmRunPath.env({ env: env2, cwd: localDir, execPath });
|
|
1795
|
-
}
|
|
1796
|
-
return env2;
|
|
1797
|
-
};
|
|
1798
|
-
var handleArguments = (file, args, options = {}) => {
|
|
1799
|
-
const parsed = crossSpawn._parse(file, args, options);
|
|
1800
|
-
file = parsed.command;
|
|
1801
|
-
args = parsed.args;
|
|
1802
|
-
options = parsed.options;
|
|
1803
|
-
options = {
|
|
1804
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
1805
|
-
buffer: true,
|
|
1806
|
-
stripFinalNewline: true,
|
|
2282
|
+
var isStream = require_is_stream();
|
|
2283
|
+
var _getStream = require_get_stream();
|
|
2284
|
+
var pFinally = require_p_finally();
|
|
2285
|
+
var onExit = require_signal_exit();
|
|
2286
|
+
var errname = require_errname();
|
|
2287
|
+
var stdio = require_stdio();
|
|
2288
|
+
var TEN_MEGABYTES = 1e3 * 1e3 * 10;
|
|
2289
|
+
function handleArgs(cmd, args, opts) {
|
|
2290
|
+
let parsed;
|
|
2291
|
+
opts = Object.assign({
|
|
1807
2292
|
extendEnv: true,
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
2293
|
+
env: {}
|
|
2294
|
+
}, opts);
|
|
2295
|
+
if (opts.extendEnv) {
|
|
2296
|
+
opts.env = Object.assign({}, process.env, opts.env);
|
|
2297
|
+
}
|
|
2298
|
+
if (opts.__winShell === true) {
|
|
2299
|
+
delete opts.__winShell;
|
|
2300
|
+
parsed = {
|
|
2301
|
+
command: cmd,
|
|
2302
|
+
args,
|
|
2303
|
+
options: opts,
|
|
2304
|
+
file: cmd,
|
|
2305
|
+
original: cmd
|
|
2306
|
+
};
|
|
2307
|
+
} else {
|
|
2308
|
+
parsed = crossSpawn._parse(cmd, args, opts);
|
|
2309
|
+
}
|
|
2310
|
+
opts = Object.assign({
|
|
2311
|
+
maxBuffer: TEN_MEGABYTES,
|
|
2312
|
+
stripEof: true,
|
|
2313
|
+
preferLocal: true,
|
|
2314
|
+
localDir: parsed.options.cwd || process.cwd(),
|
|
1811
2315
|
encoding: "utf8",
|
|
1812
2316
|
reject: true,
|
|
1813
|
-
cleanup: true
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
2317
|
+
cleanup: true
|
|
2318
|
+
}, parsed.options);
|
|
2319
|
+
opts.stdio = stdio(opts);
|
|
2320
|
+
if (opts.preferLocal) {
|
|
2321
|
+
opts.env = npmRunPath.env(Object.assign({}, opts, { cwd: opts.localDir }));
|
|
2322
|
+
}
|
|
2323
|
+
if (opts.detached) {
|
|
2324
|
+
opts.cleanup = false;
|
|
2325
|
+
}
|
|
2326
|
+
if (process.platform === "win32" && path.basename(parsed.command) === "cmd.exe") {
|
|
2327
|
+
parsed.args.unshift("/q");
|
|
2328
|
+
}
|
|
2329
|
+
return {
|
|
2330
|
+
cmd: parsed.command,
|
|
2331
|
+
args: parsed.args,
|
|
2332
|
+
opts,
|
|
2333
|
+
parsed
|
|
1817
2334
|
};
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
2335
|
+
}
|
|
2336
|
+
function handleInput(spawned, opts) {
|
|
2337
|
+
const input = opts.input;
|
|
2338
|
+
if (input === null || input === void 0) {
|
|
2339
|
+
return;
|
|
1822
2340
|
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
return error === void 0 ? void 0 : "";
|
|
2341
|
+
if (isStream(input)) {
|
|
2342
|
+
input.pipe(spawned.stdin);
|
|
2343
|
+
} else {
|
|
2344
|
+
spawned.stdin.end(input);
|
|
1828
2345
|
}
|
|
1829
|
-
|
|
1830
|
-
|
|
2346
|
+
}
|
|
2347
|
+
function handleOutput(opts, val) {
|
|
2348
|
+
if (val && opts.stripEof) {
|
|
2349
|
+
val = stripEof(val);
|
|
1831
2350
|
}
|
|
1832
|
-
return
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2351
|
+
return val;
|
|
2352
|
+
}
|
|
2353
|
+
function handleShell(fn, cmd, opts) {
|
|
2354
|
+
let file = "/bin/sh";
|
|
2355
|
+
let args = ["-c", cmd];
|
|
2356
|
+
opts = Object.assign({}, opts);
|
|
2357
|
+
if (process.platform === "win32") {
|
|
2358
|
+
opts.__winShell = true;
|
|
2359
|
+
file = process.env.comspec || "cmd.exe";
|
|
2360
|
+
args = ["/s", "/c", `"${cmd}"`];
|
|
2361
|
+
opts.windowsVerbatimArguments = true;
|
|
2362
|
+
}
|
|
2363
|
+
if (opts.shell) {
|
|
2364
|
+
file = opts.shell;
|
|
2365
|
+
delete opts.shell;
|
|
2366
|
+
}
|
|
2367
|
+
return fn(file, args, opts);
|
|
2368
|
+
}
|
|
2369
|
+
function getStream(process3, stream, encoding, maxBuffer) {
|
|
2370
|
+
if (!process3[stream]) {
|
|
2371
|
+
return null;
|
|
2372
|
+
}
|
|
2373
|
+
let ret;
|
|
2374
|
+
if (encoding) {
|
|
2375
|
+
ret = _getStream(process3[stream], {
|
|
2376
|
+
encoding,
|
|
2377
|
+
maxBuffer
|
|
2378
|
+
});
|
|
2379
|
+
} else {
|
|
2380
|
+
ret = _getStream.buffer(process3[stream], { maxBuffer });
|
|
2381
|
+
}
|
|
2382
|
+
return ret.catch((err) => {
|
|
2383
|
+
err.stream = stream;
|
|
2384
|
+
err.message = `${stream} ${err.message}`;
|
|
2385
|
+
throw err;
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
function makeError(result, options) {
|
|
2389
|
+
const stdout = result.stdout;
|
|
2390
|
+
const stderr = result.stderr;
|
|
2391
|
+
let err = result.error;
|
|
2392
|
+
const code = result.code;
|
|
2393
|
+
const signal = result.signal;
|
|
2394
|
+
const parsed = options.parsed;
|
|
2395
|
+
const joinedCmd = options.joinedCmd;
|
|
2396
|
+
const timedOut = options.timedOut || false;
|
|
2397
|
+
if (!err) {
|
|
2398
|
+
let output = "";
|
|
2399
|
+
if (Array.isArray(parsed.opts.stdio)) {
|
|
2400
|
+
if (parsed.opts.stdio[2] !== "inherit") {
|
|
2401
|
+
output += output.length > 0 ? stderr : `
|
|
2402
|
+
${stderr}`;
|
|
2403
|
+
}
|
|
2404
|
+
if (parsed.opts.stdio[1] !== "inherit") {
|
|
2405
|
+
output += `
|
|
2406
|
+
${stdout}`;
|
|
2407
|
+
}
|
|
2408
|
+
} else if (parsed.opts.stdio !== "inherit") {
|
|
2409
|
+
output = `
|
|
2410
|
+
${stderr}${stdout}`;
|
|
2411
|
+
}
|
|
2412
|
+
err = new Error(`Command failed: ${joinedCmd}${output}`);
|
|
2413
|
+
err.code = code < 0 ? errname(code) : code;
|
|
2414
|
+
}
|
|
2415
|
+
err.stdout = stdout;
|
|
2416
|
+
err.stderr = stderr;
|
|
2417
|
+
err.failed = true;
|
|
2418
|
+
err.signal = signal || null;
|
|
2419
|
+
err.cmd = joinedCmd;
|
|
2420
|
+
err.timedOut = timedOut;
|
|
2421
|
+
return err;
|
|
2422
|
+
}
|
|
2423
|
+
function joinCmd(cmd, args) {
|
|
2424
|
+
let joinedCmd = cmd;
|
|
2425
|
+
if (Array.isArray(args) && args.length > 0) {
|
|
2426
|
+
joinedCmd += " " + args.join(" ");
|
|
2427
|
+
}
|
|
2428
|
+
return joinedCmd;
|
|
2429
|
+
}
|
|
2430
|
+
module2.exports = (cmd, args, opts) => {
|
|
2431
|
+
const parsed = handleArgs(cmd, args, opts);
|
|
2432
|
+
const encoding = parsed.opts.encoding;
|
|
2433
|
+
const maxBuffer = parsed.opts.maxBuffer;
|
|
2434
|
+
const joinedCmd = joinCmd(cmd, args);
|
|
1839
2435
|
let spawned;
|
|
1840
2436
|
try {
|
|
1841
|
-
spawned = childProcess.spawn(parsed.
|
|
1842
|
-
} catch (
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
2437
|
+
spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
|
|
2438
|
+
} catch (err) {
|
|
2439
|
+
return Promise.reject(err);
|
|
2440
|
+
}
|
|
2441
|
+
let removeExitHandler;
|
|
2442
|
+
if (parsed.opts.cleanup) {
|
|
2443
|
+
removeExitHandler = onExit(() => {
|
|
2444
|
+
spawned.kill();
|
|
2445
|
+
});
|
|
2446
|
+
}
|
|
2447
|
+
let timeoutId = null;
|
|
2448
|
+
let timedOut = false;
|
|
2449
|
+
const cleanupTimeout = () => {
|
|
2450
|
+
if (timeoutId) {
|
|
2451
|
+
clearTimeout(timeoutId);
|
|
2452
|
+
timeoutId = null;
|
|
2453
|
+
}
|
|
2454
|
+
};
|
|
2455
|
+
if (parsed.opts.timeout > 0) {
|
|
2456
|
+
timeoutId = setTimeout(() => {
|
|
2457
|
+
timeoutId = null;
|
|
2458
|
+
timedOut = true;
|
|
2459
|
+
spawned.kill(parsed.opts.killSignal);
|
|
2460
|
+
}, parsed.opts.timeout);
|
|
2461
|
+
}
|
|
2462
|
+
const processDone = new Promise((resolve5) => {
|
|
2463
|
+
spawned.on("exit", (code, signal) => {
|
|
2464
|
+
cleanupTimeout();
|
|
2465
|
+
resolve5({ code, signal });
|
|
2466
|
+
});
|
|
2467
|
+
spawned.on("error", (err) => {
|
|
2468
|
+
cleanupTimeout();
|
|
2469
|
+
resolve5({ error: err });
|
|
2470
|
+
});
|
|
2471
|
+
if (spawned.stdin) {
|
|
2472
|
+
spawned.stdin.on("error", (err) => {
|
|
2473
|
+
cleanupTimeout();
|
|
2474
|
+
resolve5({ error: err });
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
});
|
|
2478
|
+
function destroy() {
|
|
2479
|
+
if (spawned.stdout) {
|
|
2480
|
+
spawned.stdout.destroy();
|
|
2481
|
+
}
|
|
2482
|
+
if (spawned.stderr) {
|
|
2483
|
+
spawned.stderr.destroy();
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
const handlePromise = () => pFinally(Promise.all([
|
|
2487
|
+
processDone,
|
|
2488
|
+
getStream(spawned, "stdout", encoding, maxBuffer),
|
|
2489
|
+
getStream(spawned, "stderr", encoding, maxBuffer)
|
|
2490
|
+
]).then((arr) => {
|
|
2491
|
+
const result = arr[0];
|
|
2492
|
+
result.stdout = arr[1];
|
|
2493
|
+
result.stderr = arr[2];
|
|
2494
|
+
if (removeExitHandler) {
|
|
2495
|
+
removeExitHandler();
|
|
2496
|
+
}
|
|
2497
|
+
if (result.error || result.code !== 0 || result.signal !== null) {
|
|
2498
|
+
const err = makeError(result, {
|
|
2499
|
+
joinedCmd,
|
|
1879
2500
|
parsed,
|
|
1880
|
-
timedOut
|
|
1881
|
-
isCanceled: context.isCanceled,
|
|
1882
|
-
killed: spawned.killed
|
|
2501
|
+
timedOut
|
|
1883
2502
|
});
|
|
1884
|
-
|
|
1885
|
-
|
|
2503
|
+
err.killed = err.killed || spawned.killed;
|
|
2504
|
+
if (!parsed.opts.reject) {
|
|
2505
|
+
return err;
|
|
1886
2506
|
}
|
|
1887
|
-
throw
|
|
2507
|
+
throw err;
|
|
1888
2508
|
}
|
|
1889
2509
|
return {
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
stdout,
|
|
1894
|
-
stderr,
|
|
1895
|
-
all,
|
|
2510
|
+
stdout: handleOutput(parsed.opts, result.stdout),
|
|
2511
|
+
stderr: handleOutput(parsed.opts, result.stderr),
|
|
2512
|
+
code: 0,
|
|
1896
2513
|
failed: false,
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
2514
|
+
killed: false,
|
|
2515
|
+
signal: null,
|
|
2516
|
+
cmd: joinedCmd,
|
|
2517
|
+
timedOut: false
|
|
1900
2518
|
};
|
|
1901
|
-
};
|
|
1902
|
-
|
|
1903
|
-
handleInput(spawned, parsed.
|
|
1904
|
-
spawned.
|
|
1905
|
-
|
|
2519
|
+
}), destroy);
|
|
2520
|
+
crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
|
|
2521
|
+
handleInput(spawned, parsed.opts);
|
|
2522
|
+
spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
|
|
2523
|
+
spawned.catch = (onrejected) => handlePromise().catch(onrejected);
|
|
2524
|
+
return spawned;
|
|
1906
2525
|
};
|
|
1907
|
-
module2.exports =
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
stdout: "",
|
|
1920
|
-
stderr: "",
|
|
1921
|
-
all: "",
|
|
1922
|
-
command: command2,
|
|
1923
|
-
escapedCommand,
|
|
1924
|
-
parsed,
|
|
1925
|
-
timedOut: false,
|
|
1926
|
-
isCanceled: false,
|
|
1927
|
-
killed: false
|
|
1928
|
-
});
|
|
2526
|
+
module2.exports.stdout = function() {
|
|
2527
|
+
return module2.exports.apply(null, arguments).then((x) => x.stdout);
|
|
2528
|
+
};
|
|
2529
|
+
module2.exports.stderr = function() {
|
|
2530
|
+
return module2.exports.apply(null, arguments).then((x) => x.stderr);
|
|
2531
|
+
};
|
|
2532
|
+
module2.exports.shell = (cmd, opts) => handleShell(module2.exports, cmd, opts);
|
|
2533
|
+
module2.exports.sync = (cmd, args, opts) => {
|
|
2534
|
+
const parsed = handleArgs(cmd, args, opts);
|
|
2535
|
+
const joinedCmd = joinCmd(cmd, args);
|
|
2536
|
+
if (isStream(parsed.opts.input)) {
|
|
2537
|
+
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
1929
2538
|
}
|
|
1930
|
-
const
|
|
1931
|
-
|
|
2539
|
+
const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
|
|
2540
|
+
result.code = result.status;
|
|
1932
2541
|
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
1933
|
-
const
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
error: result.error,
|
|
1937
|
-
signal: result.signal,
|
|
1938
|
-
exitCode: result.status,
|
|
1939
|
-
command: command2,
|
|
1940
|
-
escapedCommand,
|
|
1941
|
-
parsed,
|
|
1942
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
1943
|
-
isCanceled: false,
|
|
1944
|
-
killed: result.signal !== null
|
|
2542
|
+
const err = makeError(result, {
|
|
2543
|
+
joinedCmd,
|
|
2544
|
+
parsed
|
|
1945
2545
|
});
|
|
1946
|
-
if (!parsed.
|
|
1947
|
-
return
|
|
2546
|
+
if (!parsed.opts.reject) {
|
|
2547
|
+
return err;
|
|
1948
2548
|
}
|
|
1949
|
-
throw
|
|
2549
|
+
throw err;
|
|
1950
2550
|
}
|
|
1951
2551
|
return {
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
stdout,
|
|
1956
|
-
stderr,
|
|
2552
|
+
stdout: handleOutput(parsed.opts, result.stdout),
|
|
2553
|
+
stderr: handleOutput(parsed.opts, result.stderr),
|
|
2554
|
+
code: 0,
|
|
1957
2555
|
failed: false,
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2556
|
+
signal: null,
|
|
2557
|
+
cmd: joinedCmd,
|
|
2558
|
+
timedOut: false
|
|
1961
2559
|
};
|
|
1962
2560
|
};
|
|
1963
|
-
module2.exports.
|
|
1964
|
-
|
|
1965
|
-
return execa4(file, args, options);
|
|
1966
|
-
};
|
|
1967
|
-
module2.exports.commandSync = (command2, options) => {
|
|
1968
|
-
const [file, ...args] = parseCommand2(command2);
|
|
1969
|
-
return execa4.sync(file, args, options);
|
|
1970
|
-
};
|
|
1971
|
-
module2.exports.node = (scriptPath, args, options = {}) => {
|
|
1972
|
-
if (args && !Array.isArray(args) && typeof args === "object") {
|
|
1973
|
-
options = args;
|
|
1974
|
-
args = [];
|
|
1975
|
-
}
|
|
1976
|
-
const stdio = normalizeStdio.node(options);
|
|
1977
|
-
const defaultExecArgv = process.execArgv.filter((arg) => !arg.startsWith("--inspect"));
|
|
1978
|
-
const {
|
|
1979
|
-
nodePath = process.execPath,
|
|
1980
|
-
nodeOptions = defaultExecArgv
|
|
1981
|
-
} = options;
|
|
1982
|
-
return execa4(
|
|
1983
|
-
nodePath,
|
|
1984
|
-
[
|
|
1985
|
-
...nodeOptions,
|
|
1986
|
-
scriptPath,
|
|
1987
|
-
...Array.isArray(args) ? args : []
|
|
1988
|
-
],
|
|
1989
|
-
{
|
|
1990
|
-
...options,
|
|
1991
|
-
stdin: void 0,
|
|
1992
|
-
stdout: void 0,
|
|
1993
|
-
stderr: void 0,
|
|
1994
|
-
stdio,
|
|
1995
|
-
shell: false
|
|
1996
|
-
}
|
|
1997
|
-
);
|
|
1998
|
-
};
|
|
1999
|
-
}
|
|
2000
|
-
});
|
|
2001
|
-
|
|
2002
|
-
// ../../node_modules/process-exists/node_modules/ps-list/index.js
|
|
2003
|
-
var require_ps_list = __commonJS({
|
|
2004
|
-
"../../node_modules/process-exists/node_modules/ps-list/index.js"(exports, module2) {
|
|
2005
|
-
"use strict";
|
|
2006
|
-
var util = require("util");
|
|
2007
|
-
var path = require("path");
|
|
2008
|
-
var childProcess = require("child_process");
|
|
2009
|
-
var TEN_MEGABYTES = 1e3 * 1e3 * 10;
|
|
2010
|
-
var execFile = util.promisify(childProcess.execFile);
|
|
2011
|
-
var windows = async () => {
|
|
2012
|
-
const bin = path.join(__dirname, "fastlist.exe");
|
|
2013
|
-
const { stdout } = await execFile(bin, { maxBuffer: TEN_MEGABYTES });
|
|
2014
|
-
return stdout.trim().split("\r\n").map((line) => line.split(" ")).map(([name, pid, ppid]) => ({
|
|
2015
|
-
name,
|
|
2016
|
-
pid: Number.parseInt(pid, 10),
|
|
2017
|
-
ppid: Number.parseInt(ppid, 10)
|
|
2018
|
-
}));
|
|
2019
|
-
};
|
|
2020
|
-
var main2 = async (options = {}) => {
|
|
2021
|
-
const flags = (options.all === false ? "" : "a") + "wwxo";
|
|
2022
|
-
const ret = {};
|
|
2023
|
-
await Promise.all(["comm", "args", "ppid", "uid", "%cpu", "%mem"].map(async (cmd) => {
|
|
2024
|
-
const { stdout } = await execFile("ps", [flags, `pid,${cmd}`], { maxBuffer: TEN_MEGABYTES });
|
|
2025
|
-
for (let line of stdout.trim().split("\n").slice(1)) {
|
|
2026
|
-
line = line.trim();
|
|
2027
|
-
const [pid] = line.split(" ", 1);
|
|
2028
|
-
const val = line.slice(pid.length + 1).trim();
|
|
2029
|
-
if (ret[pid] === void 0) {
|
|
2030
|
-
ret[pid] = {};
|
|
2031
|
-
}
|
|
2032
|
-
ret[pid][cmd] = val;
|
|
2033
|
-
}
|
|
2034
|
-
}));
|
|
2035
|
-
return Object.entries(ret).filter(([, value]) => value.comm && value.args && value.ppid && value.uid && value["%cpu"] && value["%mem"]).map(([key, value]) => ({
|
|
2036
|
-
pid: Number.parseInt(key, 10),
|
|
2037
|
-
name: path.basename(value.comm),
|
|
2038
|
-
cmd: value.args,
|
|
2039
|
-
ppid: Number.parseInt(value.ppid, 10),
|
|
2040
|
-
uid: Number.parseInt(value.uid, 10),
|
|
2041
|
-
cpu: Number.parseFloat(value["%cpu"]),
|
|
2042
|
-
memory: Number.parseFloat(value["%mem"])
|
|
2043
|
-
}));
|
|
2044
|
-
};
|
|
2045
|
-
module2.exports = process.platform === "win32" ? windows : main2;
|
|
2046
|
-
module2.exports.default = module2.exports;
|
|
2561
|
+
module2.exports.shellSync = (cmd, opts) => handleShell(module2.exports.sync, cmd, opts);
|
|
2562
|
+
module2.exports.spawn = util.deprecate(module2.exports, "execa.spawn() is deprecated. Use execa() instead.");
|
|
2047
2563
|
}
|
|
2048
2564
|
});
|
|
2049
2565
|
|
|
2050
|
-
// ../../node_modules/
|
|
2051
|
-
var
|
|
2052
|
-
"../../node_modules/
|
|
2566
|
+
// ../../node_modules/pid-from-port/index.js
|
|
2567
|
+
var require_pid_from_port = __commonJS({
|
|
2568
|
+
"../../node_modules/pid-from-port/index.js"(exports, module2) {
|
|
2053
2569
|
"use strict";
|
|
2054
|
-
var
|
|
2055
|
-
var
|
|
2056
|
-
|
|
2057
|
-
|
|
2570
|
+
var execa = require_execa();
|
|
2571
|
+
var macos = () => execa.stdout("netstat", ["-anv", "-p", "tcp"]).then((data) => Promise.all([data, execa.stdout("netstat", ["-anv", "-p", "udp"])])).then((data) => data.join("\n"));
|
|
2572
|
+
var linux = () => execa.stdout("ss", ["-tunlp"]);
|
|
2573
|
+
var win32 = () => execa.stdout("netstat", ["-ano"]);
|
|
2574
|
+
var getListFn = process.platform === "darwin" ? macos : process.platform === "linux" ? linux : win32;
|
|
2575
|
+
var cols = process.platform === "darwin" ? [3, 8] : process.platform === "linux" ? [4, 6] : [1, 4];
|
|
2576
|
+
var isProtocol = (x) => /^\s*(tcp|udp)/i.test(x);
|
|
2577
|
+
var parsePid = (input) => {
|
|
2578
|
+
if (typeof input !== "string") {
|
|
2579
|
+
return null;
|
|
2058
2580
|
}
|
|
2059
|
-
|
|
2581
|
+
const match = input.match(/(?:^|",|",pid=)(\d+)/);
|
|
2582
|
+
return match ? parseInt(match[1], 10) : null;
|
|
2060
2583
|
};
|
|
2061
|
-
var
|
|
2062
|
-
|
|
2063
|
-
|
|
2584
|
+
var getPort = (input, list) => {
|
|
2585
|
+
const regex = new RegExp(`[.:]${input}$`);
|
|
2586
|
+
const port = list.find((x) => regex.test(x[cols[0]]));
|
|
2587
|
+
if (!port) {
|
|
2588
|
+
throw new Error(`Couldn't find a process with port \`${input}\``);
|
|
2064
2589
|
}
|
|
2065
|
-
return
|
|
2066
|
-
};
|
|
2067
|
-
var processMatchesName = process.platform === "linux" ? linuxProcessMatchesName : nonLinuxProcessMatchesName;
|
|
2068
|
-
module2.exports = async (processName) => {
|
|
2069
|
-
const processes = await psList2();
|
|
2070
|
-
return processes.some((x) => processMatchesName(processName, x));
|
|
2590
|
+
return parsePid(port[cols[1]]);
|
|
2071
2591
|
};
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2592
|
+
var getList = () => getListFn().then(
|
|
2593
|
+
(list) => list.split("\n").reduce((result, x) => {
|
|
2594
|
+
if (isProtocol(x)) {
|
|
2595
|
+
result.push(x.match(/\S+/g) || []);
|
|
2596
|
+
}
|
|
2597
|
+
return result;
|
|
2598
|
+
}, [])
|
|
2599
|
+
);
|
|
2600
|
+
module2.exports = (input) => {
|
|
2601
|
+
if (typeof input !== "number") {
|
|
2602
|
+
return Promise.reject(new TypeError(`Expected a number, got ${typeof input}`));
|
|
2603
|
+
}
|
|
2604
|
+
return getList().then((list) => getPort(input, list));
|
|
2075
2605
|
};
|
|
2076
|
-
module2.exports.
|
|
2077
|
-
|
|
2078
|
-
|
|
2606
|
+
module2.exports.all = (input) => {
|
|
2607
|
+
if (!Array.isArray(input)) {
|
|
2608
|
+
return Promise.reject(new TypeError(`Expected an array, got ${typeof input}`));
|
|
2609
|
+
}
|
|
2610
|
+
return getList().then((list) => Promise.all(input.map((x) => [x, getPort(x, list)]))).then((list) => new Map(list));
|
|
2079
2611
|
};
|
|
2612
|
+
module2.exports.list = () => getList().then((list) => {
|
|
2613
|
+
const ret = /* @__PURE__ */ new Map();
|
|
2614
|
+
for (const x of list) {
|
|
2615
|
+
const match = x[cols[0]].match(/[^]*[.:](\d+)$/);
|
|
2616
|
+
if (match) {
|
|
2617
|
+
ret.set(parseInt(match[1], 10), parsePid(x[cols[1]]));
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
return ret;
|
|
2621
|
+
});
|
|
2080
2622
|
}
|
|
2081
2623
|
});
|
|
2082
2624
|
|
|
2083
|
-
// ../../node_modules/
|
|
2084
|
-
var
|
|
2085
|
-
"../../node_modules/
|
|
2625
|
+
// ../../node_modules/kill-port-process/dist/lib/killer.js
|
|
2626
|
+
var require_killer = __commonJS({
|
|
2627
|
+
"../../node_modules/kill-port-process/dist/lib/killer.js"(exports) {
|
|
2086
2628
|
"use strict";
|
|
2087
|
-
var
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
var windows = async () => {
|
|
2093
|
-
let bin;
|
|
2094
|
-
switch (process.arch) {
|
|
2095
|
-
case "x64":
|
|
2096
|
-
bin = "fastlist-0.3.0-x64.exe";
|
|
2097
|
-
break;
|
|
2098
|
-
case "ia32":
|
|
2099
|
-
bin = "fastlist-0.3.0-x86.exe";
|
|
2100
|
-
break;
|
|
2101
|
-
default:
|
|
2102
|
-
throw new Error(`Unsupported architecture: ${process.arch}`);
|
|
2629
|
+
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
2630
|
+
function adopt(value) {
|
|
2631
|
+
return value instanceof P ? value : new P(function(resolve5) {
|
|
2632
|
+
resolve5(value);
|
|
2633
|
+
});
|
|
2103
2634
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
pid: Number.parseInt(pid, 10),
|
|
2111
|
-
ppid: Number.parseInt(ppid, 10),
|
|
2112
|
-
name
|
|
2113
|
-
}));
|
|
2114
|
-
};
|
|
2115
|
-
var nonWindowsMultipleCalls = async (options = {}) => {
|
|
2116
|
-
const flags = (options.all === false ? "" : "a") + "wwxo";
|
|
2117
|
-
const ret = {};
|
|
2118
|
-
await Promise.all(["comm", "args", "ppid", "uid", "%cpu", "%mem"].map(async (cmd) => {
|
|
2119
|
-
const { stdout } = await execFile("ps", [flags, `pid,${cmd}`], { maxBuffer: TEN_MEGABYTES });
|
|
2120
|
-
for (let line of stdout.trim().split("\n").slice(1)) {
|
|
2121
|
-
line = line.trim();
|
|
2122
|
-
const [pid] = line.split(" ", 1);
|
|
2123
|
-
const val = line.slice(pid.length + 1).trim();
|
|
2124
|
-
if (ret[pid] === void 0) {
|
|
2125
|
-
ret[pid] = {};
|
|
2635
|
+
return new (P || (P = Promise))(function(resolve5, reject) {
|
|
2636
|
+
function fulfilled(value) {
|
|
2637
|
+
try {
|
|
2638
|
+
step(generator.next(value));
|
|
2639
|
+
} catch (e) {
|
|
2640
|
+
reject(e);
|
|
2126
2641
|
}
|
|
2127
|
-
ret[pid][cmd] = val;
|
|
2128
2642
|
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
ppid: Number.parseInt(value.ppid, 10),
|
|
2135
|
-
uid: Number.parseInt(value.uid, 10),
|
|
2136
|
-
cpu: Number.parseFloat(value["%cpu"]),
|
|
2137
|
-
memory: Number.parseFloat(value["%mem"])
|
|
2138
|
-
}));
|
|
2139
|
-
};
|
|
2140
|
-
var ERROR_MESSAGE_PARSING_FAILED = "ps output parsing failed";
|
|
2141
|
-
var psFields = "pid,ppid,uid,%cpu,%mem,comm,args";
|
|
2142
|
-
var psOutputRegex = /^[ \t]*(?<pid>\d+)[ \t]+(?<ppid>\d+)[ \t]+(?<uid>\d+)[ \t]+(?<cpu>\d+\.\d+)[ \t]+(?<memory>\d+\.\d+)[ \t]+/;
|
|
2143
|
-
var nonWindowsSingleCall = async (options = {}) => {
|
|
2144
|
-
const flags = options.all === false ? "wwxo" : "awwxo";
|
|
2145
|
-
const [psPid, stdout] = await new Promise((resolve5, reject) => {
|
|
2146
|
-
const child = childProcess.execFile("ps", [flags, psFields], { maxBuffer: TEN_MEGABYTES }, (error, stdout2) => {
|
|
2147
|
-
if (error === null) {
|
|
2148
|
-
resolve5([child.pid, stdout2]);
|
|
2149
|
-
} else {
|
|
2150
|
-
reject(error);
|
|
2643
|
+
function rejected(value) {
|
|
2644
|
+
try {
|
|
2645
|
+
step(generator["throw"](value));
|
|
2646
|
+
} catch (e) {
|
|
2647
|
+
reject(e);
|
|
2151
2648
|
}
|
|
2152
|
-
});
|
|
2153
|
-
});
|
|
2154
|
-
const lines = stdout.trim().split("\n");
|
|
2155
|
-
lines.shift();
|
|
2156
|
-
let psIndex;
|
|
2157
|
-
let commPosition;
|
|
2158
|
-
let argsPosition;
|
|
2159
|
-
const processes = lines.map((line, index) => {
|
|
2160
|
-
const match = psOutputRegex.exec(line);
|
|
2161
|
-
if (match === null) {
|
|
2162
|
-
throw new Error(ERROR_MESSAGE_PARSING_FAILED);
|
|
2163
|
-
}
|
|
2164
|
-
const { pid, ppid, uid, cpu, memory } = match.groups;
|
|
2165
|
-
const processInfo = {
|
|
2166
|
-
pid: Number.parseInt(pid, 10),
|
|
2167
|
-
ppid: Number.parseInt(ppid, 10),
|
|
2168
|
-
uid: Number.parseInt(uid, 10),
|
|
2169
|
-
cpu: Number.parseFloat(cpu),
|
|
2170
|
-
memory: Number.parseFloat(memory),
|
|
2171
|
-
name: void 0,
|
|
2172
|
-
cmd: void 0
|
|
2173
|
-
};
|
|
2174
|
-
if (processInfo.pid === psPid) {
|
|
2175
|
-
psIndex = index;
|
|
2176
|
-
commPosition = line.indexOf("ps", match[0].length);
|
|
2177
|
-
argsPosition = line.indexOf("ps", commPosition + 2);
|
|
2178
2649
|
}
|
|
2179
|
-
|
|
2650
|
+
function step(result) {
|
|
2651
|
+
result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
2652
|
+
}
|
|
2653
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2180
2654
|
});
|
|
2181
|
-
|
|
2182
|
-
|
|
2655
|
+
};
|
|
2656
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2657
|
+
exports.Killer = void 0;
|
|
2658
|
+
var child_process_1 = require("child_process");
|
|
2659
|
+
var os_1 = require("os");
|
|
2660
|
+
var pidFromPort = require_pid_from_port();
|
|
2661
|
+
var Killer = class {
|
|
2662
|
+
constructor(ports) {
|
|
2663
|
+
this.ports = ports;
|
|
2664
|
+
}
|
|
2665
|
+
kill(options) {
|
|
2666
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2667
|
+
const killFunc = (0, os_1.platform)() === "win32" ? this.win32Kill : this.unixKill;
|
|
2668
|
+
const promises = this.ports.map((port) => killFunc(port, options.signal));
|
|
2669
|
+
return Promise.all(promises);
|
|
2670
|
+
});
|
|
2183
2671
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2672
|
+
win32Kill(port, signal) {
|
|
2673
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2674
|
+
const pid = yield pidFromPort(port).catch((error) => console.error("Failed to get pid of port", port, error));
|
|
2675
|
+
if (!pid) {
|
|
2676
|
+
return;
|
|
2677
|
+
}
|
|
2678
|
+
return new Promise((resolve5, reject) => {
|
|
2679
|
+
const taskkill = (0, child_process_1.spawn)("TASKKILL", ["/f", "/t", "/pid", pid.toString()]);
|
|
2680
|
+
taskkill.stdout.on("data", (data) => console.log(data.toString()));
|
|
2681
|
+
taskkill.stderr.on("data", (data) => console.error(data.toString()));
|
|
2682
|
+
taskkill.on("close", (code, signal2) => {
|
|
2683
|
+
if (code !== 0) {
|
|
2684
|
+
return reject(`taskkill process exited with code ${code} and signal ${signal2}`);
|
|
2685
|
+
}
|
|
2686
|
+
resolve5(void 0);
|
|
2687
|
+
});
|
|
2688
|
+
taskkill.on("error", (err) => reject(err));
|
|
2689
|
+
});
|
|
2690
|
+
});
|
|
2188
2691
|
}
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2692
|
+
unixKill(port, signal) {
|
|
2693
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2694
|
+
const killCommand = {
|
|
2695
|
+
SIGKILL: "-9",
|
|
2696
|
+
SIGTERM: "-15"
|
|
2697
|
+
}[signal];
|
|
2698
|
+
return new Promise((resolve5, reject) => {
|
|
2699
|
+
const lsof = (0, child_process_1.spawn)("lsof", ["-i", `tcp:${port}`]);
|
|
2700
|
+
const grep = (0, child_process_1.spawn)("grep", ["LISTEN"]);
|
|
2701
|
+
const awk = (0, child_process_1.spawn)("awk", ["{print $2}"]);
|
|
2702
|
+
const xargs = (0, child_process_1.spawn)("xargs", ["kill", killCommand]);
|
|
2703
|
+
lsof.stdout.pipe(grep.stdin);
|
|
2704
|
+
lsof.stderr.on("data", logStderrData("lsof"));
|
|
2705
|
+
grep.stdout.pipe(awk.stdin);
|
|
2706
|
+
grep.stderr.on("data", logStderrData("grep"));
|
|
2707
|
+
awk.stdout.pipe(xargs.stdin);
|
|
2708
|
+
awk.stderr.on("data", logStderrData("awk"));
|
|
2709
|
+
xargs.stdout.pipe(process.stdin);
|
|
2710
|
+
xargs.stderr.on("data", logStderrData("xargs"));
|
|
2711
|
+
xargs.on("close", (code) => {
|
|
2712
|
+
if (code !== 0) {
|
|
2713
|
+
return reject();
|
|
2714
|
+
}
|
|
2715
|
+
resolve5(void 0);
|
|
2716
|
+
});
|
|
2717
|
+
function logStderrData(command2) {
|
|
2718
|
+
return (data) => console.error(`${command2} - ${data.toString()}`);
|
|
2719
|
+
}
|
|
2720
|
+
});
|
|
2721
|
+
});
|
|
2197
2722
|
}
|
|
2198
2723
|
};
|
|
2199
|
-
|
|
2724
|
+
exports.Killer = Killer;
|
|
2200
2725
|
}
|
|
2201
2726
|
});
|
|
2202
2727
|
|
|
2203
|
-
//
|
|
2204
|
-
var
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
var
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
// ../../node_modules/taskkill/node_modules/arrify/index.js
|
|
2213
|
-
function arrify(value) {
|
|
2214
|
-
if (value === null || value === void 0) {
|
|
2215
|
-
return [];
|
|
2216
|
-
}
|
|
2217
|
-
if (Array.isArray(value)) {
|
|
2218
|
-
return value;
|
|
2219
|
-
}
|
|
2220
|
-
if (typeof value === "string") {
|
|
2221
|
-
return [value];
|
|
2222
|
-
}
|
|
2223
|
-
if (typeof value[Symbol.iterator] === "function") {
|
|
2224
|
-
return [...value];
|
|
2225
|
-
}
|
|
2226
|
-
return [value];
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
// ../../node_modules/taskkill/index.js
|
|
2230
|
-
var import_execa = __toESM(require_execa(), 1);
|
|
2231
|
-
async function taskkill(input, options = {}) {
|
|
2232
|
-
if (import_node_process.default.platform !== "win32") {
|
|
2233
|
-
throw new Error("Windows only");
|
|
2234
|
-
}
|
|
2235
|
-
input = arrify(input);
|
|
2236
|
-
if (input.length === 0) {
|
|
2237
|
-
throw new Error("PID or image name required");
|
|
2238
|
-
}
|
|
2239
|
-
const arguments_ = [];
|
|
2240
|
-
if (options.system && options.username && options.password) {
|
|
2241
|
-
arguments_.push("/s", options.system, "/u", options.username, "/p", options.password);
|
|
2242
|
-
}
|
|
2243
|
-
if (options.filter) {
|
|
2244
|
-
arguments_.push("/fi", options.filter);
|
|
2245
|
-
}
|
|
2246
|
-
if (options.force) {
|
|
2247
|
-
arguments_.push("/f");
|
|
2248
|
-
}
|
|
2249
|
-
if (options.tree) {
|
|
2250
|
-
arguments_.push("/t");
|
|
2251
|
-
}
|
|
2252
|
-
for (const element of input) {
|
|
2253
|
-
arguments_.push(typeof element === "number" ? "/pid" : "/im", element);
|
|
2254
|
-
}
|
|
2255
|
-
await (0, import_execa.default)("taskkill", arguments_);
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
// ../../node_modules/fkill/index.js
|
|
2259
|
-
var import_execa3 = __toESM(require_execa(), 1);
|
|
2260
|
-
|
|
2261
|
-
// ../../node_modules/fkill/node_modules/indent-string/index.js
|
|
2262
|
-
function indentString(string, count = 1, options = {}) {
|
|
2263
|
-
const {
|
|
2264
|
-
indent = " ",
|
|
2265
|
-
includeEmptyLines = false
|
|
2266
|
-
} = options;
|
|
2267
|
-
if (typeof string !== "string") {
|
|
2268
|
-
throw new TypeError(
|
|
2269
|
-
`Expected \`input\` to be a \`string\`, got \`${typeof string}\``
|
|
2270
|
-
);
|
|
2271
|
-
}
|
|
2272
|
-
if (typeof count !== "number") {
|
|
2273
|
-
throw new TypeError(
|
|
2274
|
-
`Expected \`count\` to be a \`number\`, got \`${typeof count}\``
|
|
2275
|
-
);
|
|
2276
|
-
}
|
|
2277
|
-
if (count < 0) {
|
|
2278
|
-
throw new RangeError(
|
|
2279
|
-
`Expected \`count\` to be at least 0, got \`${count}\``
|
|
2280
|
-
);
|
|
2281
|
-
}
|
|
2282
|
-
if (typeof indent !== "string") {
|
|
2283
|
-
throw new TypeError(
|
|
2284
|
-
`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``
|
|
2285
|
-
);
|
|
2286
|
-
}
|
|
2287
|
-
if (count === 0) {
|
|
2288
|
-
return string;
|
|
2289
|
-
}
|
|
2290
|
-
const regex = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
|
|
2291
|
-
return string.replace(regex, indent.repeat(count));
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
// ../../node_modules/fkill/node_modules/clean-stack/index.js
|
|
2295
|
-
var import_os = __toESM(require("os"), 1);
|
|
2296
|
-
|
|
2297
|
-
// ../../node_modules/fkill/node_modules/escape-string-regexp/index.js
|
|
2298
|
-
function escapeStringRegexp(string) {
|
|
2299
|
-
if (typeof string !== "string") {
|
|
2300
|
-
throw new TypeError("Expected a string");
|
|
2301
|
-
}
|
|
2302
|
-
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2303
|
-
}
|
|
2304
|
-
|
|
2305
|
-
// ../../node_modules/fkill/node_modules/clean-stack/index.js
|
|
2306
|
-
var extractPathRegex = /\s+at.*[(\s](.*)\)?/;
|
|
2307
|
-
var pathRegex = /^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;
|
|
2308
|
-
var homeDir = typeof import_os.default.homedir === "undefined" ? "" : import_os.default.homedir().replace(/\\/g, "/");
|
|
2309
|
-
function cleanStack(stack, { pretty = false, basePath } = {}) {
|
|
2310
|
-
const basePathRegex = basePath && new RegExp(`(at | \\()${escapeStringRegexp(basePath.replace(/\\/g, "/"))}`, "g");
|
|
2311
|
-
if (typeof stack !== "string") {
|
|
2312
|
-
return void 0;
|
|
2313
|
-
}
|
|
2314
|
-
return stack.replace(/\\/g, "/").split("\n").filter((line) => {
|
|
2315
|
-
const pathMatches = line.match(extractPathRegex);
|
|
2316
|
-
if (pathMatches === null || !pathMatches[1]) {
|
|
2317
|
-
return true;
|
|
2318
|
-
}
|
|
2319
|
-
const match = pathMatches[1];
|
|
2320
|
-
if (match.includes(".app/Contents/Resources/electron.asar") || match.includes(".app/Contents/Resources/default_app.asar") || match.includes("node_modules/electron/dist/resources/electron.asar") || match.includes("node_modules/electron/dist/resources/default_app.asar")) {
|
|
2321
|
-
return false;
|
|
2322
|
-
}
|
|
2323
|
-
return !pathRegex.test(match);
|
|
2324
|
-
}).filter((line) => line.trim() !== "").map((line) => {
|
|
2325
|
-
if (basePathRegex) {
|
|
2326
|
-
line = line.replace(basePathRegex, "$1");
|
|
2327
|
-
}
|
|
2328
|
-
if (pretty) {
|
|
2329
|
-
line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, "~")));
|
|
2330
|
-
}
|
|
2331
|
-
return line;
|
|
2332
|
-
}).join("\n");
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
|
-
// ../../node_modules/fkill/node_modules/aggregate-error/index.js
|
|
2336
|
-
var cleanInternalStack = (stack) => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, "");
|
|
2337
|
-
var AggregateError = class extends Error {
|
|
2338
|
-
#errors;
|
|
2339
|
-
name = "AggregateError";
|
|
2340
|
-
constructor(errors) {
|
|
2341
|
-
if (!Array.isArray(errors)) {
|
|
2342
|
-
throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
|
|
2343
|
-
}
|
|
2344
|
-
errors = errors.map((error) => {
|
|
2345
|
-
if (error instanceof Error) {
|
|
2346
|
-
return error;
|
|
2347
|
-
}
|
|
2348
|
-
if (error !== null && typeof error === "object") {
|
|
2349
|
-
return Object.assign(new Error(error.message), error);
|
|
2350
|
-
}
|
|
2351
|
-
return new Error(error);
|
|
2352
|
-
});
|
|
2353
|
-
let message = errors.map((error) => {
|
|
2354
|
-
return typeof error.stack === "string" && error.stack.length > 0 ? cleanInternalStack(cleanStack(error.stack)) : String(error);
|
|
2355
|
-
}).join("\n");
|
|
2356
|
-
message = "\n" + indentString(message, 4);
|
|
2357
|
-
super(message);
|
|
2358
|
-
this.#errors = errors;
|
|
2359
|
-
}
|
|
2360
|
-
get errors() {
|
|
2361
|
-
return this.#errors.slice();
|
|
2362
|
-
}
|
|
2363
|
-
};
|
|
2364
|
-
|
|
2365
|
-
// ../../node_modules/pid-port/index.js
|
|
2366
|
-
var import_node_process2 = __toESM(require("node:process"), 1);
|
|
2367
|
-
var import_execa2 = __toESM(require_execa(), 1);
|
|
2368
|
-
var netstat = async (type) => {
|
|
2369
|
-
const { stdout } = await (0, import_execa2.default)("netstat", ["-anv", "-p", type]);
|
|
2370
|
-
return stdout;
|
|
2371
|
-
};
|
|
2372
|
-
var macos = async () => {
|
|
2373
|
-
const result = await Promise.all([
|
|
2374
|
-
netstat("tcp"),
|
|
2375
|
-
netstat("udp")
|
|
2376
|
-
]);
|
|
2377
|
-
return result.join("\n");
|
|
2378
|
-
};
|
|
2379
|
-
var linux = async () => {
|
|
2380
|
-
const { stdout } = await (0, import_execa2.default)("ss", ["-tunlp"]);
|
|
2381
|
-
return stdout;
|
|
2382
|
-
};
|
|
2383
|
-
var win32 = async () => {
|
|
2384
|
-
const { stdout } = await (0, import_execa2.default)("netstat", ["-ano"]);
|
|
2385
|
-
return stdout;
|
|
2386
|
-
};
|
|
2387
|
-
var getListFunction = import_node_process2.default.platform === "darwin" ? macos : import_node_process2.default.platform === "linux" ? linux : win32;
|
|
2388
|
-
var addressColumn = import_node_process2.default.platform === "darwin" ? 3 : import_node_process2.default.platform === "linux" ? 4 : 1;
|
|
2389
|
-
var portColumn = import_node_process2.default.platform === "darwin" ? 8 : import_node_process2.default.platform === "linux" ? 6 : 4;
|
|
2390
|
-
var isProtocol = (value) => /^\s*(tcp|udp)/i.test(value);
|
|
2391
|
-
var parsePid = (pid) => {
|
|
2392
|
-
if (typeof pid !== "string") {
|
|
2393
|
-
return;
|
|
2394
|
-
}
|
|
2395
|
-
const { groups } = /(?:^|",|",pid=)(?<pid>\d+)/.exec(pid) || {};
|
|
2396
|
-
if (groups) {
|
|
2397
|
-
return Number.parseInt(groups.pid, 10);
|
|
2398
|
-
}
|
|
2399
|
-
};
|
|
2400
|
-
var getPort = (port, list) => {
|
|
2401
|
-
const regex = new RegExp(`[.:]${port}$`);
|
|
2402
|
-
const foundPort = list.find((line) => regex.test(line[addressColumn]));
|
|
2403
|
-
if (!foundPort) {
|
|
2404
|
-
throw new Error(`Could not find a process that uses port \`${port}\``);
|
|
2405
|
-
}
|
|
2406
|
-
return parsePid(foundPort[portColumn]);
|
|
2407
|
-
};
|
|
2408
|
-
var getList = async () => {
|
|
2409
|
-
const list = await getListFunction();
|
|
2410
|
-
return list.split("\n").filter((line) => isProtocol(line)).map((line) => line.match(/\S+/g) || []);
|
|
2411
|
-
};
|
|
2412
|
-
async function portToPid(port) {
|
|
2413
|
-
if (Array.isArray(port)) {
|
|
2414
|
-
const list = await getList();
|
|
2415
|
-
const tuples = await Promise.all(port.map((port_) => [port_, getPort(port_, list)]));
|
|
2416
|
-
return new Map(tuples);
|
|
2417
|
-
}
|
|
2418
|
-
if (!Number.isInteger(port)) {
|
|
2419
|
-
throw new TypeError(`Expected an integer, got ${typeof port}`);
|
|
2420
|
-
}
|
|
2421
|
-
return getPort(port, await getList());
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
// ../../node_modules/fkill/index.js
|
|
2425
|
-
var import_process_exists = __toESM(require_process_exists(), 1);
|
|
2426
|
-
var import_ps_list = __toESM(require_ps_list2(), 1);
|
|
2427
|
-
var ALIVE_CHECK_MIN_INTERVAL = 5;
|
|
2428
|
-
var ALIVE_CHECK_MAX_INTERVAL = 1280;
|
|
2429
|
-
var TASKKILL_EXIT_CODE_FOR_PROCESS_FILTERING_SIGTERM = 255;
|
|
2430
|
-
var delay = (ms) => new Promise((resolve5) => {
|
|
2431
|
-
setTimeout(resolve5, ms);
|
|
2432
|
-
});
|
|
2433
|
-
var missingBinaryError = async (command2, arguments_) => {
|
|
2434
|
-
try {
|
|
2435
|
-
return await (0, import_execa3.default)(command2, arguments_);
|
|
2436
|
-
} catch (error) {
|
|
2437
|
-
if (error.code === "ENOENT") {
|
|
2438
|
-
const newError = new Error(`\`${command2}\` doesn't seem to be installed and is required by fkill`);
|
|
2439
|
-
newError.sourceError = error;
|
|
2440
|
-
throw newError;
|
|
2441
|
-
}
|
|
2442
|
-
throw error;
|
|
2443
|
-
}
|
|
2444
|
-
};
|
|
2445
|
-
var windowsKill = async (input, options) => {
|
|
2446
|
-
try {
|
|
2447
|
-
return await taskkill(input, {
|
|
2448
|
-
force: options.force,
|
|
2449
|
-
tree: typeof options.tree === "undefined" ? true : options.tree
|
|
2450
|
-
});
|
|
2451
|
-
} catch (error) {
|
|
2452
|
-
if (error.exitCode === TASKKILL_EXIT_CODE_FOR_PROCESS_FILTERING_SIGTERM && !options.force) {
|
|
2453
|
-
return;
|
|
2454
|
-
}
|
|
2455
|
-
throw error;
|
|
2456
|
-
}
|
|
2457
|
-
};
|
|
2458
|
-
var macosKill = (input, options) => {
|
|
2459
|
-
const killByName = typeof input === "string";
|
|
2460
|
-
const command2 = killByName ? "pkill" : "kill";
|
|
2461
|
-
const arguments_ = [input];
|
|
2462
|
-
if (killByName && options.ignoreCase) {
|
|
2463
|
-
arguments_.unshift("-i");
|
|
2464
|
-
}
|
|
2465
|
-
if (killByName) {
|
|
2466
|
-
arguments_.unshift("-x");
|
|
2467
|
-
}
|
|
2468
|
-
if (options.force) {
|
|
2469
|
-
if (killByName) {
|
|
2470
|
-
arguments_.unshift("-KILL");
|
|
2471
|
-
} else {
|
|
2472
|
-
arguments_.unshift("-9");
|
|
2473
|
-
}
|
|
2474
|
-
}
|
|
2475
|
-
return missingBinaryError(command2, arguments_);
|
|
2476
|
-
};
|
|
2477
|
-
var defaultKill = (input, options) => {
|
|
2478
|
-
const killByName = typeof input === "string";
|
|
2479
|
-
const command2 = killByName ? "killall" : "kill";
|
|
2480
|
-
const arguments_ = [input];
|
|
2481
|
-
if (options.force) {
|
|
2482
|
-
arguments_.unshift("-9");
|
|
2483
|
-
}
|
|
2484
|
-
if (killByName && options.ignoreCase) {
|
|
2485
|
-
arguments_.unshift("-I");
|
|
2486
|
-
}
|
|
2487
|
-
return missingBinaryError(command2, arguments_);
|
|
2488
|
-
};
|
|
2489
|
-
var kill = (() => {
|
|
2490
|
-
if (import_node_process3.default.platform === "darwin") {
|
|
2491
|
-
return macosKill;
|
|
2492
|
-
}
|
|
2493
|
-
if (import_node_process3.default.platform === "win32") {
|
|
2494
|
-
return windowsKill;
|
|
2495
|
-
}
|
|
2496
|
-
return defaultKill;
|
|
2497
|
-
})();
|
|
2498
|
-
var parseInput = async (input) => {
|
|
2499
|
-
if (typeof input === "string" && input[0] === ":") {
|
|
2500
|
-
return portToPid(Number.parseInt(input.slice(1), 10));
|
|
2501
|
-
}
|
|
2502
|
-
return input;
|
|
2503
|
-
};
|
|
2504
|
-
var getCurrentProcessParentsPID = (processes) => {
|
|
2505
|
-
const processMap = new Map(processes.map((ps) => [ps.pid, ps.ppid]));
|
|
2506
|
-
const pids = [];
|
|
2507
|
-
let currentId = import_node_process3.default.pid;
|
|
2508
|
-
while (currentId) {
|
|
2509
|
-
pids.push(currentId);
|
|
2510
|
-
currentId = processMap.get(currentId);
|
|
2511
|
-
}
|
|
2512
|
-
return pids;
|
|
2513
|
-
};
|
|
2514
|
-
var killWithLimits = async (input, options) => {
|
|
2515
|
-
input = await parseInput(input);
|
|
2516
|
-
if (input === import_node_process3.default.pid) {
|
|
2517
|
-
return;
|
|
2518
|
-
}
|
|
2519
|
-
if (input === "node" || input === "node.exe") {
|
|
2520
|
-
const processes = await (0, import_ps_list.default)();
|
|
2521
|
-
const pids = getCurrentProcessParentsPID(processes);
|
|
2522
|
-
await Promise.all(processes.map(async (ps) => {
|
|
2523
|
-
if ((ps.name === "node" || ps.name === "node.exe") && !pids.includes(ps.pid)) {
|
|
2524
|
-
await kill(ps.pid, options);
|
|
2525
|
-
}
|
|
2526
|
-
}));
|
|
2527
|
-
return;
|
|
2528
|
-
}
|
|
2529
|
-
await kill(input, options);
|
|
2530
|
-
};
|
|
2531
|
-
async function fkill(inputs, options = {}) {
|
|
2532
|
-
inputs = [inputs].flat();
|
|
2533
|
-
const exists = await import_process_exists.default.all(inputs);
|
|
2534
|
-
const errors = [];
|
|
2535
|
-
const handleKill = async (input) => {
|
|
2536
|
-
try {
|
|
2537
|
-
await killWithLimits(input, options);
|
|
2538
|
-
} catch (error) {
|
|
2539
|
-
if (!exists.get(input)) {
|
|
2540
|
-
errors.push(`Killing process ${input} failed: Process doesn't exist`);
|
|
2541
|
-
return;
|
|
2728
|
+
// ../../node_modules/kill-port-process/dist/lib/index.js
|
|
2729
|
+
var require_lib = __commonJS({
|
|
2730
|
+
"../../node_modules/kill-port-process/dist/lib/index.js"(exports) {
|
|
2731
|
+
"use strict";
|
|
2732
|
+
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
2733
|
+
function adopt(value) {
|
|
2734
|
+
return value instanceof P ? value : new P(function(resolve5) {
|
|
2735
|
+
resolve5(value);
|
|
2736
|
+
});
|
|
2542
2737
|
}
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
if (options.forceAfterTimeout !== void 0 && !options.force) {
|
|
2551
|
-
const endTime = Date.now() + options.forceAfterTimeout;
|
|
2552
|
-
let interval = ALIVE_CHECK_MIN_INTERVAL;
|
|
2553
|
-
if (interval > options.forceAfterTimeout) {
|
|
2554
|
-
interval = options.forceAfterTimeout;
|
|
2555
|
-
}
|
|
2556
|
-
let alive = inputs;
|
|
2557
|
-
do {
|
|
2558
|
-
await delay(interval);
|
|
2559
|
-
alive = await import_process_exists.default.filterExists(alive);
|
|
2560
|
-
interval *= 2;
|
|
2561
|
-
if (interval > ALIVE_CHECK_MAX_INTERVAL) {
|
|
2562
|
-
interval = ALIVE_CHECK_MAX_INTERVAL;
|
|
2563
|
-
}
|
|
2564
|
-
} while (Date.now() < endTime && alive.length > 0);
|
|
2565
|
-
if (alive.length > 0) {
|
|
2566
|
-
await Promise.all(alive.map(async (input) => {
|
|
2567
|
-
try {
|
|
2568
|
-
await killWithLimits(input, { ...options, force: true });
|
|
2569
|
-
} catch {
|
|
2738
|
+
return new (P || (P = Promise))(function(resolve5, reject) {
|
|
2739
|
+
function fulfilled(value) {
|
|
2740
|
+
try {
|
|
2741
|
+
step(generator.next(value));
|
|
2742
|
+
} catch (e) {
|
|
2743
|
+
reject(e);
|
|
2744
|
+
}
|
|
2570
2745
|
}
|
|
2571
|
-
|
|
2746
|
+
function rejected(value) {
|
|
2747
|
+
try {
|
|
2748
|
+
step(generator["throw"](value));
|
|
2749
|
+
} catch (e) {
|
|
2750
|
+
reject(e);
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
function step(result) {
|
|
2754
|
+
result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
2755
|
+
}
|
|
2756
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2757
|
+
});
|
|
2758
|
+
};
|
|
2759
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2760
|
+
exports.killPortProcess = void 0;
|
|
2761
|
+
var helpers_1 = require_helpers();
|
|
2762
|
+
var killer_1 = require_killer();
|
|
2763
|
+
function killPortProcess2(inputPorts, inputOptions = {}) {
|
|
2764
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2765
|
+
if ((0, helpers_1.isNullOrUndefined)(inputPorts)) {
|
|
2766
|
+
throw new Error("No ports found in input");
|
|
2767
|
+
}
|
|
2768
|
+
const options = (0, helpers_1.mergeOptions)(inputOptions);
|
|
2769
|
+
const toNumber = (value) => Number(value);
|
|
2770
|
+
const ports = (0, helpers_1.arrayifyInput)(inputPorts).map(toNumber);
|
|
2771
|
+
const killer = new killer_1.Killer(ports);
|
|
2772
|
+
yield killer.kill({
|
|
2773
|
+
signal: options.signal
|
|
2774
|
+
});
|
|
2775
|
+
});
|
|
2572
2776
|
}
|
|
2777
|
+
exports.killPortProcess = killPortProcess2;
|
|
2573
2778
|
}
|
|
2574
|
-
}
|
|
2779
|
+
});
|
|
2780
|
+
|
|
2781
|
+
// src/with-dev-server.mts
|
|
2782
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
2575
2783
|
|
|
2576
2784
|
// node_modules/get-port/index.js
|
|
2577
2785
|
var import_node_net = __toESM(require("node:net"), 1);
|
|
@@ -2687,6 +2895,7 @@ async function getPorts(options) {
|
|
|
2687
2895
|
}
|
|
2688
2896
|
|
|
2689
2897
|
// src/with-dev-server.mts
|
|
2898
|
+
var import_kill_port_process = __toESM(require_lib(), 1);
|
|
2690
2899
|
var import_process = __toESM(require("process"), 1);
|
|
2691
2900
|
|
|
2692
2901
|
// node_modules/yargs/lib/platform-shims/esm.mjs
|
|
@@ -4213,13 +4422,13 @@ var y18n_default = y18n2;
|
|
|
4213
4422
|
var import_meta = {};
|
|
4214
4423
|
var REQUIRE_ERROR = "require is not supported by ESM";
|
|
4215
4424
|
var REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM";
|
|
4216
|
-
var
|
|
4425
|
+
var __dirname;
|
|
4217
4426
|
try {
|
|
4218
|
-
|
|
4427
|
+
__dirname = (0, import_url.fileURLToPath)(import_meta.url);
|
|
4219
4428
|
} catch (e) {
|
|
4220
|
-
|
|
4429
|
+
__dirname = process.cwd();
|
|
4221
4430
|
}
|
|
4222
|
-
var mainFilename =
|
|
4431
|
+
var mainFilename = __dirname.substring(0, __dirname.lastIndexOf("node_modules"));
|
|
4223
4432
|
var esm_default = {
|
|
4224
4433
|
assert: {
|
|
4225
4434
|
notStrictEqual: import_assert.notStrictEqual,
|
|
@@ -4264,7 +4473,7 @@ var esm_default = {
|
|
|
4264
4473
|
return [...str].length;
|
|
4265
4474
|
},
|
|
4266
4475
|
y18n: y18n_default({
|
|
4267
|
-
directory: (0, import_path4.resolve)(
|
|
4476
|
+
directory: (0, import_path4.resolve)(__dirname, "../../../locales"),
|
|
4268
4477
|
updateFiles: false
|
|
4269
4478
|
})
|
|
4270
4479
|
};
|
|
@@ -7599,7 +7808,7 @@ async function main() {
|
|
|
7599
7808
|
});
|
|
7600
7809
|
const killDevServer = () => {
|
|
7601
7810
|
devProcess.kill("SIGKILL");
|
|
7602
|
-
return
|
|
7811
|
+
return (0, import_kill_port_process.killPortProcess)([port]).catch((err) => {
|
|
7603
7812
|
console.error(`Plasmic: Failed to kill dev server: ${err}`);
|
|
7604
7813
|
});
|
|
7605
7814
|
};
|