1fceda4724
* chore(refactor): tests use vitest and msw * fix(directory): Ensure filenames conform to eslint requirements * chore(yarn): Specify node engine version * fix(yarn): use the proper nodelinker * fix(GitHub workflow): yarn install with caching * docs(README): update to match changes --------- Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2900 lines
65 KiB
JavaScript
Generated
2900 lines
65 KiB
JavaScript
Generated
export const id = 902;
|
|
export const ids = [902];
|
|
export const modules = {
|
|
|
|
/***/ 8567:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
/*! arch. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
var cp = __webpack_require__(2081)
|
|
var fs = __webpack_require__(7147)
|
|
var path = __webpack_require__(1017)
|
|
|
|
/**
|
|
* Returns the operating system's CPU architecture. This is different than
|
|
* `process.arch` or `os.arch()` which returns the architecture the Node.js (or
|
|
* Electron) binary was compiled for.
|
|
*/
|
|
module.exports = function arch () {
|
|
/**
|
|
* The running binary is 64-bit, so the OS is clearly 64-bit.
|
|
*/
|
|
if (process.arch === 'x64') {
|
|
return 'x64'
|
|
}
|
|
|
|
/**
|
|
* All recent versions of Mac OS are 64-bit.
|
|
*/
|
|
if (process.platform === 'darwin') {
|
|
return 'x64'
|
|
}
|
|
|
|
/**
|
|
* On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit
|
|
* app is based on the presence of a WOW64 file: %SystemRoot%\SysNative.
|
|
* See: https://twitter.com/feross/status/776949077208510464
|
|
*/
|
|
if (process.platform === 'win32') {
|
|
var useEnv = false
|
|
try {
|
|
useEnv = !!(process.env.SYSTEMROOT && fs.statSync(process.env.SYSTEMROOT))
|
|
} catch (err) {}
|
|
|
|
var sysRoot = useEnv ? process.env.SYSTEMROOT : 'C:\\Windows'
|
|
|
|
// If %SystemRoot%\SysNative exists, we are in a WOW64 FS Redirected application.
|
|
var isWOW64 = false
|
|
try {
|
|
isWOW64 = !!fs.statSync(path.join(sysRoot, 'sysnative'))
|
|
} catch (err) {}
|
|
|
|
return isWOW64 ? 'x64' : 'x86'
|
|
}
|
|
|
|
/**
|
|
* On Linux, use the `getconf` command to get the architecture.
|
|
*/
|
|
if (process.platform === 'linux') {
|
|
var output = cp.execSync('getconf LONG_BIT', { encoding: 'utf8' })
|
|
return output === '64\n' ? 'x64' : 'x86'
|
|
}
|
|
|
|
/**
|
|
* If none of the above, assume the architecture is 32-bit.
|
|
*/
|
|
return 'x86'
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2746:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
const cp = __webpack_require__(2081);
|
|
const parse = __webpack_require__(6855);
|
|
const enoent = __webpack_require__(4101);
|
|
|
|
function spawn(command, args, options) {
|
|
// Parse the arguments
|
|
const parsed = parse(command, args, options);
|
|
|
|
// Spawn the child process
|
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
|
|
// Hook into child process "exit" event to emit an error if the command
|
|
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
|
enoent.hookChildProcess(spawned, parsed);
|
|
|
|
return spawned;
|
|
}
|
|
|
|
function spawnSync(command, args, options) {
|
|
// Parse the arguments
|
|
const parsed = parse(command, args, options);
|
|
|
|
// Spawn the child process
|
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
|
|
// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
|
|
return result;
|
|
}
|
|
|
|
module.exports = spawn;
|
|
module.exports.spawn = spawn;
|
|
module.exports.sync = spawnSync;
|
|
|
|
module.exports._parse = parse;
|
|
module.exports._enoent = enoent;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4101:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
const isWin = process.platform === 'win32';
|
|
|
|
function notFoundError(original, syscall) {
|
|
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
code: 'ENOENT',
|
|
errno: 'ENOENT',
|
|
syscall: `${syscall} ${original.command}`,
|
|
path: original.command,
|
|
spawnargs: original.args,
|
|
});
|
|
}
|
|
|
|
function hookChildProcess(cp, parsed) {
|
|
if (!isWin) {
|
|
return;
|
|
}
|
|
|
|
const originalEmit = cp.emit;
|
|
|
|
cp.emit = function (name, arg1) {
|
|
// If emitting "exit" event and exit code is 1, we need to check if
|
|
// the command exists and emit an "error" instead
|
|
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
|
if (name === 'exit') {
|
|
const err = verifyENOENT(arg1, parsed, 'spawn');
|
|
|
|
if (err) {
|
|
return originalEmit.call(cp, 'error', err);
|
|
}
|
|
}
|
|
|
|
return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
|
|
};
|
|
}
|
|
|
|
function verifyENOENT(status, parsed) {
|
|
if (isWin && status === 1 && !parsed.file) {
|
|
return notFoundError(parsed.original, 'spawn');
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
function verifyENOENTSync(status, parsed) {
|
|
if (isWin && status === 1 && !parsed.file) {
|
|
return notFoundError(parsed.original, 'spawnSync');
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
module.exports = {
|
|
hookChildProcess,
|
|
verifyENOENT,
|
|
verifyENOENTSync,
|
|
notFoundError,
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6855:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
const path = __webpack_require__(1017);
|
|
const resolveCommand = __webpack_require__(7274);
|
|
const escape = __webpack_require__(4274);
|
|
const readShebang = __webpack_require__(1252);
|
|
|
|
const isWin = process.platform === 'win32';
|
|
const isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
|
|
function detectShebang(parsed) {
|
|
parsed.file = resolveCommand(parsed);
|
|
|
|
const shebang = parsed.file && readShebang(parsed.file);
|
|
|
|
if (shebang) {
|
|
parsed.args.unshift(parsed.file);
|
|
parsed.command = shebang;
|
|
|
|
return resolveCommand(parsed);
|
|
}
|
|
|
|
return parsed.file;
|
|
}
|
|
|
|
function parseNonShell(parsed) {
|
|
if (!isWin) {
|
|
return parsed;
|
|
}
|
|
|
|
// Detect & add support for shebangs
|
|
const commandFile = detectShebang(parsed);
|
|
|
|
// We don't need a shell if the command filename is an executable
|
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
|
|
// If a shell is required, use cmd.exe and take care of escaping everything correctly
|
|
// Note that `forceShell` is an hidden option used only in tests
|
|
if (parsed.options.forceShell || needsShell) {
|
|
// Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
|
|
// The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
|
|
// Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
|
|
// we need to double escape them
|
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
|
|
// Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
|
|
// This is necessary otherwise it will always fail with ENOENT in those cases
|
|
parsed.command = path.normalize(parsed.command);
|
|
|
|
// Escape command & arguments
|
|
parsed.command = escape.command(parsed.command);
|
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
|
|
const shellCommand = [parsed.command].concat(parsed.args).join(' ');
|
|
|
|
parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
|
|
parsed.command = process.env.comspec || 'cmd.exe';
|
|
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
|
|
}
|
|
|
|
return parsed;
|
|
}
|
|
|
|
function parse(command, args, options) {
|
|
// Normalize arguments, similar to nodejs
|
|
if (args && !Array.isArray(args)) {
|
|
options = args;
|
|
args = null;
|
|
}
|
|
|
|
args = args ? args.slice(0) : []; // Clone array to avoid changing the original
|
|
options = Object.assign({}, options); // Clone object to avoid changing the original
|
|
|
|
// Build our parsed object
|
|
const parsed = {
|
|
command,
|
|
args,
|
|
options,
|
|
file: undefined,
|
|
original: {
|
|
command,
|
|
args,
|
|
},
|
|
};
|
|
|
|
// Delegate further parsing to shell or non-shell
|
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
}
|
|
|
|
module.exports = parse;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4274:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
// See http://www.robvanderwoude.com/escapechars.php
|
|
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
|
|
function escapeCommand(arg) {
|
|
// Escape meta chars
|
|
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
|
|
return arg;
|
|
}
|
|
|
|
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
// Convert to string
|
|
arg = `${arg}`;
|
|
|
|
// Algorithm below is based on https://qntm.org/cmd
|
|
|
|
// Sequence of backslashes followed by a double quote:
|
|
// double up all the backslashes and escape the double quote
|
|
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
|
|
// Sequence of backslashes followed by the end of the string
|
|
// (which will become a double quote later):
|
|
// double up all the backslashes
|
|
arg = arg.replace(/(\\*)$/, '$1$1');
|
|
|
|
// All other backslashes occur literally
|
|
|
|
// Quote the whole thing:
|
|
arg = `"${arg}"`;
|
|
|
|
// Escape meta chars
|
|
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
|
|
// Double escape meta chars if necessary
|
|
if (doubleEscapeMetaChars) {
|
|
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
}
|
|
|
|
return arg;
|
|
}
|
|
|
|
module.exports.command = escapeCommand;
|
|
module.exports.argument = escapeArgument;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1252:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
const fs = __webpack_require__(7147);
|
|
const shebangCommand = __webpack_require__(7032);
|
|
|
|
function readShebang(command) {
|
|
// Read the first 150 bytes from the file
|
|
const size = 150;
|
|
const buffer = Buffer.alloc(size);
|
|
|
|
let fd;
|
|
|
|
try {
|
|
fd = fs.openSync(command, 'r');
|
|
fs.readSync(fd, buffer, 0, size, 0);
|
|
fs.closeSync(fd);
|
|
} catch (e) { /* Empty */ }
|
|
|
|
// Attempt to extract shebang (null is returned if not a shebang)
|
|
return shebangCommand(buffer.toString());
|
|
}
|
|
|
|
module.exports = readShebang;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7274:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
const path = __webpack_require__(1017);
|
|
const which = __webpack_require__(4207);
|
|
const getPathKey = __webpack_require__(539);
|
|
|
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
const env = parsed.options.env || process.env;
|
|
const cwd = process.cwd();
|
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
// Worker threads do not have process.chdir()
|
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
|
|
|
|
// If a custom `cwd` was specified, we need to change the process cwd
|
|
// because `which` will do stat calls but does not support a custom cwd
|
|
if (shouldSwitchCwd) {
|
|
try {
|
|
process.chdir(parsed.options.cwd);
|
|
} catch (err) {
|
|
/* Empty */
|
|
}
|
|
}
|
|
|
|
let resolved;
|
|
|
|
try {
|
|
resolved = which.sync(parsed.command, {
|
|
path: env[getPathKey({ env })],
|
|
pathExt: withoutPathExt ? path.delimiter : undefined,
|
|
});
|
|
} catch (e) {
|
|
/* Empty */
|
|
} finally {
|
|
if (shouldSwitchCwd) {
|
|
process.chdir(cwd);
|
|
}
|
|
}
|
|
|
|
// If we successfully resolved, ensure that an absolute path is returned
|
|
// Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
|
|
if (resolved) {
|
|
resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
|
|
}
|
|
|
|
return resolved;
|
|
}
|
|
|
|
function resolveCommand(parsed) {
|
|
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
}
|
|
|
|
module.exports = resolveCommand;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5447:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const path = __webpack_require__(1017);
|
|
const childProcess = __webpack_require__(2081);
|
|
const crossSpawn = __webpack_require__(2746);
|
|
const stripFinalNewline = __webpack_require__(8174);
|
|
const npmRunPath = __webpack_require__(502);
|
|
const onetime = __webpack_require__(9082);
|
|
const makeError = __webpack_require__(2187);
|
|
const normalizeStdio = __webpack_require__(166);
|
|
const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = __webpack_require__(9819);
|
|
const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(2592);
|
|
const {mergePromise, getSpawnedPromise} = __webpack_require__(7814);
|
|
const {joinCommand, parseCommand, getEscapedCommand} = __webpack_require__(8286);
|
|
|
|
const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
|
|
|
|
const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {
|
|
const env = extendEnv ? {...process.env, ...envOption} : envOption;
|
|
|
|
if (preferLocal) {
|
|
return npmRunPath.env({env, cwd: localDir, execPath});
|
|
}
|
|
|
|
return env;
|
|
};
|
|
|
|
const handleArguments = (file, args, options = {}) => {
|
|
const parsed = crossSpawn._parse(file, args, options);
|
|
file = parsed.command;
|
|
args = parsed.args;
|
|
options = parsed.options;
|
|
|
|
options = {
|
|
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
buffer: true,
|
|
stripFinalNewline: true,
|
|
extendEnv: true,
|
|
preferLocal: false,
|
|
localDir: options.cwd || process.cwd(),
|
|
execPath: process.execPath,
|
|
encoding: 'utf8',
|
|
reject: true,
|
|
cleanup: true,
|
|
all: false,
|
|
windowsHide: true,
|
|
...options
|
|
};
|
|
|
|
options.env = getEnv(options);
|
|
|
|
options.stdio = normalizeStdio(options);
|
|
|
|
if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {
|
|
// #116
|
|
args.unshift('/q');
|
|
}
|
|
|
|
return {file, args, options, parsed};
|
|
};
|
|
|
|
const handleOutput = (options, value, error) => {
|
|
if (typeof value !== 'string' && !Buffer.isBuffer(value)) {
|
|
// When `execa.sync()` errors, we normalize it to '' to mimic `execa()`
|
|
return error === undefined ? undefined : '';
|
|
}
|
|
|
|
if (options.stripFinalNewline) {
|
|
return stripFinalNewline(value);
|
|
}
|
|
|
|
return value;
|
|
};
|
|
|
|
const execa = (file, args, options) => {
|
|
const parsed = handleArguments(file, args, options);
|
|
const command = joinCommand(file, args);
|
|
const escapedCommand = getEscapedCommand(file, args);
|
|
|
|
validateTimeout(parsed.options);
|
|
|
|
let spawned;
|
|
try {
|
|
spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
|
|
} catch (error) {
|
|
// Ensure the returned error is always both a promise and a child process
|
|
const dummySpawned = new childProcess.ChildProcess();
|
|
const errorPromise = Promise.reject(makeError({
|
|
error,
|
|
stdout: '',
|
|
stderr: '',
|
|
all: '',
|
|
command,
|
|
escapedCommand,
|
|
parsed,
|
|
timedOut: false,
|
|
isCanceled: false,
|
|
killed: false
|
|
}));
|
|
return mergePromise(dummySpawned, errorPromise);
|
|
}
|
|
|
|
const spawnedPromise = getSpawnedPromise(spawned);
|
|
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
|
|
|
const context = {isCanceled: false};
|
|
|
|
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
|
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
|
|
const handlePromise = async () => {
|
|
const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
|
const stdout = handleOutput(parsed.options, stdoutResult);
|
|
const stderr = handleOutput(parsed.options, stderrResult);
|
|
const all = handleOutput(parsed.options, allResult);
|
|
|
|
if (error || exitCode !== 0 || signal !== null) {
|
|
const returnedError = makeError({
|
|
error,
|
|
exitCode,
|
|
signal,
|
|
stdout,
|
|
stderr,
|
|
all,
|
|
command,
|
|
escapedCommand,
|
|
parsed,
|
|
timedOut,
|
|
isCanceled: context.isCanceled,
|
|
killed: spawned.killed
|
|
});
|
|
|
|
if (!parsed.options.reject) {
|
|
return returnedError;
|
|
}
|
|
|
|
throw returnedError;
|
|
}
|
|
|
|
return {
|
|
command,
|
|
escapedCommand,
|
|
exitCode: 0,
|
|
stdout,
|
|
stderr,
|
|
all,
|
|
failed: false,
|
|
timedOut: false,
|
|
isCanceled: false,
|
|
killed: false
|
|
};
|
|
};
|
|
|
|
const handlePromiseOnce = onetime(handlePromise);
|
|
|
|
handleInput(spawned, parsed.options.input);
|
|
|
|
spawned.all = makeAllStream(spawned, parsed.options);
|
|
|
|
return mergePromise(spawned, handlePromiseOnce);
|
|
};
|
|
|
|
module.exports = execa;
|
|
|
|
module.exports.sync = (file, args, options) => {
|
|
const parsed = handleArguments(file, args, options);
|
|
const command = joinCommand(file, args);
|
|
const escapedCommand = getEscapedCommand(file, args);
|
|
|
|
validateInputSync(parsed.options);
|
|
|
|
let result;
|
|
try {
|
|
result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
|
|
} catch (error) {
|
|
throw makeError({
|
|
error,
|
|
stdout: '',
|
|
stderr: '',
|
|
all: '',
|
|
command,
|
|
escapedCommand,
|
|
parsed,
|
|
timedOut: false,
|
|
isCanceled: false,
|
|
killed: false
|
|
});
|
|
}
|
|
|
|
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
|
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
|
|
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
const error = makeError({
|
|
stdout,
|
|
stderr,
|
|
error: result.error,
|
|
signal: result.signal,
|
|
exitCode: result.status,
|
|
command,
|
|
escapedCommand,
|
|
parsed,
|
|
timedOut: result.error && result.error.code === 'ETIMEDOUT',
|
|
isCanceled: false,
|
|
killed: result.signal !== null
|
|
});
|
|
|
|
if (!parsed.options.reject) {
|
|
return error;
|
|
}
|
|
|
|
throw error;
|
|
}
|
|
|
|
return {
|
|
command,
|
|
escapedCommand,
|
|
exitCode: 0,
|
|
stdout,
|
|
stderr,
|
|
failed: false,
|
|
timedOut: false,
|
|
isCanceled: false,
|
|
killed: false
|
|
};
|
|
};
|
|
|
|
module.exports.command = (command, options) => {
|
|
const [file, ...args] = parseCommand(command);
|
|
return execa(file, args, options);
|
|
};
|
|
|
|
module.exports.commandSync = (command, options) => {
|
|
const [file, ...args] = parseCommand(command);
|
|
return execa.sync(file, args, options);
|
|
};
|
|
|
|
module.exports.node = (scriptPath, args, options = {}) => {
|
|
if (args && !Array.isArray(args) && typeof args === 'object') {
|
|
options = args;
|
|
args = [];
|
|
}
|
|
|
|
const stdio = normalizeStdio.node(options);
|
|
const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));
|
|
|
|
const {
|
|
nodePath = process.execPath,
|
|
nodeOptions = defaultExecArgv
|
|
} = options;
|
|
|
|
return execa(
|
|
nodePath,
|
|
[
|
|
...nodeOptions,
|
|
scriptPath,
|
|
...(Array.isArray(args) ? args : [])
|
|
],
|
|
{
|
|
...options,
|
|
stdin: undefined,
|
|
stdout: undefined,
|
|
stderr: undefined,
|
|
stdio,
|
|
shell: false
|
|
}
|
|
);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8286:
|
|
/***/ ((module) => {
|
|
|
|
|
|
const normalizeArgs = (file, args = []) => {
|
|
if (!Array.isArray(args)) {
|
|
return [file];
|
|
}
|
|
|
|
return [file, ...args];
|
|
};
|
|
|
|
const NO_ESCAPE_REGEXP = /^[\w.-]+$/;
|
|
const DOUBLE_QUOTES_REGEXP = /"/g;
|
|
|
|
const escapeArg = arg => {
|
|
if (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) {
|
|
return arg;
|
|
}
|
|
|
|
return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`;
|
|
};
|
|
|
|
const joinCommand = (file, args) => {
|
|
return normalizeArgs(file, args).join(' ');
|
|
};
|
|
|
|
const getEscapedCommand = (file, args) => {
|
|
return normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' ');
|
|
};
|
|
|
|
const SPACES_REGEXP = / +/g;
|
|
|
|
// Handle `execa.command()`
|
|
const parseCommand = command => {
|
|
const tokens = [];
|
|
for (const token of command.trim().split(SPACES_REGEXP)) {
|
|
// Allow spaces to be escaped by a backslash if not meant as a delimiter
|
|
const previousToken = tokens[tokens.length - 1];
|
|
if (previousToken && previousToken.endsWith('\\')) {
|
|
// Merge previous token with current one
|
|
tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
|
|
} else {
|
|
tokens.push(token);
|
|
}
|
|
}
|
|
|
|
return tokens;
|
|
};
|
|
|
|
module.exports = {
|
|
joinCommand,
|
|
getEscapedCommand,
|
|
parseCommand
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2187:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const {signalsByName} = __webpack_require__(2779);
|
|
|
|
const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => {
|
|
if (timedOut) {
|
|
return `timed out after ${timeout} milliseconds`;
|
|
}
|
|
|
|
if (isCanceled) {
|
|
return 'was canceled';
|
|
}
|
|
|
|
if (errorCode !== undefined) {
|
|
return `failed with ${errorCode}`;
|
|
}
|
|
|
|
if (signal !== undefined) {
|
|
return `was killed with ${signal} (${signalDescription})`;
|
|
}
|
|
|
|
if (exitCode !== undefined) {
|
|
return `failed with exit code ${exitCode}`;
|
|
}
|
|
|
|
return 'failed';
|
|
};
|
|
|
|
const makeError = ({
|
|
stdout,
|
|
stderr,
|
|
all,
|
|
error,
|
|
signal,
|
|
exitCode,
|
|
command,
|
|
escapedCommand,
|
|
timedOut,
|
|
isCanceled,
|
|
killed,
|
|
parsed: {options: {timeout}}
|
|
}) => {
|
|
// `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`.
|
|
// We normalize them to `undefined`
|
|
exitCode = exitCode === null ? undefined : exitCode;
|
|
signal = signal === null ? undefined : signal;
|
|
const signalDescription = signal === undefined ? undefined : signalsByName[signal].description;
|
|
|
|
const errorCode = error && error.code;
|
|
|
|
const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled});
|
|
const execaMessage = `Command ${prefix}: ${command}`;
|
|
const isError = Object.prototype.toString.call(error) === '[object Error]';
|
|
const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage;
|
|
const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n');
|
|
|
|
if (isError) {
|
|
error.originalMessage = error.message;
|
|
error.message = message;
|
|
} else {
|
|
error = new Error(message);
|
|
}
|
|
|
|
error.shortMessage = shortMessage;
|
|
error.command = command;
|
|
error.escapedCommand = escapedCommand;
|
|
error.exitCode = exitCode;
|
|
error.signal = signal;
|
|
error.signalDescription = signalDescription;
|
|
error.stdout = stdout;
|
|
error.stderr = stderr;
|
|
|
|
if (all !== undefined) {
|
|
error.all = all;
|
|
}
|
|
|
|
if ('bufferedData' in error) {
|
|
delete error.bufferedData;
|
|
}
|
|
|
|
error.failed = true;
|
|
error.timedOut = Boolean(timedOut);
|
|
error.isCanceled = isCanceled;
|
|
error.killed = killed && !timedOut;
|
|
|
|
return error;
|
|
};
|
|
|
|
module.exports = makeError;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9819:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const os = __webpack_require__(2037);
|
|
const onExit = __webpack_require__(4931);
|
|
|
|
const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
|
|
|
|
// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior
|
|
const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => {
|
|
const killResult = kill(signal);
|
|
setKillTimeout(kill, signal, options, killResult);
|
|
return killResult;
|
|
};
|
|
|
|
const setKillTimeout = (kill, signal, options, killResult) => {
|
|
if (!shouldForceKill(signal, options, killResult)) {
|
|
return;
|
|
}
|
|
|
|
const timeout = getForceKillAfterTimeout(options);
|
|
const t = setTimeout(() => {
|
|
kill('SIGKILL');
|
|
}, timeout);
|
|
|
|
// Guarded because there's no `.unref()` when `execa` is used in the renderer
|
|
// process in Electron. This cannot be tested since we don't run tests in
|
|
// Electron.
|
|
// istanbul ignore else
|
|
if (t.unref) {
|
|
t.unref();
|
|
}
|
|
};
|
|
|
|
const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => {
|
|
return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
};
|
|
|
|
const isSigterm = signal => {
|
|
return signal === os.constants.signals.SIGTERM ||
|
|
(typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');
|
|
};
|
|
|
|
const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {
|
|
if (forceKillAfterTimeout === true) {
|
|
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
}
|
|
|
|
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
}
|
|
|
|
return forceKillAfterTimeout;
|
|
};
|
|
|
|
// `childProcess.cancel()`
|
|
const spawnedCancel = (spawned, context) => {
|
|
const killResult = spawned.kill();
|
|
|
|
if (killResult) {
|
|
context.isCanceled = true;
|
|
}
|
|
};
|
|
|
|
const timeoutKill = (spawned, signal, reject) => {
|
|
spawned.kill(signal);
|
|
reject(Object.assign(new Error('Timed out'), {timedOut: true, signal}));
|
|
};
|
|
|
|
// `timeout` option handling
|
|
const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => {
|
|
if (timeout === 0 || timeout === undefined) {
|
|
return spawnedPromise;
|
|
}
|
|
|
|
let timeoutId;
|
|
const timeoutPromise = new Promise((resolve, reject) => {
|
|
timeoutId = setTimeout(() => {
|
|
timeoutKill(spawned, killSignal, reject);
|
|
}, timeout);
|
|
});
|
|
|
|
const safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
clearTimeout(timeoutId);
|
|
});
|
|
|
|
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
};
|
|
|
|
const validateTimeout = ({timeout}) => {
|
|
if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {
|
|
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
}
|
|
};
|
|
|
|
// `cleanup` option handling
|
|
const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => {
|
|
if (!cleanup || detached) {
|
|
return timedPromise;
|
|
}
|
|
|
|
const removeExitHandler = onExit(() => {
|
|
spawned.kill();
|
|
});
|
|
|
|
return timedPromise.finally(() => {
|
|
removeExitHandler();
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
spawnedKill,
|
|
spawnedCancel,
|
|
setupTimeout,
|
|
validateTimeout,
|
|
setExitHandler
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7814:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
const nativePromisePrototype = (async () => {})().constructor.prototype;
|
|
const descriptors = ['then', 'catch', 'finally'].map(property => [
|
|
property,
|
|
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
]);
|
|
|
|
// The return value is a mixin of `childProcess` and `Promise`
|
|
const mergePromise = (spawned, promise) => {
|
|
for (const [property, descriptor] of descriptors) {
|
|
// Starting the main `promise` is deferred to avoid consuming streams
|
|
const value = typeof promise === 'function' ?
|
|
(...args) => Reflect.apply(descriptor.value, promise(), args) :
|
|
descriptor.value.bind(promise);
|
|
|
|
Reflect.defineProperty(spawned, property, {...descriptor, value});
|
|
}
|
|
|
|
return spawned;
|
|
};
|
|
|
|
// Use promises instead of `child_process` events
|
|
const getSpawnedPromise = spawned => {
|
|
return new Promise((resolve, reject) => {
|
|
spawned.on('exit', (exitCode, signal) => {
|
|
resolve({exitCode, signal});
|
|
});
|
|
|
|
spawned.on('error', error => {
|
|
reject(error);
|
|
});
|
|
|
|
if (spawned.stdin) {
|
|
spawned.stdin.on('error', error => {
|
|
reject(error);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
mergePromise,
|
|
getSpawnedPromise
|
|
};
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 166:
|
|
/***/ ((module) => {
|
|
|
|
|
|
const aliases = ['stdin', 'stdout', 'stderr'];
|
|
|
|
const hasAlias = options => aliases.some(alias => options[alias] !== undefined);
|
|
|
|
const normalizeStdio = options => {
|
|
if (!options) {
|
|
return;
|
|
}
|
|
|
|
const {stdio} = options;
|
|
|
|
if (stdio === undefined) {
|
|
return aliases.map(alias => options[alias]);
|
|
}
|
|
|
|
if (hasAlias(options)) {
|
|
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`);
|
|
}
|
|
|
|
if (typeof stdio === 'string') {
|
|
return stdio;
|
|
}
|
|
|
|
if (!Array.isArray(stdio)) {
|
|
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
}
|
|
|
|
const length = Math.max(stdio.length, aliases.length);
|
|
return Array.from({length}, (value, index) => stdio[index]);
|
|
};
|
|
|
|
module.exports = normalizeStdio;
|
|
|
|
// `ipc` is pushed unless it is already present
|
|
module.exports.node = options => {
|
|
const stdio = normalizeStdio(options);
|
|
|
|
if (stdio === 'ipc') {
|
|
return 'ipc';
|
|
}
|
|
|
|
if (stdio === undefined || typeof stdio === 'string') {
|
|
return [stdio, stdio, stdio, 'ipc'];
|
|
}
|
|
|
|
if (stdio.includes('ipc')) {
|
|
return stdio;
|
|
}
|
|
|
|
return [...stdio, 'ipc'];
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2592:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const isStream = __webpack_require__(1554);
|
|
const getStream = __webpack_require__(1766);
|
|
const mergeStream = __webpack_require__(2621);
|
|
|
|
// `input` option
|
|
const handleInput = (spawned, input) => {
|
|
// Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852
|
|
// @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0
|
|
if (input === undefined || spawned.stdin === undefined) {
|
|
return;
|
|
}
|
|
|
|
if (isStream(input)) {
|
|
input.pipe(spawned.stdin);
|
|
} else {
|
|
spawned.stdin.end(input);
|
|
}
|
|
};
|
|
|
|
// `all` interleaves `stdout` and `stderr`
|
|
const makeAllStream = (spawned, {all}) => {
|
|
if (!all || (!spawned.stdout && !spawned.stderr)) {
|
|
return;
|
|
}
|
|
|
|
const mixed = mergeStream();
|
|
|
|
if (spawned.stdout) {
|
|
mixed.add(spawned.stdout);
|
|
}
|
|
|
|
if (spawned.stderr) {
|
|
mixed.add(spawned.stderr);
|
|
}
|
|
|
|
return mixed;
|
|
};
|
|
|
|
// On failure, `result.stdout|stderr|all` should contain the currently buffered stream
|
|
const getBufferedData = async (stream, streamPromise) => {
|
|
if (!stream) {
|
|
return;
|
|
}
|
|
|
|
stream.destroy();
|
|
|
|
try {
|
|
return await streamPromise;
|
|
} catch (error) {
|
|
return error.bufferedData;
|
|
}
|
|
};
|
|
|
|
const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => {
|
|
if (!stream || !buffer) {
|
|
return;
|
|
}
|
|
|
|
if (encoding) {
|
|
return getStream(stream, {encoding, maxBuffer});
|
|
}
|
|
|
|
return getStream.buffer(stream, {maxBuffer});
|
|
};
|
|
|
|
// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all)
|
|
const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => {
|
|
const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer});
|
|
const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer});
|
|
const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2});
|
|
|
|
try {
|
|
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
} catch (error) {
|
|
return Promise.all([
|
|
{error, signal: error.signal, timedOut: error.timedOut},
|
|
getBufferedData(stdout, stdoutPromise),
|
|
getBufferedData(stderr, stderrPromise),
|
|
getBufferedData(all, allPromise)
|
|
]);
|
|
}
|
|
};
|
|
|
|
const validateInputSync = ({input}) => {
|
|
if (isStream(input)) {
|
|
throw new TypeError('The `input` option cannot be a stream in sync mode');
|
|
}
|
|
};
|
|
|
|
module.exports = {
|
|
handleInput,
|
|
makeAllStream,
|
|
getSpawnedResult,
|
|
validateInputSync
|
|
};
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1585:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const {PassThrough: PassThroughStream} = __webpack_require__(2781);
|
|
|
|
module.exports = options => {
|
|
options = {...options};
|
|
|
|
const {array} = options;
|
|
let {encoding} = options;
|
|
const isBuffer = encoding === 'buffer';
|
|
let objectMode = false;
|
|
|
|
if (array) {
|
|
objectMode = !(encoding || isBuffer);
|
|
} else {
|
|
encoding = encoding || 'utf8';
|
|
}
|
|
|
|
if (isBuffer) {
|
|
encoding = null;
|
|
}
|
|
|
|
const stream = new PassThroughStream({objectMode});
|
|
|
|
if (encoding) {
|
|
stream.setEncoding(encoding);
|
|
}
|
|
|
|
let length = 0;
|
|
const chunks = [];
|
|
|
|
stream.on('data', chunk => {
|
|
chunks.push(chunk);
|
|
|
|
if (objectMode) {
|
|
length = chunks.length;
|
|
} else {
|
|
length += chunk.length;
|
|
}
|
|
});
|
|
|
|
stream.getBufferedValue = () => {
|
|
if (array) {
|
|
return chunks;
|
|
}
|
|
|
|
return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
|
|
};
|
|
|
|
stream.getBufferedLength = () => length;
|
|
|
|
return stream;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1766:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const {constants: BufferConstants} = __webpack_require__(4300);
|
|
const stream = __webpack_require__(2781);
|
|
const {promisify} = __webpack_require__(3837);
|
|
const bufferStream = __webpack_require__(1585);
|
|
|
|
const streamPipelinePromisified = promisify(stream.pipeline);
|
|
|
|
class MaxBufferError extends Error {
|
|
constructor() {
|
|
super('maxBuffer exceeded');
|
|
this.name = 'MaxBufferError';
|
|
}
|
|
}
|
|
|
|
async function getStream(inputStream, options) {
|
|
if (!inputStream) {
|
|
throw new Error('Expected a stream');
|
|
}
|
|
|
|
options = {
|
|
maxBuffer: Infinity,
|
|
...options
|
|
};
|
|
|
|
const {maxBuffer} = options;
|
|
const stream = bufferStream(options);
|
|
|
|
await new Promise((resolve, reject) => {
|
|
const rejectPromise = error => {
|
|
// Don't retrieve an oversized buffer.
|
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
error.bufferedData = stream.getBufferedValue();
|
|
}
|
|
|
|
reject(error);
|
|
};
|
|
|
|
(async () => {
|
|
try {
|
|
await streamPipelinePromisified(inputStream, stream);
|
|
resolve();
|
|
} catch (error) {
|
|
rejectPromise(error);
|
|
}
|
|
})();
|
|
|
|
stream.on('data', () => {
|
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
rejectPromise(new MaxBufferError());
|
|
}
|
|
});
|
|
});
|
|
|
|
return stream.getBufferedValue();
|
|
}
|
|
|
|
module.exports = getStream;
|
|
module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});
|
|
module.exports.array = (stream, options) => getStream(stream, {...options, array: true});
|
|
module.exports.MaxBufferError = MaxBufferError;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8213:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
Object.defineProperty(exports, "__esModule", ({value:true}));exports.SIGNALS=void 0;
|
|
|
|
const SIGNALS=[
|
|
{
|
|
name:"SIGHUP",
|
|
number:1,
|
|
action:"terminate",
|
|
description:"Terminal closed",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGINT",
|
|
number:2,
|
|
action:"terminate",
|
|
description:"User interruption with CTRL-C",
|
|
standard:"ansi"},
|
|
|
|
{
|
|
name:"SIGQUIT",
|
|
number:3,
|
|
action:"core",
|
|
description:"User interruption with CTRL-\\",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGILL",
|
|
number:4,
|
|
action:"core",
|
|
description:"Invalid machine instruction",
|
|
standard:"ansi"},
|
|
|
|
{
|
|
name:"SIGTRAP",
|
|
number:5,
|
|
action:"core",
|
|
description:"Debugger breakpoint",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGABRT",
|
|
number:6,
|
|
action:"core",
|
|
description:"Aborted",
|
|
standard:"ansi"},
|
|
|
|
{
|
|
name:"SIGIOT",
|
|
number:6,
|
|
action:"core",
|
|
description:"Aborted",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGBUS",
|
|
number:7,
|
|
action:"core",
|
|
description:
|
|
"Bus error due to misaligned, non-existing address or paging error",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGEMT",
|
|
number:7,
|
|
action:"terminate",
|
|
description:"Command should be emulated but is not implemented",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGFPE",
|
|
number:8,
|
|
action:"core",
|
|
description:"Floating point arithmetic error",
|
|
standard:"ansi"},
|
|
|
|
{
|
|
name:"SIGKILL",
|
|
number:9,
|
|
action:"terminate",
|
|
description:"Forced termination",
|
|
standard:"posix",
|
|
forced:true},
|
|
|
|
{
|
|
name:"SIGUSR1",
|
|
number:10,
|
|
action:"terminate",
|
|
description:"Application-specific signal",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGSEGV",
|
|
number:11,
|
|
action:"core",
|
|
description:"Segmentation fault",
|
|
standard:"ansi"},
|
|
|
|
{
|
|
name:"SIGUSR2",
|
|
number:12,
|
|
action:"terminate",
|
|
description:"Application-specific signal",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGPIPE",
|
|
number:13,
|
|
action:"terminate",
|
|
description:"Broken pipe or socket",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGALRM",
|
|
number:14,
|
|
action:"terminate",
|
|
description:"Timeout or timer",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGTERM",
|
|
number:15,
|
|
action:"terminate",
|
|
description:"Termination",
|
|
standard:"ansi"},
|
|
|
|
{
|
|
name:"SIGSTKFLT",
|
|
number:16,
|
|
action:"terminate",
|
|
description:"Stack is empty or overflowed",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGCHLD",
|
|
number:17,
|
|
action:"ignore",
|
|
description:"Child process terminated, paused or unpaused",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGCLD",
|
|
number:17,
|
|
action:"ignore",
|
|
description:"Child process terminated, paused or unpaused",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGCONT",
|
|
number:18,
|
|
action:"unpause",
|
|
description:"Unpaused",
|
|
standard:"posix",
|
|
forced:true},
|
|
|
|
{
|
|
name:"SIGSTOP",
|
|
number:19,
|
|
action:"pause",
|
|
description:"Paused",
|
|
standard:"posix",
|
|
forced:true},
|
|
|
|
{
|
|
name:"SIGTSTP",
|
|
number:20,
|
|
action:"pause",
|
|
description:"Paused using CTRL-Z or \"suspend\"",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGTTIN",
|
|
number:21,
|
|
action:"pause",
|
|
description:"Background process cannot read terminal input",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGBREAK",
|
|
number:21,
|
|
action:"terminate",
|
|
description:"User interruption with CTRL-BREAK",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGTTOU",
|
|
number:22,
|
|
action:"pause",
|
|
description:"Background process cannot write to terminal output",
|
|
standard:"posix"},
|
|
|
|
{
|
|
name:"SIGURG",
|
|
number:23,
|
|
action:"ignore",
|
|
description:"Socket received out-of-band data",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGXCPU",
|
|
number:24,
|
|
action:"core",
|
|
description:"Process timed out",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGXFSZ",
|
|
number:25,
|
|
action:"core",
|
|
description:"File too big",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGVTALRM",
|
|
number:26,
|
|
action:"terminate",
|
|
description:"Timeout or timer",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGPROF",
|
|
number:27,
|
|
action:"terminate",
|
|
description:"Timeout or timer",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGWINCH",
|
|
number:28,
|
|
action:"ignore",
|
|
description:"Terminal window size changed",
|
|
standard:"bsd"},
|
|
|
|
{
|
|
name:"SIGIO",
|
|
number:29,
|
|
action:"terminate",
|
|
description:"I/O is available",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGPOLL",
|
|
number:29,
|
|
action:"terminate",
|
|
description:"Watched event",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGINFO",
|
|
number:29,
|
|
action:"ignore",
|
|
description:"Request for process information",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGPWR",
|
|
number:30,
|
|
action:"terminate",
|
|
description:"Device running out of power",
|
|
standard:"systemv"},
|
|
|
|
{
|
|
name:"SIGSYS",
|
|
number:31,
|
|
action:"core",
|
|
description:"Invalid system call",
|
|
standard:"other"},
|
|
|
|
{
|
|
name:"SIGUNUSED",
|
|
number:31,
|
|
action:"terminate",
|
|
description:"Invalid system call",
|
|
standard:"other"}];exports.SIGNALS=SIGNALS;
|
|
//# sourceMappingURL=core.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2779:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(2037);
|
|
|
|
var _signals=__webpack_require__(6435);
|
|
var _realtime=__webpack_require__(5295);
|
|
|
|
|
|
|
|
const getSignalsByName=function(){
|
|
const signals=(0,_signals.getSignals)();
|
|
return signals.reduce(getSignalByName,{});
|
|
};
|
|
|
|
const getSignalByName=function(
|
|
signalByNameMemo,
|
|
{name,number,description,supported,action,forced,standard})
|
|
{
|
|
return{
|
|
...signalByNameMemo,
|
|
[name]:{name,number,description,supported,action,forced,standard}};
|
|
|
|
};
|
|
|
|
const signalsByName=getSignalsByName();exports.signalsByName=signalsByName;
|
|
|
|
|
|
|
|
|
|
const getSignalsByNumber=function(){
|
|
const signals=(0,_signals.getSignals)();
|
|
const length=_realtime.SIGRTMAX+1;
|
|
const signalsA=Array.from({length},(value,number)=>
|
|
getSignalByNumber(number,signals));
|
|
|
|
return Object.assign({},...signalsA);
|
|
};
|
|
|
|
const getSignalByNumber=function(number,signals){
|
|
const signal=findSignalByNumber(number,signals);
|
|
|
|
if(signal===undefined){
|
|
return{};
|
|
}
|
|
|
|
const{name,description,supported,action,forced,standard}=signal;
|
|
return{
|
|
[number]:{
|
|
name,
|
|
number,
|
|
description,
|
|
supported,
|
|
action,
|
|
forced,
|
|
standard}};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const findSignalByNumber=function(number,signals){
|
|
const signal=signals.find(({name})=>_os.constants.signals[name]===number);
|
|
|
|
if(signal!==undefined){
|
|
return signal;
|
|
}
|
|
|
|
return signals.find(signalA=>signalA.number===number);
|
|
};
|
|
|
|
const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber;
|
|
//# sourceMappingURL=main.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5295:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
Object.defineProperty(exports, "__esModule", ({value:true}));exports.SIGRTMAX=exports.getRealtimeSignals=void 0;
|
|
const getRealtimeSignals=function(){
|
|
const length=SIGRTMAX-SIGRTMIN+1;
|
|
return Array.from({length},getRealtimeSignal);
|
|
};exports.getRealtimeSignals=getRealtimeSignals;
|
|
|
|
const getRealtimeSignal=function(value,index){
|
|
return{
|
|
name:`SIGRT${index+1}`,
|
|
number:SIGRTMIN+index,
|
|
action:"terminate",
|
|
description:"Application-specific signal (realtime)",
|
|
standard:"posix"};
|
|
|
|
};
|
|
|
|
const SIGRTMIN=34;
|
|
const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX;
|
|
//# sourceMappingURL=realtime.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6435:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__webpack_require__(2037);
|
|
|
|
var _core=__webpack_require__(8213);
|
|
var _realtime=__webpack_require__(5295);
|
|
|
|
|
|
|
|
const getSignals=function(){
|
|
const realtimeSignals=(0,_realtime.getRealtimeSignals)();
|
|
const signals=[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal);
|
|
return signals;
|
|
};exports.getSignals=getSignals;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const normalizeSignal=function({
|
|
name,
|
|
number:defaultNumber,
|
|
description,
|
|
action,
|
|
forced=false,
|
|
standard})
|
|
{
|
|
const{
|
|
signals:{[name]:constantSignal}}=
|
|
_os.constants;
|
|
const supported=constantSignal!==undefined;
|
|
const number=supported?constantSignal:defaultNumber;
|
|
return{name,number,description,supported,action,forced,standard};
|
|
};
|
|
//# sourceMappingURL=signals.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8768:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const fs = __webpack_require__(7147);
|
|
|
|
let isDocker;
|
|
|
|
function hasDockerEnv() {
|
|
try {
|
|
fs.statSync('/.dockerenv');
|
|
return true;
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function hasDockerCGroup() {
|
|
try {
|
|
return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
module.exports = () => {
|
|
if (isDocker === undefined) {
|
|
isDocker = hasDockerEnv() || hasDockerCGroup();
|
|
}
|
|
|
|
return isDocker;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1554:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
const isStream = stream =>
|
|
stream !== null &&
|
|
typeof stream === 'object' &&
|
|
typeof stream.pipe === 'function';
|
|
|
|
isStream.writable = stream =>
|
|
isStream(stream) &&
|
|
stream.writable !== false &&
|
|
typeof stream._write === 'function' &&
|
|
typeof stream._writableState === 'object';
|
|
|
|
isStream.readable = stream =>
|
|
isStream(stream) &&
|
|
stream.readable !== false &&
|
|
typeof stream._read === 'function' &&
|
|
typeof stream._readableState === 'object';
|
|
|
|
isStream.duplex = stream =>
|
|
isStream.writable(stream) &&
|
|
isStream.readable(stream);
|
|
|
|
isStream.transform = stream =>
|
|
isStream.duplex(stream) &&
|
|
typeof stream._transform === 'function';
|
|
|
|
module.exports = isStream;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2559:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const os = __webpack_require__(2037);
|
|
const fs = __webpack_require__(7147);
|
|
const isDocker = __webpack_require__(8768);
|
|
|
|
const isWsl = () => {
|
|
if (process.platform !== 'linux') {
|
|
return false;
|
|
}
|
|
|
|
if (os.release().toLowerCase().includes('microsoft')) {
|
|
if (isDocker()) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
try {
|
|
return fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') ?
|
|
!isDocker() : false;
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
if (process.env.__IS_WSL_TEST__) {
|
|
module.exports = isWsl;
|
|
} else {
|
|
module.exports = isWsl();
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7126:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
var fs = __webpack_require__(7147)
|
|
var core
|
|
if (process.platform === 'win32' || global.TESTING_WINDOWS) {
|
|
core = __webpack_require__(2001)
|
|
} else {
|
|
core = __webpack_require__(9728)
|
|
}
|
|
|
|
module.exports = isexe
|
|
isexe.sync = sync
|
|
|
|
function isexe (path, options, cb) {
|
|
if (typeof options === 'function') {
|
|
cb = options
|
|
options = {}
|
|
}
|
|
|
|
if (!cb) {
|
|
if (typeof Promise !== 'function') {
|
|
throw new TypeError('callback not provided')
|
|
}
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
isexe(path, options || {}, function (er, is) {
|
|
if (er) {
|
|
reject(er)
|
|
} else {
|
|
resolve(is)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
core(path, options || {}, function (er, is) {
|
|
// ignore EACCES because that just means we aren't allowed to run it
|
|
if (er) {
|
|
if (er.code === 'EACCES' || options && options.ignoreErrors) {
|
|
er = null
|
|
is = false
|
|
}
|
|
}
|
|
cb(er, is)
|
|
})
|
|
}
|
|
|
|
function sync (path, options) {
|
|
// my kingdom for a filtered catch
|
|
try {
|
|
return core.sync(path, options || {})
|
|
} catch (er) {
|
|
if (options && options.ignoreErrors || er.code === 'EACCES') {
|
|
return false
|
|
} else {
|
|
throw er
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9728:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
module.exports = isexe
|
|
isexe.sync = sync
|
|
|
|
var fs = __webpack_require__(7147)
|
|
|
|
function isexe (path, options, cb) {
|
|
fs.stat(path, function (er, stat) {
|
|
cb(er, er ? false : checkStat(stat, options))
|
|
})
|
|
}
|
|
|
|
function sync (path, options) {
|
|
return checkStat(fs.statSync(path), options)
|
|
}
|
|
|
|
function checkStat (stat, options) {
|
|
return stat.isFile() && checkMode(stat, options)
|
|
}
|
|
|
|
function checkMode (stat, options) {
|
|
var mod = stat.mode
|
|
var uid = stat.uid
|
|
var gid = stat.gid
|
|
|
|
var myUid = options.uid !== undefined ?
|
|
options.uid : process.getuid && process.getuid()
|
|
var myGid = options.gid !== undefined ?
|
|
options.gid : process.getgid && process.getgid()
|
|
|
|
var u = parseInt('100', 8)
|
|
var g = parseInt('010', 8)
|
|
var o = parseInt('001', 8)
|
|
var ug = u | g
|
|
|
|
var ret = (mod & o) ||
|
|
(mod & g) && gid === myGid ||
|
|
(mod & u) && uid === myUid ||
|
|
(mod & ug) && myUid === 0
|
|
|
|
return ret
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2001:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
module.exports = isexe
|
|
isexe.sync = sync
|
|
|
|
var fs = __webpack_require__(7147)
|
|
|
|
function checkPathExt (path, options) {
|
|
var pathext = options.pathExt !== undefined ?
|
|
options.pathExt : process.env.PATHEXT
|
|
|
|
if (!pathext) {
|
|
return true
|
|
}
|
|
|
|
pathext = pathext.split(';')
|
|
if (pathext.indexOf('') !== -1) {
|
|
return true
|
|
}
|
|
for (var i = 0; i < pathext.length; i++) {
|
|
var p = pathext[i].toLowerCase()
|
|
if (p && path.substr(-p.length).toLowerCase() === p) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
function checkStat (stat, path, options) {
|
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
return false
|
|
}
|
|
return checkPathExt(path, options)
|
|
}
|
|
|
|
function isexe (path, options, cb) {
|
|
fs.stat(path, function (er, stat) {
|
|
cb(er, er ? false : checkStat(stat, path, options))
|
|
})
|
|
}
|
|
|
|
function sync (path, options) {
|
|
return checkStat(fs.statSync(path), path, options)
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2621:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
const { PassThrough } = __webpack_require__(2781);
|
|
|
|
module.exports = function (/*streams...*/) {
|
|
var sources = []
|
|
var output = new PassThrough({objectMode: true})
|
|
|
|
output.setMaxListeners(0)
|
|
|
|
output.add = add
|
|
output.isEmpty = isEmpty
|
|
|
|
output.on('unpipe', remove)
|
|
|
|
Array.prototype.slice.call(arguments).forEach(add)
|
|
|
|
return output
|
|
|
|
function add (source) {
|
|
if (Array.isArray(source)) {
|
|
source.forEach(add)
|
|
return this
|
|
}
|
|
|
|
sources.push(source);
|
|
source.once('end', remove.bind(null, source))
|
|
source.once('error', output.emit.bind(output, 'error'))
|
|
source.pipe(output, {end: false})
|
|
return this
|
|
}
|
|
|
|
function isEmpty () {
|
|
return sources.length == 0;
|
|
}
|
|
|
|
function remove (source) {
|
|
sources = sources.filter(function (it) { return it !== source })
|
|
if (!sources.length && output.readable) { output.end() }
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6047:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
const mimicFn = (to, from) => {
|
|
for (const prop of Reflect.ownKeys(from)) {
|
|
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
|
|
}
|
|
|
|
return to;
|
|
};
|
|
|
|
module.exports = mimicFn;
|
|
// TODO: Remove this for the next major release
|
|
module.exports["default"] = mimicFn;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 502:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const path = __webpack_require__(1017);
|
|
const pathKey = __webpack_require__(539);
|
|
|
|
const npmRunPath = options => {
|
|
options = {
|
|
cwd: process.cwd(),
|
|
path: process.env[pathKey()],
|
|
execPath: process.execPath,
|
|
...options
|
|
};
|
|
|
|
let previous;
|
|
let cwdPath = path.resolve(options.cwd);
|
|
const result = [];
|
|
|
|
while (previous !== cwdPath) {
|
|
result.push(path.join(cwdPath, 'node_modules/.bin'));
|
|
previous = cwdPath;
|
|
cwdPath = path.resolve(cwdPath, '..');
|
|
}
|
|
|
|
// Ensure the running `node` binary is used
|
|
const execPathDir = path.resolve(options.cwd, options.execPath, '..');
|
|
result.push(execPathDir);
|
|
|
|
return result.concat(options.path).join(path.delimiter);
|
|
};
|
|
|
|
module.exports = npmRunPath;
|
|
// TODO: Remove this for the next major release
|
|
module.exports["default"] = npmRunPath;
|
|
|
|
module.exports.env = options => {
|
|
options = {
|
|
env: process.env,
|
|
...options
|
|
};
|
|
|
|
const env = {...options.env};
|
|
const path = pathKey({env});
|
|
|
|
options.path = env[path];
|
|
env[path] = module.exports(options);
|
|
|
|
return env;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9082:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const mimicFn = __webpack_require__(6047);
|
|
|
|
const calledFunctions = new WeakMap();
|
|
|
|
const onetime = (function_, options = {}) => {
|
|
if (typeof function_ !== 'function') {
|
|
throw new TypeError('Expected a function');
|
|
}
|
|
|
|
let returnValue;
|
|
let callCount = 0;
|
|
const functionName = function_.displayName || function_.name || '<anonymous>';
|
|
|
|
const onetime = function (...arguments_) {
|
|
calledFunctions.set(onetime, ++callCount);
|
|
|
|
if (callCount === 1) {
|
|
returnValue = function_.apply(this, arguments_);
|
|
function_ = null;
|
|
} else if (options.throw === true) {
|
|
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
}
|
|
|
|
return returnValue;
|
|
};
|
|
|
|
mimicFn(onetime, function_);
|
|
calledFunctions.set(onetime, callCount);
|
|
|
|
return onetime;
|
|
};
|
|
|
|
module.exports = onetime;
|
|
// TODO: Remove this for the next major release
|
|
module.exports["default"] = onetime;
|
|
|
|
module.exports.callCount = function_ => {
|
|
if (!calledFunctions.has(function_)) {
|
|
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
}
|
|
|
|
return calledFunctions.get(function_);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 539:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
const pathKey = (options = {}) => {
|
|
const environment = options.env || process.env;
|
|
const platform = options.platform || process.platform;
|
|
|
|
if (platform !== 'win32') {
|
|
return 'PATH';
|
|
}
|
|
|
|
return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
|
|
};
|
|
|
|
module.exports = pathKey;
|
|
// TODO: Remove this for the next major release
|
|
module.exports["default"] = pathKey;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7032:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
|
|
const shebangRegex = __webpack_require__(2638);
|
|
|
|
module.exports = (string = '') => {
|
|
const match = string.match(shebangRegex);
|
|
|
|
if (!match) {
|
|
return null;
|
|
}
|
|
|
|
const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
|
|
const binary = path.split('/').pop();
|
|
|
|
if (binary === 'env') {
|
|
return argument;
|
|
}
|
|
|
|
return argument ? `${binary} ${argument}` : binary;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2638:
|
|
/***/ ((module) => {
|
|
|
|
|
|
module.exports = /^#!(.*)/;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4931:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
// Note: since nyc uses this module to output coverage, any lines
|
|
// that are in the direct sync flow of nyc's outputCoverage are
|
|
// ignored, since we can never get coverage for them.
|
|
// grab a reference to node's real process object right away
|
|
var process = global.process
|
|
|
|
const processOk = function (process) {
|
|
return process &&
|
|
typeof process === 'object' &&
|
|
typeof process.removeListener === 'function' &&
|
|
typeof process.emit === 'function' &&
|
|
typeof process.reallyExit === 'function' &&
|
|
typeof process.listeners === 'function' &&
|
|
typeof process.kill === 'function' &&
|
|
typeof process.pid === 'number' &&
|
|
typeof process.on === 'function'
|
|
}
|
|
|
|
// some kind of non-node environment, just no-op
|
|
/* istanbul ignore if */
|
|
if (!processOk(process)) {
|
|
module.exports = function () {
|
|
return function () {}
|
|
}
|
|
} else {
|
|
var assert = __webpack_require__(9491)
|
|
var signals = __webpack_require__(3710)
|
|
var isWin = /^win/i.test(process.platform)
|
|
|
|
var EE = __webpack_require__(2361)
|
|
/* istanbul ignore if */
|
|
if (typeof EE !== 'function') {
|
|
EE = EE.EventEmitter
|
|
}
|
|
|
|
var emitter
|
|
if (process.__signal_exit_emitter__) {
|
|
emitter = process.__signal_exit_emitter__
|
|
} else {
|
|
emitter = process.__signal_exit_emitter__ = new EE()
|
|
emitter.count = 0
|
|
emitter.emitted = {}
|
|
}
|
|
|
|
// Because this emitter is a global, we have to check to see if a
|
|
// previous version of this library failed to enable infinite listeners.
|
|
// I know what you're about to say. But literally everything about
|
|
// signal-exit is a compromise with evil. Get used to it.
|
|
if (!emitter.infinite) {
|
|
emitter.setMaxListeners(Infinity)
|
|
emitter.infinite = true
|
|
}
|
|
|
|
module.exports = function (cb, opts) {
|
|
/* istanbul ignore if */
|
|
if (!processOk(global.process)) {
|
|
return function () {}
|
|
}
|
|
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
|
|
|
|
if (loaded === false) {
|
|
load()
|
|
}
|
|
|
|
var ev = 'exit'
|
|
if (opts && opts.alwaysLast) {
|
|
ev = 'afterexit'
|
|
}
|
|
|
|
var remove = function () {
|
|
emitter.removeListener(ev, cb)
|
|
if (emitter.listeners('exit').length === 0 &&
|
|
emitter.listeners('afterexit').length === 0) {
|
|
unload()
|
|
}
|
|
}
|
|
emitter.on(ev, cb)
|
|
|
|
return remove
|
|
}
|
|
|
|
var unload = function unload () {
|
|
if (!loaded || !processOk(global.process)) {
|
|
return
|
|
}
|
|
loaded = false
|
|
|
|
signals.forEach(function (sig) {
|
|
try {
|
|
process.removeListener(sig, sigListeners[sig])
|
|
} catch (er) {}
|
|
})
|
|
process.emit = originalProcessEmit
|
|
process.reallyExit = originalProcessReallyExit
|
|
emitter.count -= 1
|
|
}
|
|
module.exports.unload = unload
|
|
|
|
var emit = function emit (event, code, signal) {
|
|
/* istanbul ignore if */
|
|
if (emitter.emitted[event]) {
|
|
return
|
|
}
|
|
emitter.emitted[event] = true
|
|
emitter.emit(event, code, signal)
|
|
}
|
|
|
|
// { <signal>: <listener fn>, ... }
|
|
var sigListeners = {}
|
|
signals.forEach(function (sig) {
|
|
sigListeners[sig] = function listener () {
|
|
/* istanbul ignore if */
|
|
if (!processOk(global.process)) {
|
|
return
|
|
}
|
|
// If there are no other listeners, an exit is coming!
|
|
// Simplest way: remove us and then re-send the signal.
|
|
// We know that this will kill the process, so we can
|
|
// safely emit now.
|
|
var listeners = process.listeners(sig)
|
|
if (listeners.length === emitter.count) {
|
|
unload()
|
|
emit('exit', null, sig)
|
|
/* istanbul ignore next */
|
|
emit('afterexit', null, sig)
|
|
/* istanbul ignore next */
|
|
if (isWin && sig === 'SIGHUP') {
|
|
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
// so use a supported signal instead
|
|
sig = 'SIGINT'
|
|
}
|
|
/* istanbul ignore next */
|
|
process.kill(process.pid, sig)
|
|
}
|
|
}
|
|
})
|
|
|
|
module.exports.signals = function () {
|
|
return signals
|
|
}
|
|
|
|
var loaded = false
|
|
|
|
var load = function load () {
|
|
if (loaded || !processOk(global.process)) {
|
|
return
|
|
}
|
|
loaded = true
|
|
|
|
// This is the number of onSignalExit's that are in play.
|
|
// It's important so that we can count the correct number of
|
|
// listeners on signals, and don't wait for the other one to
|
|
// handle it instead of us.
|
|
emitter.count += 1
|
|
|
|
signals = signals.filter(function (sig) {
|
|
try {
|
|
process.on(sig, sigListeners[sig])
|
|
return true
|
|
} catch (er) {
|
|
return false
|
|
}
|
|
})
|
|
|
|
process.emit = processEmit
|
|
process.reallyExit = processReallyExit
|
|
}
|
|
module.exports.load = load
|
|
|
|
var originalProcessReallyExit = process.reallyExit
|
|
var processReallyExit = function processReallyExit (code) {
|
|
/* istanbul ignore if */
|
|
if (!processOk(global.process)) {
|
|
return
|
|
}
|
|
process.exitCode = code || /* istanbul ignore next */ 0
|
|
emit('exit', process.exitCode, null)
|
|
/* istanbul ignore next */
|
|
emit('afterexit', process.exitCode, null)
|
|
/* istanbul ignore next */
|
|
originalProcessReallyExit.call(process, process.exitCode)
|
|
}
|
|
|
|
var originalProcessEmit = process.emit
|
|
var processEmit = function processEmit (ev, arg) {
|
|
if (ev === 'exit' && processOk(global.process)) {
|
|
/* istanbul ignore else */
|
|
if (arg !== undefined) {
|
|
process.exitCode = arg
|
|
}
|
|
var ret = originalProcessEmit.apply(this, arguments)
|
|
/* istanbul ignore next */
|
|
emit('exit', process.exitCode, null)
|
|
/* istanbul ignore next */
|
|
emit('afterexit', process.exitCode, null)
|
|
/* istanbul ignore next */
|
|
return ret
|
|
} else {
|
|
return originalProcessEmit.apply(this, arguments)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3710:
|
|
/***/ ((module) => {
|
|
|
|
// This is not the set of all possible signals.
|
|
//
|
|
// It IS, however, the set of all signals that trigger
|
|
// an exit on either Linux or BSD systems. Linux is a
|
|
// superset of the signal names supported on BSD, and
|
|
// the unknown signals just fail to register, so we can
|
|
// catch that easily enough.
|
|
//
|
|
// Don't bother with SIGKILL. It's uncatchable, which
|
|
// means that we can't fire any callbacks anyway.
|
|
//
|
|
// If a user does happen to register a handler on a non-
|
|
// fatal signal like SIGWINCH or something, and then
|
|
// exit, it'll end up firing `process.emit('exit')`, so
|
|
// the handler will be fired anyway.
|
|
//
|
|
// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
// artificially, inherently leave the process in a
|
|
// state from which it is not safe to try and enter JS
|
|
// listeners.
|
|
module.exports = [
|
|
'SIGABRT',
|
|
'SIGALRM',
|
|
'SIGHUP',
|
|
'SIGINT',
|
|
'SIGTERM'
|
|
]
|
|
|
|
if (process.platform !== 'win32') {
|
|
module.exports.push(
|
|
'SIGVTALRM',
|
|
'SIGXCPU',
|
|
'SIGXFSZ',
|
|
'SIGUSR2',
|
|
'SIGTRAP',
|
|
'SIGSYS',
|
|
'SIGQUIT',
|
|
'SIGIOT'
|
|
// should detect profiler and enable/disable accordingly.
|
|
// see #21
|
|
// 'SIGPROF'
|
|
)
|
|
}
|
|
|
|
if (process.platform === 'linux') {
|
|
module.exports.push(
|
|
'SIGIO',
|
|
'SIGPOLL',
|
|
'SIGPWR',
|
|
'SIGSTKFLT',
|
|
'SIGUNUSED'
|
|
)
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8174:
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
module.exports = input => {
|
|
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
|
const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
|
|
|
|
if (input[input.length - 1] === LF) {
|
|
input = input.slice(0, input.length - 1);
|
|
}
|
|
|
|
if (input[input.length - 1] === CR) {
|
|
input = input.slice(0, input.length - 1);
|
|
}
|
|
|
|
return input;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4207:
|
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
|
|
const isWindows = process.platform === 'win32' ||
|
|
process.env.OSTYPE === 'cygwin' ||
|
|
process.env.OSTYPE === 'msys'
|
|
|
|
const path = __webpack_require__(1017)
|
|
const COLON = isWindows ? ';' : ':'
|
|
const isexe = __webpack_require__(7126)
|
|
|
|
const getNotFoundError = (cmd) =>
|
|
Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
|
|
|
|
const getPathInfo = (cmd, opt) => {
|
|
const colon = opt.colon || COLON
|
|
|
|
// If it has a slash, then we don't bother searching the pathenv.
|
|
// just check the file itself, and that's it.
|
|
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? ['']
|
|
: (
|
|
[
|
|
// windows always checks the cwd first
|
|
...(isWindows ? [process.cwd()] : []),
|
|
...(opt.path || process.env.PATH ||
|
|
/* istanbul ignore next: very unusual */ '').split(colon),
|
|
]
|
|
)
|
|
const pathExtExe = isWindows
|
|
? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'
|
|
: ''
|
|
const pathExt = isWindows ? pathExtExe.split(colon) : ['']
|
|
|
|
if (isWindows) {
|
|
if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
|
|
pathExt.unshift('')
|
|
}
|
|
|
|
return {
|
|
pathEnv,
|
|
pathExt,
|
|
pathExtExe,
|
|
}
|
|
}
|
|
|
|
const which = (cmd, opt, cb) => {
|
|
if (typeof opt === 'function') {
|
|
cb = opt
|
|
opt = {}
|
|
}
|
|
if (!opt)
|
|
opt = {}
|
|
|
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
|
|
const found = []
|
|
|
|
const step = i => new Promise((resolve, reject) => {
|
|
if (i === pathEnv.length)
|
|
return opt.all && found.length ? resolve(found)
|
|
: reject(getNotFoundError(cmd))
|
|
|
|
const ppRaw = pathEnv[i]
|
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
|
|
|
|
const pCmd = path.join(pathPart, cmd)
|
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
|
|
: pCmd
|
|
|
|
resolve(subStep(p, i, 0))
|
|
})
|
|
|
|
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
if (ii === pathExt.length)
|
|
return resolve(step(i + 1))
|
|
const ext = pathExt[ii]
|
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
if (!er && is) {
|
|
if (opt.all)
|
|
found.push(p + ext)
|
|
else
|
|
return resolve(p + ext)
|
|
}
|
|
return resolve(subStep(p, i, ii + 1))
|
|
})
|
|
})
|
|
|
|
return cb ? step(0).then(res => cb(null, res), cb) : step(0)
|
|
}
|
|
|
|
const whichSync = (cmd, opt) => {
|
|
opt = opt || {}
|
|
|
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
|
|
const found = []
|
|
|
|
for (let i = 0; i < pathEnv.length; i ++) {
|
|
const ppRaw = pathEnv[i]
|
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
|
|
|
|
const pCmd = path.join(pathPart, cmd)
|
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
|
|
: pCmd
|
|
|
|
for (let j = 0; j < pathExt.length; j ++) {
|
|
const cur = p + pathExt[j]
|
|
try {
|
|
const is = isexe.sync(cur, { pathExt: pathExtExe })
|
|
if (is) {
|
|
if (opt.all)
|
|
found.push(cur)
|
|
else
|
|
return cur
|
|
}
|
|
} catch (ex) {}
|
|
}
|
|
}
|
|
|
|
if (opt.all && found.length)
|
|
return found
|
|
|
|
if (opt.nothrow)
|
|
return null
|
|
|
|
throw getNotFoundError(cmd)
|
|
}
|
|
|
|
module.exports = which
|
|
which.sync = whichSync
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9902:
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": () => (/* binding */ clipboardy)
|
|
});
|
|
|
|
// EXTERNAL MODULE: external "node:process"
|
|
var external_node_process_ = __webpack_require__(7742);
|
|
// EXTERNAL MODULE: ./node_modules/is-wsl/index.js
|
|
var is_wsl = __webpack_require__(2559);
|
|
// EXTERNAL MODULE: ./node_modules/execa/index.js
|
|
var execa = __webpack_require__(5447);
|
|
;// CONCATENATED MODULE: ./node_modules/clipboardy/lib/termux.js
|
|
|
|
|
|
const handler = error => {
|
|
if (error.code === 'ENOENT') {
|
|
throw new Error('Couldn\'t find the termux-api scripts. You can install them with: apt install termux-api');
|
|
}
|
|
|
|
throw error;
|
|
};
|
|
|
|
const clipboard = {
|
|
copy: async options => {
|
|
try {
|
|
await execa('termux-clipboard-set', options);
|
|
} catch (error) {
|
|
handler(error);
|
|
}
|
|
},
|
|
paste: async options => {
|
|
try {
|
|
const {stdout} = await execa('termux-clipboard-get', options);
|
|
return stdout;
|
|
} catch (error) {
|
|
handler(error);
|
|
}
|
|
},
|
|
copySync: options => {
|
|
try {
|
|
execa.sync('termux-clipboard-set', options);
|
|
} catch (error) {
|
|
handler(error);
|
|
}
|
|
},
|
|
pasteSync: options => {
|
|
try {
|
|
return execa.sync('termux-clipboard-get', options).stdout;
|
|
} catch (error) {
|
|
handler(error);
|
|
}
|
|
},
|
|
};
|
|
|
|
/* harmony default export */ const termux = (clipboard);
|
|
|
|
// EXTERNAL MODULE: external "node:path"
|
|
var external_node_path_ = __webpack_require__(9411);
|
|
// EXTERNAL MODULE: external "node:url"
|
|
var external_node_url_ = __webpack_require__(1041);
|
|
;// CONCATENATED MODULE: ./node_modules/clipboardy/lib/linux.js
|
|
|
|
|
|
|
|
|
|
const linux_dirname = external_node_path_.dirname((0,external_node_url_.fileURLToPath)(import.meta.url));
|
|
|
|
const xsel = 'xsel';
|
|
const xselFallback = external_node_path_.join(linux_dirname, '../fallbacks/linux/xsel');
|
|
|
|
const copyArguments = ['--clipboard', '--input'];
|
|
const pasteArguments = ['--clipboard', '--output'];
|
|
|
|
const makeError = (xselError, fallbackError) => {
|
|
let error;
|
|
if (xselError.code === 'ENOENT') {
|
|
error = new Error('Couldn\'t find the `xsel` binary and fallback didn\'t work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel');
|
|
} else {
|
|
error = new Error('Both xsel and fallback failed');
|
|
error.xselError = xselError;
|
|
}
|
|
|
|
error.fallbackError = fallbackError;
|
|
return error;
|
|
};
|
|
|
|
const xselWithFallback = async (argumentList, options) => {
|
|
try {
|
|
const {stdout} = await execa(xsel, argumentList, options);
|
|
return stdout;
|
|
} catch (xselError) {
|
|
try {
|
|
const {stdout} = await execa(xselFallback, argumentList, options);
|
|
return stdout;
|
|
} catch (fallbackError) {
|
|
throw makeError(xselError, fallbackError);
|
|
}
|
|
}
|
|
};
|
|
|
|
const xselWithFallbackSync = (argumentList, options) => {
|
|
try {
|
|
return execa.sync(xsel, argumentList, options).stdout;
|
|
} catch (xselError) {
|
|
try {
|
|
return execa.sync(xselFallback, argumentList, options).stdout;
|
|
} catch (fallbackError) {
|
|
throw makeError(xselError, fallbackError);
|
|
}
|
|
}
|
|
};
|
|
|
|
const linux_clipboard = {
|
|
copy: async options => {
|
|
await xselWithFallback(copyArguments, options);
|
|
},
|
|
copySync: options => {
|
|
xselWithFallbackSync(copyArguments, options);
|
|
},
|
|
paste: options => xselWithFallback(pasteArguments, options),
|
|
pasteSync: options => xselWithFallbackSync(pasteArguments, options),
|
|
};
|
|
|
|
/* harmony default export */ const linux = (linux_clipboard);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/clipboardy/lib/macos.js
|
|
|
|
|
|
const env = {
|
|
LC_CTYPE: 'UTF-8',
|
|
};
|
|
|
|
const macos_clipboard = {
|
|
copy: async options => execa('pbcopy', {...options, env}),
|
|
paste: async options => {
|
|
const {stdout} = await execa('pbpaste', {...options, env});
|
|
return stdout;
|
|
},
|
|
copySync: options => execa.sync('pbcopy', {...options, env}),
|
|
pasteSync: options => execa.sync('pbpaste', {...options, env}).stdout,
|
|
};
|
|
|
|
/* harmony default export */ const macos = (macos_clipboard);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/arch/index.js
|
|
var arch = __webpack_require__(8567);
|
|
;// CONCATENATED MODULE: ./node_modules/clipboardy/lib/windows.js
|
|
|
|
|
|
|
|
|
|
|
|
const windows_dirname = external_node_path_.dirname((0,external_node_url_.fileURLToPath)(import.meta.url));
|
|
|
|
const binarySuffix = arch() === 'x64' ? 'x86_64' : 'i686';
|
|
|
|
// Binaries from: https://github.com/sindresorhus/win-clipboard
|
|
const windowBinaryPath = external_node_path_.join(windows_dirname, `../fallbacks/windows/clipboard_${binarySuffix}.exe`);
|
|
|
|
const windows_clipboard = {
|
|
copy: async options => execa(windowBinaryPath, ['--copy'], options),
|
|
paste: async options => {
|
|
const {stdout} = await execa(windowBinaryPath, ['--paste'], options);
|
|
return stdout;
|
|
},
|
|
copySync: options => execa.sync(windowBinaryPath, ['--copy'], options),
|
|
pasteSync: options => execa.sync(windowBinaryPath, ['--paste'], options).stdout,
|
|
};
|
|
|
|
/* harmony default export */ const windows = (windows_clipboard);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/clipboardy/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const platformLib = (() => {
|
|
switch (external_node_process_.platform) {
|
|
case 'darwin':
|
|
return macos;
|
|
case 'win32':
|
|
return windows;
|
|
case 'android':
|
|
if (external_node_process_.env.PREFIX !== '/data/data/com.termux/files/usr') {
|
|
throw new Error('You need to install Termux for this module to work on Android: https://termux.com');
|
|
}
|
|
|
|
return termux;
|
|
default:
|
|
// `process.platform === 'linux'` for WSL.
|
|
if (is_wsl) {
|
|
return windows;
|
|
}
|
|
|
|
return linux;
|
|
}
|
|
})();
|
|
|
|
const clipboardy_clipboard = {};
|
|
|
|
clipboardy_clipboard.write = async text => {
|
|
if (typeof text !== 'string') {
|
|
throw new TypeError(`Expected a string, got ${typeof text}`);
|
|
}
|
|
|
|
await platformLib.copy({input: text});
|
|
};
|
|
|
|
clipboardy_clipboard.read = async () => platformLib.paste({stripFinalNewline: false});
|
|
|
|
clipboardy_clipboard.writeSync = text => {
|
|
if (typeof text !== 'string') {
|
|
throw new TypeError(`Expected a string, got ${typeof text}`);
|
|
}
|
|
|
|
platformLib.copySync({input: text});
|
|
};
|
|
|
|
clipboardy_clipboard.readSync = () => platformLib.pasteSync({stripFinalNewline: false});
|
|
|
|
/* harmony default export */ const clipboardy = (clipboardy_clipboard);
|
|
|
|
|
|
/***/ })
|
|
|
|
};
|
|
|
|
//# sourceMappingURL=902.index.js.map
|