@eclipse-glsp/cli 2.6.0 → 2.7.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -26
- package/dist/cli.js +181 -1453
- package/dist/cli.js.map +3 -3
- package/package.json +3 -5
package/dist/cli.js
CHANGED
|
@@ -3667,1206 +3667,6 @@ var require_brace_expansion = __commonJS({
|
|
|
3667
3667
|
}
|
|
3668
3668
|
});
|
|
3669
3669
|
|
|
3670
|
-
// ../../node_modules/readline-sync/lib/readline-sync.js
|
|
3671
|
-
var require_readline_sync = __commonJS({
|
|
3672
|
-
"../../node_modules/readline-sync/lib/readline-sync.js"(exports2) {
|
|
3673
|
-
"use strict";
|
|
3674
|
-
var IS_WIN = process.platform === "win32";
|
|
3675
|
-
var ALGORITHM_CIPHER = "aes-256-cbc";
|
|
3676
|
-
var ALGORITHM_HASH = "sha256";
|
|
3677
|
-
var DEFAULT_ERR_MSG = "The current environment doesn't support interactive reading from TTY.";
|
|
3678
|
-
var fs10 = require("fs");
|
|
3679
|
-
var TTY = process.binding("tty_wrap").TTY;
|
|
3680
|
-
var childProc = require("child_process");
|
|
3681
|
-
var pathUtil = require("path");
|
|
3682
|
-
var defaultOptions = {
|
|
3683
|
-
/* eslint-disable key-spacing */
|
|
3684
|
-
prompt: "> ",
|
|
3685
|
-
hideEchoBack: false,
|
|
3686
|
-
mask: "*",
|
|
3687
|
-
limit: [],
|
|
3688
|
-
limitMessage: "Input another, please.$<( [)limit(])>",
|
|
3689
|
-
defaultInput: "",
|
|
3690
|
-
trueValue: [],
|
|
3691
|
-
falseValue: [],
|
|
3692
|
-
caseSensitive: false,
|
|
3693
|
-
keepWhitespace: false,
|
|
3694
|
-
encoding: "utf8",
|
|
3695
|
-
bufferSize: 1024,
|
|
3696
|
-
print: void 0,
|
|
3697
|
-
history: true,
|
|
3698
|
-
cd: false,
|
|
3699
|
-
phContent: void 0,
|
|
3700
|
-
preCheck: void 0
|
|
3701
|
-
/* eslint-enable key-spacing */
|
|
3702
|
-
};
|
|
3703
|
-
var fdR = "none";
|
|
3704
|
-
var isRawMode = false;
|
|
3705
|
-
var salt = 0;
|
|
3706
|
-
var lastInput = "";
|
|
3707
|
-
var inputHistory = [];
|
|
3708
|
-
var _DBG_useExt = false;
|
|
3709
|
-
var _DBG_checkOptions = false;
|
|
3710
|
-
var _DBG_checkMethod = false;
|
|
3711
|
-
var fdW;
|
|
3712
|
-
var ttyR;
|
|
3713
|
-
var extHostPath;
|
|
3714
|
-
var extHostArgs;
|
|
3715
|
-
var tempdir;
|
|
3716
|
-
var rawInput;
|
|
3717
|
-
function getHostArgs(options) {
|
|
3718
|
-
function encodeArg(arg) {
|
|
3719
|
-
return arg.replace(/[^\w\u0080-\uFFFF]/g, function(chr) {
|
|
3720
|
-
return "#" + chr.charCodeAt(0) + ";";
|
|
3721
|
-
});
|
|
3722
|
-
}
|
|
3723
|
-
return extHostArgs.concat((function(conf) {
|
|
3724
|
-
var args = [];
|
|
3725
|
-
Object.keys(conf).forEach(function(optionName) {
|
|
3726
|
-
if (conf[optionName] === "boolean") {
|
|
3727
|
-
if (options[optionName]) {
|
|
3728
|
-
args.push("--" + optionName);
|
|
3729
|
-
}
|
|
3730
|
-
} else if (conf[optionName] === "string") {
|
|
3731
|
-
if (options[optionName]) {
|
|
3732
|
-
args.push("--" + optionName, encodeArg(options[optionName]));
|
|
3733
|
-
}
|
|
3734
|
-
}
|
|
3735
|
-
});
|
|
3736
|
-
return args;
|
|
3737
|
-
})({
|
|
3738
|
-
/* eslint-disable key-spacing */
|
|
3739
|
-
display: "string",
|
|
3740
|
-
displayOnly: "boolean",
|
|
3741
|
-
keyIn: "boolean",
|
|
3742
|
-
hideEchoBack: "boolean",
|
|
3743
|
-
mask: "string",
|
|
3744
|
-
limit: "string",
|
|
3745
|
-
caseSensitive: "boolean"
|
|
3746
|
-
/* eslint-enable key-spacing */
|
|
3747
|
-
}));
|
|
3748
|
-
}
|
|
3749
|
-
function _execFileSync(options, execOptions) {
|
|
3750
|
-
function getTempfile(name) {
|
|
3751
|
-
var suffix = "", filepath, fd;
|
|
3752
|
-
tempdir = tempdir || require("os").tmpdir();
|
|
3753
|
-
while (true) {
|
|
3754
|
-
filepath = pathUtil.join(tempdir, name + suffix);
|
|
3755
|
-
try {
|
|
3756
|
-
fd = fs10.openSync(filepath, "wx");
|
|
3757
|
-
} catch (e) {
|
|
3758
|
-
if (e.code === "EEXIST") {
|
|
3759
|
-
suffix++;
|
|
3760
|
-
continue;
|
|
3761
|
-
} else {
|
|
3762
|
-
throw e;
|
|
3763
|
-
}
|
|
3764
|
-
}
|
|
3765
|
-
fs10.closeSync(fd);
|
|
3766
|
-
break;
|
|
3767
|
-
}
|
|
3768
|
-
return filepath;
|
|
3769
|
-
}
|
|
3770
|
-
var res = {}, pathStdout = getTempfile("readline-sync.stdout"), pathStderr = getTempfile("readline-sync.stderr"), pathExit = getTempfile("readline-sync.exit"), pathDone = getTempfile("readline-sync.done"), crypto = require("crypto"), hostArgs, shellPath, shellArgs, exitCode, extMessage, shasum, decipher, password;
|
|
3771
|
-
shasum = crypto.createHash(ALGORITHM_HASH);
|
|
3772
|
-
shasum.update("" + process.pid + salt++ + Math.random());
|
|
3773
|
-
password = shasum.digest("hex");
|
|
3774
|
-
decipher = crypto.createDecipher(ALGORITHM_CIPHER, password);
|
|
3775
|
-
hostArgs = getHostArgs(options);
|
|
3776
|
-
if (IS_WIN) {
|
|
3777
|
-
shellPath = process.env.ComSpec || "cmd.exe";
|
|
3778
|
-
process.env.Q = '"';
|
|
3779
|
-
shellArgs = [
|
|
3780
|
-
"/V:ON",
|
|
3781
|
-
"/S",
|
|
3782
|
-
"/C",
|
|
3783
|
-
"(%Q%" + shellPath + "%Q% /V:ON /S /C %Q%%Q%" + extHostPath + "%Q%" + hostArgs.map(function(arg) {
|
|
3784
|
-
return " %Q%" + arg + "%Q%";
|
|
3785
|
-
}).join("") + " & (echo !ERRORLEVEL!)>%Q%" + pathExit + "%Q%%Q%) 2>%Q%" + pathStderr + "%Q% |%Q%" + process.execPath + "%Q% %Q%" + __dirname + "\\encrypt.js%Q% %Q%" + ALGORITHM_CIPHER + "%Q% %Q%" + password + "%Q% >%Q%" + pathStdout + "%Q% & (echo 1)>%Q%" + pathDone + "%Q%"
|
|
3786
|
-
];
|
|
3787
|
-
} else {
|
|
3788
|
-
shellPath = "/bin/sh";
|
|
3789
|
-
shellArgs = [
|
|
3790
|
-
"-c",
|
|
3791
|
-
// Use `()`, not `{}` for `-c` (text param)
|
|
3792
|
-
'("' + extHostPath + '"' + /* ESLint bug? */
|
|
3793
|
-
// eslint-disable-line no-path-concat
|
|
3794
|
-
hostArgs.map(function(arg) {
|
|
3795
|
-
return " '" + arg.replace(/'/g, "'\\''") + "'";
|
|
3796
|
-
}).join("") + '; echo $?>"' + pathExit + '") 2>"' + pathStderr + '" |"' + process.execPath + '" "' + __dirname + '/encrypt.js" "' + ALGORITHM_CIPHER + '" "' + password + '" >"' + pathStdout + '"; echo 1 >"' + pathDone + '"'
|
|
3797
|
-
];
|
|
3798
|
-
}
|
|
3799
|
-
if (_DBG_checkMethod) {
|
|
3800
|
-
_DBG_checkMethod("_execFileSync", hostArgs);
|
|
3801
|
-
}
|
|
3802
|
-
try {
|
|
3803
|
-
childProc.spawn(shellPath, shellArgs, execOptions);
|
|
3804
|
-
} catch (e) {
|
|
3805
|
-
res.error = new Error(e.message);
|
|
3806
|
-
res.error.method = "_execFileSync - spawn";
|
|
3807
|
-
res.error.program = shellPath;
|
|
3808
|
-
res.error.args = shellArgs;
|
|
3809
|
-
}
|
|
3810
|
-
while (fs10.readFileSync(pathDone, { encoding: options.encoding }).trim() !== "1") {
|
|
3811
|
-
}
|
|
3812
|
-
if ((exitCode = fs10.readFileSync(pathExit, { encoding: options.encoding }).trim()) === "0") {
|
|
3813
|
-
res.input = decipher.update(
|
|
3814
|
-
fs10.readFileSync(pathStdout, { encoding: "binary" }),
|
|
3815
|
-
"hex",
|
|
3816
|
-
options.encoding
|
|
3817
|
-
) + decipher.final(options.encoding);
|
|
3818
|
-
} else {
|
|
3819
|
-
extMessage = fs10.readFileSync(pathStderr, { encoding: options.encoding }).trim();
|
|
3820
|
-
res.error = new Error(DEFAULT_ERR_MSG + (extMessage ? "\n" + extMessage : ""));
|
|
3821
|
-
res.error.method = "_execFileSync";
|
|
3822
|
-
res.error.program = shellPath;
|
|
3823
|
-
res.error.args = shellArgs;
|
|
3824
|
-
res.error.extMessage = extMessage;
|
|
3825
|
-
res.error.exitCode = +exitCode;
|
|
3826
|
-
}
|
|
3827
|
-
fs10.unlinkSync(pathStdout);
|
|
3828
|
-
fs10.unlinkSync(pathStderr);
|
|
3829
|
-
fs10.unlinkSync(pathExit);
|
|
3830
|
-
fs10.unlinkSync(pathDone);
|
|
3831
|
-
return res;
|
|
3832
|
-
}
|
|
3833
|
-
function readlineExt(options) {
|
|
3834
|
-
var res = {}, execOptions = { env: process.env, encoding: options.encoding }, hostArgs, extMessage;
|
|
3835
|
-
if (!extHostPath) {
|
|
3836
|
-
if (IS_WIN) {
|
|
3837
|
-
if (process.env.PSModulePath) {
|
|
3838
|
-
extHostPath = "powershell.exe";
|
|
3839
|
-
extHostArgs = [
|
|
3840
|
-
"-ExecutionPolicy",
|
|
3841
|
-
"Bypass",
|
|
3842
|
-
"-File",
|
|
3843
|
-
__dirname + "\\read.ps1"
|
|
3844
|
-
];
|
|
3845
|
-
} else {
|
|
3846
|
-
extHostPath = "cscript.exe";
|
|
3847
|
-
extHostArgs = ["//nologo", __dirname + "\\read.cs.js"];
|
|
3848
|
-
}
|
|
3849
|
-
} else {
|
|
3850
|
-
extHostPath = "/bin/sh";
|
|
3851
|
-
extHostArgs = [__dirname + "/read.sh"];
|
|
3852
|
-
}
|
|
3853
|
-
}
|
|
3854
|
-
if (IS_WIN && !process.env.PSModulePath) {
|
|
3855
|
-
execOptions.stdio = [process.stdin];
|
|
3856
|
-
}
|
|
3857
|
-
if (childProc.execFileSync) {
|
|
3858
|
-
hostArgs = getHostArgs(options);
|
|
3859
|
-
if (_DBG_checkMethod) {
|
|
3860
|
-
_DBG_checkMethod("execFileSync", hostArgs);
|
|
3861
|
-
}
|
|
3862
|
-
try {
|
|
3863
|
-
res.input = childProc.execFileSync(extHostPath, hostArgs, execOptions);
|
|
3864
|
-
} catch (e) {
|
|
3865
|
-
extMessage = e.stderr ? (e.stderr + "").trim() : "";
|
|
3866
|
-
res.error = new Error(DEFAULT_ERR_MSG + (extMessage ? "\n" + extMessage : ""));
|
|
3867
|
-
res.error.method = "execFileSync";
|
|
3868
|
-
res.error.program = extHostPath;
|
|
3869
|
-
res.error.args = hostArgs;
|
|
3870
|
-
res.error.extMessage = extMessage;
|
|
3871
|
-
res.error.exitCode = e.status;
|
|
3872
|
-
res.error.code = e.code;
|
|
3873
|
-
res.error.signal = e.signal;
|
|
3874
|
-
}
|
|
3875
|
-
} else {
|
|
3876
|
-
res = _execFileSync(options, execOptions);
|
|
3877
|
-
}
|
|
3878
|
-
if (!res.error) {
|
|
3879
|
-
res.input = res.input.replace(/^\s*'|'\s*$/g, "");
|
|
3880
|
-
options.display = "";
|
|
3881
|
-
}
|
|
3882
|
-
return res;
|
|
3883
|
-
}
|
|
3884
|
-
function _readlineSync(options) {
|
|
3885
|
-
var input = "", displaySave = options.display, silent = !options.display && options.keyIn && options.hideEchoBack && !options.mask;
|
|
3886
|
-
function tryExt() {
|
|
3887
|
-
var res = readlineExt(options);
|
|
3888
|
-
if (res.error) {
|
|
3889
|
-
throw res.error;
|
|
3890
|
-
}
|
|
3891
|
-
return res.input;
|
|
3892
|
-
}
|
|
3893
|
-
if (_DBG_checkOptions) {
|
|
3894
|
-
_DBG_checkOptions(options);
|
|
3895
|
-
}
|
|
3896
|
-
(function() {
|
|
3897
|
-
var fsB, constants, verNum;
|
|
3898
|
-
function getFsB() {
|
|
3899
|
-
if (!fsB) {
|
|
3900
|
-
fsB = process.binding("fs");
|
|
3901
|
-
constants = process.binding("constants");
|
|
3902
|
-
constants = constants && constants.fs && typeof constants.fs.O_RDWR === "number" ? constants.fs : constants;
|
|
3903
|
-
}
|
|
3904
|
-
return fsB;
|
|
3905
|
-
}
|
|
3906
|
-
if (typeof fdR !== "string") {
|
|
3907
|
-
return;
|
|
3908
|
-
}
|
|
3909
|
-
fdR = null;
|
|
3910
|
-
if (IS_WIN) {
|
|
3911
|
-
verNum = (function(ver) {
|
|
3912
|
-
var nums = ver.replace(/^\D+/, "").split(".");
|
|
3913
|
-
var verNum2 = 0;
|
|
3914
|
-
if (nums[0] = +nums[0]) {
|
|
3915
|
-
verNum2 += nums[0] * 1e4;
|
|
3916
|
-
}
|
|
3917
|
-
if (nums[1] = +nums[1]) {
|
|
3918
|
-
verNum2 += nums[1] * 100;
|
|
3919
|
-
}
|
|
3920
|
-
if (nums[2] = +nums[2]) {
|
|
3921
|
-
verNum2 += nums[2];
|
|
3922
|
-
}
|
|
3923
|
-
return verNum2;
|
|
3924
|
-
})(process.version);
|
|
3925
|
-
if (!(verNum >= 20302 && verNum < 40204 || verNum >= 5e4 && verNum < 50100 || verNum >= 50600 && verNum < 60200) && process.stdin.isTTY) {
|
|
3926
|
-
process.stdin.pause();
|
|
3927
|
-
fdR = process.stdin.fd;
|
|
3928
|
-
ttyR = process.stdin._handle;
|
|
3929
|
-
} else {
|
|
3930
|
-
try {
|
|
3931
|
-
fdR = getFsB().open("CONIN$", constants.O_RDWR, parseInt("0666", 8));
|
|
3932
|
-
ttyR = new TTY(fdR, true);
|
|
3933
|
-
} catch (e) {
|
|
3934
|
-
}
|
|
3935
|
-
}
|
|
3936
|
-
if (process.stdout.isTTY) {
|
|
3937
|
-
fdW = process.stdout.fd;
|
|
3938
|
-
} else {
|
|
3939
|
-
try {
|
|
3940
|
-
fdW = fs10.openSync("\\\\.\\CON", "w");
|
|
3941
|
-
} catch (e) {
|
|
3942
|
-
}
|
|
3943
|
-
if (typeof fdW !== "number") {
|
|
3944
|
-
try {
|
|
3945
|
-
fdW = getFsB().open("CONOUT$", constants.O_RDWR, parseInt("0666", 8));
|
|
3946
|
-
} catch (e) {
|
|
3947
|
-
}
|
|
3948
|
-
}
|
|
3949
|
-
}
|
|
3950
|
-
} else {
|
|
3951
|
-
if (process.stdin.isTTY) {
|
|
3952
|
-
process.stdin.pause();
|
|
3953
|
-
try {
|
|
3954
|
-
fdR = fs10.openSync("/dev/tty", "r");
|
|
3955
|
-
ttyR = process.stdin._handle;
|
|
3956
|
-
} catch (e) {
|
|
3957
|
-
}
|
|
3958
|
-
} else {
|
|
3959
|
-
try {
|
|
3960
|
-
fdR = fs10.openSync("/dev/tty", "r");
|
|
3961
|
-
ttyR = new TTY(fdR, false);
|
|
3962
|
-
} catch (e) {
|
|
3963
|
-
}
|
|
3964
|
-
}
|
|
3965
|
-
if (process.stdout.isTTY) {
|
|
3966
|
-
fdW = process.stdout.fd;
|
|
3967
|
-
} else {
|
|
3968
|
-
try {
|
|
3969
|
-
fdW = fs10.openSync("/dev/tty", "w");
|
|
3970
|
-
} catch (e) {
|
|
3971
|
-
}
|
|
3972
|
-
}
|
|
3973
|
-
}
|
|
3974
|
-
})();
|
|
3975
|
-
(function() {
|
|
3976
|
-
var isCooked = !options.hideEchoBack && !options.keyIn, atEol, limit, buffer, reqSize, readSize, chunk, line;
|
|
3977
|
-
rawInput = "";
|
|
3978
|
-
function setRawMode(mode) {
|
|
3979
|
-
if (mode === isRawMode) {
|
|
3980
|
-
return true;
|
|
3981
|
-
}
|
|
3982
|
-
if (ttyR.setRawMode(mode) !== 0) {
|
|
3983
|
-
return false;
|
|
3984
|
-
}
|
|
3985
|
-
isRawMode = mode;
|
|
3986
|
-
return true;
|
|
3987
|
-
}
|
|
3988
|
-
if (_DBG_useExt || !ttyR || typeof fdW !== "number" && (options.display || !isCooked)) {
|
|
3989
|
-
input = tryExt();
|
|
3990
|
-
return;
|
|
3991
|
-
}
|
|
3992
|
-
if (options.display) {
|
|
3993
|
-
fs10.writeSync(fdW, options.display);
|
|
3994
|
-
options.display = "";
|
|
3995
|
-
}
|
|
3996
|
-
if (options.displayOnly) {
|
|
3997
|
-
return;
|
|
3998
|
-
}
|
|
3999
|
-
if (!setRawMode(!isCooked)) {
|
|
4000
|
-
input = tryExt();
|
|
4001
|
-
return;
|
|
4002
|
-
}
|
|
4003
|
-
reqSize = options.keyIn ? 1 : options.bufferSize;
|
|
4004
|
-
buffer = Buffer.allocUnsafe && Buffer.alloc ? Buffer.alloc(reqSize) : new Buffer(reqSize);
|
|
4005
|
-
if (options.keyIn && options.limit) {
|
|
4006
|
-
limit = new RegExp(
|
|
4007
|
-
"[^" + options.limit + "]",
|
|
4008
|
-
"g" + (options.caseSensitive ? "" : "i")
|
|
4009
|
-
);
|
|
4010
|
-
}
|
|
4011
|
-
while (true) {
|
|
4012
|
-
readSize = 0;
|
|
4013
|
-
try {
|
|
4014
|
-
readSize = fs10.readSync(fdR, buffer, 0, reqSize);
|
|
4015
|
-
} catch (e) {
|
|
4016
|
-
if (e.code !== "EOF") {
|
|
4017
|
-
setRawMode(false);
|
|
4018
|
-
input += tryExt();
|
|
4019
|
-
return;
|
|
4020
|
-
}
|
|
4021
|
-
}
|
|
4022
|
-
if (readSize > 0) {
|
|
4023
|
-
chunk = buffer.toString(options.encoding, 0, readSize);
|
|
4024
|
-
rawInput += chunk;
|
|
4025
|
-
} else {
|
|
4026
|
-
chunk = "\n";
|
|
4027
|
-
rawInput += String.fromCharCode(0);
|
|
4028
|
-
}
|
|
4029
|
-
if (chunk && typeof (line = (chunk.match(/^(.*?)[\r\n]/) || [])[1]) === "string") {
|
|
4030
|
-
chunk = line;
|
|
4031
|
-
atEol = true;
|
|
4032
|
-
}
|
|
4033
|
-
if (chunk) {
|
|
4034
|
-
chunk = chunk.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
|
|
4035
|
-
}
|
|
4036
|
-
if (chunk && limit) {
|
|
4037
|
-
chunk = chunk.replace(limit, "");
|
|
4038
|
-
}
|
|
4039
|
-
if (chunk) {
|
|
4040
|
-
if (!isCooked) {
|
|
4041
|
-
if (!options.hideEchoBack) {
|
|
4042
|
-
fs10.writeSync(fdW, chunk);
|
|
4043
|
-
} else if (options.mask) {
|
|
4044
|
-
fs10.writeSync(fdW, new Array(chunk.length + 1).join(options.mask));
|
|
4045
|
-
}
|
|
4046
|
-
}
|
|
4047
|
-
input += chunk;
|
|
4048
|
-
}
|
|
4049
|
-
if (!options.keyIn && atEol || options.keyIn && input.length >= reqSize) {
|
|
4050
|
-
break;
|
|
4051
|
-
}
|
|
4052
|
-
}
|
|
4053
|
-
if (!isCooked && !silent) {
|
|
4054
|
-
fs10.writeSync(fdW, "\n");
|
|
4055
|
-
}
|
|
4056
|
-
setRawMode(false);
|
|
4057
|
-
})();
|
|
4058
|
-
if (options.print && !silent) {
|
|
4059
|
-
options.print(
|
|
4060
|
-
displaySave + (options.displayOnly ? "" : (options.hideEchoBack ? new Array(input.length + 1).join(options.mask) : input) + "\n"),
|
|
4061
|
-
options.encoding
|
|
4062
|
-
);
|
|
4063
|
-
}
|
|
4064
|
-
return options.displayOnly ? "" : lastInput = options.keepWhitespace || options.keyIn ? input : input.trim();
|
|
4065
|
-
}
|
|
4066
|
-
function flattenArray(array, validator) {
|
|
4067
|
-
var flatArray = [];
|
|
4068
|
-
function _flattenArray(array2) {
|
|
4069
|
-
if (array2 == null) {
|
|
4070
|
-
return;
|
|
4071
|
-
}
|
|
4072
|
-
if (Array.isArray(array2)) {
|
|
4073
|
-
array2.forEach(_flattenArray);
|
|
4074
|
-
} else if (!validator || validator(array2)) {
|
|
4075
|
-
flatArray.push(array2);
|
|
4076
|
-
}
|
|
4077
|
-
}
|
|
4078
|
-
_flattenArray(array);
|
|
4079
|
-
return flatArray;
|
|
4080
|
-
}
|
|
4081
|
-
function escapePattern(pattern) {
|
|
4082
|
-
return pattern.replace(
|
|
4083
|
-
/[\x00-\x7f]/g,
|
|
4084
|
-
// eslint-disable-line no-control-regex
|
|
4085
|
-
function(s) {
|
|
4086
|
-
return "\\x" + ("00" + s.charCodeAt().toString(16)).substr(-2);
|
|
4087
|
-
}
|
|
4088
|
-
);
|
|
4089
|
-
}
|
|
4090
|
-
function margeOptions() {
|
|
4091
|
-
var optionsList = Array.prototype.slice.call(arguments), optionNames, fromDefault;
|
|
4092
|
-
if (optionsList.length && typeof optionsList[0] === "boolean") {
|
|
4093
|
-
fromDefault = optionsList.shift();
|
|
4094
|
-
if (fromDefault) {
|
|
4095
|
-
optionNames = Object.keys(defaultOptions);
|
|
4096
|
-
optionsList.unshift(defaultOptions);
|
|
4097
|
-
}
|
|
4098
|
-
}
|
|
4099
|
-
return optionsList.reduce(function(options, optionsPart) {
|
|
4100
|
-
if (optionsPart == null) {
|
|
4101
|
-
return options;
|
|
4102
|
-
}
|
|
4103
|
-
if (optionsPart.hasOwnProperty("noEchoBack") && !optionsPart.hasOwnProperty("hideEchoBack")) {
|
|
4104
|
-
optionsPart.hideEchoBack = optionsPart.noEchoBack;
|
|
4105
|
-
delete optionsPart.noEchoBack;
|
|
4106
|
-
}
|
|
4107
|
-
if (optionsPart.hasOwnProperty("noTrim") && !optionsPart.hasOwnProperty("keepWhitespace")) {
|
|
4108
|
-
optionsPart.keepWhitespace = optionsPart.noTrim;
|
|
4109
|
-
delete optionsPart.noTrim;
|
|
4110
|
-
}
|
|
4111
|
-
if (!fromDefault) {
|
|
4112
|
-
optionNames = Object.keys(optionsPart);
|
|
4113
|
-
}
|
|
4114
|
-
optionNames.forEach(function(optionName) {
|
|
4115
|
-
var value;
|
|
4116
|
-
if (!optionsPart.hasOwnProperty(optionName)) {
|
|
4117
|
-
return;
|
|
4118
|
-
}
|
|
4119
|
-
value = optionsPart[optionName];
|
|
4120
|
-
switch (optionName) {
|
|
4121
|
-
// _readlineSync <- * * -> defaultOptions
|
|
4122
|
-
// ================ string
|
|
4123
|
-
case "mask":
|
|
4124
|
-
// * *
|
|
4125
|
-
case "limitMessage":
|
|
4126
|
-
// *
|
|
4127
|
-
case "defaultInput":
|
|
4128
|
-
// *
|
|
4129
|
-
case "encoding":
|
|
4130
|
-
value = value != null ? value + "" : "";
|
|
4131
|
-
if (value && optionName !== "limitMessage") {
|
|
4132
|
-
value = value.replace(/[\r\n]/g, "");
|
|
4133
|
-
}
|
|
4134
|
-
options[optionName] = value;
|
|
4135
|
-
break;
|
|
4136
|
-
// ================ number(int)
|
|
4137
|
-
case "bufferSize":
|
|
4138
|
-
if (!isNaN(value = parseInt(value, 10)) && typeof value === "number") {
|
|
4139
|
-
options[optionName] = value;
|
|
4140
|
-
}
|
|
4141
|
-
break;
|
|
4142
|
-
// ================ boolean
|
|
4143
|
-
case "displayOnly":
|
|
4144
|
-
// *
|
|
4145
|
-
case "keyIn":
|
|
4146
|
-
// *
|
|
4147
|
-
case "hideEchoBack":
|
|
4148
|
-
// * *
|
|
4149
|
-
case "caseSensitive":
|
|
4150
|
-
// * *
|
|
4151
|
-
case "keepWhitespace":
|
|
4152
|
-
// * *
|
|
4153
|
-
case "history":
|
|
4154
|
-
// *
|
|
4155
|
-
case "cd":
|
|
4156
|
-
options[optionName] = !!value;
|
|
4157
|
-
break;
|
|
4158
|
-
// ================ array
|
|
4159
|
-
case "limit":
|
|
4160
|
-
// * * to string for readlineExt
|
|
4161
|
-
case "trueValue":
|
|
4162
|
-
// *
|
|
4163
|
-
case "falseValue":
|
|
4164
|
-
options[optionName] = flattenArray(value, function(value2) {
|
|
4165
|
-
var type = typeof value2;
|
|
4166
|
-
return type === "string" || type === "number" || type === "function" || value2 instanceof RegExp;
|
|
4167
|
-
}).map(function(value2) {
|
|
4168
|
-
return typeof value2 === "string" ? value2.replace(/[\r\n]/g, "") : value2;
|
|
4169
|
-
});
|
|
4170
|
-
break;
|
|
4171
|
-
// ================ function
|
|
4172
|
-
case "print":
|
|
4173
|
-
// * *
|
|
4174
|
-
case "phContent":
|
|
4175
|
-
// *
|
|
4176
|
-
case "preCheck":
|
|
4177
|
-
options[optionName] = typeof value === "function" ? value : void 0;
|
|
4178
|
-
break;
|
|
4179
|
-
// ================ other
|
|
4180
|
-
case "prompt":
|
|
4181
|
-
// *
|
|
4182
|
-
case "display":
|
|
4183
|
-
options[optionName] = value != null ? value : "";
|
|
4184
|
-
break;
|
|
4185
|
-
}
|
|
4186
|
-
});
|
|
4187
|
-
return options;
|
|
4188
|
-
}, {});
|
|
4189
|
-
}
|
|
4190
|
-
function isMatched(res, comps, caseSensitive) {
|
|
4191
|
-
return comps.some(function(comp) {
|
|
4192
|
-
var type = typeof comp;
|
|
4193
|
-
return type === "string" ? caseSensitive ? res === comp : res.toLowerCase() === comp.toLowerCase() : type === "number" ? parseFloat(res) === comp : type === "function" ? comp(res) : comp instanceof RegExp ? comp.test(res) : false;
|
|
4194
|
-
});
|
|
4195
|
-
}
|
|
4196
|
-
function replaceHomePath(path13, expand2) {
|
|
4197
|
-
var homePath = pathUtil.normalize(
|
|
4198
|
-
IS_WIN ? (process.env.HOMEDRIVE || "") + (process.env.HOMEPATH || "") : process.env.HOME || ""
|
|
4199
|
-
).replace(/[/\\]+$/, "");
|
|
4200
|
-
path13 = pathUtil.normalize(path13);
|
|
4201
|
-
return expand2 ? path13.replace(/^~(?=\/|\\|$)/, homePath) : path13.replace(new RegExp("^" + escapePattern(homePath) + "(?=\\/|\\\\|$)", IS_WIN ? "i" : ""), "~");
|
|
4202
|
-
}
|
|
4203
|
-
function replacePlaceholder(text, generator) {
|
|
4204
|
-
var PTN_INNER = "(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?", rePlaceholder = new RegExp("(\\$)?(\\$<" + PTN_INNER + ">)", "g"), rePlaceholderCompat = new RegExp("(\\$)?(\\$\\{" + PTN_INNER + "\\})", "g");
|
|
4205
|
-
function getPlaceholderText(s, escape2, placeholder, pre, param, post) {
|
|
4206
|
-
var text2;
|
|
4207
|
-
return escape2 || typeof (text2 = generator(param)) !== "string" ? placeholder : text2 ? (pre || "") + text2 + (post || "") : "";
|
|
4208
|
-
}
|
|
4209
|
-
return text.replace(rePlaceholder, getPlaceholderText).replace(rePlaceholderCompat, getPlaceholderText);
|
|
4210
|
-
}
|
|
4211
|
-
function array2charlist(array, caseSensitive, collectSymbols) {
|
|
4212
|
-
var group = [], groupClass = -1, charCode = 0, symbols = "", values, suppressed;
|
|
4213
|
-
function addGroup(groups, group2) {
|
|
4214
|
-
if (group2.length > 3) {
|
|
4215
|
-
groups.push(group2[0] + "..." + group2[group2.length - 1]);
|
|
4216
|
-
suppressed = true;
|
|
4217
|
-
} else if (group2.length) {
|
|
4218
|
-
groups = groups.concat(group2);
|
|
4219
|
-
}
|
|
4220
|
-
return groups;
|
|
4221
|
-
}
|
|
4222
|
-
values = array.reduce(function(chars, value) {
|
|
4223
|
-
return chars.concat((value + "").split(""));
|
|
4224
|
-
}, []).reduce(function(groups, curChar) {
|
|
4225
|
-
var curGroupClass, curCharCode;
|
|
4226
|
-
if (!caseSensitive) {
|
|
4227
|
-
curChar = curChar.toLowerCase();
|
|
4228
|
-
}
|
|
4229
|
-
curGroupClass = /^\d$/.test(curChar) ? 1 : /^[A-Z]$/.test(curChar) ? 2 : /^[a-z]$/.test(curChar) ? 3 : 0;
|
|
4230
|
-
if (collectSymbols && curGroupClass === 0) {
|
|
4231
|
-
symbols += curChar;
|
|
4232
|
-
} else {
|
|
4233
|
-
curCharCode = curChar.charCodeAt(0);
|
|
4234
|
-
if (curGroupClass && curGroupClass === groupClass && curCharCode === charCode + 1) {
|
|
4235
|
-
group.push(curChar);
|
|
4236
|
-
} else {
|
|
4237
|
-
groups = addGroup(groups, group);
|
|
4238
|
-
group = [curChar];
|
|
4239
|
-
groupClass = curGroupClass;
|
|
4240
|
-
}
|
|
4241
|
-
charCode = curCharCode;
|
|
4242
|
-
}
|
|
4243
|
-
return groups;
|
|
4244
|
-
}, []);
|
|
4245
|
-
values = addGroup(values, group);
|
|
4246
|
-
if (symbols) {
|
|
4247
|
-
values.push(symbols);
|
|
4248
|
-
suppressed = true;
|
|
4249
|
-
}
|
|
4250
|
-
return { values, suppressed };
|
|
4251
|
-
}
|
|
4252
|
-
function joinChunks(chunks, suppressed) {
|
|
4253
|
-
return chunks.join(chunks.length > 2 ? ", " : suppressed ? " / " : "/");
|
|
4254
|
-
}
|
|
4255
|
-
function getPhContent(param, options) {
|
|
4256
|
-
var resCharlist = {}, text, values, arg;
|
|
4257
|
-
if (options.phContent) {
|
|
4258
|
-
text = options.phContent(param, options);
|
|
4259
|
-
}
|
|
4260
|
-
if (typeof text !== "string") {
|
|
4261
|
-
switch (param) {
|
|
4262
|
-
case "hideEchoBack":
|
|
4263
|
-
case "mask":
|
|
4264
|
-
case "defaultInput":
|
|
4265
|
-
case "caseSensitive":
|
|
4266
|
-
case "keepWhitespace":
|
|
4267
|
-
case "encoding":
|
|
4268
|
-
case "bufferSize":
|
|
4269
|
-
case "history":
|
|
4270
|
-
case "cd":
|
|
4271
|
-
text = !options.hasOwnProperty(param) ? "" : typeof options[param] === "boolean" ? options[param] ? "on" : "off" : options[param] + "";
|
|
4272
|
-
break;
|
|
4273
|
-
// case 'prompt':
|
|
4274
|
-
// case 'query':
|
|
4275
|
-
// case 'display':
|
|
4276
|
-
// text = options.hasOwnProperty('displaySrc') ? options.displaySrc + '' : '';
|
|
4277
|
-
// break;
|
|
4278
|
-
case "limit":
|
|
4279
|
-
case "trueValue":
|
|
4280
|
-
case "falseValue":
|
|
4281
|
-
values = options[options.hasOwnProperty(param + "Src") ? param + "Src" : param];
|
|
4282
|
-
if (options.keyIn) {
|
|
4283
|
-
resCharlist = array2charlist(values, options.caseSensitive);
|
|
4284
|
-
values = resCharlist.values;
|
|
4285
|
-
} else {
|
|
4286
|
-
values = values.filter(function(value) {
|
|
4287
|
-
var type = typeof value;
|
|
4288
|
-
return type === "string" || type === "number";
|
|
4289
|
-
});
|
|
4290
|
-
}
|
|
4291
|
-
text = joinChunks(values, resCharlist.suppressed);
|
|
4292
|
-
break;
|
|
4293
|
-
case "limitCount":
|
|
4294
|
-
case "limitCountNotZero":
|
|
4295
|
-
text = options[options.hasOwnProperty("limitSrc") ? "limitSrc" : "limit"].length;
|
|
4296
|
-
text = text || param !== "limitCountNotZero" ? text + "" : "";
|
|
4297
|
-
break;
|
|
4298
|
-
case "lastInput":
|
|
4299
|
-
text = lastInput;
|
|
4300
|
-
break;
|
|
4301
|
-
case "cwd":
|
|
4302
|
-
case "CWD":
|
|
4303
|
-
case "cwdHome":
|
|
4304
|
-
text = process.cwd();
|
|
4305
|
-
if (param === "CWD") {
|
|
4306
|
-
text = pathUtil.basename(text);
|
|
4307
|
-
} else if (param === "cwdHome") {
|
|
4308
|
-
text = replaceHomePath(text);
|
|
4309
|
-
}
|
|
4310
|
-
break;
|
|
4311
|
-
case "date":
|
|
4312
|
-
case "time":
|
|
4313
|
-
case "localeDate":
|
|
4314
|
-
case "localeTime":
|
|
4315
|
-
text = (/* @__PURE__ */ new Date())["to" + param.replace(/^./, function(str) {
|
|
4316
|
-
return str.toUpperCase();
|
|
4317
|
-
}) + "String"]();
|
|
4318
|
-
break;
|
|
4319
|
-
default:
|
|
4320
|
-
if (typeof (arg = (param.match(/^history_m(\d+)$/) || [])[1]) === "string") {
|
|
4321
|
-
text = inputHistory[inputHistory.length - arg] || "";
|
|
4322
|
-
}
|
|
4323
|
-
}
|
|
4324
|
-
}
|
|
4325
|
-
return text;
|
|
4326
|
-
}
|
|
4327
|
-
function getPhCharlist(param) {
|
|
4328
|
-
var matches = /^(.)-(.)$/.exec(param), text = "", from, to, code, step;
|
|
4329
|
-
if (!matches) {
|
|
4330
|
-
return null;
|
|
4331
|
-
}
|
|
4332
|
-
from = matches[1].charCodeAt(0);
|
|
4333
|
-
to = matches[2].charCodeAt(0);
|
|
4334
|
-
step = from < to ? 1 : -1;
|
|
4335
|
-
for (code = from; code !== to + step; code += step) {
|
|
4336
|
-
text += String.fromCharCode(code);
|
|
4337
|
-
}
|
|
4338
|
-
return text;
|
|
4339
|
-
}
|
|
4340
|
-
function parseCl(cl) {
|
|
4341
|
-
var reToken = new RegExp(/(\s*)(?:("|')(.*?)(?:\2|$)|(\S+))/g), taken = "", args = [], matches, part;
|
|
4342
|
-
cl = cl.trim();
|
|
4343
|
-
while (matches = reToken.exec(cl)) {
|
|
4344
|
-
part = matches[3] || matches[4] || "";
|
|
4345
|
-
if (matches[1]) {
|
|
4346
|
-
args.push(taken);
|
|
4347
|
-
taken = "";
|
|
4348
|
-
}
|
|
4349
|
-
taken += part;
|
|
4350
|
-
}
|
|
4351
|
-
if (taken) {
|
|
4352
|
-
args.push(taken);
|
|
4353
|
-
}
|
|
4354
|
-
return args;
|
|
4355
|
-
}
|
|
4356
|
-
function toBool(res, options) {
|
|
4357
|
-
return options.trueValue.length && isMatched(res, options.trueValue, options.caseSensitive) ? true : options.falseValue.length && isMatched(res, options.falseValue, options.caseSensitive) ? false : res;
|
|
4358
|
-
}
|
|
4359
|
-
function getValidLine(options) {
|
|
4360
|
-
var res, forceNext, limitMessage, matches, histInput, args, resCheck;
|
|
4361
|
-
function _getPhContent(param) {
|
|
4362
|
-
return getPhContent(param, options);
|
|
4363
|
-
}
|
|
4364
|
-
function addDisplay(text) {
|
|
4365
|
-
options.display += (/[^\r\n]$/.test(options.display) ? "\n" : "") + text;
|
|
4366
|
-
}
|
|
4367
|
-
options.limitSrc = options.limit;
|
|
4368
|
-
options.displaySrc = options.display;
|
|
4369
|
-
options.limit = "";
|
|
4370
|
-
options.display = replacePlaceholder(options.display + "", _getPhContent);
|
|
4371
|
-
while (true) {
|
|
4372
|
-
res = _readlineSync(options);
|
|
4373
|
-
forceNext = false;
|
|
4374
|
-
limitMessage = "";
|
|
4375
|
-
if (options.defaultInput && !res) {
|
|
4376
|
-
res = options.defaultInput;
|
|
4377
|
-
}
|
|
4378
|
-
if (options.history) {
|
|
4379
|
-
if (matches = /^\s*!(?:!|-1)(:p)?\s*$/.exec(res)) {
|
|
4380
|
-
histInput = inputHistory[0] || "";
|
|
4381
|
-
if (matches[1]) {
|
|
4382
|
-
forceNext = true;
|
|
4383
|
-
} else {
|
|
4384
|
-
res = histInput;
|
|
4385
|
-
}
|
|
4386
|
-
addDisplay(histInput + "\n");
|
|
4387
|
-
if (!forceNext) {
|
|
4388
|
-
options.displayOnly = true;
|
|
4389
|
-
_readlineSync(options);
|
|
4390
|
-
options.displayOnly = false;
|
|
4391
|
-
}
|
|
4392
|
-
} else if (res && res !== inputHistory[inputHistory.length - 1]) {
|
|
4393
|
-
inputHistory = [res];
|
|
4394
|
-
}
|
|
4395
|
-
}
|
|
4396
|
-
if (!forceNext && options.cd && res) {
|
|
4397
|
-
args = parseCl(res);
|
|
4398
|
-
switch (args[0].toLowerCase()) {
|
|
4399
|
-
case "cd":
|
|
4400
|
-
if (args[1]) {
|
|
4401
|
-
try {
|
|
4402
|
-
process.chdir(replaceHomePath(args[1], true));
|
|
4403
|
-
} catch (e) {
|
|
4404
|
-
addDisplay(e + "");
|
|
4405
|
-
}
|
|
4406
|
-
}
|
|
4407
|
-
forceNext = true;
|
|
4408
|
-
break;
|
|
4409
|
-
case "pwd":
|
|
4410
|
-
addDisplay(process.cwd());
|
|
4411
|
-
forceNext = true;
|
|
4412
|
-
break;
|
|
4413
|
-
}
|
|
4414
|
-
}
|
|
4415
|
-
if (!forceNext && options.preCheck) {
|
|
4416
|
-
resCheck = options.preCheck(res, options);
|
|
4417
|
-
res = resCheck.res;
|
|
4418
|
-
if (resCheck.forceNext) {
|
|
4419
|
-
forceNext = true;
|
|
4420
|
-
}
|
|
4421
|
-
}
|
|
4422
|
-
if (!forceNext) {
|
|
4423
|
-
if (!options.limitSrc.length || isMatched(res, options.limitSrc, options.caseSensitive)) {
|
|
4424
|
-
break;
|
|
4425
|
-
}
|
|
4426
|
-
if (options.limitMessage) {
|
|
4427
|
-
limitMessage = replacePlaceholder(options.limitMessage, _getPhContent);
|
|
4428
|
-
}
|
|
4429
|
-
}
|
|
4430
|
-
addDisplay((limitMessage ? limitMessage + "\n" : "") + replacePlaceholder(options.displaySrc + "", _getPhContent));
|
|
4431
|
-
}
|
|
4432
|
-
return toBool(res, options);
|
|
4433
|
-
}
|
|
4434
|
-
exports2._DBG_set_useExt = function(val) {
|
|
4435
|
-
_DBG_useExt = val;
|
|
4436
|
-
};
|
|
4437
|
-
exports2._DBG_set_checkOptions = function(val) {
|
|
4438
|
-
_DBG_checkOptions = val;
|
|
4439
|
-
};
|
|
4440
|
-
exports2._DBG_set_checkMethod = function(val) {
|
|
4441
|
-
_DBG_checkMethod = val;
|
|
4442
|
-
};
|
|
4443
|
-
exports2._DBG_clearHistory = function() {
|
|
4444
|
-
lastInput = "";
|
|
4445
|
-
inputHistory = [];
|
|
4446
|
-
};
|
|
4447
|
-
exports2.setDefaultOptions = function(options) {
|
|
4448
|
-
defaultOptions = margeOptions(true, options);
|
|
4449
|
-
return margeOptions(true);
|
|
4450
|
-
};
|
|
4451
|
-
exports2.question = function(query, options) {
|
|
4452
|
-
return getValidLine(margeOptions(margeOptions(true, options), {
|
|
4453
|
-
display: query
|
|
4454
|
-
}));
|
|
4455
|
-
};
|
|
4456
|
-
exports2.prompt = function(options) {
|
|
4457
|
-
var readOptions = margeOptions(true, options);
|
|
4458
|
-
readOptions.display = readOptions.prompt;
|
|
4459
|
-
return getValidLine(readOptions);
|
|
4460
|
-
};
|
|
4461
|
-
exports2.keyIn = function(query, options) {
|
|
4462
|
-
var readOptions = margeOptions(margeOptions(true, options), {
|
|
4463
|
-
display: query,
|
|
4464
|
-
keyIn: true,
|
|
4465
|
-
keepWhitespace: true
|
|
4466
|
-
});
|
|
4467
|
-
readOptions.limitSrc = readOptions.limit.filter(function(value) {
|
|
4468
|
-
var type = typeof value;
|
|
4469
|
-
return type === "string" || type === "number";
|
|
4470
|
-
}).map(function(text) {
|
|
4471
|
-
return replacePlaceholder(text + "", getPhCharlist);
|
|
4472
|
-
});
|
|
4473
|
-
readOptions.limit = escapePattern(readOptions.limitSrc.join(""));
|
|
4474
|
-
["trueValue", "falseValue"].forEach(function(optionName) {
|
|
4475
|
-
readOptions[optionName] = readOptions[optionName].reduce(function(comps, comp) {
|
|
4476
|
-
var type = typeof comp;
|
|
4477
|
-
if (type === "string" || type === "number") {
|
|
4478
|
-
comps = comps.concat((comp + "").split(""));
|
|
4479
|
-
} else {
|
|
4480
|
-
comps.push(comp);
|
|
4481
|
-
}
|
|
4482
|
-
return comps;
|
|
4483
|
-
}, []);
|
|
4484
|
-
});
|
|
4485
|
-
readOptions.display = replacePlaceholder(
|
|
4486
|
-
readOptions.display + "",
|
|
4487
|
-
function(param) {
|
|
4488
|
-
return getPhContent(param, readOptions);
|
|
4489
|
-
}
|
|
4490
|
-
);
|
|
4491
|
-
return toBool(_readlineSync(readOptions), readOptions);
|
|
4492
|
-
};
|
|
4493
|
-
exports2.questionEMail = function(query, options) {
|
|
4494
|
-
if (query == null) {
|
|
4495
|
-
query = "Input e-mail address: ";
|
|
4496
|
-
}
|
|
4497
|
-
return exports2.question(query, margeOptions({
|
|
4498
|
-
// -------- default
|
|
4499
|
-
hideEchoBack: false,
|
|
4500
|
-
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
|
4501
|
-
limit: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,
|
|
4502
|
-
limitMessage: "Input valid e-mail address, please.",
|
|
4503
|
-
trueValue: null,
|
|
4504
|
-
falseValue: null
|
|
4505
|
-
}, options, {
|
|
4506
|
-
// -------- forced
|
|
4507
|
-
keepWhitespace: false,
|
|
4508
|
-
cd: false
|
|
4509
|
-
}));
|
|
4510
|
-
};
|
|
4511
|
-
exports2.questionNewPassword = function(query, options) {
|
|
4512
|
-
var resCharlist, min, max, readOptions = margeOptions({
|
|
4513
|
-
// -------- default
|
|
4514
|
-
hideEchoBack: true,
|
|
4515
|
-
mask: "*",
|
|
4516
|
-
limitMessage: "It can include: $<charlist>\nAnd the length must be: $<length>",
|
|
4517
|
-
trueValue: null,
|
|
4518
|
-
falseValue: null,
|
|
4519
|
-
caseSensitive: true
|
|
4520
|
-
}, options, {
|
|
4521
|
-
// -------- forced
|
|
4522
|
-
history: false,
|
|
4523
|
-
cd: false,
|
|
4524
|
-
// limit (by charlist etc.),
|
|
4525
|
-
phContent: function(param) {
|
|
4526
|
-
return param === "charlist" ? resCharlist.text : param === "length" ? min + "..." + max : null;
|
|
4527
|
-
}
|
|
4528
|
-
}), charlist, confirmMessage, unmatchMessage, limit, limitMessage, res1, res2;
|
|
4529
|
-
options = options || {};
|
|
4530
|
-
charlist = replacePlaceholder(
|
|
4531
|
-
options.charlist ? options.charlist + "" : "$<!-~>",
|
|
4532
|
-
getPhCharlist
|
|
4533
|
-
);
|
|
4534
|
-
if (isNaN(min = parseInt(options.min, 10)) || typeof min !== "number") {
|
|
4535
|
-
min = 12;
|
|
4536
|
-
}
|
|
4537
|
-
if (isNaN(max = parseInt(options.max, 10)) || typeof max !== "number") {
|
|
4538
|
-
max = 24;
|
|
4539
|
-
}
|
|
4540
|
-
limit = new RegExp("^[" + escapePattern(charlist) + "]{" + min + "," + max + "}$");
|
|
4541
|
-
resCharlist = array2charlist([charlist], readOptions.caseSensitive, true);
|
|
4542
|
-
resCharlist.text = joinChunks(resCharlist.values, resCharlist.suppressed);
|
|
4543
|
-
confirmMessage = options.confirmMessage != null ? options.confirmMessage : "Reinput a same one to confirm it: ";
|
|
4544
|
-
unmatchMessage = options.unmatchMessage != null ? options.unmatchMessage : "It differs from first one. Hit only the Enter key if you want to retry from first one.";
|
|
4545
|
-
if (query == null) {
|
|
4546
|
-
query = "Input new password: ";
|
|
4547
|
-
}
|
|
4548
|
-
limitMessage = readOptions.limitMessage;
|
|
4549
|
-
while (!res2) {
|
|
4550
|
-
readOptions.limit = limit;
|
|
4551
|
-
readOptions.limitMessage = limitMessage;
|
|
4552
|
-
res1 = exports2.question(query, readOptions);
|
|
4553
|
-
readOptions.limit = [res1, ""];
|
|
4554
|
-
readOptions.limitMessage = unmatchMessage;
|
|
4555
|
-
res2 = exports2.question(confirmMessage, readOptions);
|
|
4556
|
-
}
|
|
4557
|
-
return res1;
|
|
4558
|
-
};
|
|
4559
|
-
function _questionNum(query, options, parser) {
|
|
4560
|
-
var validValue;
|
|
4561
|
-
function getValidValue(value) {
|
|
4562
|
-
validValue = parser(value);
|
|
4563
|
-
return !isNaN(validValue) && typeof validValue === "number";
|
|
4564
|
-
}
|
|
4565
|
-
exports2.question(query, margeOptions({
|
|
4566
|
-
// -------- default
|
|
4567
|
-
limitMessage: "Input valid number, please."
|
|
4568
|
-
}, options, {
|
|
4569
|
-
// -------- forced
|
|
4570
|
-
limit: getValidValue,
|
|
4571
|
-
cd: false
|
|
4572
|
-
// trueValue, falseValue, caseSensitive, keepWhitespace don't work.
|
|
4573
|
-
}));
|
|
4574
|
-
return validValue;
|
|
4575
|
-
}
|
|
4576
|
-
exports2.questionInt = function(query, options) {
|
|
4577
|
-
return _questionNum(query, options, function(value) {
|
|
4578
|
-
return parseInt(value, 10);
|
|
4579
|
-
});
|
|
4580
|
-
};
|
|
4581
|
-
exports2.questionFloat = function(query, options) {
|
|
4582
|
-
return _questionNum(query, options, parseFloat);
|
|
4583
|
-
};
|
|
4584
|
-
exports2.questionPath = function(query, options) {
|
|
4585
|
-
var error = "", validPath, readOptions = margeOptions({
|
|
4586
|
-
// -------- default
|
|
4587
|
-
hideEchoBack: false,
|
|
4588
|
-
limitMessage: "$<error(\n)>Input valid path, please.$<( Min:)min>$<( Max:)max>",
|
|
4589
|
-
history: true,
|
|
4590
|
-
cd: true
|
|
4591
|
-
}, options, {
|
|
4592
|
-
// -------- forced
|
|
4593
|
-
keepWhitespace: false,
|
|
4594
|
-
limit: function(value) {
|
|
4595
|
-
var exists, stat, res;
|
|
4596
|
-
value = replaceHomePath(value, true);
|
|
4597
|
-
error = "";
|
|
4598
|
-
function mkdirParents(dirPath) {
|
|
4599
|
-
dirPath.split(/\/|\\/).reduce(function(parents, dir) {
|
|
4600
|
-
var path13 = pathUtil.resolve(parents += dir + pathUtil.sep);
|
|
4601
|
-
if (!fs10.existsSync(path13)) {
|
|
4602
|
-
fs10.mkdirSync(path13);
|
|
4603
|
-
} else if (!fs10.statSync(path13).isDirectory()) {
|
|
4604
|
-
throw new Error("Non directory already exists: " + path13);
|
|
4605
|
-
}
|
|
4606
|
-
return parents;
|
|
4607
|
-
}, "");
|
|
4608
|
-
}
|
|
4609
|
-
try {
|
|
4610
|
-
exists = fs10.existsSync(value);
|
|
4611
|
-
validPath = exists ? fs10.realpathSync(value) : pathUtil.resolve(value);
|
|
4612
|
-
if (!options.hasOwnProperty("exists") && !exists || typeof options.exists === "boolean" && options.exists !== exists) {
|
|
4613
|
-
error = (exists ? "Already exists" : "No such file or directory") + ": " + validPath;
|
|
4614
|
-
return false;
|
|
4615
|
-
}
|
|
4616
|
-
if (!exists && options.create) {
|
|
4617
|
-
if (options.isDirectory) {
|
|
4618
|
-
mkdirParents(validPath);
|
|
4619
|
-
} else {
|
|
4620
|
-
mkdirParents(pathUtil.dirname(validPath));
|
|
4621
|
-
fs10.closeSync(fs10.openSync(validPath, "w"));
|
|
4622
|
-
}
|
|
4623
|
-
validPath = fs10.realpathSync(validPath);
|
|
4624
|
-
}
|
|
4625
|
-
if (exists && (options.min || options.max || options.isFile || options.isDirectory)) {
|
|
4626
|
-
stat = fs10.statSync(validPath);
|
|
4627
|
-
if (options.isFile && !stat.isFile()) {
|
|
4628
|
-
error = "Not file: " + validPath;
|
|
4629
|
-
return false;
|
|
4630
|
-
} else if (options.isDirectory && !stat.isDirectory()) {
|
|
4631
|
-
error = "Not directory: " + validPath;
|
|
4632
|
-
return false;
|
|
4633
|
-
} else if (options.min && stat.size < +options.min || options.max && stat.size > +options.max) {
|
|
4634
|
-
error = "Size " + stat.size + " is out of range: " + validPath;
|
|
4635
|
-
return false;
|
|
4636
|
-
}
|
|
4637
|
-
}
|
|
4638
|
-
if (typeof options.validate === "function" && (res = options.validate(validPath)) !== true) {
|
|
4639
|
-
if (typeof res === "string") {
|
|
4640
|
-
error = res;
|
|
4641
|
-
}
|
|
4642
|
-
return false;
|
|
4643
|
-
}
|
|
4644
|
-
} catch (e) {
|
|
4645
|
-
error = e + "";
|
|
4646
|
-
return false;
|
|
4647
|
-
}
|
|
4648
|
-
return true;
|
|
4649
|
-
},
|
|
4650
|
-
// trueValue, falseValue, caseSensitive don't work.
|
|
4651
|
-
phContent: function(param) {
|
|
4652
|
-
return param === "error" ? error : param !== "min" && param !== "max" ? null : options.hasOwnProperty(param) ? options[param] + "" : "";
|
|
4653
|
-
}
|
|
4654
|
-
});
|
|
4655
|
-
options = options || {};
|
|
4656
|
-
if (query == null) {
|
|
4657
|
-
query = 'Input path (you can "cd" and "pwd"): ';
|
|
4658
|
-
}
|
|
4659
|
-
exports2.question(query, readOptions);
|
|
4660
|
-
return validPath;
|
|
4661
|
-
};
|
|
4662
|
-
function getClHandler(commandHandler, options) {
|
|
4663
|
-
var clHandler = {}, hIndex = {};
|
|
4664
|
-
if (typeof commandHandler === "object") {
|
|
4665
|
-
Object.keys(commandHandler).forEach(function(cmd) {
|
|
4666
|
-
if (typeof commandHandler[cmd] === "function") {
|
|
4667
|
-
hIndex[options.caseSensitive ? cmd : cmd.toLowerCase()] = commandHandler[cmd];
|
|
4668
|
-
}
|
|
4669
|
-
});
|
|
4670
|
-
clHandler.preCheck = function(res) {
|
|
4671
|
-
var cmdKey;
|
|
4672
|
-
clHandler.args = parseCl(res);
|
|
4673
|
-
cmdKey = clHandler.args[0] || "";
|
|
4674
|
-
if (!options.caseSensitive) {
|
|
4675
|
-
cmdKey = cmdKey.toLowerCase();
|
|
4676
|
-
}
|
|
4677
|
-
clHandler.hRes = cmdKey !== "_" && hIndex.hasOwnProperty(cmdKey) ? hIndex[cmdKey].apply(res, clHandler.args.slice(1)) : hIndex.hasOwnProperty("_") ? hIndex._.apply(res, clHandler.args) : null;
|
|
4678
|
-
return { res, forceNext: false };
|
|
4679
|
-
};
|
|
4680
|
-
if (!hIndex.hasOwnProperty("_")) {
|
|
4681
|
-
clHandler.limit = function() {
|
|
4682
|
-
var cmdKey = clHandler.args[0] || "";
|
|
4683
|
-
if (!options.caseSensitive) {
|
|
4684
|
-
cmdKey = cmdKey.toLowerCase();
|
|
4685
|
-
}
|
|
4686
|
-
return hIndex.hasOwnProperty(cmdKey);
|
|
4687
|
-
};
|
|
4688
|
-
}
|
|
4689
|
-
} else {
|
|
4690
|
-
clHandler.preCheck = function(res) {
|
|
4691
|
-
clHandler.args = parseCl(res);
|
|
4692
|
-
clHandler.hRes = typeof commandHandler === "function" ? commandHandler.apply(res, clHandler.args) : true;
|
|
4693
|
-
return { res, forceNext: false };
|
|
4694
|
-
};
|
|
4695
|
-
}
|
|
4696
|
-
return clHandler;
|
|
4697
|
-
}
|
|
4698
|
-
exports2.promptCL = function(commandHandler, options) {
|
|
4699
|
-
var readOptions = margeOptions({
|
|
4700
|
-
// -------- default
|
|
4701
|
-
hideEchoBack: false,
|
|
4702
|
-
limitMessage: "Requested command is not available.",
|
|
4703
|
-
caseSensitive: false,
|
|
4704
|
-
history: true
|
|
4705
|
-
}, options), clHandler = getClHandler(commandHandler, readOptions);
|
|
4706
|
-
readOptions.limit = clHandler.limit;
|
|
4707
|
-
readOptions.preCheck = clHandler.preCheck;
|
|
4708
|
-
exports2.prompt(readOptions);
|
|
4709
|
-
return clHandler.args;
|
|
4710
|
-
};
|
|
4711
|
-
exports2.promptLoop = function(inputHandler, options) {
|
|
4712
|
-
var readOptions = margeOptions({
|
|
4713
|
-
// -------- default
|
|
4714
|
-
hideEchoBack: false,
|
|
4715
|
-
trueValue: null,
|
|
4716
|
-
falseValue: null,
|
|
4717
|
-
caseSensitive: false,
|
|
4718
|
-
history: true
|
|
4719
|
-
}, options);
|
|
4720
|
-
while (true) {
|
|
4721
|
-
if (inputHandler(exports2.prompt(readOptions))) {
|
|
4722
|
-
break;
|
|
4723
|
-
}
|
|
4724
|
-
}
|
|
4725
|
-
};
|
|
4726
|
-
exports2.promptCLLoop = function(commandHandler, options) {
|
|
4727
|
-
var readOptions = margeOptions({
|
|
4728
|
-
// -------- default
|
|
4729
|
-
hideEchoBack: false,
|
|
4730
|
-
limitMessage: "Requested command is not available.",
|
|
4731
|
-
caseSensitive: false,
|
|
4732
|
-
history: true
|
|
4733
|
-
}, options), clHandler = getClHandler(commandHandler, readOptions);
|
|
4734
|
-
readOptions.limit = clHandler.limit;
|
|
4735
|
-
readOptions.preCheck = clHandler.preCheck;
|
|
4736
|
-
while (true) {
|
|
4737
|
-
exports2.prompt(readOptions);
|
|
4738
|
-
if (clHandler.hRes) {
|
|
4739
|
-
break;
|
|
4740
|
-
}
|
|
4741
|
-
}
|
|
4742
|
-
};
|
|
4743
|
-
exports2.promptSimShell = function(options) {
|
|
4744
|
-
return exports2.prompt(margeOptions({
|
|
4745
|
-
// -------- default
|
|
4746
|
-
hideEchoBack: false,
|
|
4747
|
-
history: true
|
|
4748
|
-
}, options, {
|
|
4749
|
-
// -------- forced
|
|
4750
|
-
prompt: (function() {
|
|
4751
|
-
return IS_WIN ? "$<cwd>>" : (
|
|
4752
|
-
// 'user@host:cwd$ '
|
|
4753
|
-
(process.env.USER || "") + (process.env.HOSTNAME ? "@" + process.env.HOSTNAME.replace(/\..*$/, "") : "") + ":$<cwdHome>$ "
|
|
4754
|
-
);
|
|
4755
|
-
})()
|
|
4756
|
-
}));
|
|
4757
|
-
};
|
|
4758
|
-
function _keyInYN(query, options, limit) {
|
|
4759
|
-
var res;
|
|
4760
|
-
if (query == null) {
|
|
4761
|
-
query = "Are you sure? ";
|
|
4762
|
-
}
|
|
4763
|
-
if ((!options || options.guide !== false) && (query += "")) {
|
|
4764
|
-
query = query.replace(/\s*:?\s*$/, "") + " [y/n]: ";
|
|
4765
|
-
}
|
|
4766
|
-
res = exports2.keyIn(query, margeOptions(options, {
|
|
4767
|
-
// -------- forced
|
|
4768
|
-
hideEchoBack: false,
|
|
4769
|
-
limit,
|
|
4770
|
-
trueValue: "y",
|
|
4771
|
-
falseValue: "n",
|
|
4772
|
-
caseSensitive: false
|
|
4773
|
-
// mask doesn't work.
|
|
4774
|
-
}));
|
|
4775
|
-
return typeof res === "boolean" ? res : "";
|
|
4776
|
-
}
|
|
4777
|
-
exports2.keyInYN = function(query, options) {
|
|
4778
|
-
return _keyInYN(query, options);
|
|
4779
|
-
};
|
|
4780
|
-
exports2.keyInYNStrict = function(query, options) {
|
|
4781
|
-
return _keyInYN(query, options, "yn");
|
|
4782
|
-
};
|
|
4783
|
-
exports2.keyInPause = function(query, options) {
|
|
4784
|
-
if (query == null) {
|
|
4785
|
-
query = "Continue...";
|
|
4786
|
-
}
|
|
4787
|
-
if ((!options || options.guide !== false) && (query += "")) {
|
|
4788
|
-
query = query.replace(/\s+$/, "") + " (Hit any key)";
|
|
4789
|
-
}
|
|
4790
|
-
exports2.keyIn(query, margeOptions({
|
|
4791
|
-
// -------- default
|
|
4792
|
-
limit: null
|
|
4793
|
-
}, options, {
|
|
4794
|
-
// -------- forced
|
|
4795
|
-
hideEchoBack: true,
|
|
4796
|
-
mask: ""
|
|
4797
|
-
}));
|
|
4798
|
-
};
|
|
4799
|
-
exports2.keyInSelect = function(items, query, options) {
|
|
4800
|
-
var readOptions = margeOptions({
|
|
4801
|
-
// -------- default
|
|
4802
|
-
hideEchoBack: false
|
|
4803
|
-
}, options, {
|
|
4804
|
-
// -------- forced
|
|
4805
|
-
trueValue: null,
|
|
4806
|
-
falseValue: null,
|
|
4807
|
-
caseSensitive: false,
|
|
4808
|
-
// limit (by items),
|
|
4809
|
-
phContent: function(param) {
|
|
4810
|
-
return param === "itemsCount" ? items.length + "" : param === "firstItem" ? (items[0] + "").trim() : param === "lastItem" ? (items[items.length - 1] + "").trim() : null;
|
|
4811
|
-
}
|
|
4812
|
-
}), keylist = "", key2i = {}, charCode = 49, display = "\n";
|
|
4813
|
-
if (!Array.isArray(items) || !items.length || items.length > 35) {
|
|
4814
|
-
throw "`items` must be Array (max length: 35).";
|
|
4815
|
-
}
|
|
4816
|
-
items.forEach(function(item, i) {
|
|
4817
|
-
var key = String.fromCharCode(charCode);
|
|
4818
|
-
keylist += key;
|
|
4819
|
-
key2i[key] = i;
|
|
4820
|
-
display += "[" + key + "] " + (item + "").trim() + "\n";
|
|
4821
|
-
charCode = charCode === 57 ? 97 : charCode + 1;
|
|
4822
|
-
});
|
|
4823
|
-
if (!options || options.cancel !== false) {
|
|
4824
|
-
keylist += "0";
|
|
4825
|
-
key2i["0"] = -1;
|
|
4826
|
-
display += "[0] " + (options && options.cancel != null && typeof options.cancel !== "boolean" ? (options.cancel + "").trim() : "CANCEL") + "\n";
|
|
4827
|
-
}
|
|
4828
|
-
readOptions.limit = keylist;
|
|
4829
|
-
display += "\n";
|
|
4830
|
-
if (query == null) {
|
|
4831
|
-
query = "Choose one from list: ";
|
|
4832
|
-
}
|
|
4833
|
-
if (query += "") {
|
|
4834
|
-
if (!options || options.guide !== false) {
|
|
4835
|
-
query = query.replace(/\s*:?\s*$/, "") + " [$<limit>]: ";
|
|
4836
|
-
}
|
|
4837
|
-
display += query;
|
|
4838
|
-
}
|
|
4839
|
-
return key2i[exports2.keyIn(display, readOptions).toLowerCase()];
|
|
4840
|
-
};
|
|
4841
|
-
exports2.getRawInput = function() {
|
|
4842
|
-
return rawInput;
|
|
4843
|
-
};
|
|
4844
|
-
function _setOption(optionName, args) {
|
|
4845
|
-
var options;
|
|
4846
|
-
if (args.length) {
|
|
4847
|
-
options = {};
|
|
4848
|
-
options[optionName] = args[0];
|
|
4849
|
-
}
|
|
4850
|
-
return exports2.setDefaultOptions(options)[optionName];
|
|
4851
|
-
}
|
|
4852
|
-
exports2.setPrint = function() {
|
|
4853
|
-
return _setOption("print", arguments);
|
|
4854
|
-
};
|
|
4855
|
-
exports2.setPrompt = function() {
|
|
4856
|
-
return _setOption("prompt", arguments);
|
|
4857
|
-
};
|
|
4858
|
-
exports2.setEncoding = function() {
|
|
4859
|
-
return _setOption("encoding", arguments);
|
|
4860
|
-
};
|
|
4861
|
-
exports2.setMask = function() {
|
|
4862
|
-
return _setOption("mask", arguments);
|
|
4863
|
-
};
|
|
4864
|
-
exports2.setBufferSize = function() {
|
|
4865
|
-
return _setOption("bufferSize", arguments);
|
|
4866
|
-
};
|
|
4867
|
-
}
|
|
4868
|
-
});
|
|
4869
|
-
|
|
4870
3670
|
// ../../node_modules/@sindresorhus/merge-streams/index.js
|
|
4871
3671
|
function mergeStreams(streams) {
|
|
4872
3672
|
if (!Array.isArray(streams)) {
|
|
@@ -5049,9 +3849,9 @@ var init_merge_streams = __esm({
|
|
|
5049
3849
|
}
|
|
5050
3850
|
});
|
|
5051
3851
|
|
|
5052
|
-
// node_modules/fast-glob/out/utils/array.js
|
|
3852
|
+
// ../../node_modules/fast-glob/out/utils/array.js
|
|
5053
3853
|
var require_array = __commonJS({
|
|
5054
|
-
"node_modules/fast-glob/out/utils/array.js"(exports2) {
|
|
3854
|
+
"../../node_modules/fast-glob/out/utils/array.js"(exports2) {
|
|
5055
3855
|
"use strict";
|
|
5056
3856
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5057
3857
|
exports2.splitWhen = exports2.flatten = void 0;
|
|
@@ -5076,9 +3876,9 @@ var require_array = __commonJS({
|
|
|
5076
3876
|
}
|
|
5077
3877
|
});
|
|
5078
3878
|
|
|
5079
|
-
// node_modules/fast-glob/out/utils/errno.js
|
|
3879
|
+
// ../../node_modules/fast-glob/out/utils/errno.js
|
|
5080
3880
|
var require_errno = __commonJS({
|
|
5081
|
-
"node_modules/fast-glob/out/utils/errno.js"(exports2) {
|
|
3881
|
+
"../../node_modules/fast-glob/out/utils/errno.js"(exports2) {
|
|
5082
3882
|
"use strict";
|
|
5083
3883
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5084
3884
|
exports2.isEnoentCodeError = void 0;
|
|
@@ -5089,9 +3889,9 @@ var require_errno = __commonJS({
|
|
|
5089
3889
|
}
|
|
5090
3890
|
});
|
|
5091
3891
|
|
|
5092
|
-
// node_modules/fast-glob/out/utils/fs.js
|
|
3892
|
+
// ../../node_modules/fast-glob/out/utils/fs.js
|
|
5093
3893
|
var require_fs = __commonJS({
|
|
5094
|
-
"node_modules/fast-glob/out/utils/fs.js"(exports2) {
|
|
3894
|
+
"../../node_modules/fast-glob/out/utils/fs.js"(exports2) {
|
|
5095
3895
|
"use strict";
|
|
5096
3896
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5097
3897
|
exports2.createDirentFromStats = void 0;
|
|
@@ -5114,9 +3914,9 @@ var require_fs = __commonJS({
|
|
|
5114
3914
|
}
|
|
5115
3915
|
});
|
|
5116
3916
|
|
|
5117
|
-
// node_modules/fast-glob/out/utils/path.js
|
|
3917
|
+
// ../../node_modules/fast-glob/out/utils/path.js
|
|
5118
3918
|
var require_path = __commonJS({
|
|
5119
|
-
"node_modules/fast-glob/out/utils/path.js"(exports2) {
|
|
3919
|
+
"../../node_modules/fast-glob/out/utils/path.js"(exports2) {
|
|
5120
3920
|
"use strict";
|
|
5121
3921
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5122
3922
|
exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
|
|
@@ -5344,9 +4144,9 @@ var require_glob_parent = __commonJS({
|
|
|
5344
4144
|
}
|
|
5345
4145
|
});
|
|
5346
4146
|
|
|
5347
|
-
// node_modules/braces/lib/utils.js
|
|
4147
|
+
// ../../node_modules/micromatch/node_modules/braces/lib/utils.js
|
|
5348
4148
|
var require_utils = __commonJS({
|
|
5349
|
-
"node_modules/braces/lib/utils.js"(exports2) {
|
|
4149
|
+
"../../node_modules/micromatch/node_modules/braces/lib/utils.js"(exports2) {
|
|
5350
4150
|
"use strict";
|
|
5351
4151
|
exports2.isInteger = (num) => {
|
|
5352
4152
|
if (typeof num === "number") {
|
|
@@ -5426,9 +4226,9 @@ var require_utils = __commonJS({
|
|
|
5426
4226
|
}
|
|
5427
4227
|
});
|
|
5428
4228
|
|
|
5429
|
-
// node_modules/braces/lib/stringify.js
|
|
4229
|
+
// ../../node_modules/micromatch/node_modules/braces/lib/stringify.js
|
|
5430
4230
|
var require_stringify = __commonJS({
|
|
5431
|
-
"node_modules/braces/lib/stringify.js"(exports2, module2) {
|
|
4231
|
+
"../../node_modules/micromatch/node_modules/braces/lib/stringify.js"(exports2, module2) {
|
|
5432
4232
|
"use strict";
|
|
5433
4233
|
var utils = require_utils();
|
|
5434
4234
|
module2.exports = (ast, options = {}) => {
|
|
@@ -5684,9 +4484,9 @@ var require_to_regex_range = __commonJS({
|
|
|
5684
4484
|
}
|
|
5685
4485
|
});
|
|
5686
4486
|
|
|
5687
|
-
// node_modules/fill-range/index.js
|
|
4487
|
+
// ../../node_modules/micromatch/node_modules/fill-range/index.js
|
|
5688
4488
|
var require_fill_range = __commonJS({
|
|
5689
|
-
"node_modules/fill-range/index.js"(exports2, module2) {
|
|
4489
|
+
"../../node_modules/micromatch/node_modules/fill-range/index.js"(exports2, module2) {
|
|
5690
4490
|
"use strict";
|
|
5691
4491
|
var util = require("util");
|
|
5692
4492
|
var toRegexRange = require_to_regex_range();
|
|
@@ -5878,9 +4678,9 @@ var require_fill_range = __commonJS({
|
|
|
5878
4678
|
}
|
|
5879
4679
|
});
|
|
5880
4680
|
|
|
5881
|
-
// node_modules/braces/lib/compile.js
|
|
4681
|
+
// ../../node_modules/micromatch/node_modules/braces/lib/compile.js
|
|
5882
4682
|
var require_compile = __commonJS({
|
|
5883
|
-
"node_modules/braces/lib/compile.js"(exports2, module2) {
|
|
4683
|
+
"../../node_modules/micromatch/node_modules/braces/lib/compile.js"(exports2, module2) {
|
|
5884
4684
|
"use strict";
|
|
5885
4685
|
var fill = require_fill_range();
|
|
5886
4686
|
var utils = require_utils();
|
|
@@ -5930,9 +4730,9 @@ var require_compile = __commonJS({
|
|
|
5930
4730
|
}
|
|
5931
4731
|
});
|
|
5932
4732
|
|
|
5933
|
-
// node_modules/braces/lib/expand.js
|
|
4733
|
+
// ../../node_modules/micromatch/node_modules/braces/lib/expand.js
|
|
5934
4734
|
var require_expand = __commonJS({
|
|
5935
|
-
"node_modules/braces/lib/expand.js"(exports2, module2) {
|
|
4735
|
+
"../../node_modules/micromatch/node_modules/braces/lib/expand.js"(exports2, module2) {
|
|
5936
4736
|
"use strict";
|
|
5937
4737
|
var fill = require_fill_range();
|
|
5938
4738
|
var stringify = require_stringify();
|
|
@@ -6024,9 +4824,9 @@ var require_expand = __commonJS({
|
|
|
6024
4824
|
}
|
|
6025
4825
|
});
|
|
6026
4826
|
|
|
6027
|
-
// node_modules/braces/lib/constants.js
|
|
4827
|
+
// ../../node_modules/micromatch/node_modules/braces/lib/constants.js
|
|
6028
4828
|
var require_constants = __commonJS({
|
|
6029
|
-
"node_modules/braces/lib/constants.js"(exports2, module2) {
|
|
4829
|
+
"../../node_modules/micromatch/node_modules/braces/lib/constants.js"(exports2, module2) {
|
|
6030
4830
|
"use strict";
|
|
6031
4831
|
module2.exports = {
|
|
6032
4832
|
MAX_LENGTH: 1e4,
|
|
@@ -6125,9 +4925,9 @@ var require_constants = __commonJS({
|
|
|
6125
4925
|
}
|
|
6126
4926
|
});
|
|
6127
4927
|
|
|
6128
|
-
// node_modules/braces/lib/parse.js
|
|
4928
|
+
// ../../node_modules/micromatch/node_modules/braces/lib/parse.js
|
|
6129
4929
|
var require_parse = __commonJS({
|
|
6130
|
-
"node_modules/braces/lib/parse.js"(exports2, module2) {
|
|
4930
|
+
"../../node_modules/micromatch/node_modules/braces/lib/parse.js"(exports2, module2) {
|
|
6131
4931
|
"use strict";
|
|
6132
4932
|
var stringify = require_stringify();
|
|
6133
4933
|
var {
|
|
@@ -6363,9 +5163,9 @@ var require_parse = __commonJS({
|
|
|
6363
5163
|
}
|
|
6364
5164
|
});
|
|
6365
5165
|
|
|
6366
|
-
// node_modules/braces/index.js
|
|
5166
|
+
// ../../node_modules/micromatch/node_modules/braces/index.js
|
|
6367
5167
|
var require_braces = __commonJS({
|
|
6368
|
-
"node_modules/braces/index.js"(exports2, module2) {
|
|
5168
|
+
"../../node_modules/micromatch/node_modules/braces/index.js"(exports2, module2) {
|
|
6369
5169
|
"use strict";
|
|
6370
5170
|
var stringify = require_stringify();
|
|
6371
5171
|
var compile = require_compile();
|
|
@@ -7936,9 +6736,9 @@ var require_picomatch2 = __commonJS({
|
|
|
7936
6736
|
}
|
|
7937
6737
|
});
|
|
7938
6738
|
|
|
7939
|
-
// node_modules/micromatch/index.js
|
|
6739
|
+
// ../../node_modules/micromatch/index.js
|
|
7940
6740
|
var require_micromatch = __commonJS({
|
|
7941
|
-
"node_modules/micromatch/index.js"(exports2, module2) {
|
|
6741
|
+
"../../node_modules/micromatch/index.js"(exports2, module2) {
|
|
7942
6742
|
"use strict";
|
|
7943
6743
|
var util = require("util");
|
|
7944
6744
|
var braces = require_braces();
|
|
@@ -8097,9 +6897,9 @@ var require_micromatch = __commonJS({
|
|
|
8097
6897
|
}
|
|
8098
6898
|
});
|
|
8099
6899
|
|
|
8100
|
-
// node_modules/fast-glob/out/utils/pattern.js
|
|
6900
|
+
// ../../node_modules/fast-glob/out/utils/pattern.js
|
|
8101
6901
|
var require_pattern = __commonJS({
|
|
8102
|
-
"node_modules/fast-glob/out/utils/pattern.js"(exports2) {
|
|
6902
|
+
"../../node_modules/fast-glob/out/utils/pattern.js"(exports2) {
|
|
8103
6903
|
"use strict";
|
|
8104
6904
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8105
6905
|
exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
|
@@ -8381,9 +7181,9 @@ var require_merge2 = __commonJS({
|
|
|
8381
7181
|
}
|
|
8382
7182
|
});
|
|
8383
7183
|
|
|
8384
|
-
// node_modules/fast-glob/out/utils/stream.js
|
|
7184
|
+
// ../../node_modules/fast-glob/out/utils/stream.js
|
|
8385
7185
|
var require_stream = __commonJS({
|
|
8386
|
-
"node_modules/fast-glob/out/utils/stream.js"(exports2) {
|
|
7186
|
+
"../../node_modules/fast-glob/out/utils/stream.js"(exports2) {
|
|
8387
7187
|
"use strict";
|
|
8388
7188
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8389
7189
|
exports2.merge = void 0;
|
|
@@ -8404,9 +7204,9 @@ var require_stream = __commonJS({
|
|
|
8404
7204
|
}
|
|
8405
7205
|
});
|
|
8406
7206
|
|
|
8407
|
-
// node_modules/fast-glob/out/utils/string.js
|
|
7207
|
+
// ../../node_modules/fast-glob/out/utils/string.js
|
|
8408
7208
|
var require_string = __commonJS({
|
|
8409
|
-
"node_modules/fast-glob/out/utils/string.js"(exports2) {
|
|
7209
|
+
"../../node_modules/fast-glob/out/utils/string.js"(exports2) {
|
|
8410
7210
|
"use strict";
|
|
8411
7211
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8412
7212
|
exports2.isEmpty = exports2.isString = void 0;
|
|
@@ -8421,9 +7221,9 @@ var require_string = __commonJS({
|
|
|
8421
7221
|
}
|
|
8422
7222
|
});
|
|
8423
7223
|
|
|
8424
|
-
// node_modules/fast-glob/out/utils/index.js
|
|
7224
|
+
// ../../node_modules/fast-glob/out/utils/index.js
|
|
8425
7225
|
var require_utils3 = __commonJS({
|
|
8426
|
-
"node_modules/fast-glob/out/utils/index.js"(exports2) {
|
|
7226
|
+
"../../node_modules/fast-glob/out/utils/index.js"(exports2) {
|
|
8427
7227
|
"use strict";
|
|
8428
7228
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8429
7229
|
exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
|
|
@@ -8444,9 +7244,9 @@ var require_utils3 = __commonJS({
|
|
|
8444
7244
|
}
|
|
8445
7245
|
});
|
|
8446
7246
|
|
|
8447
|
-
// node_modules/fast-glob/out/managers/tasks.js
|
|
7247
|
+
// ../../node_modules/fast-glob/out/managers/tasks.js
|
|
8448
7248
|
var require_tasks = __commonJS({
|
|
8449
|
-
"node_modules/fast-glob/out/managers/tasks.js"(exports2) {
|
|
7249
|
+
"../../node_modules/fast-glob/out/managers/tasks.js"(exports2) {
|
|
8450
7250
|
"use strict";
|
|
8451
7251
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8452
7252
|
exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
|
|
@@ -9319,26 +8119,26 @@ var require_queue = __commonJS({
|
|
|
9319
8119
|
queue.drained = drained;
|
|
9320
8120
|
return queue;
|
|
9321
8121
|
function push(value) {
|
|
9322
|
-
var p = new Promise(function(
|
|
8122
|
+
var p = new Promise(function(resolve13, reject) {
|
|
9323
8123
|
pushCb(value, function(err, result) {
|
|
9324
8124
|
if (err) {
|
|
9325
8125
|
reject(err);
|
|
9326
8126
|
return;
|
|
9327
8127
|
}
|
|
9328
|
-
|
|
8128
|
+
resolve13(result);
|
|
9329
8129
|
});
|
|
9330
8130
|
});
|
|
9331
8131
|
p.catch(noop2);
|
|
9332
8132
|
return p;
|
|
9333
8133
|
}
|
|
9334
8134
|
function unshift(value) {
|
|
9335
|
-
var p = new Promise(function(
|
|
8135
|
+
var p = new Promise(function(resolve13, reject) {
|
|
9336
8136
|
unshiftCb(value, function(err, result) {
|
|
9337
8137
|
if (err) {
|
|
9338
8138
|
reject(err);
|
|
9339
8139
|
return;
|
|
9340
8140
|
}
|
|
9341
|
-
|
|
8141
|
+
resolve13(result);
|
|
9342
8142
|
});
|
|
9343
8143
|
});
|
|
9344
8144
|
p.catch(noop2);
|
|
@@ -9346,15 +8146,15 @@ var require_queue = __commonJS({
|
|
|
9346
8146
|
}
|
|
9347
8147
|
function drained() {
|
|
9348
8148
|
if (queue.idle()) {
|
|
9349
|
-
return new Promise(function(
|
|
9350
|
-
|
|
8149
|
+
return new Promise(function(resolve13) {
|
|
8150
|
+
resolve13();
|
|
9351
8151
|
});
|
|
9352
8152
|
}
|
|
9353
8153
|
var previousDrain = queue.drain;
|
|
9354
|
-
var p = new Promise(function(
|
|
8154
|
+
var p = new Promise(function(resolve13) {
|
|
9355
8155
|
queue.drain = function() {
|
|
9356
8156
|
previousDrain();
|
|
9357
|
-
|
|
8157
|
+
resolve13();
|
|
9358
8158
|
};
|
|
9359
8159
|
});
|
|
9360
8160
|
return p;
|
|
@@ -9752,9 +8552,9 @@ var require_out3 = __commonJS({
|
|
|
9752
8552
|
}
|
|
9753
8553
|
});
|
|
9754
8554
|
|
|
9755
|
-
// node_modules/fast-glob/out/readers/reader.js
|
|
8555
|
+
// ../../node_modules/fast-glob/out/readers/reader.js
|
|
9756
8556
|
var require_reader2 = __commonJS({
|
|
9757
|
-
"node_modules/fast-glob/out/readers/reader.js"(exports2) {
|
|
8557
|
+
"../../node_modules/fast-glob/out/readers/reader.js"(exports2) {
|
|
9758
8558
|
"use strict";
|
|
9759
8559
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9760
8560
|
var path13 = require("path");
|
|
@@ -9791,9 +8591,9 @@ var require_reader2 = __commonJS({
|
|
|
9791
8591
|
}
|
|
9792
8592
|
});
|
|
9793
8593
|
|
|
9794
|
-
// node_modules/fast-glob/out/readers/stream.js
|
|
8594
|
+
// ../../node_modules/fast-glob/out/readers/stream.js
|
|
9795
8595
|
var require_stream3 = __commonJS({
|
|
9796
|
-
"node_modules/fast-glob/out/readers/stream.js"(exports2) {
|
|
8596
|
+
"../../node_modules/fast-glob/out/readers/stream.js"(exports2) {
|
|
9797
8597
|
"use strict";
|
|
9798
8598
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9799
8599
|
var stream_1 = require("stream");
|
|
@@ -9837,9 +8637,9 @@ var require_stream3 = __commonJS({
|
|
|
9837
8637
|
});
|
|
9838
8638
|
}
|
|
9839
8639
|
_getStat(filepath) {
|
|
9840
|
-
return new Promise((
|
|
8640
|
+
return new Promise((resolve13, reject) => {
|
|
9841
8641
|
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
9842
|
-
return error === null ?
|
|
8642
|
+
return error === null ? resolve13(stats) : reject(error);
|
|
9843
8643
|
});
|
|
9844
8644
|
});
|
|
9845
8645
|
}
|
|
@@ -9848,9 +8648,9 @@ var require_stream3 = __commonJS({
|
|
|
9848
8648
|
}
|
|
9849
8649
|
});
|
|
9850
8650
|
|
|
9851
|
-
// node_modules/fast-glob/out/readers/async.js
|
|
8651
|
+
// ../../node_modules/fast-glob/out/readers/async.js
|
|
9852
8652
|
var require_async5 = __commonJS({
|
|
9853
|
-
"node_modules/fast-glob/out/readers/async.js"(exports2) {
|
|
8653
|
+
"../../node_modules/fast-glob/out/readers/async.js"(exports2) {
|
|
9854
8654
|
"use strict";
|
|
9855
8655
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9856
8656
|
var fsWalk = require_out3();
|
|
@@ -9863,10 +8663,10 @@ var require_async5 = __commonJS({
|
|
|
9863
8663
|
this._readerStream = new stream_1.default(this._settings);
|
|
9864
8664
|
}
|
|
9865
8665
|
dynamic(root, options) {
|
|
9866
|
-
return new Promise((
|
|
8666
|
+
return new Promise((resolve13, reject) => {
|
|
9867
8667
|
this._walkAsync(root, options, (error, entries) => {
|
|
9868
8668
|
if (error === null) {
|
|
9869
|
-
|
|
8669
|
+
resolve13(entries);
|
|
9870
8670
|
} else {
|
|
9871
8671
|
reject(error);
|
|
9872
8672
|
}
|
|
@@ -9876,10 +8676,10 @@ var require_async5 = __commonJS({
|
|
|
9876
8676
|
async static(patterns, options) {
|
|
9877
8677
|
const entries = [];
|
|
9878
8678
|
const stream2 = this._readerStream.static(patterns, options);
|
|
9879
|
-
return new Promise((
|
|
8679
|
+
return new Promise((resolve13, reject) => {
|
|
9880
8680
|
stream2.once("error", reject);
|
|
9881
8681
|
stream2.on("data", (entry) => entries.push(entry));
|
|
9882
|
-
stream2.once("end", () =>
|
|
8682
|
+
stream2.once("end", () => resolve13(entries));
|
|
9883
8683
|
});
|
|
9884
8684
|
}
|
|
9885
8685
|
};
|
|
@@ -9887,9 +8687,9 @@ var require_async5 = __commonJS({
|
|
|
9887
8687
|
}
|
|
9888
8688
|
});
|
|
9889
8689
|
|
|
9890
|
-
// node_modules/fast-glob/out/providers/matchers/matcher.js
|
|
8690
|
+
// ../../node_modules/fast-glob/out/providers/matchers/matcher.js
|
|
9891
8691
|
var require_matcher = __commonJS({
|
|
9892
|
-
"node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
|
|
8692
|
+
"../../node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
|
|
9893
8693
|
"use strict";
|
|
9894
8694
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9895
8695
|
var utils = require_utils3();
|
|
@@ -9938,9 +8738,9 @@ var require_matcher = __commonJS({
|
|
|
9938
8738
|
}
|
|
9939
8739
|
});
|
|
9940
8740
|
|
|
9941
|
-
// node_modules/fast-glob/out/providers/matchers/partial.js
|
|
8741
|
+
// ../../node_modules/fast-glob/out/providers/matchers/partial.js
|
|
9942
8742
|
var require_partial = __commonJS({
|
|
9943
|
-
"node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
|
|
8743
|
+
"../../node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
|
|
9944
8744
|
"use strict";
|
|
9945
8745
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9946
8746
|
var matcher_1 = require_matcher();
|
|
@@ -9975,9 +8775,9 @@ var require_partial = __commonJS({
|
|
|
9975
8775
|
}
|
|
9976
8776
|
});
|
|
9977
8777
|
|
|
9978
|
-
// node_modules/fast-glob/out/providers/filters/deep.js
|
|
8778
|
+
// ../../node_modules/fast-glob/out/providers/filters/deep.js
|
|
9979
8779
|
var require_deep = __commonJS({
|
|
9980
|
-
"node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
|
|
8780
|
+
"../../node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
|
|
9981
8781
|
"use strict";
|
|
9982
8782
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9983
8783
|
var utils = require_utils3();
|
|
@@ -10040,9 +8840,9 @@ var require_deep = __commonJS({
|
|
|
10040
8840
|
}
|
|
10041
8841
|
});
|
|
10042
8842
|
|
|
10043
|
-
// node_modules/fast-glob/out/providers/filters/entry.js
|
|
8843
|
+
// ../../node_modules/fast-glob/out/providers/filters/entry.js
|
|
10044
8844
|
var require_entry = __commonJS({
|
|
10045
|
-
"node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
|
|
8845
|
+
"../../node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
|
|
10046
8846
|
"use strict";
|
|
10047
8847
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10048
8848
|
var utils = require_utils3();
|
|
@@ -10128,9 +8928,9 @@ var require_entry = __commonJS({
|
|
|
10128
8928
|
}
|
|
10129
8929
|
});
|
|
10130
8930
|
|
|
10131
|
-
// node_modules/fast-glob/out/providers/filters/error.js
|
|
8931
|
+
// ../../node_modules/fast-glob/out/providers/filters/error.js
|
|
10132
8932
|
var require_error2 = __commonJS({
|
|
10133
|
-
"node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
|
|
8933
|
+
"../../node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
|
|
10134
8934
|
"use strict";
|
|
10135
8935
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10136
8936
|
var utils = require_utils3();
|
|
@@ -10149,9 +8949,9 @@ var require_error2 = __commonJS({
|
|
|
10149
8949
|
}
|
|
10150
8950
|
});
|
|
10151
8951
|
|
|
10152
|
-
// node_modules/fast-glob/out/providers/transformers/entry.js
|
|
8952
|
+
// ../../node_modules/fast-glob/out/providers/transformers/entry.js
|
|
10153
8953
|
var require_entry2 = __commonJS({
|
|
10154
|
-
"node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
|
|
8954
|
+
"../../node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
|
|
10155
8955
|
"use strict";
|
|
10156
8956
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10157
8957
|
var utils = require_utils3();
|
|
@@ -10181,9 +8981,9 @@ var require_entry2 = __commonJS({
|
|
|
10181
8981
|
}
|
|
10182
8982
|
});
|
|
10183
8983
|
|
|
10184
|
-
// node_modules/fast-glob/out/providers/provider.js
|
|
8984
|
+
// ../../node_modules/fast-glob/out/providers/provider.js
|
|
10185
8985
|
var require_provider = __commonJS({
|
|
10186
|
-
"node_modules/fast-glob/out/providers/provider.js"(exports2) {
|
|
8986
|
+
"../../node_modules/fast-glob/out/providers/provider.js"(exports2) {
|
|
10187
8987
|
"use strict";
|
|
10188
8988
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10189
8989
|
var path13 = require("path");
|
|
@@ -10235,9 +9035,9 @@ var require_provider = __commonJS({
|
|
|
10235
9035
|
}
|
|
10236
9036
|
});
|
|
10237
9037
|
|
|
10238
|
-
// node_modules/fast-glob/out/providers/async.js
|
|
9038
|
+
// ../../node_modules/fast-glob/out/providers/async.js
|
|
10239
9039
|
var require_async6 = __commonJS({
|
|
10240
|
-
"node_modules/fast-glob/out/providers/async.js"(exports2) {
|
|
9040
|
+
"../../node_modules/fast-glob/out/providers/async.js"(exports2) {
|
|
10241
9041
|
"use strict";
|
|
10242
9042
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10243
9043
|
var async_1 = require_async5();
|
|
@@ -10264,9 +9064,9 @@ var require_async6 = __commonJS({
|
|
|
10264
9064
|
}
|
|
10265
9065
|
});
|
|
10266
9066
|
|
|
10267
|
-
// node_modules/fast-glob/out/providers/stream.js
|
|
9067
|
+
// ../../node_modules/fast-glob/out/providers/stream.js
|
|
10268
9068
|
var require_stream4 = __commonJS({
|
|
10269
|
-
"node_modules/fast-glob/out/providers/stream.js"(exports2) {
|
|
9069
|
+
"../../node_modules/fast-glob/out/providers/stream.js"(exports2) {
|
|
10270
9070
|
"use strict";
|
|
10271
9071
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10272
9072
|
var stream_1 = require("stream");
|
|
@@ -10298,9 +9098,9 @@ var require_stream4 = __commonJS({
|
|
|
10298
9098
|
}
|
|
10299
9099
|
});
|
|
10300
9100
|
|
|
10301
|
-
// node_modules/fast-glob/out/readers/sync.js
|
|
9101
|
+
// ../../node_modules/fast-glob/out/readers/sync.js
|
|
10302
9102
|
var require_sync5 = __commonJS({
|
|
10303
|
-
"node_modules/fast-glob/out/readers/sync.js"(exports2) {
|
|
9103
|
+
"../../node_modules/fast-glob/out/readers/sync.js"(exports2) {
|
|
10304
9104
|
"use strict";
|
|
10305
9105
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10306
9106
|
var fsStat = require_out();
|
|
@@ -10346,9 +9146,9 @@ var require_sync5 = __commonJS({
|
|
|
10346
9146
|
}
|
|
10347
9147
|
});
|
|
10348
9148
|
|
|
10349
|
-
// node_modules/fast-glob/out/providers/sync.js
|
|
9149
|
+
// ../../node_modules/fast-glob/out/providers/sync.js
|
|
10350
9150
|
var require_sync6 = __commonJS({
|
|
10351
|
-
"node_modules/fast-glob/out/providers/sync.js"(exports2) {
|
|
9151
|
+
"../../node_modules/fast-glob/out/providers/sync.js"(exports2) {
|
|
10352
9152
|
"use strict";
|
|
10353
9153
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10354
9154
|
var sync_1 = require_sync5();
|
|
@@ -10375,9 +9175,9 @@ var require_sync6 = __commonJS({
|
|
|
10375
9175
|
}
|
|
10376
9176
|
});
|
|
10377
9177
|
|
|
10378
|
-
// node_modules/fast-glob/out/settings.js
|
|
9178
|
+
// ../../node_modules/fast-glob/out/settings.js
|
|
10379
9179
|
var require_settings4 = __commonJS({
|
|
10380
|
-
"node_modules/fast-glob/out/settings.js"(exports2) {
|
|
9180
|
+
"../../node_modules/fast-glob/out/settings.js"(exports2) {
|
|
10381
9181
|
"use strict";
|
|
10382
9182
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10383
9183
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
@@ -10435,9 +9235,9 @@ var require_settings4 = __commonJS({
|
|
|
10435
9235
|
}
|
|
10436
9236
|
});
|
|
10437
9237
|
|
|
10438
|
-
// node_modules/fast-glob/out/index.js
|
|
9238
|
+
// ../../node_modules/fast-glob/out/index.js
|
|
10439
9239
|
var require_out4 = __commonJS({
|
|
10440
|
-
"node_modules/fast-glob/out/index.js"(exports2, module2) {
|
|
9240
|
+
"../../node_modules/fast-glob/out/index.js"(exports2, module2) {
|
|
10441
9241
|
"use strict";
|
|
10442
9242
|
var taskManager = require_tasks();
|
|
10443
9243
|
var async_1 = require_async6();
|
|
@@ -10536,7 +9336,7 @@ var require_out4 = __commonJS({
|
|
|
10536
9336
|
}
|
|
10537
9337
|
});
|
|
10538
9338
|
|
|
10539
|
-
// node_modules/path-type/index.js
|
|
9339
|
+
// ../../node_modules/globby/node_modules/path-type/index.js
|
|
10540
9340
|
async function isType(fsStatType, statsMethodName, filePath) {
|
|
10541
9341
|
if (typeof filePath !== "string") {
|
|
10542
9342
|
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
@@ -10566,7 +9366,7 @@ function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
|
10566
9366
|
}
|
|
10567
9367
|
var import_node_fs, import_promises3, isFile, isDirectory, isSymlink, isFileSync, isDirectorySync, isSymlinkSync;
|
|
10568
9368
|
var init_path_type = __esm({
|
|
10569
|
-
"node_modules/path-type/index.js"() {
|
|
9369
|
+
"../../node_modules/globby/node_modules/path-type/index.js"() {
|
|
10570
9370
|
import_node_fs = __toESM(require("node:fs"), 1);
|
|
10571
9371
|
import_promises3 = __toESM(require("node:fs/promises"), 1);
|
|
10572
9372
|
isFile = isType.bind(void 0, "stat", "isFile");
|
|
@@ -10600,9 +9400,9 @@ var init_node = __esm({
|
|
|
10600
9400
|
}
|
|
10601
9401
|
});
|
|
10602
9402
|
|
|
10603
|
-
// node_modules/ignore/index.js
|
|
9403
|
+
// ../../node_modules/globby/node_modules/ignore/index.js
|
|
10604
9404
|
var require_ignore = __commonJS({
|
|
10605
|
-
"node_modules/ignore/index.js"(exports2, module2) {
|
|
9405
|
+
"../../node_modules/globby/node_modules/ignore/index.js"(exports2, module2) {
|
|
10606
9406
|
function makeArray(subject) {
|
|
10607
9407
|
return Array.isArray(subject) ? subject : [subject];
|
|
10608
9408
|
}
|
|
@@ -11057,7 +9857,7 @@ var require_ignore = __commonJS({
|
|
|
11057
9857
|
}
|
|
11058
9858
|
});
|
|
11059
9859
|
|
|
11060
|
-
// node_modules/slash/index.js
|
|
9860
|
+
// ../../node_modules/globby/node_modules/slash/index.js
|
|
11061
9861
|
function slash(path13) {
|
|
11062
9862
|
const isExtendedLengthPath = path13.startsWith("\\\\?\\");
|
|
11063
9863
|
if (isExtendedLengthPath) {
|
|
@@ -11066,22 +9866,22 @@ function slash(path13) {
|
|
|
11066
9866
|
return path13.replace(/\\/g, "/");
|
|
11067
9867
|
}
|
|
11068
9868
|
var init_slash = __esm({
|
|
11069
|
-
"node_modules/slash/index.js"() {
|
|
9869
|
+
"../../node_modules/globby/node_modules/slash/index.js"() {
|
|
11070
9870
|
}
|
|
11071
9871
|
});
|
|
11072
9872
|
|
|
11073
|
-
// node_modules/globby/utilities.js
|
|
9873
|
+
// ../../node_modules/globby/utilities.js
|
|
11074
9874
|
var isNegativePattern;
|
|
11075
9875
|
var init_utilities = __esm({
|
|
11076
|
-
"node_modules/globby/utilities.js"() {
|
|
9876
|
+
"../../node_modules/globby/utilities.js"() {
|
|
11077
9877
|
isNegativePattern = (pattern) => pattern[0] === "!";
|
|
11078
9878
|
}
|
|
11079
9879
|
});
|
|
11080
9880
|
|
|
11081
|
-
// node_modules/globby/ignore.js
|
|
9881
|
+
// ../../node_modules/globby/ignore.js
|
|
11082
9882
|
var import_node_process, import_node_fs2, import_promises4, import_node_path2, import_fast_glob, import_ignore3, defaultIgnoredDirectories, ignoreFilesGlobOptions, GITIGNORE_FILES_PATTERN, applyBaseToPattern, parseIgnoreFile, toRelativePath, getIsIgnoredPredicate, normalizeOptions, isIgnoredByIgnoreFiles, isIgnoredByIgnoreFilesSync, isGitIgnored, isGitIgnoredSync;
|
|
11083
9883
|
var init_ignore = __esm({
|
|
11084
|
-
"node_modules/globby/ignore.js"() {
|
|
9884
|
+
"../../node_modules/globby/ignore.js"() {
|
|
11085
9885
|
import_node_process = __toESM(require("node:process"), 1);
|
|
11086
9886
|
import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
11087
9887
|
import_promises4 = __toESM(require("node:fs/promises"), 1);
|
|
@@ -11169,7 +9969,7 @@ var init_ignore = __esm({
|
|
|
11169
9969
|
}
|
|
11170
9970
|
});
|
|
11171
9971
|
|
|
11172
|
-
// node_modules/globby/index.js
|
|
9972
|
+
// ../../node_modules/globby/index.js
|
|
11173
9973
|
var globby_exports = {};
|
|
11174
9974
|
__export(globby_exports, {
|
|
11175
9975
|
convertPathToPattern: () => convertPathToPattern,
|
|
@@ -11186,7 +9986,7 @@ __export(globby_exports, {
|
|
|
11186
9986
|
});
|
|
11187
9987
|
var import_node_process2, import_node_fs3, import_node_path3, import_fast_glob2, assertPatternsInput, normalizePathForDirectoryGlob, getDirectoryGlob, directoryToGlob, directoryToGlobSync, toPatternsArray, checkCwdOption, normalizeOptions2, normalizeArguments, normalizeArgumentsSync, getIgnoreFilesPatterns, getFilter, getFilterSync, createFilterFunction, unionFastGlobResults, convertNegativePatterns, normalizeExpandDirectoriesOption, generateTasks, generateTasksSync, globby, globbySync, globbyStream, isDynamicPattern, generateGlobTasks, generateGlobTasksSync, convertPathToPattern;
|
|
11188
9988
|
var init_globby = __esm({
|
|
11189
|
-
"node_modules/globby/index.js"() {
|
|
9989
|
+
"../../node_modules/globby/index.js"() {
|
|
11190
9990
|
import_node_process2 = __toESM(require("node:process"), 1);
|
|
11191
9991
|
import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
11192
9992
|
import_node_path3 = __toESM(require("node:path"), 1);
|
|
@@ -11792,16 +10592,16 @@ var require_semver = __commonJS({
|
|
|
11792
10592
|
}
|
|
11793
10593
|
}
|
|
11794
10594
|
if (identifier) {
|
|
11795
|
-
let
|
|
10595
|
+
let prerelease2 = [identifier, base];
|
|
11796
10596
|
if (identifierBase === false) {
|
|
11797
|
-
|
|
10597
|
+
prerelease2 = [identifier];
|
|
11798
10598
|
}
|
|
11799
10599
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
11800
10600
|
if (isNaN(this.prerelease[1])) {
|
|
11801
|
-
this.prerelease =
|
|
10601
|
+
this.prerelease = prerelease2;
|
|
11802
10602
|
}
|
|
11803
10603
|
} else {
|
|
11804
|
-
this.prerelease =
|
|
10604
|
+
this.prerelease = prerelease2;
|
|
11805
10605
|
}
|
|
11806
10606
|
}
|
|
11807
10607
|
break;
|
|
@@ -11847,11 +10647,11 @@ var require_valid = __commonJS({
|
|
|
11847
10647
|
"node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
11848
10648
|
"use strict";
|
|
11849
10649
|
var parse = require_parse3();
|
|
11850
|
-
var
|
|
10650
|
+
var valid2 = (version2, options) => {
|
|
11851
10651
|
const v = parse(version2, options);
|
|
11852
10652
|
return v ? v.version : null;
|
|
11853
10653
|
};
|
|
11854
|
-
module2.exports =
|
|
10654
|
+
module2.exports = valid2;
|
|
11855
10655
|
}
|
|
11856
10656
|
});
|
|
11857
10657
|
|
|
@@ -11873,7 +10673,7 @@ var require_inc = __commonJS({
|
|
|
11873
10673
|
"node_modules/semver/functions/inc.js"(exports2, module2) {
|
|
11874
10674
|
"use strict";
|
|
11875
10675
|
var SemVer = require_semver();
|
|
11876
|
-
var
|
|
10676
|
+
var inc2 = (version2, release, options, identifier, identifierBase) => {
|
|
11877
10677
|
if (typeof options === "string") {
|
|
11878
10678
|
identifierBase = identifier;
|
|
11879
10679
|
identifier = options;
|
|
@@ -11888,7 +10688,7 @@ var require_inc = __commonJS({
|
|
|
11888
10688
|
return null;
|
|
11889
10689
|
}
|
|
11890
10690
|
};
|
|
11891
|
-
module2.exports =
|
|
10691
|
+
module2.exports = inc2;
|
|
11892
10692
|
}
|
|
11893
10693
|
});
|
|
11894
10694
|
|
|
@@ -11971,11 +10771,11 @@ var require_prerelease = __commonJS({
|
|
|
11971
10771
|
"node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
11972
10772
|
"use strict";
|
|
11973
10773
|
var parse = require_parse3();
|
|
11974
|
-
var
|
|
10774
|
+
var prerelease2 = (version2, options) => {
|
|
11975
10775
|
const parsed = parse(version2, options);
|
|
11976
10776
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
11977
10777
|
};
|
|
11978
|
-
module2.exports =
|
|
10778
|
+
module2.exports = prerelease2;
|
|
11979
10779
|
}
|
|
11980
10780
|
});
|
|
11981
10781
|
|
|
@@ -12191,9 +10991,9 @@ var require_coerce = __commonJS({
|
|
|
12191
10991
|
const major2 = match2[2];
|
|
12192
10992
|
const minor2 = match2[3] || "0";
|
|
12193
10993
|
const patch = match2[4] || "0";
|
|
12194
|
-
const
|
|
10994
|
+
const prerelease2 = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
|
12195
10995
|
const build2 = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
|
12196
|
-
return parse(`${major2}.${minor2}.${patch}${
|
|
10996
|
+
return parse(`${major2}.${minor2}.${patch}${prerelease2}${build2}`, options);
|
|
12197
10997
|
};
|
|
12198
10998
|
module2.exports = coerce;
|
|
12199
10999
|
}
|
|
@@ -13210,14 +12010,14 @@ var require_semver2 = __commonJS({
|
|
|
13210
12010
|
var SemVer = require_semver();
|
|
13211
12011
|
var identifiers = require_identifiers();
|
|
13212
12012
|
var parse = require_parse3();
|
|
13213
|
-
var
|
|
12013
|
+
var valid2 = require_valid();
|
|
13214
12014
|
var clean = require_clean();
|
|
13215
|
-
var
|
|
12015
|
+
var inc2 = require_inc();
|
|
13216
12016
|
var diff = require_diff();
|
|
13217
12017
|
var major2 = require_major();
|
|
13218
12018
|
var minor2 = require_minor();
|
|
13219
12019
|
var patch = require_patch();
|
|
13220
|
-
var
|
|
12020
|
+
var prerelease2 = require_prerelease();
|
|
13221
12021
|
var compare = require_compare();
|
|
13222
12022
|
var rcompare = require_rcompare();
|
|
13223
12023
|
var compareLoose = require_compare_loose();
|
|
@@ -13248,14 +12048,14 @@ var require_semver2 = __commonJS({
|
|
|
13248
12048
|
var subset = require_subset();
|
|
13249
12049
|
module2.exports = {
|
|
13250
12050
|
parse,
|
|
13251
|
-
valid,
|
|
12051
|
+
valid: valid2,
|
|
13252
12052
|
clean,
|
|
13253
|
-
inc,
|
|
12053
|
+
inc: inc2,
|
|
13254
12054
|
diff,
|
|
13255
12055
|
major: major2,
|
|
13256
12056
|
minor: minor2,
|
|
13257
12057
|
patch,
|
|
13258
|
-
prerelease,
|
|
12058
|
+
prerelease: prerelease2,
|
|
13259
12059
|
compare,
|
|
13260
12060
|
rcompare,
|
|
13261
12061
|
compareLoose,
|
|
@@ -13314,7 +12114,7 @@ var {
|
|
|
13314
12114
|
} = import_index.default;
|
|
13315
12115
|
|
|
13316
12116
|
// src/commands/check-header.ts
|
|
13317
|
-
var
|
|
12117
|
+
var fs7 = __toESM(require("fs"));
|
|
13318
12118
|
|
|
13319
12119
|
// node_modules/minimatch/dist/esm/index.js
|
|
13320
12120
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
|
@@ -14646,6 +13446,12 @@ minimatch.Minimatch = Minimatch;
|
|
|
14646
13446
|
minimatch.escape = escape;
|
|
14647
13447
|
minimatch.unescape = unescape;
|
|
14648
13448
|
|
|
13449
|
+
// src/commands/check-header.ts
|
|
13450
|
+
var path6 = __toESM(require("path"));
|
|
13451
|
+
|
|
13452
|
+
// src/util/file-util.ts
|
|
13453
|
+
var fs = __toESM(require("fs"));
|
|
13454
|
+
|
|
14649
13455
|
// node_modules/glob/dist/esm/glob.js
|
|
14650
13456
|
var import_node_url2 = require("node:url");
|
|
14651
13457
|
|
|
@@ -16661,10 +15467,10 @@ var Minipass = class extends import_node_events.EventEmitter {
|
|
|
16661
15467
|
* Return a void Promise that resolves once the stream ends.
|
|
16662
15468
|
*/
|
|
16663
15469
|
async promise() {
|
|
16664
|
-
return new Promise((
|
|
15470
|
+
return new Promise((resolve13, reject) => {
|
|
16665
15471
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
16666
15472
|
this.on("error", (er) => reject(er));
|
|
16667
|
-
this.on("end", () =>
|
|
15473
|
+
this.on("end", () => resolve13());
|
|
16668
15474
|
});
|
|
16669
15475
|
}
|
|
16670
15476
|
/**
|
|
@@ -16688,7 +15494,7 @@ var Minipass = class extends import_node_events.EventEmitter {
|
|
|
16688
15494
|
return Promise.resolve({ done: false, value: res });
|
|
16689
15495
|
if (this[EOF])
|
|
16690
15496
|
return stop();
|
|
16691
|
-
let
|
|
15497
|
+
let resolve13;
|
|
16692
15498
|
let reject;
|
|
16693
15499
|
const onerr = (er) => {
|
|
16694
15500
|
this.off("data", ondata);
|
|
@@ -16702,19 +15508,19 @@ var Minipass = class extends import_node_events.EventEmitter {
|
|
|
16702
15508
|
this.off("end", onend);
|
|
16703
15509
|
this.off(DESTROYED, ondestroy);
|
|
16704
15510
|
this.pause();
|
|
16705
|
-
|
|
15511
|
+
resolve13({ value, done: !!this[EOF] });
|
|
16706
15512
|
};
|
|
16707
15513
|
const onend = () => {
|
|
16708
15514
|
this.off("error", onerr);
|
|
16709
15515
|
this.off("data", ondata);
|
|
16710
15516
|
this.off(DESTROYED, ondestroy);
|
|
16711
15517
|
stop();
|
|
16712
|
-
|
|
15518
|
+
resolve13({ done: true, value: void 0 });
|
|
16713
15519
|
};
|
|
16714
15520
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
16715
15521
|
return new Promise((res2, rej) => {
|
|
16716
15522
|
reject = rej;
|
|
16717
|
-
|
|
15523
|
+
resolve13 = res2;
|
|
16718
15524
|
this.once(DESTROYED, ondestroy);
|
|
16719
15525
|
this.once("error", onerr);
|
|
16720
15526
|
this.once("end", onend);
|
|
@@ -17682,9 +16488,9 @@ var PathBase = class {
|
|
|
17682
16488
|
if (this.#asyncReaddirInFlight) {
|
|
17683
16489
|
await this.#asyncReaddirInFlight;
|
|
17684
16490
|
} else {
|
|
17685
|
-
let
|
|
16491
|
+
let resolve13 = () => {
|
|
17686
16492
|
};
|
|
17687
|
-
this.#asyncReaddirInFlight = new Promise((res) =>
|
|
16493
|
+
this.#asyncReaddirInFlight = new Promise((res) => resolve13 = res);
|
|
17688
16494
|
try {
|
|
17689
16495
|
for (const e of await this.#fs.promises.readdir(fullpath, {
|
|
17690
16496
|
withFileTypes: true
|
|
@@ -17697,7 +16503,7 @@ var PathBase = class {
|
|
|
17697
16503
|
children.provisional = 0;
|
|
17698
16504
|
}
|
|
17699
16505
|
this.#asyncReaddirInFlight = void 0;
|
|
17700
|
-
|
|
16506
|
+
resolve13();
|
|
17701
16507
|
}
|
|
17702
16508
|
return children.slice(0, children.provisional);
|
|
17703
16509
|
}
|
|
@@ -19428,10 +18234,10 @@ var Minipass2 = class extends import_node_events2.EventEmitter {
|
|
|
19428
18234
|
* Return a void Promise that resolves once the stream ends.
|
|
19429
18235
|
*/
|
|
19430
18236
|
async promise() {
|
|
19431
|
-
return new Promise((
|
|
18237
|
+
return new Promise((resolve13, reject) => {
|
|
19432
18238
|
this.on(DESTROYED2, () => reject(new Error("stream destroyed")));
|
|
19433
18239
|
this.on("error", (er) => reject(er));
|
|
19434
|
-
this.on("end", () =>
|
|
18240
|
+
this.on("end", () => resolve13());
|
|
19435
18241
|
});
|
|
19436
18242
|
}
|
|
19437
18243
|
/**
|
|
@@ -19455,7 +18261,7 @@ var Minipass2 = class extends import_node_events2.EventEmitter {
|
|
|
19455
18261
|
return Promise.resolve({ done: false, value: res });
|
|
19456
18262
|
if (this[EOF2])
|
|
19457
18263
|
return stop();
|
|
19458
|
-
let
|
|
18264
|
+
let resolve13;
|
|
19459
18265
|
let reject;
|
|
19460
18266
|
const onerr = (er) => {
|
|
19461
18267
|
this.off("data", ondata);
|
|
@@ -19469,19 +18275,19 @@ var Minipass2 = class extends import_node_events2.EventEmitter {
|
|
|
19469
18275
|
this.off("end", onend);
|
|
19470
18276
|
this.off(DESTROYED2, ondestroy);
|
|
19471
18277
|
this.pause();
|
|
19472
|
-
|
|
18278
|
+
resolve13({ value, done: !!this[EOF2] });
|
|
19473
18279
|
};
|
|
19474
18280
|
const onend = () => {
|
|
19475
18281
|
this.off("error", onerr);
|
|
19476
18282
|
this.off("data", ondata);
|
|
19477
18283
|
this.off(DESTROYED2, ondestroy);
|
|
19478
18284
|
stop();
|
|
19479
|
-
|
|
18285
|
+
resolve13({ done: true, value: void 0 });
|
|
19480
18286
|
};
|
|
19481
18287
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
19482
18288
|
return new Promise((res2, rej) => {
|
|
19483
18289
|
reject = rej;
|
|
19484
|
-
|
|
18290
|
+
resolve13 = res2;
|
|
19485
18291
|
this.once(DESTROYED2, ondestroy);
|
|
19486
18292
|
this.once("error", onerr);
|
|
19487
18293
|
this.once("end", onend);
|
|
@@ -20472,12 +19278,7 @@ var glob = Object.assign(glob_, {
|
|
|
20472
19278
|
});
|
|
20473
19279
|
glob.glob = glob;
|
|
20474
19280
|
|
|
20475
|
-
// src/commands/check-header.ts
|
|
20476
|
-
var readline = __toESM(require_readline_sync());
|
|
20477
|
-
var path5 = __toESM(require("path"));
|
|
20478
|
-
|
|
20479
19281
|
// src/util/file-util.ts
|
|
20480
|
-
var fs = __toESM(require("fs"));
|
|
20481
19282
|
var os = __toESM(require("os"));
|
|
20482
19283
|
var path2 = __toESM(require("path"));
|
|
20483
19284
|
function moveFile(src, dest) {
|
|
@@ -20615,7 +19416,7 @@ var child = __toESM(require("child_process"));
|
|
|
20615
19416
|
var path3 = __toESM(require("path"));
|
|
20616
19417
|
|
|
20617
19418
|
// package.json
|
|
20618
|
-
var version = "2.
|
|
19419
|
+
var version = "2.7.0-next";
|
|
20619
19420
|
|
|
20620
19421
|
// src/util/process-util.ts
|
|
20621
19422
|
var COMMAND_VERSION = version;
|
|
@@ -20674,7 +19475,7 @@ function execAsync(cmd, options = {}) {
|
|
|
20674
19475
|
if (verbose) {
|
|
20675
19476
|
console.log(`+ ${cmd}`);
|
|
20676
19477
|
}
|
|
20677
|
-
return new Promise((
|
|
19478
|
+
return new Promise((resolve13, reject) => {
|
|
20678
19479
|
const [command, ...args] = cmd.split(" ");
|
|
20679
19480
|
const childProcess = child.spawn(command, args, {
|
|
20680
19481
|
shell: true,
|
|
@@ -20707,7 +19508,7 @@ ${stderr}`.trim();
|
|
|
20707
19508
|
return;
|
|
20708
19509
|
}
|
|
20709
19510
|
}
|
|
20710
|
-
|
|
19511
|
+
resolve13(stdout.trim());
|
|
20711
19512
|
});
|
|
20712
19513
|
childProcess.on("error", (error) => {
|
|
20713
19514
|
const errorMsg = `Command failed: ${cmd}
|
|
@@ -20749,9 +19550,6 @@ function commitChanges(message, path13) {
|
|
|
20749
19550
|
function getChangesOfLastCommit(path13) {
|
|
20750
19551
|
return exec("git diff --name-only HEAD^", { cwd: path13 }).split("\n").map((file) => (0, import_path.resolve)(path13 ?? process.cwd(), file));
|
|
20751
19552
|
}
|
|
20752
|
-
function getLastCommitMessage(path13) {
|
|
20753
|
-
return exec("git log -1 --pretty=%B", { cwd: path13 }).trim();
|
|
20754
|
-
}
|
|
20755
19553
|
function getLastModificationDate(filePath, repoRoot, excludeMessage) {
|
|
20756
19554
|
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : "";
|
|
20757
19555
|
try {
|
|
@@ -20936,14 +19734,14 @@ var CheckHeaderCommand = baseCommand().name("checkHeaders").description("Validat
|
|
|
20936
19734
|
).option(
|
|
20937
19735
|
"--no-exclude-defaults",
|
|
20938
19736
|
"Disables the default excludes patterns. Only explicitly passed exclude patterns (-e, --exclude) are considered"
|
|
20939
|
-
).option("-j, --json", "Also persist validation results as json file", false).option("-a, --autoFix", "Auto apply
|
|
20940
|
-
function checkHeaders(rootDir, options) {
|
|
19737
|
+
).option("-j, --json", "Also persist validation results as json file", false).option("-a, --autoFix", "Auto apply fixes without prompting the user", false).option("--commit", "When used with --autoFix, also create a git commit for the fixed files", false).action(checkHeaders);
|
|
19738
|
+
async function checkHeaders(rootDir, options) {
|
|
20941
19739
|
configureExec({ silent: true, fatal: true });
|
|
20942
19740
|
cd(rootDir);
|
|
20943
19741
|
if (options.excludeDefaults) {
|
|
20944
19742
|
options.exclude.push(...DEFAULT_EXCLUDES);
|
|
20945
19743
|
}
|
|
20946
|
-
const files = getFiles(rootDir, options);
|
|
19744
|
+
const files = await getFiles(rootDir, options);
|
|
20947
19745
|
LOGGER.info(`Check copy right headers of ${files.length} files`);
|
|
20948
19746
|
if (files.length === 0) {
|
|
20949
19747
|
LOGGER.info("Check completed");
|
|
@@ -20952,13 +19750,15 @@ function checkHeaders(rootDir, options) {
|
|
|
20952
19750
|
const results = validate(rootDir, files, options);
|
|
20953
19751
|
handleValidationResults(rootDir, results, options);
|
|
20954
19752
|
}
|
|
20955
|
-
function getFiles(rootDir, options) {
|
|
19753
|
+
async function getFiles(rootDir, options) {
|
|
20956
19754
|
const includePattern = `**/*.@(${options.fileExtensions.join("|")})`;
|
|
20957
19755
|
const excludePattern = options.exclude;
|
|
20958
19756
|
if (options.type === "full") {
|
|
20959
|
-
const
|
|
19757
|
+
const { globbySync: globbySync2 } = await Promise.resolve().then(() => (init_globby(), globby_exports));
|
|
19758
|
+
const result2 = globbySync2(includePattern, {
|
|
20960
19759
|
cwd: rootDir,
|
|
20961
|
-
ignore: excludePattern
|
|
19760
|
+
ignore: excludePattern,
|
|
19761
|
+
gitignore: true
|
|
20962
19762
|
});
|
|
20963
19763
|
return resolveFiles(result2);
|
|
20964
19764
|
}
|
|
@@ -20967,7 +19767,7 @@ function getFiles(rootDir, options) {
|
|
|
20967
19767
|
excludePattern.forEach((pattern) => {
|
|
20968
19768
|
changedFiles = changedFiles.filter(filter(`!${pattern}`));
|
|
20969
19769
|
});
|
|
20970
|
-
const result = changedFiles.filter((file) =>
|
|
19770
|
+
const result = changedFiles.filter((file) => fs7.existsSync(file));
|
|
20971
19771
|
return resolveFiles(result);
|
|
20972
19772
|
}
|
|
20973
19773
|
function validate(rootDir, files, options) {
|
|
@@ -20981,7 +19781,7 @@ function validate(rootDir, files, options) {
|
|
|
20981
19781
|
}
|
|
20982
19782
|
noHeaders.forEach((file, i) => {
|
|
20983
19783
|
printFileProgress(i + 1, allFilesLength, `Validating ${file}`);
|
|
20984
|
-
results.push({ file:
|
|
19784
|
+
results.push({ file: path6.resolve(rootDir, file), violation: "noOrMissingHeader" });
|
|
20985
19785
|
});
|
|
20986
19786
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
20987
19787
|
let defaultEndYear;
|
|
@@ -21013,26 +19813,28 @@ function validate(rootDir, files, options) {
|
|
|
21013
19813
|
}
|
|
21014
19814
|
});
|
|
21015
19815
|
results.sort((a, b) => a.file.localeCompare(b.file));
|
|
21016
|
-
process.stdout.
|
|
19816
|
+
if (process.stdout.isTTY) {
|
|
19817
|
+
process.stdout.clearLine(0);
|
|
19818
|
+
}
|
|
21017
19819
|
return results;
|
|
21018
19820
|
}
|
|
21019
19821
|
function validateEndYear(result) {
|
|
21020
19822
|
const { currentStartYear, expectedEndYear, currentEndYear } = result;
|
|
21021
19823
|
result.violation = "invalidEndYear";
|
|
21022
|
-
const
|
|
21023
|
-
if (
|
|
19824
|
+
const valid2 = currentEndYear ? currentEndYear === expectedEndYear : currentStartYear === expectedEndYear;
|
|
19825
|
+
if (valid2) {
|
|
21024
19826
|
result.violation = "none";
|
|
21025
19827
|
return;
|
|
21026
19828
|
}
|
|
21027
19829
|
}
|
|
21028
19830
|
function printFileProgress(currentFileCount, maxFileCount, message, clear = true) {
|
|
21029
|
-
if (clear) {
|
|
19831
|
+
if (clear && process.stdout.isTTY) {
|
|
21030
19832
|
process.stdout.clearLine(0);
|
|
21031
19833
|
process.stdout.cursorTo(0);
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
19834
|
+
process.stdout.write(`[${currentFileCount} of ${maxFileCount}] ${message}`);
|
|
19835
|
+
} else {
|
|
19836
|
+
process.stdout.write(`[${currentFileCount} of ${maxFileCount}] ${message}
|
|
19837
|
+
`);
|
|
21036
19838
|
}
|
|
21037
19839
|
}
|
|
21038
19840
|
function handleValidationResults(rootDir, results, options) {
|
|
@@ -21045,13 +19847,16 @@ function handleValidationResults(rootDir, results, options) {
|
|
|
21045
19847
|
toPrint.forEach((result, i) => LOGGER.info(`${i + 1}. `, result.file, ":", toPrintMessage(result)));
|
|
21046
19848
|
LOGGER.newLine();
|
|
21047
19849
|
if (options.json) {
|
|
21048
|
-
|
|
19850
|
+
fs7.writeFileSync(path6.join(rootDir, "headerCheck.json"), JSON.stringify(results, void 0, 2));
|
|
21049
19851
|
}
|
|
21050
|
-
if (violations.length > 0 &&
|
|
19852
|
+
if (violations.length > 0 && options.autoFix) {
|
|
21051
19853
|
const toFix = violations.filter((violation) => isDateValidationResult(violation));
|
|
21052
19854
|
fixViolations(rootDir, toFix, options);
|
|
21053
19855
|
}
|
|
21054
19856
|
LOGGER.info("Check completed");
|
|
19857
|
+
if (violations.length > 0 && !options.autoFix) {
|
|
19858
|
+
process.exit(1);
|
|
19859
|
+
}
|
|
21055
19860
|
}
|
|
21056
19861
|
function toPrintMessage(result) {
|
|
21057
19862
|
const error = "\x1B[31m";
|
|
@@ -21077,7 +19882,7 @@ function fixViolations(rootDir, violations, options) {
|
|
|
21077
19882
|
replaceInFile(violation.file, RegExp("Copyright \\([cC]\\) " + currentRange), `Copyright (c) ${fixedRange}`);
|
|
21078
19883
|
});
|
|
21079
19884
|
LOGGER.newLine();
|
|
21080
|
-
if (options.
|
|
19885
|
+
if (options.commit && options.autoFix) {
|
|
21081
19886
|
LOGGER.newLine();
|
|
21082
19887
|
const files = violations.map((violation) => violation.file).join(" ");
|
|
21083
19888
|
exec(`git add ${files}`);
|
|
@@ -21090,8 +19895,8 @@ function isDateValidationResult(object) {
|
|
|
21090
19895
|
}
|
|
21091
19896
|
|
|
21092
19897
|
// src/commands/coverage-report.ts
|
|
21093
|
-
var
|
|
21094
|
-
var
|
|
19898
|
+
var fs8 = __toESM(require("fs"));
|
|
19899
|
+
var path7 = __toESM(require("path"));
|
|
21095
19900
|
var CoverageReportCommand = baseCommand().name("coverageReport").description("Generate a test coverage report for a glsp component").option("-p, --projectRoot <projectRoot>", "The root directory of the GLSP component", validateDirectory, process.cwd()).option("-c, --coverageScript <script>", "Script command of the package root for creating coverage reports", "test:coverage").action(generateCoverageReport);
|
|
21096
19901
|
async function generateCoverageReport(options) {
|
|
21097
19902
|
cd(options.projectRoot);
|
|
@@ -21121,19 +19926,19 @@ async function collectPackageReportFiles(packages, options) {
|
|
|
21121
19926
|
}
|
|
21122
19927
|
async function combineReports(reportFiles, options) {
|
|
21123
19928
|
LOGGER.info("Create combined coverage report");
|
|
21124
|
-
const reportsDir =
|
|
21125
|
-
if (
|
|
21126
|
-
|
|
19929
|
+
const reportsDir = path7.join(options.projectRoot, ".nyc_output");
|
|
19930
|
+
if (fs8.existsSync(reportsDir)) {
|
|
19931
|
+
fs8.rmSync(reportsDir, { force: true, recursive: true });
|
|
21127
19932
|
}
|
|
21128
|
-
|
|
19933
|
+
fs8.mkdirSync(reportsDir);
|
|
21129
19934
|
for (let i = 0; i < reportFiles.length; i++) {
|
|
21130
|
-
|
|
19935
|
+
fs8.copyFileSync(reportFiles[i], path7.resolve(".nyc_output", `coverage-final-${i}.json`));
|
|
21131
19936
|
}
|
|
21132
19937
|
cd(options.projectRoot);
|
|
21133
19938
|
const configFiles = [".nycrc", ".nycrc.json", ".nyc-config.js"];
|
|
21134
19939
|
const tempFiles = [];
|
|
21135
19940
|
configFiles.forEach((config) => {
|
|
21136
|
-
if (
|
|
19941
|
+
if (fs8.existsSync(path7.join(options.projectRoot, config))) {
|
|
21137
19942
|
moveFile(config, "_" + config);
|
|
21138
19943
|
tempFiles.push("_" + config);
|
|
21139
19944
|
}
|
|
@@ -21242,8 +20047,8 @@ function extractReusableContent(fileContent) {
|
|
|
21242
20047
|
var path11 = __toESM(require("path"));
|
|
21243
20048
|
|
|
21244
20049
|
// src/commands/releng/common.ts
|
|
21245
|
-
var
|
|
21246
|
-
var
|
|
20050
|
+
var path9 = __toESM(require("path"));
|
|
20051
|
+
var semver = __toESM(require_semver2());
|
|
21247
20052
|
var GLSPRepo;
|
|
21248
20053
|
((GLSPRepo2) => {
|
|
21249
20054
|
GLSPRepo2.choices = [
|
|
@@ -21318,7 +20123,7 @@ var VersionType;
|
|
|
21318
20123
|
validate2(versionType, customVersion);
|
|
21319
20124
|
LOGGER.debug(`Derive version for version type: ${versionType} with custom version: ${customVersion}`);
|
|
21320
20125
|
if (versionType === "custom") {
|
|
21321
|
-
if (GLSPRepo.isNpmRepo(options.repo) && !
|
|
20126
|
+
if (GLSPRepo.isNpmRepo(options.repo) && !semver.valid(customVersion)) {
|
|
21322
20127
|
throw new Error(`Not a valid custom version: ${customVersion}`);
|
|
21323
20128
|
}
|
|
21324
20129
|
return customVersion;
|
|
@@ -21359,13 +20164,13 @@ function getLocalVersion(repoDir, repo) {
|
|
|
21359
20164
|
if (repo === "glsp-server") {
|
|
21360
20165
|
return getVersionFromPom(repoDir);
|
|
21361
20166
|
} else if (repo === "glsp-eclipse-integration") {
|
|
21362
|
-
return getVersionFromPom(
|
|
20167
|
+
return getVersionFromPom(path9.resolve(repoDir, "server"));
|
|
21363
20168
|
} else {
|
|
21364
20169
|
return getVersionFromPackage(repoDir);
|
|
21365
20170
|
}
|
|
21366
20171
|
}
|
|
21367
20172
|
function getVersionFromPom(repoDir) {
|
|
21368
|
-
const pom = readFile(
|
|
20173
|
+
const pom = readFile(path9.resolve(repoDir, "pom.xml"));
|
|
21369
20174
|
const match2 = pom.match(/<version>(.*?)<\/version>/);
|
|
21370
20175
|
if (!match2) {
|
|
21371
20176
|
throw new Error(`Could not find version in pom.xml of ${repoDir}`);
|
|
@@ -21373,7 +20178,7 @@ function getVersionFromPom(repoDir) {
|
|
|
21373
20178
|
return match2[1];
|
|
21374
20179
|
}
|
|
21375
20180
|
function getVersionFromPackage(repoDir) {
|
|
21376
|
-
const rootPkg = readPackage(
|
|
20181
|
+
const rootPkg = readPackage(path9.resolve(repoDir, "package.json"));
|
|
21377
20182
|
const existingVersion = rootPkg.content.version;
|
|
21378
20183
|
if (!existingVersion) {
|
|
21379
20184
|
throw new Error(`No version found in package.json of ${repoDir}`);
|
|
@@ -21381,7 +20186,7 @@ function getVersionFromPackage(repoDir) {
|
|
|
21381
20186
|
return existingVersion;
|
|
21382
20187
|
}
|
|
21383
20188
|
function toNewVersion(version2, versionType) {
|
|
21384
|
-
const newVersion = versionType === "next" ?
|
|
20189
|
+
const newVersion = versionType === "next" ? semver.inc(version2, "minor")?.concat("-next") : semver.inc(version2, versionType);
|
|
21385
20190
|
if (!newVersion) {
|
|
21386
20191
|
throw new Error(`Could not increment version: ${version2} `);
|
|
21387
20192
|
}
|
|
@@ -21402,7 +20207,7 @@ function getLastReleaseTag(repoDir) {
|
|
|
21402
20207
|
return false;
|
|
21403
20208
|
}
|
|
21404
20209
|
const version2 = tag.substring(1);
|
|
21405
|
-
return
|
|
20210
|
+
return semver.valid(version2) !== void 0 && !semver.prerelease(version2);
|
|
21406
20211
|
});
|
|
21407
20212
|
return lastTag;
|
|
21408
20213
|
}
|
|
@@ -21766,85 +20571,8 @@ Note: This pull request was created automatically. After merging, the automated
|
|
|
21766
20571
|
}
|
|
21767
20572
|
}
|
|
21768
20573
|
|
|
21769
|
-
// src/commands/releng/publish.ts
|
|
21770
|
-
var PublishCommand = baseCommand().name("publish").description("Publish a new release for a GLSP component (npm, maven, github ...)").option("-v, --verbose", "Enable verbose (debug) log output", false).option("-r, --repoDir <repoDir>", "Path to the component repository", validateGitDirectory, process.cwd()).option("--no-npm", "Skip npm publishing", true).option("-d, --draft", "Create a draft GitHub release", false).action((options) => {
|
|
21771
|
-
configureEnv(options);
|
|
21772
|
-
const repo = GLSPRepo.deriveFromDirectory(options.repoDir);
|
|
21773
|
-
if (!repo) {
|
|
21774
|
-
throw new Error(`Cannot derive GLSP repository from directory ${options.repoDir}`);
|
|
21775
|
-
}
|
|
21776
|
-
const version2 = getLocalVersion(options.repoDir, repo);
|
|
21777
|
-
publish({ ...options, repo, version: version2 });
|
|
21778
|
-
});
|
|
21779
|
-
async function publish(options) {
|
|
21780
|
-
cd(options.repoDir);
|
|
21781
|
-
LOGGER.info("Publish new release for repository", options.repo);
|
|
21782
|
-
LOGGER.debug("Options:", options);
|
|
21783
|
-
validateCurrentState(options);
|
|
21784
|
-
createTag(options);
|
|
21785
|
-
publishGHRelease(options);
|
|
21786
|
-
await publishNpm(options);
|
|
21787
|
-
LOGGER.info("Release process completed successfully.");
|
|
21788
|
-
}
|
|
21789
|
-
function validateCurrentState(options) {
|
|
21790
|
-
LOGGER.info("Validate if repository is in a release state ...");
|
|
21791
|
-
LOGGER.debug(`Validate local repository version: ${options.repoDir}`);
|
|
21792
|
-
const version2 = options.version;
|
|
21793
|
-
checkGHCli();
|
|
21794
|
-
if (version2.includes("-")) {
|
|
21795
|
-
throw new Error(`Cannot publish non-release version: ${version2}`);
|
|
21796
|
-
}
|
|
21797
|
-
LOGGER.debug("Validate last commit message");
|
|
21798
|
-
const lastCommitMessage = getLastCommitMessage(options.repoDir);
|
|
21799
|
-
if (!lastCommitMessage.includes(`v${version2}`)) {
|
|
21800
|
-
throw new Error(`Last commit message is not the correct release message: ${lastCommitMessage}`);
|
|
21801
|
-
}
|
|
21802
|
-
LOGGER.debug("Validate changelog");
|
|
21803
|
-
const changelog = readFile("CHANGELOG.md");
|
|
21804
|
-
if (!changelog.includes("## [v2.5.0")) {
|
|
21805
|
-
throw new Error(`CHANGELOG.md does not contain an entry for version ${version2}`);
|
|
21806
|
-
}
|
|
21807
|
-
LOGGER.debug("Ensure that we are logged in to npm");
|
|
21808
|
-
if (options.npm) {
|
|
21809
|
-
exec("npm whoami", { silent: true, errorMsg: 'Not logged in to npm! Please run "npm login"' });
|
|
21810
|
-
}
|
|
21811
|
-
LOGGER.info("Validation successful. Repository is in a releasable state.");
|
|
21812
|
-
}
|
|
21813
|
-
function createTag(options) {
|
|
21814
|
-
LOGGER.info("Create git tag ...");
|
|
21815
|
-
const version2 = options.version;
|
|
21816
|
-
exec(`git tag -a v${version2} -m "Release v${version2}"`, { errorMsg: "Failed to create git tag" });
|
|
21817
|
-
exec("git push origin tag v${version}", { errorMsg: "Failed to push tag to origin" });
|
|
21818
|
-
LOGGER.info(`Created and pushed git tag v${version2}`);
|
|
21819
|
-
}
|
|
21820
|
-
function publishGHRelease(options) {
|
|
21821
|
-
LOGGER.info("Publish GitHub release ...");
|
|
21822
|
-
const changeLog = getChangeLogChanges(options);
|
|
21823
|
-
const draft = options.draft ? "--draft" : "";
|
|
21824
|
-
exec(
|
|
21825
|
-
`gh release create v${options.version} ${draft} --title "v${options.version}" --notes "${changeLog.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`,
|
|
21826
|
-
{
|
|
21827
|
-
errorMsg: "Failed to create GitHub release"
|
|
21828
|
-
}
|
|
21829
|
-
);
|
|
21830
|
-
LOGGER.info(`Created GitHub release v${options.version}`);
|
|
21831
|
-
}
|
|
21832
|
-
async function publishNpm(options) {
|
|
21833
|
-
if (!options.npm) {
|
|
21834
|
-
LOGGER.info("Skipping npm publish");
|
|
21835
|
-
return;
|
|
21836
|
-
}
|
|
21837
|
-
if (!GLSPRepo.isNpmRepo(options.repo)) {
|
|
21838
|
-
LOGGER.info(`Skipping npm publish for repository ${options.repo}`);
|
|
21839
|
-
return;
|
|
21840
|
-
}
|
|
21841
|
-
LOGGER.info("Publish new npm version ...");
|
|
21842
|
-
await execAsync("lerna publish from-package --no-git-reset -y", { errorMsg: "Failed to publish new npm version" });
|
|
21843
|
-
LOGGER.info(`Published new npm version ${options.version}`);
|
|
21844
|
-
}
|
|
21845
|
-
|
|
21846
20574
|
// src/commands/releng/releng.ts
|
|
21847
|
-
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand)
|
|
20575
|
+
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand);
|
|
21848
20576
|
|
|
21849
20577
|
// src/commands/update-next.ts
|
|
21850
20578
|
var path12 = __toESM(require("path"));
|
|
@@ -21859,7 +20587,7 @@ async function updateNext(rootDir, options) {
|
|
|
21859
20587
|
configureExec({ silent: false, fatal: true });
|
|
21860
20588
|
LOGGER.info("Updating next dependencies ...");
|
|
21861
20589
|
rootDir = path12.resolve(rootDir);
|
|
21862
|
-
const packages = getYarnWorkspacePackages(rootDir);
|
|
20590
|
+
const packages = getYarnWorkspacePackages(rootDir, true);
|
|
21863
20591
|
LOGGER.debug(`Scanning ${packages.length} packages to derive resolutions`, packages);
|
|
21864
20592
|
const resolutions = await getResolutions(packages);
|
|
21865
20593
|
if (Object.keys(resolutions).length === 0) {
|