mirror of
https://github.com/JonasKruckenberg/tauri-build.git
synced 2025-08-14 21:05:05 +00:00
5662 lines
158 KiB
JavaScript
Generated
5662 lines
158 KiB
JavaScript
Generated
require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
|
|
/******/ var __webpack_modules__ = ({
|
|
|
|
/***/ 6314:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
module.exports = require(__nccwpck_require__.ab + "cli.darwin-x64.node")
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3654:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
module.exports = require(__nccwpck_require__.ab + "cli.linux-x64-gnu.node")
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7683:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
module.exports = require(__nccwpck_require__.ab + "cli.win32-x64-msvc.node")
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5365:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.buildProject = void 0;
|
|
const cli_1 = __nccwpck_require__(8162);
|
|
const execa_1 = __nccwpck_require__(5835);
|
|
const path_1 = __nccwpck_require__(1017);
|
|
const tiny_glob_1 = __importDefault(__nccwpck_require__(927));
|
|
function buildProject(options) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const projectPath = options.projectPath || process.cwd();
|
|
let args = options.args || [];
|
|
if (options.configPath) {
|
|
args.push('--config', options.configPath);
|
|
}
|
|
if (options.target) {
|
|
args.push('--target', options.target);
|
|
}
|
|
process.chdir(projectPath);
|
|
if (options.runner) {
|
|
yield (0, execa_1.execa)(options.runner, args, { stdio: 'inherit' });
|
|
}
|
|
else {
|
|
yield (0, cli_1.run)(args, '');
|
|
}
|
|
const profile = options.debug ? 'debug' : 'release';
|
|
const outDir = options.target
|
|
? `./target/${options.target}/${profile}/bundle`
|
|
: `./target/${profile}/bundle`;
|
|
const macOSExts = ['app', 'app.tar.gz', 'app.tar.gz.sig', 'dmg'];
|
|
const linuxExts = [
|
|
'AppImage',
|
|
'AppImage.tar.gz',
|
|
'AppImage.tar.gz.sig',
|
|
'deb'
|
|
];
|
|
const windowsExts = ['msi', 'msi.zip', 'msi.zip.sig'];
|
|
return (0, tiny_glob_1.default)((0, path_1.join)(outDir, `*/*.{${[...macOSExts, linuxExts, windowsExts].join(',')}}`));
|
|
});
|
|
}
|
|
exports.buildProject = buildProject;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8690:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
const core = __importStar(__nccwpck_require__(9670));
|
|
const build_project_1 = __nccwpck_require__(5365);
|
|
const string_argv_1 = __importDefault(__nccwpck_require__(8458));
|
|
function run() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
try {
|
|
const artifacts = yield (0, build_project_1.buildProject)({
|
|
runner: core.getInput('runner'),
|
|
args: (0, string_argv_1.default)(core.getInput('args')),
|
|
projectPath: core.getInput('projectPath'),
|
|
configPath: core.getInput('configPath'),
|
|
target: core.getInput('target'),
|
|
debug: core.getBooleanInput('debug')
|
|
});
|
|
core.setOutput('artifacts', artifacts.join('\n'));
|
|
}
|
|
catch (error) {
|
|
if (error instanceof Error)
|
|
core.setFailed(error.message);
|
|
}
|
|
});
|
|
}
|
|
run();
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3633:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.issue = exports.issueCommand = void 0;
|
|
const os = __importStar(__nccwpck_require__(2037));
|
|
const utils_1 = __nccwpck_require__(294);
|
|
/**
|
|
* Commands
|
|
*
|
|
* Command Format:
|
|
* ::name key=value,key=value::message
|
|
*
|
|
* Examples:
|
|
* ::warning::This is the message
|
|
* ::set-env name=MY_VAR::some value
|
|
*/
|
|
function issueCommand(command, properties, message) {
|
|
const cmd = new Command(command, properties, message);
|
|
process.stdout.write(cmd.toString() + os.EOL);
|
|
}
|
|
exports.issueCommand = issueCommand;
|
|
function issue(name, message = '') {
|
|
issueCommand(name, {}, message);
|
|
}
|
|
exports.issue = issue;
|
|
const CMD_STRING = '::';
|
|
class Command {
|
|
constructor(command, properties, message) {
|
|
if (!command) {
|
|
command = 'missing.command';
|
|
}
|
|
this.command = command;
|
|
this.properties = properties;
|
|
this.message = message;
|
|
}
|
|
toString() {
|
|
let cmdStr = CMD_STRING + this.command;
|
|
if (this.properties && Object.keys(this.properties).length > 0) {
|
|
cmdStr += ' ';
|
|
let first = true;
|
|
for (const key in this.properties) {
|
|
if (this.properties.hasOwnProperty(key)) {
|
|
const val = this.properties[key];
|
|
if (val) {
|
|
if (first) {
|
|
first = false;
|
|
}
|
|
else {
|
|
cmdStr += ',';
|
|
}
|
|
cmdStr += `${key}=${escapeProperty(val)}`;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
|
|
return cmdStr;
|
|
}
|
|
}
|
|
function escapeData(s) {
|
|
return utils_1.toCommandValue(s)
|
|
.replace(/%/g, '%25')
|
|
.replace(/\r/g, '%0D')
|
|
.replace(/\n/g, '%0A');
|
|
}
|
|
function escapeProperty(s) {
|
|
return utils_1.toCommandValue(s)
|
|
.replace(/%/g, '%25')
|
|
.replace(/\r/g, '%0D')
|
|
.replace(/\n/g, '%0A')
|
|
.replace(/:/g, '%3A')
|
|
.replace(/,/g, '%2C');
|
|
}
|
|
//# sourceMappingURL=command.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9670:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
|
const command_1 = __nccwpck_require__(3633);
|
|
const file_command_1 = __nccwpck_require__(8395);
|
|
const utils_1 = __nccwpck_require__(294);
|
|
const os = __importStar(__nccwpck_require__(2037));
|
|
const path = __importStar(__nccwpck_require__(1017));
|
|
const oidc_utils_1 = __nccwpck_require__(5994);
|
|
/**
|
|
* The code to exit an action
|
|
*/
|
|
var ExitCode;
|
|
(function (ExitCode) {
|
|
/**
|
|
* A code indicating that the action was successful
|
|
*/
|
|
ExitCode[ExitCode["Success"] = 0] = "Success";
|
|
/**
|
|
* A code indicating that the action was a failure
|
|
*/
|
|
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
|
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
|
//-----------------------------------------------------------------------
|
|
// Variables
|
|
//-----------------------------------------------------------------------
|
|
/**
|
|
* Sets env variable for this action and future actions in the job
|
|
* @param name the name of the variable to set
|
|
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
function exportVariable(name, val) {
|
|
const convertedVal = utils_1.toCommandValue(val);
|
|
process.env[name] = convertedVal;
|
|
const filePath = process.env['GITHUB_ENV'] || '';
|
|
if (filePath) {
|
|
const delimiter = '_GitHubActionsFileCommandDelimeter_';
|
|
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
|
|
file_command_1.issueCommand('ENV', commandValue);
|
|
}
|
|
else {
|
|
command_1.issueCommand('set-env', { name }, convertedVal);
|
|
}
|
|
}
|
|
exports.exportVariable = exportVariable;
|
|
/**
|
|
* Registers a secret which will get masked from logs
|
|
* @param secret value of the secret
|
|
*/
|
|
function setSecret(secret) {
|
|
command_1.issueCommand('add-mask', {}, secret);
|
|
}
|
|
exports.setSecret = setSecret;
|
|
/**
|
|
* Prepends inputPath to the PATH (for this action and future actions)
|
|
* @param inputPath
|
|
*/
|
|
function addPath(inputPath) {
|
|
const filePath = process.env['GITHUB_PATH'] || '';
|
|
if (filePath) {
|
|
file_command_1.issueCommand('PATH', inputPath);
|
|
}
|
|
else {
|
|
command_1.issueCommand('add-path', {}, inputPath);
|
|
}
|
|
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
|
}
|
|
exports.addPath = addPath;
|
|
/**
|
|
* Gets the value of an input.
|
|
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
|
|
* Returns an empty string if the value is not defined.
|
|
*
|
|
* @param name name of the input to get
|
|
* @param options optional. See InputOptions.
|
|
* @returns string
|
|
*/
|
|
function getInput(name, options) {
|
|
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
|
if (options && options.required && !val) {
|
|
throw new Error(`Input required and not supplied: ${name}`);
|
|
}
|
|
if (options && options.trimWhitespace === false) {
|
|
return val;
|
|
}
|
|
return val.trim();
|
|
}
|
|
exports.getInput = getInput;
|
|
/**
|
|
* Gets the values of an multiline input. Each value is also trimmed.
|
|
*
|
|
* @param name name of the input to get
|
|
* @param options optional. See InputOptions.
|
|
* @returns string[]
|
|
*
|
|
*/
|
|
function getMultilineInput(name, options) {
|
|
const inputs = getInput(name, options)
|
|
.split('\n')
|
|
.filter(x => x !== '');
|
|
return inputs;
|
|
}
|
|
exports.getMultilineInput = getMultilineInput;
|
|
/**
|
|
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
|
|
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
|
|
* The return value is also in boolean type.
|
|
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
|
|
*
|
|
* @param name name of the input to get
|
|
* @param options optional. See InputOptions.
|
|
* @returns boolean
|
|
*/
|
|
function getBooleanInput(name, options) {
|
|
const trueValue = ['true', 'True', 'TRUE'];
|
|
const falseValue = ['false', 'False', 'FALSE'];
|
|
const val = getInput(name, options);
|
|
if (trueValue.includes(val))
|
|
return true;
|
|
if (falseValue.includes(val))
|
|
return false;
|
|
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
|
|
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
|
}
|
|
exports.getBooleanInput = getBooleanInput;
|
|
/**
|
|
* Sets the value of an output.
|
|
*
|
|
* @param name name of the output to set
|
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
function setOutput(name, value) {
|
|
process.stdout.write(os.EOL);
|
|
command_1.issueCommand('set-output', { name }, value);
|
|
}
|
|
exports.setOutput = setOutput;
|
|
/**
|
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
|
*
|
|
*/
|
|
function setCommandEcho(enabled) {
|
|
command_1.issue('echo', enabled ? 'on' : 'off');
|
|
}
|
|
exports.setCommandEcho = setCommandEcho;
|
|
//-----------------------------------------------------------------------
|
|
// Results
|
|
//-----------------------------------------------------------------------
|
|
/**
|
|
* Sets the action status to failed.
|
|
* When the action exits it will be with an exit code of 1
|
|
* @param message add error issue message
|
|
*/
|
|
function setFailed(message) {
|
|
process.exitCode = ExitCode.Failure;
|
|
error(message);
|
|
}
|
|
exports.setFailed = setFailed;
|
|
//-----------------------------------------------------------------------
|
|
// Logging Commands
|
|
//-----------------------------------------------------------------------
|
|
/**
|
|
* Gets whether Actions Step Debug is on or not
|
|
*/
|
|
function isDebug() {
|
|
return process.env['RUNNER_DEBUG'] === '1';
|
|
}
|
|
exports.isDebug = isDebug;
|
|
/**
|
|
* Writes debug message to user log
|
|
* @param message debug message
|
|
*/
|
|
function debug(message) {
|
|
command_1.issueCommand('debug', {}, message);
|
|
}
|
|
exports.debug = debug;
|
|
/**
|
|
* Adds an error issue
|
|
* @param message error issue message. Errors will be converted to string via toString()
|
|
* @param properties optional properties to add to the annotation.
|
|
*/
|
|
function error(message, properties = {}) {
|
|
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
}
|
|
exports.error = error;
|
|
/**
|
|
* Adds a warning issue
|
|
* @param message warning issue message. Errors will be converted to string via toString()
|
|
* @param properties optional properties to add to the annotation.
|
|
*/
|
|
function warning(message, properties = {}) {
|
|
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
}
|
|
exports.warning = warning;
|
|
/**
|
|
* Adds a notice issue
|
|
* @param message notice issue message. Errors will be converted to string via toString()
|
|
* @param properties optional properties to add to the annotation.
|
|
*/
|
|
function notice(message, properties = {}) {
|
|
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
}
|
|
exports.notice = notice;
|
|
/**
|
|
* Writes info to log with console.log.
|
|
* @param message info message
|
|
*/
|
|
function info(message) {
|
|
process.stdout.write(message + os.EOL);
|
|
}
|
|
exports.info = info;
|
|
/**
|
|
* Begin an output group.
|
|
*
|
|
* Output until the next `groupEnd` will be foldable in this group
|
|
*
|
|
* @param name The name of the output group
|
|
*/
|
|
function startGroup(name) {
|
|
command_1.issue('group', name);
|
|
}
|
|
exports.startGroup = startGroup;
|
|
/**
|
|
* End an output group.
|
|
*/
|
|
function endGroup() {
|
|
command_1.issue('endgroup');
|
|
}
|
|
exports.endGroup = endGroup;
|
|
/**
|
|
* Wrap an asynchronous function call in a group.
|
|
*
|
|
* Returns the same type as the function itself.
|
|
*
|
|
* @param name The name of the group
|
|
* @param fn The function to wrap in the group
|
|
*/
|
|
function group(name, fn) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
startGroup(name);
|
|
let result;
|
|
try {
|
|
result = yield fn();
|
|
}
|
|
finally {
|
|
endGroup();
|
|
}
|
|
return result;
|
|
});
|
|
}
|
|
exports.group = group;
|
|
//-----------------------------------------------------------------------
|
|
// Wrapper action state
|
|
//-----------------------------------------------------------------------
|
|
/**
|
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
|
*
|
|
* @param name name of the state to store
|
|
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
function saveState(name, value) {
|
|
command_1.issueCommand('save-state', { name }, value);
|
|
}
|
|
exports.saveState = saveState;
|
|
/**
|
|
* Gets the value of an state set by this action's main execution.
|
|
*
|
|
* @param name name of the state to get
|
|
* @returns string
|
|
*/
|
|
function getState(name) {
|
|
return process.env[`STATE_${name}`] || '';
|
|
}
|
|
exports.getState = getState;
|
|
function getIDToken(aud) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return yield oidc_utils_1.OidcClient.getIDToken(aud);
|
|
});
|
|
}
|
|
exports.getIDToken = getIDToken;
|
|
/**
|
|
* Summary exports
|
|
*/
|
|
var summary_1 = __nccwpck_require__(9321);
|
|
Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
|
|
/**
|
|
* @deprecated use core.summary
|
|
*/
|
|
var summary_2 = __nccwpck_require__(9321);
|
|
Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
|
|
//# sourceMappingURL=core.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8395:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
// For internal use, subject to change.
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.issueCommand = void 0;
|
|
// We use any as a valid input type
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
const fs = __importStar(__nccwpck_require__(7147));
|
|
const os = __importStar(__nccwpck_require__(2037));
|
|
const utils_1 = __nccwpck_require__(294);
|
|
function issueCommand(command, message) {
|
|
const filePath = process.env[`GITHUB_${command}`];
|
|
if (!filePath) {
|
|
throw new Error(`Unable to find environment variable for file command ${command}`);
|
|
}
|
|
if (!fs.existsSync(filePath)) {
|
|
throw new Error(`Missing file at path: ${filePath}`);
|
|
}
|
|
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
|
|
encoding: 'utf8'
|
|
});
|
|
}
|
|
exports.issueCommand = issueCommand;
|
|
//# sourceMappingURL=file-command.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5994:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.OidcClient = void 0;
|
|
const http_client_1 = __nccwpck_require__(8596);
|
|
const auth_1 = __nccwpck_require__(3498);
|
|
const core_1 = __nccwpck_require__(9670);
|
|
class OidcClient {
|
|
static createHttpClient(allowRetry = true, maxRetry = 10) {
|
|
const requestOptions = {
|
|
allowRetries: allowRetry,
|
|
maxRetries: maxRetry
|
|
};
|
|
return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
|
|
}
|
|
static getRequestToken() {
|
|
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
|
|
if (!token) {
|
|
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
|
|
}
|
|
return token;
|
|
}
|
|
static getIDTokenUrl() {
|
|
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
|
|
if (!runtimeUrl) {
|
|
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
|
|
}
|
|
return runtimeUrl;
|
|
}
|
|
static getCall(id_token_url) {
|
|
var _a;
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const httpclient = OidcClient.createHttpClient();
|
|
const res = yield httpclient
|
|
.getJson(id_token_url)
|
|
.catch(error => {
|
|
throw new Error(`Failed to get ID Token. \n
|
|
Error Code : ${error.statusCode}\n
|
|
Error Message: ${error.result.message}`);
|
|
});
|
|
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
|
if (!id_token) {
|
|
throw new Error('Response json body do not have ID Token field');
|
|
}
|
|
return id_token;
|
|
});
|
|
}
|
|
static getIDToken(audience) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
try {
|
|
// New ID Token is requested from action service
|
|
let id_token_url = OidcClient.getIDTokenUrl();
|
|
if (audience) {
|
|
const encodedAudience = encodeURIComponent(audience);
|
|
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
|
}
|
|
core_1.debug(`ID token url is ${id_token_url}`);
|
|
const id_token = yield OidcClient.getCall(id_token_url);
|
|
core_1.setSecret(id_token);
|
|
return id_token;
|
|
}
|
|
catch (error) {
|
|
throw new Error(`Error message: ${error.message}`);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
exports.OidcClient = OidcClient;
|
|
//# sourceMappingURL=oidc-utils.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9321:
|
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
|
|
"use strict";
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
|
|
const os_1 = __nccwpck_require__(2037);
|
|
const fs_1 = __nccwpck_require__(7147);
|
|
const { access, appendFile, writeFile } = fs_1.promises;
|
|
exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
|
|
exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
|
|
class Summary {
|
|
constructor() {
|
|
this._buffer = '';
|
|
}
|
|
/**
|
|
* Finds the summary file path from the environment, rejects if env var is not found or file does not exist
|
|
* Also checks r/w permissions.
|
|
*
|
|
* @returns step summary file path
|
|
*/
|
|
filePath() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
if (this._filePath) {
|
|
return this._filePath;
|
|
}
|
|
const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
|
|
if (!pathFromEnv) {
|
|
throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
|
|
}
|
|
try {
|
|
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
|
|
}
|
|
catch (_a) {
|
|
throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
|
|
}
|
|
this._filePath = pathFromEnv;
|
|
return this._filePath;
|
|
});
|
|
}
|
|
/**
|
|
* Wraps content in an HTML tag, adding any HTML attributes
|
|
*
|
|
* @param {string} tag HTML tag to wrap
|
|
* @param {string | null} content content within the tag
|
|
* @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
|
|
*
|
|
* @returns {string} content wrapped in HTML element
|
|
*/
|
|
wrap(tag, content, attrs = {}) {
|
|
const htmlAttrs = Object.entries(attrs)
|
|
.map(([key, value]) => ` ${key}="${value}"`)
|
|
.join('');
|
|
if (!content) {
|
|
return `<${tag}${htmlAttrs}>`;
|
|
}
|
|
return `<${tag}${htmlAttrs}>${content}</${tag}>`;
|
|
}
|
|
/**
|
|
* Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
|
|
*
|
|
* @param {SummaryWriteOptions} [options] (optional) options for write operation
|
|
*
|
|
* @returns {Promise<Summary>} summary instance
|
|
*/
|
|
write(options) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
|
|
const filePath = yield this.filePath();
|
|
const writeFunc = overwrite ? writeFile : appendFile;
|
|
yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
|
|
return this.emptyBuffer();
|
|
});
|
|
}
|
|
/**
|
|
* Clears the summary buffer and wipes the summary file
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
clear() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.emptyBuffer().write({ overwrite: true });
|
|
});
|
|
}
|
|
/**
|
|
* Returns the current summary buffer as a string
|
|
*
|
|
* @returns {string} string of summary buffer
|
|
*/
|
|
stringify() {
|
|
return this._buffer;
|
|
}
|
|
/**
|
|
* If the summary buffer is empty
|
|
*
|
|
* @returns {boolen} true if the buffer is empty
|
|
*/
|
|
isEmptyBuffer() {
|
|
return this._buffer.length === 0;
|
|
}
|
|
/**
|
|
* Resets the summary buffer without writing to summary file
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
emptyBuffer() {
|
|
this._buffer = '';
|
|
return this;
|
|
}
|
|
/**
|
|
* Adds raw text to the summary buffer
|
|
*
|
|
* @param {string} text content to add
|
|
* @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addRaw(text, addEOL = false) {
|
|
this._buffer += text;
|
|
return addEOL ? this.addEOL() : this;
|
|
}
|
|
/**
|
|
* Adds the operating system-specific end-of-line marker to the buffer
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addEOL() {
|
|
return this.addRaw(os_1.EOL);
|
|
}
|
|
/**
|
|
* Adds an HTML codeblock to the summary buffer
|
|
*
|
|
* @param {string} code content to render within fenced code block
|
|
* @param {string} lang (optional) language to syntax highlight code
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addCodeBlock(code, lang) {
|
|
const attrs = Object.assign({}, (lang && { lang }));
|
|
const element = this.wrap('pre', this.wrap('code', code), attrs);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML list to the summary buffer
|
|
*
|
|
* @param {string[]} items list of items to render
|
|
* @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addList(items, ordered = false) {
|
|
const tag = ordered ? 'ol' : 'ul';
|
|
const listItems = items.map(item => this.wrap('li', item)).join('');
|
|
const element = this.wrap(tag, listItems);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML table to the summary buffer
|
|
*
|
|
* @param {SummaryTableCell[]} rows table rows
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addTable(rows) {
|
|
const tableBody = rows
|
|
.map(row => {
|
|
const cells = row
|
|
.map(cell => {
|
|
if (typeof cell === 'string') {
|
|
return this.wrap('td', cell);
|
|
}
|
|
const { header, data, colspan, rowspan } = cell;
|
|
const tag = header ? 'th' : 'td';
|
|
const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
|
|
return this.wrap(tag, data, attrs);
|
|
})
|
|
.join('');
|
|
return this.wrap('tr', cells);
|
|
})
|
|
.join('');
|
|
const element = this.wrap('table', tableBody);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds a collapsable HTML details element to the summary buffer
|
|
*
|
|
* @param {string} label text for the closed state
|
|
* @param {string} content collapsable content
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addDetails(label, content) {
|
|
const element = this.wrap('details', this.wrap('summary', label) + content);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML image tag to the summary buffer
|
|
*
|
|
* @param {string} src path to the image you to embed
|
|
* @param {string} alt text description of the image
|
|
* @param {SummaryImageOptions} options (optional) addition image attributes
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addImage(src, alt, options) {
|
|
const { width, height } = options || {};
|
|
const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
|
|
const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML section heading element
|
|
*
|
|
* @param {string} text heading text
|
|
* @param {number | string} [level=1] (optional) the heading level, default: 1
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addHeading(text, level) {
|
|
const tag = `h${level}`;
|
|
const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
|
|
? tag
|
|
: 'h1';
|
|
const element = this.wrap(allowedTag, text);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML thematic break (<hr>) to the summary buffer
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addSeparator() {
|
|
const element = this.wrap('hr', null);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML line break (<br>) to the summary buffer
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addBreak() {
|
|
const element = this.wrap('br', null);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML blockquote to the summary buffer
|
|
*
|
|
* @param {string} text quote text
|
|
* @param {string} cite (optional) citation url
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addQuote(text, cite) {
|
|
const attrs = Object.assign({}, (cite && { cite }));
|
|
const element = this.wrap('blockquote', text, attrs);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
/**
|
|
* Adds an HTML anchor tag to the summary buffer
|
|
*
|
|
* @param {string} text link text/content
|
|
* @param {string} href hyperlink
|
|
*
|
|
* @returns {Summary} summary instance
|
|
*/
|
|
addLink(text, href) {
|
|
const element = this.wrap('a', text, { href });
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
}
|
|
const _summary = new Summary();
|
|
/**
|
|
* @deprecated use `core.summary`
|
|
*/
|
|
exports.markdownSummary = _summary;
|
|
exports.summary = _summary;
|
|
//# sourceMappingURL=summary.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 294:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
"use strict";
|
|
|
|
// We use any as a valid input type
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.toCommandProperties = exports.toCommandValue = void 0;
|
|
/**
|
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
|
* @param input input to sanitize into a string
|
|
*/
|
|
function toCommandValue(input) {
|
|
if (input === null || input === undefined) {
|
|
return '';
|
|
}
|
|
else if (typeof input === 'string' || input instanceof String) {
|
|
return input;
|
|
}
|
|
return JSON.stringify(input);
|
|
}
|
|
exports.toCommandValue = toCommandValue;
|
|
/**
|
|
*
|
|
* @param annotationProperties
|
|
* @returns The command properties to send with the actual annotation command
|
|
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
|
*/
|
|
function toCommandProperties(annotationProperties) {
|
|
if (!Object.keys(annotationProperties).length) {
|
|
return {};
|
|
}
|
|
return {
|
|
title: annotationProperties.title,
|
|
file: annotationProperties.file,
|
|
line: annotationProperties.startLine,
|
|
endLine: annotationProperties.endLine,
|
|
col: annotationProperties.startColumn,
|
|
endColumn: annotationProperties.endColumn
|
|
};
|
|
}
|
|
exports.toCommandProperties = toCommandProperties;
|
|
//# sourceMappingURL=utils.js.map
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3498:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
class BasicCredentialHandler {
|
|
constructor(username, password) {
|
|
this.username = username;
|
|
this.password = password;
|
|
}
|
|
prepareRequest(options) {
|
|
options.headers['Authorization'] =
|
|
'Basic ' +
|
|
Buffer.from(this.username + ':' + this.password).toString('base64');
|
|
}
|
|
// This handler cannot handle 401
|
|
canHandleAuthentication(response) {
|
|
return false;
|
|
}
|
|
handleAuthentication(httpClient, requestInfo, objs) {
|
|
return null;
|
|
}
|
|
}
|
|
exports.BasicCredentialHandler = BasicCredentialHandler;
|
|
class BearerCredentialHandler {
|
|
constructor(token) {
|
|
this.token = token;
|
|
}
|
|
// currently implements pre-authorization
|
|
// TODO: support preAuth = false where it hooks on 401
|
|
prepareRequest(options) {
|
|
options.headers['Authorization'] = 'Bearer ' + this.token;
|
|
}
|
|
// This handler cannot handle 401
|
|
canHandleAuthentication(response) {
|
|
return false;
|
|
}
|
|
handleAuthentication(httpClient, requestInfo, objs) {
|
|
return null;
|
|
}
|
|
}
|
|
exports.BearerCredentialHandler = BearerCredentialHandler;
|
|
class PersonalAccessTokenCredentialHandler {
|
|
constructor(token) {
|
|
this.token = token;
|
|
}
|
|
// currently implements pre-authorization
|
|
// TODO: support preAuth = false where it hooks on 401
|
|
prepareRequest(options) {
|
|
options.headers['Authorization'] =
|
|
'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
|
|
}
|
|
// This handler cannot handle 401
|
|
canHandleAuthentication(response) {
|
|
return false;
|
|
}
|
|
handleAuthentication(httpClient, requestInfo, objs) {
|
|
return null;
|
|
}
|
|
}
|
|
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8596:
|
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
const http = __nccwpck_require__(3685);
|
|
const https = __nccwpck_require__(5687);
|
|
const pm = __nccwpck_require__(4150);
|
|
let tunnel;
|
|
var HttpCodes;
|
|
(function (HttpCodes) {
|
|
HttpCodes[HttpCodes["OK"] = 200] = "OK";
|
|
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
|
|
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
|
|
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
|
|
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
|
|
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
|
|
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
|
|
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
|
|
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
|
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
|
|
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
|
|
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
|
|
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
|
|
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
|
|
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
|
|
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
|
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
|
|
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
|
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
|
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
|
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
|
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
|
|
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
|
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
|
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
|
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
|
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
|
var Headers;
|
|
(function (Headers) {
|
|
Headers["Accept"] = "accept";
|
|
Headers["ContentType"] = "content-type";
|
|
})(Headers = exports.Headers || (exports.Headers = {}));
|
|
var MediaTypes;
|
|
(function (MediaTypes) {
|
|
MediaTypes["ApplicationJson"] = "application/json";
|
|
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
|
|
/**
|
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|
*/
|
|
function getProxyUrl(serverUrl) {
|
|
let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
|
|
return proxyUrl ? proxyUrl.href : '';
|
|
}
|
|
exports.getProxyUrl = getProxyUrl;
|
|
const HttpRedirectCodes = [
|
|
HttpCodes.MovedPermanently,
|
|
HttpCodes.ResourceMoved,
|
|
HttpCodes.SeeOther,
|
|
HttpCodes.TemporaryRedirect,
|
|
HttpCodes.PermanentRedirect
|
|
];
|
|
const HttpResponseRetryCodes = [
|
|
HttpCodes.BadGateway,
|
|
HttpCodes.ServiceUnavailable,
|
|
HttpCodes.GatewayTimeout
|
|
];
|
|
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
|
const ExponentialBackoffCeiling = 10;
|
|
const ExponentialBackoffTimeSlice = 5;
|
|
class HttpClientError extends Error {
|
|
constructor(message, statusCode) {
|
|
super(message);
|
|
this.name = 'HttpClientError';
|
|
this.statusCode = statusCode;
|
|
Object.setPrototypeOf(this, HttpClientError.prototype);
|
|
}
|
|
}
|
|
exports.HttpClientError = HttpClientError;
|
|
class HttpClientResponse {
|
|
constructor(message) {
|
|
this.message = message;
|
|
}
|
|
readBody() {
|
|
return new Promise(async (resolve, reject) => {
|
|
let output = Buffer.alloc(0);
|
|
this.message.on('data', (chunk) => {
|
|
output = Buffer.concat([output, chunk]);
|
|
});
|
|
this.message.on('end', () => {
|
|
resolve(output.toString());
|
|
});
|
|
});
|
|
}
|
|
}
|
|
exports.HttpClientResponse = HttpClientResponse;
|
|
function isHttps(requestUrl) {
|
|
let parsedUrl = new URL(requestUrl);
|
|
return parsedUrl.protocol === 'https:';
|
|
}
|
|
exports.isHttps = isHttps;
|
|
class HttpClient {
|
|
constructor(userAgent, handlers, requestOptions) {
|
|
this._ignoreSslError = false;
|
|
this._allowRedirects = true;
|
|
this._allowRedirectDowngrade = false;
|
|
this._maxRedirects = 50;
|
|
this._allowRetries = false;
|
|
this._maxRetries = 1;
|
|
this._keepAlive = false;
|
|
this._disposed = false;
|
|
this.userAgent = userAgent;
|
|
this.handlers = handlers || [];
|
|
this.requestOptions = requestOptions;
|
|
if (requestOptions) {
|
|
if (requestOptions.ignoreSslError != null) {
|
|
this._ignoreSslError = requestOptions.ignoreSslError;
|
|
}
|
|
this._socketTimeout = requestOptions.socketTimeout;
|
|
if (requestOptions.allowRedirects != null) {
|
|
this._allowRedirects = requestOptions.allowRedirects;
|
|
}
|
|
if (requestOptions.allowRedirectDowngrade != null) {
|
|
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
|
}
|
|
if (requestOptions.maxRedirects != null) {
|
|
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
|
}
|
|
if (requestOptions.keepAlive != null) {
|
|
this._keepAlive = requestOptions.keepAlive;
|
|
}
|
|
if (requestOptions.allowRetries != null) {
|
|
this._allowRetries = requestOptions.allowRetries;
|
|
}
|
|
if (requestOptions.maxRetries != null) {
|
|
this._maxRetries = requestOptions.maxRetries;
|
|
}
|
|
}
|
|
}
|
|
options(requestUrl, additionalHeaders) {
|
|
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
|
|
}
|
|
get(requestUrl, additionalHeaders) {
|
|
return this.request('GET', requestUrl, null, additionalHeaders || {});
|
|
}
|
|
del(requestUrl, additionalHeaders) {
|
|
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
|
|
}
|
|
post(requestUrl, data, additionalHeaders) {
|
|
return this.request('POST', requestUrl, data, additionalHeaders || {});
|
|
}
|
|
patch(requestUrl, data, additionalHeaders) {
|
|
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
|
|
}
|
|
put(requestUrl, data, additionalHeaders) {
|
|
return this.request('PUT', requestUrl, data, additionalHeaders || {});
|
|
}
|
|
head(requestUrl, additionalHeaders) {
|
|
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
|
|
}
|
|
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
|
return this.request(verb, requestUrl, stream, additionalHeaders);
|
|
}
|
|
/**
|
|
* Gets a typed object from an endpoint
|
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
|
*/
|
|
async getJson(requestUrl, additionalHeaders = {}) {
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
let res = await this.get(requestUrl, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
}
|
|
async postJson(requestUrl, obj, additionalHeaders = {}) {
|
|
let data = JSON.stringify(obj, null, 2);
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
let res = await this.post(requestUrl, data, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
}
|
|
async putJson(requestUrl, obj, additionalHeaders = {}) {
|
|
let data = JSON.stringify(obj, null, 2);
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
let res = await this.put(requestUrl, data, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
}
|
|
async patchJson(requestUrl, obj, additionalHeaders = {}) {
|
|
let data = JSON.stringify(obj, null, 2);
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
let res = await this.patch(requestUrl, data, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
}
|
|
/**
|
|
* Makes a raw http request.
|
|
* All other methods such as get, post, patch, and request ultimately call this.
|
|
* Prefer get, del, post and patch
|
|
*/
|
|
async request(verb, requestUrl, data, headers) {
|
|
if (this._disposed) {
|
|
throw new Error('Client has already been disposed.');
|
|
}
|
|
let parsedUrl = new URL(requestUrl);
|
|
let info = this._prepareRequest(verb, parsedUrl, headers);
|
|
// Only perform retries on reads since writes may not be idempotent.
|
|
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
|
|
? this._maxRetries + 1
|
|
: 1;
|
|
let numTries = 0;
|
|
let response;
|
|
while (numTries < maxTries) {
|
|
response = await this.requestRaw(info, data);
|
|
// Check if it's an authentication challenge
|
|
if (response &&
|
|
response.message &&
|
|
response.message.statusCode === HttpCodes.Unauthorized) {
|
|
let authenticationHandler;
|
|
for (let i = 0; i < this.handlers.length; i++) {
|
|
if (this.handlers[i].canHandleAuthentication(response)) {
|
|
authenticationHandler = this.handlers[i];
|
|
break;
|
|
}
|
|
}
|
|
if (authenticationHandler) {
|
|
return authenticationHandler.handleAuthentication(this, info, data);
|
|
}
|
|
else {
|
|
// We have received an unauthorized response but have no handlers to handle it.
|
|
// Let the response return to the caller.
|
|
return response;
|
|
}
|
|
}
|
|
let redirectsRemaining = this._maxRedirects;
|
|
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
|
|
this._allowRedirects &&
|
|
redirectsRemaining > 0) {
|
|
const redirectUrl = response.message.headers['location'];
|
|
if (!redirectUrl) {
|
|
// if there's no location to redirect to, we won't
|
|
break;
|
|
}
|
|
let parsedRedirectUrl = new URL(redirectUrl);
|
|
if (parsedUrl.protocol == 'https:' &&
|
|
parsedUrl.protocol != parsedRedirectUrl.protocol &&
|
|
!this._allowRedirectDowngrade) {
|
|
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
|
|
}
|
|
// we need to finish reading the response before reassigning response
|
|
// which will leak the open socket.
|
|
await response.readBody();
|
|
// strip authorization header if redirected to a different hostname
|
|
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
|
|
for (let header in headers) {
|
|
// header names are case insensitive
|
|
if (header.toLowerCase() === 'authorization') {
|
|
delete headers[header];
|
|
}
|
|
}
|
|
}
|
|
// let's make the request with the new redirectUrl
|
|
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
|
response = await this.requestRaw(info, data);
|
|
redirectsRemaining--;
|
|
}
|
|
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
|
|
// If not a retry code, return immediately instead of retrying
|
|
return response;
|
|
}
|
|
numTries += 1;
|
|
if (numTries < maxTries) {
|
|
await response.readBody();
|
|
await this._performExponentialBackoff(numTries);
|
|
}
|
|
}
|
|
return response;
|
|
}
|
|
/**
|
|
* Needs to be called if keepAlive is set to true in request options.
|
|
*/
|
|
dispose() {
|
|
if (this._agent) {
|
|
this._agent.destroy();
|
|
}
|
|
this._disposed = true;
|
|
}
|
|
/**
|
|
* Raw request.
|
|
* @param info
|
|
* @param data
|
|
*/
|
|
requestRaw(info, data) {
|
|
return new Promise((resolve, reject) => {
|
|
let callbackForResult = function (err, res) {
|
|
if (err) {
|
|
reject(err);
|
|
}
|
|
resolve(res);
|
|
};
|
|
this.requestRawWithCallback(info, data, callbackForResult);
|
|
});
|
|
}
|
|
/**
|
|
* Raw request with callback.
|
|
* @param info
|
|
* @param data
|
|
* @param onResult
|
|
*/
|
|
requestRawWithCallback(info, data, onResult) {
|
|
let socket;
|
|
if (typeof data === 'string') {
|
|
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
|
|
}
|
|
let callbackCalled = false;
|
|
let handleResult = (err, res) => {
|
|
if (!callbackCalled) {
|
|
callbackCalled = true;
|
|
onResult(err, res);
|
|
}
|
|
};
|
|
let req = info.httpModule.request(info.options, (msg) => {
|
|
let res = new HttpClientResponse(msg);
|
|
handleResult(null, res);
|
|
});
|
|
req.on('socket', sock => {
|
|
socket = sock;
|
|
});
|
|
// If we ever get disconnected, we want the socket to timeout eventually
|
|
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
|
|
if (socket) {
|
|
socket.end();
|
|
}
|
|
handleResult(new Error('Request timeout: ' + info.options.path), null);
|
|
});
|
|
req.on('error', function (err) {
|
|
// err has statusCode property
|
|
// res should have headers
|
|
handleResult(err, null);
|
|
});
|
|
if (data && typeof data === 'string') {
|
|
req.write(data, 'utf8');
|
|
}
|
|
if (data && typeof data !== 'string') {
|
|
data.on('close', function () {
|
|
req.end();
|
|
});
|
|
data.pipe(req);
|
|
}
|
|
else {
|
|
req.end();
|
|
}
|
|
}
|
|
/**
|
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|
*/
|
|
getAgent(serverUrl) {
|
|
let parsedUrl = new URL(serverUrl);
|
|
return this._getAgent(parsedUrl);
|
|
}
|
|
_prepareRequest(method, requestUrl, headers) {
|
|
const info = {};
|
|
info.parsedUrl = requestUrl;
|
|
const usingSsl = info.parsedUrl.protocol === 'https:';
|
|
info.httpModule = usingSsl ? https : http;
|
|
const defaultPort = usingSsl ? 443 : 80;
|
|
info.options = {};
|
|
info.options.host = info.parsedUrl.hostname;
|
|
info.options.port = info.parsedUrl.port
|
|
? parseInt(info.parsedUrl.port)
|
|
: defaultPort;
|
|
info.options.path =
|
|
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
|
info.options.method = method;
|
|
info.options.headers = this._mergeHeaders(headers);
|
|
if (this.userAgent != null) {
|
|
info.options.headers['user-agent'] = this.userAgent;
|
|
}
|
|
info.options.agent = this._getAgent(info.parsedUrl);
|
|
// gives handlers an opportunity to participate
|
|
if (this.handlers) {
|
|
this.handlers.forEach(handler => {
|
|
handler.prepareRequest(info.options);
|
|
});
|
|
}
|
|
return info;
|
|
}
|
|
_mergeHeaders(headers) {
|
|
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
|
|
if (this.requestOptions && this.requestOptions.headers) {
|
|
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
|
|
}
|
|
return lowercaseKeys(headers || {});
|
|
}
|
|
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
|
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
|
|
let clientHeader;
|
|
if (this.requestOptions && this.requestOptions.headers) {
|
|
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
|
}
|
|
return additionalHeaders[header] || clientHeader || _default;
|
|
}
|
|
_getAgent(parsedUrl) {
|
|
let agent;
|
|
let proxyUrl = pm.getProxyUrl(parsedUrl);
|
|
let useProxy = proxyUrl && proxyUrl.hostname;
|
|
if (this._keepAlive && useProxy) {
|
|
agent = this._proxyAgent;
|
|
}
|
|
if (this._keepAlive && !useProxy) {
|
|
agent = this._agent;
|
|
}
|
|
// if agent is already assigned use that agent.
|
|
if (!!agent) {
|
|
return agent;
|
|
}
|
|
const usingSsl = parsedUrl.protocol === 'https:';
|
|
let maxSockets = 100;
|
|
if (!!this.requestOptions) {
|
|
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
|
}
|
|
if (useProxy) {
|
|
// If using proxy, need tunnel
|
|
if (!tunnel) {
|
|
tunnel = __nccwpck_require__(417);
|
|
}
|
|
const agentOptions = {
|
|
maxSockets: maxSockets,
|
|
keepAlive: this._keepAlive,
|
|
proxy: {
|
|
...((proxyUrl.username || proxyUrl.password) && {
|
|
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
|
|
}),
|
|
host: proxyUrl.hostname,
|
|
port: proxyUrl.port
|
|
}
|
|
};
|
|
let tunnelAgent;
|
|
const overHttps = proxyUrl.protocol === 'https:';
|
|
if (usingSsl) {
|
|
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
|
}
|
|
else {
|
|
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
|
}
|
|
agent = tunnelAgent(agentOptions);
|
|
this._proxyAgent = agent;
|
|
}
|
|
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
|
if (this._keepAlive && !agent) {
|
|
const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
|
|
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
|
this._agent = agent;
|
|
}
|
|
// if not using private agent and tunnel agent isn't setup then use global agent
|
|
if (!agent) {
|
|
agent = usingSsl ? https.globalAgent : http.globalAgent;
|
|
}
|
|
if (usingSsl && this._ignoreSslError) {
|
|
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
|
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
|
// we have to cast it to any and change it directly
|
|
agent.options = Object.assign(agent.options || {}, {
|
|
rejectUnauthorized: false
|
|
});
|
|
}
|
|
return agent;
|
|
}
|
|
_performExponentialBackoff(retryNumber) {
|
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
|
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
|
}
|
|
static dateTimeDeserializer(key, value) {
|
|
if (typeof value === 'string') {
|
|
let a = new Date(value);
|
|
if (!isNaN(a.valueOf())) {
|
|
return a;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
async _processResponse(res, options) {
|
|
return new Promise(async (resolve, reject) => {
|
|
const statusCode = res.message.statusCode;
|
|
const response = {
|
|
statusCode: statusCode,
|
|
result: null,
|
|
headers: {}
|
|
};
|
|
// not found leads to null obj returned
|
|
if (statusCode == HttpCodes.NotFound) {
|
|
resolve(response);
|
|
}
|
|
let obj;
|
|
let contents;
|
|
// get the result from the body
|
|
try {
|
|
contents = await res.readBody();
|
|
if (contents && contents.length > 0) {
|
|
if (options && options.deserializeDates) {
|
|
obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
|
|
}
|
|
else {
|
|
obj = JSON.parse(contents);
|
|
}
|
|
response.result = obj;
|
|
}
|
|
response.headers = res.message.headers;
|
|
}
|
|
catch (err) {
|
|
// Invalid resource (contents not json); leaving result obj null
|
|
}
|
|
// note that 3xx redirects are handled by the http layer.
|
|
if (statusCode > 299) {
|
|
let msg;
|
|
// if exception/error in body, attempt to get better error
|
|
if (obj && obj.message) {
|
|
msg = obj.message;
|
|
}
|
|
else if (contents && contents.length > 0) {
|
|
// it may be the case that the exception is in the body message as string
|
|
msg = contents;
|
|
}
|
|
else {
|
|
msg = 'Failed request: (' + statusCode + ')';
|
|
}
|
|
let err = new HttpClientError(msg, statusCode);
|
|
err.result = response.result;
|
|
reject(err);
|
|
}
|
|
else {
|
|
resolve(response);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
exports.HttpClient = HttpClient;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4150:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
function getProxyUrl(reqUrl) {
|
|
let usingSsl = reqUrl.protocol === 'https:';
|
|
let proxyUrl;
|
|
if (checkBypass(reqUrl)) {
|
|
return proxyUrl;
|
|
}
|
|
let proxyVar;
|
|
if (usingSsl) {
|
|
proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
|
|
}
|
|
else {
|
|
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
|
|
}
|
|
if (proxyVar) {
|
|
proxyUrl = new URL(proxyVar);
|
|
}
|
|
return proxyUrl;
|
|
}
|
|
exports.getProxyUrl = getProxyUrl;
|
|
function checkBypass(reqUrl) {
|
|
if (!reqUrl.hostname) {
|
|
return false;
|
|
}
|
|
let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
|
if (!noProxy) {
|
|
return false;
|
|
}
|
|
// Determine the request port
|
|
let reqPort;
|
|
if (reqUrl.port) {
|
|
reqPort = Number(reqUrl.port);
|
|
}
|
|
else if (reqUrl.protocol === 'http:') {
|
|
reqPort = 80;
|
|
}
|
|
else if (reqUrl.protocol === 'https:') {
|
|
reqPort = 443;
|
|
}
|
|
// Format the request hostname and hostname with port
|
|
let upperReqHosts = [reqUrl.hostname.toUpperCase()];
|
|
if (typeof reqPort === 'number') {
|
|
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
|
}
|
|
// Compare request host against noproxy
|
|
for (let upperNoProxyItem of noProxy
|
|
.split(',')
|
|
.map(x => x.trim().toUpperCase())
|
|
.filter(x => x)) {
|
|
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
exports.checkBypass = checkBypass;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 316:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
const { existsSync, readFileSync } = __nccwpck_require__(7147)
|
|
const { join } = __nccwpck_require__(1017)
|
|
|
|
const { platform, arch } = process
|
|
|
|
let nativeBinding = null
|
|
let localFileExisted = false
|
|
let loadError = null
|
|
|
|
function isMusl() {
|
|
// For Node 10
|
|
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
try {
|
|
return readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
|
|
} catch (e) {
|
|
return true
|
|
}
|
|
} else {
|
|
const { glibcVersionRuntime } = process.report.getReport().header
|
|
return !glibcVersionRuntime
|
|
}
|
|
}
|
|
|
|
switch (platform) {
|
|
case 'android':
|
|
switch (arch) {
|
|
case 'arm64':
|
|
localFileExisted = existsSync(join(__dirname, 'cli.android-arm64.node'))
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(2424)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(4718)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
case 'arm':
|
|
localFileExisted = existsSync(join(__dirname, 'cli.android-arm-eabi.node'))
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(6831)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(8558)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
default:
|
|
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
}
|
|
break
|
|
case 'win32':
|
|
switch (arch) {
|
|
case 'x64':
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.win32-x64-msvc.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(7552)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(7683)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
case 'ia32':
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.win32-ia32-msvc.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(534)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(6445)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
case 'arm64':
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.win32-arm64-msvc.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(1296)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(8886)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
default:
|
|
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
}
|
|
break
|
|
case 'darwin':
|
|
switch (arch) {
|
|
case 'x64':
|
|
localFileExisted = existsSync(join(__dirname, 'cli.darwin-x64.node'))
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(7069)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(6314)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
case 'arm64':
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.darwin-arm64.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(709)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(7529)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
default:
|
|
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
}
|
|
break
|
|
case 'freebsd':
|
|
if (arch !== 'x64') {
|
|
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
}
|
|
localFileExisted = existsSync(join(__dirname, 'cli.freebsd-x64.node'))
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(5110)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(1758)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
case 'linux':
|
|
switch (arch) {
|
|
case 'x64':
|
|
if (isMusl()) {
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.linux-x64-musl.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(4301)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(1608)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
} else {
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.linux-x64-gnu.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(6546)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(3654)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
}
|
|
break
|
|
case 'arm64':
|
|
if (isMusl()) {
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.linux-arm64-musl.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(8354)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(9226)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
} else {
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.linux-arm64-gnu.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(6199)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(1475)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
}
|
|
break
|
|
case 'arm':
|
|
localFileExisted = existsSync(
|
|
join(__dirname, 'cli.linux-arm-gnueabihf.node')
|
|
)
|
|
try {
|
|
if (localFileExisted) {
|
|
nativeBinding = __nccwpck_require__(2357)
|
|
} else {
|
|
nativeBinding = __nccwpck_require__(824)
|
|
}
|
|
} catch (e) {
|
|
loadError = e
|
|
}
|
|
break
|
|
default:
|
|
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
}
|
|
break
|
|
default:
|
|
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
}
|
|
|
|
if (!nativeBinding) {
|
|
if (loadError) {
|
|
throw loadError
|
|
}
|
|
throw new Error(`Failed to load native binding`)
|
|
}
|
|
|
|
const { run } = nativeBinding
|
|
|
|
module.exports.run = run
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8162:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
const { run } = __nccwpck_require__(316)
|
|
|
|
module.exports.run = (args, binName) => {
|
|
return new Promise((resolve, reject) => {
|
|
run(args, binName, res => {
|
|
if (res instanceof Error) {
|
|
reject(res)
|
|
} else {
|
|
resolve(res)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7701:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
const cp = __nccwpck_require__(2081);
|
|
const parse = __nccwpck_require__(1394);
|
|
const enoent = __nccwpck_require__(4284);
|
|
|
|
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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4284:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
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,
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1394:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
const path = __nccwpck_require__(1017);
|
|
const resolveCommand = __nccwpck_require__(3815);
|
|
const escape = __nccwpck_require__(9997);
|
|
const readShebang = __nccwpck_require__(8632);
|
|
|
|
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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9997:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
// 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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8632:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
const fs = __nccwpck_require__(7147);
|
|
const shebangCommand = __nccwpck_require__(6059);
|
|
|
|
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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3815:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
const path = __nccwpck_require__(1017);
|
|
const which = __nccwpck_require__(7985);
|
|
const getPathKey = __nccwpck_require__(9683);
|
|
|
|
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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7317:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
const {PassThrough: PassThroughStream} = __nccwpck_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;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7337:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
const {constants: BufferConstants} = __nccwpck_require__(4300);
|
|
const stream = __nccwpck_require__(2781);
|
|
const {promisify} = __nccwpck_require__(3837);
|
|
const bufferStream = __nccwpck_require__(7317);
|
|
|
|
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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8541:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
const os = __nccwpck_require__(2037);
|
|
const path = __nccwpck_require__(1017);
|
|
const isWin = os.platform() === 'win32';
|
|
|
|
const CHARS = { '{': '}', '(': ')', '[': ']'};
|
|
const STRICT = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/;
|
|
const RELAXED = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
|
|
|
|
/**
|
|
* Detect if a string cointains glob
|
|
* @param {String} str Input string
|
|
* @param {Object} [options] Configuration object
|
|
* @param {Boolean} [options.strict=true] Use relaxed regex if true
|
|
* @returns {Boolean} true if string contains glob
|
|
*/
|
|
function isglob(str, { strict = true } = {}) {
|
|
if (str === '') return false;
|
|
let match, rgx = strict ? STRICT : RELAXED;
|
|
|
|
while ((match = rgx.exec(str))) {
|
|
if (match[2]) return true;
|
|
let idx = match.index + match[0].length;
|
|
|
|
// if an open bracket/brace/paren is escaped,
|
|
// set the index to the next closing character
|
|
let open = match[1];
|
|
let close = open ? CHARS[open] : null;
|
|
if (open && close) {
|
|
let n = str.indexOf(close, idx);
|
|
if (n !== -1) idx = n + 1;
|
|
}
|
|
|
|
str = str.slice(idx);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
/**
|
|
* Find the static part of a glob-path,
|
|
* split path and return path part
|
|
* @param {String} str Path/glob string
|
|
* @returns {String} static path section of glob
|
|
*/
|
|
function parent(str, { strict = false } = {}) {
|
|
if (isWin && str.includes('/'))
|
|
str = str.split('\\').join('/');
|
|
|
|
// special case for strings ending in enclosure containing path separator
|
|
if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
|
|
|
|
// preserves full path in case of trailing path separator
|
|
str += 'a';
|
|
|
|
do {str = path.dirname(str)}
|
|
while (isglob(str, {strict}) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str));
|
|
|
|
// remove escape chars and return result
|
|
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
|
|
};
|
|
|
|
|
|
/**
|
|
* Parse a glob path, and split it by static/glob part
|
|
* @param {String} pattern String path
|
|
* @param {Object} [opts] Options
|
|
* @param {Object} [opts.strict=false] Use strict parsing
|
|
* @returns {Object} object with parsed path
|
|
*/
|
|
function globalyzer(pattern, opts = {}) {
|
|
let base = parent(pattern, opts);
|
|
let isGlob = isglob(pattern, opts);
|
|
let glob;
|
|
|
|
if (base != '.') {
|
|
glob = pattern.substr(base.length);
|
|
if (glob.startsWith('/')) glob = glob.substr(1);
|
|
} else {
|
|
glob = pattern;
|
|
}
|
|
|
|
if (!isGlob) {
|
|
base = path.dirname(pattern);
|
|
glob = base !== '.' ? pattern.substr(base.length) : pattern;
|
|
}
|
|
|
|
if (glob.startsWith('./')) glob = glob.substr(2);
|
|
if (glob.startsWith('/')) glob = glob.substr(1);
|
|
|
|
return { base, glob, isGlob };
|
|
}
|
|
|
|
|
|
module.exports = globalyzer;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8291:
|
|
/***/ ((module) => {
|
|
|
|
const isWin = process.platform === 'win32';
|
|
const SEP = isWin ? `\\\\+` : `\\/`;
|
|
const SEP_ESC = isWin ? `\\\\` : `/`;
|
|
const GLOBSTAR = `((?:[^/]*(?:/|$))*)`;
|
|
const WILDCARD = `([^/]*)`;
|
|
const GLOBSTAR_SEGMENT = `((?:[^${SEP_ESC}]*(?:${SEP_ESC}|$))*)`;
|
|
const WILDCARD_SEGMENT = `([^${SEP_ESC}]*)`;
|
|
|
|
/**
|
|
* Convert any glob pattern to a JavaScript Regexp object
|
|
* @param {String} glob Glob pattern to convert
|
|
* @param {Object} opts Configuration object
|
|
* @param {Boolean} [opts.extended=false] Support advanced ext globbing
|
|
* @param {Boolean} [opts.globstar=false] Support globstar
|
|
* @param {Boolean} [opts.strict=true] be laissez faire about mutiple slashes
|
|
* @param {Boolean} [opts.filepath=''] Parse as filepath for extra path related features
|
|
* @param {String} [opts.flags=''] RegExp globs
|
|
* @returns {Object} converted object with string, segments and RegExp object
|
|
*/
|
|
function globrex(glob, {extended = false, globstar = false, strict = false, filepath = false, flags = ''} = {}) {
|
|
let regex = '';
|
|
let segment = '';
|
|
let path = { regex: '', segments: [] };
|
|
|
|
// If we are doing extended matching, this boolean is true when we are inside
|
|
// a group (eg {*.html,*.js}), and false otherwise.
|
|
let inGroup = false;
|
|
let inRange = false;
|
|
|
|
// extglob stack. Keep track of scope
|
|
const ext = [];
|
|
|
|
// Helper function to build string and segments
|
|
function add(str, {split, last, only}={}) {
|
|
if (only !== 'path') regex += str;
|
|
if (filepath && only !== 'regex') {
|
|
path.regex += (str === '\\/' ? SEP : str);
|
|
if (split) {
|
|
if (last) segment += str;
|
|
if (segment !== '') {
|
|
if (!flags.includes('g')) segment = `^${segment}$`; // change it 'includes'
|
|
path.segments.push(new RegExp(segment, flags));
|
|
}
|
|
segment = '';
|
|
} else {
|
|
segment += str;
|
|
}
|
|
}
|
|
}
|
|
|
|
let c, n;
|
|
for (let i = 0; i < glob.length; i++) {
|
|
c = glob[i];
|
|
n = glob[i + 1];
|
|
|
|
if (['\\', '$', '^', '.', '='].includes(c)) {
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '/') {
|
|
add(`\\${c}`, {split: true});
|
|
if (n === '/' && !strict) regex += '?';
|
|
continue;
|
|
}
|
|
|
|
if (c === '(') {
|
|
if (ext.length) {
|
|
add(c);
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === ')') {
|
|
if (ext.length) {
|
|
add(c);
|
|
let type = ext.pop();
|
|
if (type === '@') {
|
|
add('{1}');
|
|
} else if (type === '!') {
|
|
add('([^\/]*)');
|
|
} else {
|
|
add(type);
|
|
}
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '|') {
|
|
if (ext.length) {
|
|
add(c);
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '+') {
|
|
if (n === '(' && extended) {
|
|
ext.push(c);
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '@' && extended) {
|
|
if (n === '(') {
|
|
ext.push(c);
|
|
continue;
|
|
}
|
|
}
|
|
|
|
if (c === '!') {
|
|
if (extended) {
|
|
if (inRange) {
|
|
add('^');
|
|
continue
|
|
}
|
|
if (n === '(') {
|
|
ext.push(c);
|
|
add('(?!');
|
|
i++;
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '?') {
|
|
if (extended) {
|
|
if (n === '(') {
|
|
ext.push(c);
|
|
} else {
|
|
add('.');
|
|
}
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '[') {
|
|
if (inRange && n === ':') {
|
|
i++; // skip [
|
|
let value = '';
|
|
while(glob[++i] !== ':') value += glob[i];
|
|
if (value === 'alnum') add('(\\w|\\d)');
|
|
else if (value === 'space') add('\\s');
|
|
else if (value === 'digit') add('\\d');
|
|
i++; // skip last ]
|
|
continue;
|
|
}
|
|
if (extended) {
|
|
inRange = true;
|
|
add(c);
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === ']') {
|
|
if (extended) {
|
|
inRange = false;
|
|
add(c);
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '{') {
|
|
if (extended) {
|
|
inGroup = true;
|
|
add('(');
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '}') {
|
|
if (extended) {
|
|
inGroup = false;
|
|
add(')');
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === ',') {
|
|
if (inGroup) {
|
|
add('|');
|
|
continue;
|
|
}
|
|
add(`\\${c}`);
|
|
continue;
|
|
}
|
|
|
|
if (c === '*') {
|
|
if (n === '(' && extended) {
|
|
ext.push(c);
|
|
continue;
|
|
}
|
|
// Move over all consecutive "*"'s.
|
|
// Also store the previous and next characters
|
|
let prevChar = glob[i - 1];
|
|
let starCount = 1;
|
|
while (glob[i + 1] === '*') {
|
|
starCount++;
|
|
i++;
|
|
}
|
|
let nextChar = glob[i + 1];
|
|
if (!globstar) {
|
|
// globstar is disabled, so treat any number of "*" as one
|
|
add('.*');
|
|
} else {
|
|
// globstar is enabled, so determine if this is a globstar segment
|
|
let isGlobstar =
|
|
starCount > 1 && // multiple "*"'s
|
|
(prevChar === '/' || prevChar === undefined) && // from the start of the segment
|
|
(nextChar === '/' || nextChar === undefined); // to the end of the segment
|
|
if (isGlobstar) {
|
|
// it's a globstar, so match zero or more path segments
|
|
add(GLOBSTAR, {only:'regex'});
|
|
add(GLOBSTAR_SEGMENT, {only:'path', last:true, split:true});
|
|
i++; // move over the "/"
|
|
} else {
|
|
// it's not a globstar, so only match one path segment
|
|
add(WILDCARD, {only:'regex'});
|
|
add(WILDCARD_SEGMENT, {only:'path'});
|
|
}
|
|
}
|
|
continue;
|
|
}
|
|
|
|
add(c);
|
|
}
|
|
|
|
|
|
// When regexp 'g' flag is specified don't
|
|
// constrain the regular expression with ^ & $
|
|
if (!flags.includes('g')) {
|
|
regex = `^${regex}$`;
|
|
segment = `^${segment}$`;
|
|
if (filepath) path.regex = `^${path.regex}$`;
|
|
}
|
|
|
|
const result = {regex: new RegExp(regex, flags)};
|
|
|
|
// Push the last segment
|
|
if (filepath) {
|
|
path.segments.push(new RegExp(segment, flags));
|
|
path.regex = new RegExp(path.regex, flags);
|
|
path.globstar = new RegExp(!flags.includes('g') ? `^${GLOBSTAR_SEGMENT}$` : GLOBSTAR_SEGMENT, flags);
|
|
result.path = path;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
module.exports = globrex;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 94:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
var fs = __nccwpck_require__(7147)
|
|
var core
|
|
if (process.platform === 'win32' || global.TESTING_WINDOWS) {
|
|
core = __nccwpck_require__(6818)
|
|
} else {
|
|
core = __nccwpck_require__(9922)
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9922:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
module.exports = isexe
|
|
isexe.sync = sync
|
|
|
|
var fs = __nccwpck_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
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6818:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
module.exports = isexe
|
|
isexe.sync = sync
|
|
|
|
var fs = __nccwpck_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)
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5483:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
const { PassThrough } = __nccwpck_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() }
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9683:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
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;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6059:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
const shebangRegex = __nccwpck_require__(313);
|
|
|
|
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;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 313:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
|
|
module.exports = /^#!(.*)/;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4199:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_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 = __nccwpck_require__(9491)
|
|
var signals = __nccwpck_require__(6473)
|
|
var isWin = /^win/i.test(process.platform)
|
|
|
|
var EE = __nccwpck_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)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6473:
|
|
/***/ ((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'
|
|
)
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8458:
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
"use strict";
|
|
|
|
exports.__esModule = true;
|
|
function parseArgsStringToArgv(value, env, file) {
|
|
// ([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*) Matches nested quotes until the first space outside of quotes
|
|
// [^\s'"]+ or Match if not a space ' or "
|
|
// (['"])([^\5]*?)\5 or Match "quoted text" without quotes
|
|
// `\3` and `\5` are a backreference to the quote style (' or ") captured
|
|
var myRegexp = /([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi;
|
|
var myString = value;
|
|
var myArray = [];
|
|
if (env) {
|
|
myArray.push(env);
|
|
}
|
|
if (file) {
|
|
myArray.push(file);
|
|
}
|
|
var match;
|
|
do {
|
|
// Each call to exec returns the next regex match as an array
|
|
match = myRegexp.exec(myString);
|
|
if (match !== null) {
|
|
// Index 1 in the array is the captured group if it exists
|
|
// Index 0 is the matched text, which we use if no captured group exists
|
|
myArray.push(firstString(match[1], match[6], match[0]));
|
|
}
|
|
} while (match !== null);
|
|
return myArray;
|
|
}
|
|
exports["default"] = parseArgsStringToArgv;
|
|
exports.parseArgsStringToArgv = parseArgsStringToArgv;
|
|
// Accepts any number of arguments, and returns the first one that is a string
|
|
// (even an empty string)
|
|
function firstString() {
|
|
var args = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
args[_i] = arguments[_i];
|
|
}
|
|
for (var i = 0; i < args.length; i++) {
|
|
var arg = args[i];
|
|
if (typeof arg === "string") {
|
|
return arg;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 927:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
const fs = __nccwpck_require__(7147);
|
|
const globrex = __nccwpck_require__(8291);
|
|
const { promisify } = __nccwpck_require__(3837);
|
|
const globalyzer = __nccwpck_require__(8541);
|
|
const { join, resolve, relative } = __nccwpck_require__(1017);
|
|
const isHidden = /(^|[\\\/])\.[^\\\/\.]/g;
|
|
const readdir = promisify(fs.readdir);
|
|
const stat = promisify(fs.stat);
|
|
let CACHE = {};
|
|
|
|
async function walk(output, prefix, lexer, opts, dirname='', level=0) {
|
|
const rgx = lexer.segments[level];
|
|
const dir = resolve(opts.cwd, prefix, dirname);
|
|
const files = await readdir(dir);
|
|
const { dot, filesOnly } = opts;
|
|
|
|
let i=0, len=files.length, file;
|
|
let fullpath, relpath, stats, isMatch;
|
|
|
|
for (; i < len; i++) {
|
|
fullpath = join(dir, file=files[i]);
|
|
relpath = dirname ? join(dirname, file) : file;
|
|
if (!dot && isHidden.test(relpath)) continue;
|
|
isMatch = lexer.regex.test(relpath);
|
|
|
|
if ((stats=CACHE[relpath]) === void 0) {
|
|
CACHE[relpath] = stats = fs.lstatSync(fullpath);
|
|
}
|
|
|
|
if (!stats.isDirectory()) {
|
|
isMatch && output.push(relative(opts.cwd, fullpath));
|
|
continue;
|
|
}
|
|
|
|
if (rgx && !rgx.test(file)) continue;
|
|
!filesOnly && isMatch && output.push(join(prefix, relpath));
|
|
|
|
await walk(output, prefix, lexer, opts, relpath, rgx && rgx.toString() !== lexer.globstar && level + 1);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Find files using bash-like globbing.
|
|
* All paths are normalized compared to node-glob.
|
|
* @param {String} str Glob string
|
|
* @param {String} [options.cwd='.'] Current working directory
|
|
* @param {Boolean} [options.dot=false] Include dotfile matches
|
|
* @param {Boolean} [options.absolute=false] Return absolute paths
|
|
* @param {Boolean} [options.filesOnly=false] Do not include folders if true
|
|
* @param {Boolean} [options.flush=false] Reset cache object
|
|
* @returns {Array} array containing matching files
|
|
*/
|
|
module.exports = async function (str, opts={}) {
|
|
if (!str) return [];
|
|
|
|
let glob = globalyzer(str);
|
|
|
|
opts.cwd = opts.cwd || '.';
|
|
|
|
if (!glob.isGlob) {
|
|
try {
|
|
let resolved = resolve(opts.cwd, str);
|
|
let dirent = await stat(resolved);
|
|
if (opts.filesOnly && !dirent.isFile()) return [];
|
|
|
|
return opts.absolute ? [resolved] : [str];
|
|
} catch (err) {
|
|
if (err.code != 'ENOENT') throw err;
|
|
|
|
return [];
|
|
}
|
|
}
|
|
|
|
if (opts.flush) CACHE = {};
|
|
|
|
let matches = [];
|
|
const { path } = globrex(glob.glob, { filepath:true, globstar:true, extended:true });
|
|
|
|
path.globstar = path.globstar.toString();
|
|
await walk(matches, glob.base, path, opts, '.', 0);
|
|
|
|
return opts.absolute ? matches.map(x => resolve(opts.cwd, x)) : matches;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 417:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
module.exports = __nccwpck_require__(5452);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5452:
|
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
|
|
|
|
var net = __nccwpck_require__(1808);
|
|
var tls = __nccwpck_require__(4404);
|
|
var http = __nccwpck_require__(3685);
|
|
var https = __nccwpck_require__(5687);
|
|
var events = __nccwpck_require__(2361);
|
|
var assert = __nccwpck_require__(9491);
|
|
var util = __nccwpck_require__(3837);
|
|
|
|
|
|
exports.httpOverHttp = httpOverHttp;
|
|
exports.httpsOverHttp = httpsOverHttp;
|
|
exports.httpOverHttps = httpOverHttps;
|
|
exports.httpsOverHttps = httpsOverHttps;
|
|
|
|
|
|
function httpOverHttp(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = http.request;
|
|
return agent;
|
|
}
|
|
|
|
function httpsOverHttp(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = http.request;
|
|
agent.createSocket = createSecureSocket;
|
|
agent.defaultPort = 443;
|
|
return agent;
|
|
}
|
|
|
|
function httpOverHttps(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = https.request;
|
|
return agent;
|
|
}
|
|
|
|
function httpsOverHttps(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = https.request;
|
|
agent.createSocket = createSecureSocket;
|
|
agent.defaultPort = 443;
|
|
return agent;
|
|
}
|
|
|
|
|
|
function TunnelingAgent(options) {
|
|
var self = this;
|
|
self.options = options || {};
|
|
self.proxyOptions = self.options.proxy || {};
|
|
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
|
self.requests = [];
|
|
self.sockets = [];
|
|
|
|
self.on('free', function onFree(socket, host, port, localAddress) {
|
|
var options = toOptions(host, port, localAddress);
|
|
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
|
var pending = self.requests[i];
|
|
if (pending.host === options.host && pending.port === options.port) {
|
|
// Detect the request to connect same origin server,
|
|
// reuse the connection.
|
|
self.requests.splice(i, 1);
|
|
pending.request.onSocket(socket);
|
|
return;
|
|
}
|
|
}
|
|
socket.destroy();
|
|
self.removeSocket(socket);
|
|
});
|
|
}
|
|
util.inherits(TunnelingAgent, events.EventEmitter);
|
|
|
|
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
|
var self = this;
|
|
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
|
|
|
|
if (self.sockets.length >= this.maxSockets) {
|
|
// We are over limit so we'll add it to the queue.
|
|
self.requests.push(options);
|
|
return;
|
|
}
|
|
|
|
// If we are under maxSockets create a new one.
|
|
self.createSocket(options, function(socket) {
|
|
socket.on('free', onFree);
|
|
socket.on('close', onCloseOrRemove);
|
|
socket.on('agentRemove', onCloseOrRemove);
|
|
req.onSocket(socket);
|
|
|
|
function onFree() {
|
|
self.emit('free', socket, options);
|
|
}
|
|
|
|
function onCloseOrRemove(err) {
|
|
self.removeSocket(socket);
|
|
socket.removeListener('free', onFree);
|
|
socket.removeListener('close', onCloseOrRemove);
|
|
socket.removeListener('agentRemove', onCloseOrRemove);
|
|
}
|
|
});
|
|
};
|
|
|
|
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
|
|
var self = this;
|
|
var placeholder = {};
|
|
self.sockets.push(placeholder);
|
|
|
|
var connectOptions = mergeOptions({}, self.proxyOptions, {
|
|
method: 'CONNECT',
|
|
path: options.host + ':' + options.port,
|
|
agent: false,
|
|
headers: {
|
|
host: options.host + ':' + options.port
|
|
}
|
|
});
|
|
if (options.localAddress) {
|
|
connectOptions.localAddress = options.localAddress;
|
|
}
|
|
if (connectOptions.proxyAuth) {
|
|
connectOptions.headers = connectOptions.headers || {};
|
|
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
|
|
new Buffer(connectOptions.proxyAuth).toString('base64');
|
|
}
|
|
|
|
debug('making CONNECT request');
|
|
var connectReq = self.request(connectOptions);
|
|
connectReq.useChunkedEncodingByDefault = false; // for v0.6
|
|
connectReq.once('response', onResponse); // for v0.6
|
|
connectReq.once('upgrade', onUpgrade); // for v0.6
|
|
connectReq.once('connect', onConnect); // for v0.7 or later
|
|
connectReq.once('error', onError);
|
|
connectReq.end();
|
|
|
|
function onResponse(res) {
|
|
// Very hacky. This is necessary to avoid http-parser leaks.
|
|
res.upgrade = true;
|
|
}
|
|
|
|
function onUpgrade(res, socket, head) {
|
|
// Hacky.
|
|
process.nextTick(function() {
|
|
onConnect(res, socket, head);
|
|
});
|
|
}
|
|
|
|
function onConnect(res, socket, head) {
|
|
connectReq.removeAllListeners();
|
|
socket.removeAllListeners();
|
|
|
|
if (res.statusCode !== 200) {
|
|
debug('tunneling socket could not be established, statusCode=%d',
|
|
res.statusCode);
|
|
socket.destroy();
|
|
var error = new Error('tunneling socket could not be established, ' +
|
|
'statusCode=' + res.statusCode);
|
|
error.code = 'ECONNRESET';
|
|
options.request.emit('error', error);
|
|
self.removeSocket(placeholder);
|
|
return;
|
|
}
|
|
if (head.length > 0) {
|
|
debug('got illegal response body from proxy');
|
|
socket.destroy();
|
|
var error = new Error('got illegal response body from proxy');
|
|
error.code = 'ECONNRESET';
|
|
options.request.emit('error', error);
|
|
self.removeSocket(placeholder);
|
|
return;
|
|
}
|
|
debug('tunneling connection has established');
|
|
self.sockets[self.sockets.indexOf(placeholder)] = socket;
|
|
return cb(socket);
|
|
}
|
|
|
|
function onError(cause) {
|
|
connectReq.removeAllListeners();
|
|
|
|
debug('tunneling socket could not be established, cause=%s\n',
|
|
cause.message, cause.stack);
|
|
var error = new Error('tunneling socket could not be established, ' +
|
|
'cause=' + cause.message);
|
|
error.code = 'ECONNRESET';
|
|
options.request.emit('error', error);
|
|
self.removeSocket(placeholder);
|
|
}
|
|
};
|
|
|
|
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
|
|
var pos = this.sockets.indexOf(socket)
|
|
if (pos === -1) {
|
|
return;
|
|
}
|
|
this.sockets.splice(pos, 1);
|
|
|
|
var pending = this.requests.shift();
|
|
if (pending) {
|
|
// If we have pending requests and a socket gets closed a new one
|
|
// needs to be created to take over in the pool for the one that closed.
|
|
this.createSocket(pending, function(socket) {
|
|
pending.request.onSocket(socket);
|
|
});
|
|
}
|
|
};
|
|
|
|
function createSecureSocket(options, cb) {
|
|
var self = this;
|
|
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
|
|
var hostHeader = options.request.getHeader('host');
|
|
var tlsOptions = mergeOptions({}, self.options, {
|
|
socket: socket,
|
|
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
|
|
});
|
|
|
|
// 0 is dummy port for v0.6
|
|
var secureSocket = tls.connect(0, tlsOptions);
|
|
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
|
|
cb(secureSocket);
|
|
});
|
|
}
|
|
|
|
|
|
function toOptions(host, port, localAddress) {
|
|
if (typeof host === 'string') { // since v0.10
|
|
return {
|
|
host: host,
|
|
port: port,
|
|
localAddress: localAddress
|
|
};
|
|
}
|
|
return host; // for v0.11 or later
|
|
}
|
|
|
|
function mergeOptions(target) {
|
|
for (var i = 1, len = arguments.length; i < len; ++i) {
|
|
var overrides = arguments[i];
|
|
if (typeof overrides === 'object') {
|
|
var keys = Object.keys(overrides);
|
|
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
|
var k = keys[j];
|
|
if (overrides[k] !== undefined) {
|
|
target[k] = overrides[k];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
|
|
|
|
var debug;
|
|
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
|
debug = function() {
|
|
var args = Array.prototype.slice.call(arguments);
|
|
if (typeof args[0] === 'string') {
|
|
args[0] = 'TUNNEL: ' + args[0];
|
|
} else {
|
|
args.unshift('TUNNEL:');
|
|
}
|
|
console.error.apply(console, args);
|
|
}
|
|
} else {
|
|
debug = function() {};
|
|
}
|
|
exports.debug = debug; // for test
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7985:
|
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
|
|
const isWindows = process.platform === 'win32' ||
|
|
process.env.OSTYPE === 'cygwin' ||
|
|
process.env.OSTYPE === 'msys'
|
|
|
|
const path = __nccwpck_require__(1017)
|
|
const COLON = isWindows ? ';' : ':'
|
|
const isexe = __nccwpck_require__(94)
|
|
|
|
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
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6831:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.android-arm-eabi.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2424:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.android-arm64.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 709:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.darwin-arm64.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7069:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.darwin-x64.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5110:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.freebsd-x64.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2357:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.linux-arm-gnueabihf.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6199:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.linux-arm64-gnu.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8354:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.linux-arm64-musl.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6546:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.linux-x64-gnu.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4301:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.linux-x64-musl.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1296:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.win32-arm64-msvc.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 534:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.win32-ia32-msvc.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7552:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("./cli.win32-x64-msvc.node");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8558:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-android-arm-eabi");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4718:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-android-arm64");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7529:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-darwin-arm64");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1758:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-freebsd-x64");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 824:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-linux-arm-gnueabihf");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1475:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-linux-arm64-gnu");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9226:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-linux-arm64-musl");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1608:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-linux-x64-musl");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8886:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-win32-arm64-msvc");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6445:
|
|
/***/ ((module) => {
|
|
|
|
module.exports = eval("require")("@tauri-apps/cli-win32-ia32-msvc");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9491:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("assert");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4300:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("buffer");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2081:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("child_process");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2361:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("events");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7147:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("fs");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3685:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("http");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5687:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("https");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1808:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("net");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2037:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("os");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1017:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("path");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2781:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("stream");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4404:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("tls");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3837:
|
|
/***/ ((module) => {
|
|
|
|
"use strict";
|
|
module.exports = require("util");
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5835:
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
|
|
"use strict";
|
|
// ESM COMPAT FLAG
|
|
__nccwpck_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__nccwpck_require__.d(__webpack_exports__, {
|
|
"execa": () => (/* binding */ execa),
|
|
"execaCommand": () => (/* binding */ execaCommand),
|
|
"execaCommandSync": () => (/* binding */ execaCommandSync),
|
|
"execaNode": () => (/* binding */ execaNode),
|
|
"execaSync": () => (/* binding */ execaSync)
|
|
});
|
|
|
|
;// CONCATENATED MODULE: external "node:buffer"
|
|
const external_node_buffer_namespaceObject = require("node:buffer");
|
|
;// CONCATENATED MODULE: external "node:path"
|
|
const external_node_path_namespaceObject = require("node:path");
|
|
;// CONCATENATED MODULE: external "node:child_process"
|
|
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
;// CONCATENATED MODULE: external "node:process"
|
|
const external_node_process_namespaceObject = require("node:process");
|
|
// EXTERNAL MODULE: ./node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
|
|
var cross_spawn = __nccwpck_require__(7701);
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
|
|
function stripFinalNewline(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, -1);
|
|
}
|
|
|
|
if (input[input.length - 1] === CR) {
|
|
input = input.slice(0, -1);
|
|
}
|
|
|
|
return input;
|
|
}
|
|
|
|
;// CONCATENATED MODULE: external "node:url"
|
|
const external_node_url_namespaceObject = require("node:url");
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
function pathKey(options = {}) {
|
|
const {
|
|
env = process.env,
|
|
platform = process.platform
|
|
} = options;
|
|
|
|
if (platform !== 'win32') {
|
|
return 'PATH';
|
|
}
|
|
|
|
return Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
|
|
}
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/npm-run-path@5.1.0/node_modules/npm-run-path/index.js
|
|
|
|
|
|
|
|
|
|
|
|
function npmRunPath(options = {}) {
|
|
const {
|
|
cwd = external_node_process_namespaceObject.cwd(),
|
|
path: path_ = external_node_process_namespaceObject.env[pathKey()],
|
|
execPath = external_node_process_namespaceObject.execPath,
|
|
} = options;
|
|
|
|
let previous;
|
|
const cwdString = cwd instanceof URL ? external_node_url_namespaceObject.fileURLToPath(cwd) : cwd;
|
|
let cwdPath = external_node_path_namespaceObject.resolve(cwdString);
|
|
const result = [];
|
|
|
|
while (previous !== cwdPath) {
|
|
result.push(external_node_path_namespaceObject.join(cwdPath, 'node_modules/.bin'));
|
|
previous = cwdPath;
|
|
cwdPath = external_node_path_namespaceObject.resolve(cwdPath, '..');
|
|
}
|
|
|
|
// Ensure the running `node` binary is used.
|
|
result.push(external_node_path_namespaceObject.resolve(cwdString, execPath, '..'));
|
|
|
|
return [...result, path_].join(external_node_path_namespaceObject.delimiter);
|
|
}
|
|
|
|
function npmRunPathEnv({env = external_node_process_namespaceObject.env, ...options} = {}) {
|
|
env = {...env};
|
|
|
|
const path = pathKey({env});
|
|
options.path = env[path];
|
|
env[path] = npmRunPath(options);
|
|
|
|
return env;
|
|
}
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
|
|
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
|
|
// `Function#prototype` is non-writable and non-configurable so can never be modified.
|
|
if (property === 'length' || property === 'prototype') {
|
|
return;
|
|
}
|
|
|
|
// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.
|
|
if (property === 'arguments' || property === 'caller') {
|
|
return;
|
|
}
|
|
|
|
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
|
|
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
return;
|
|
}
|
|
|
|
Object.defineProperty(to, property, fromDescriptor);
|
|
};
|
|
|
|
// `Object.defineProperty()` throws if the property exists, is not configurable and either:
|
|
// - one its descriptors is changed
|
|
// - it is non-writable and its value is changed
|
|
const canCopyProperty = function (toDescriptor, fromDescriptor) {
|
|
return toDescriptor === undefined || toDescriptor.configurable || (
|
|
toDescriptor.writable === fromDescriptor.writable &&
|
|
toDescriptor.enumerable === fromDescriptor.enumerable &&
|
|
toDescriptor.configurable === fromDescriptor.configurable &&
|
|
(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)
|
|
);
|
|
};
|
|
|
|
const changePrototype = (to, from) => {
|
|
const fromPrototype = Object.getPrototypeOf(from);
|
|
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
return;
|
|
}
|
|
|
|
Object.setPrototypeOf(to, fromPrototype);
|
|
};
|
|
|
|
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`;
|
|
|
|
const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');
|
|
const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');
|
|
|
|
// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.
|
|
// We use `bind()` instead of a closure for the same reason.
|
|
// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.
|
|
const changeToString = (to, from, name) => {
|
|
const withName = name === '' ? '' : `with ${name.trim()}() `;
|
|
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
// Ensure `to.toString.toString` is non-enumerable and has the same `same`
|
|
Object.defineProperty(newToString, 'name', toStringName);
|
|
Object.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});
|
|
};
|
|
|
|
function mimicFunction(to, from, {ignoreNonConfigurable = false} = {}) {
|
|
const {name} = to;
|
|
|
|
for (const property of Reflect.ownKeys(from)) {
|
|
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
}
|
|
|
|
changePrototype(to, from);
|
|
changeToString(to, from, name);
|
|
|
|
return to;
|
|
}
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
|
|
|
|
|
|
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;
|
|
};
|
|
|
|
mimicFunction(onetime, function_);
|
|
calledFunctions.set(onetime, callCount);
|
|
|
|
return onetime;
|
|
};
|
|
|
|
onetime.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_);
|
|
};
|
|
|
|
/* harmony default export */ const node_modules_onetime = (onetime);
|
|
|
|
// EXTERNAL MODULE: external "os"
|
|
var external_os_ = __nccwpck_require__(2037);
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/realtime.js
|
|
|
|
const getRealtimeSignals=function(){
|
|
const length=SIGRTMAX-SIGRTMIN+1;
|
|
return Array.from({length},getRealtimeSignal);
|
|
};
|
|
|
|
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;
|
|
//# sourceMappingURL=realtime.js.map
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/core.js
|
|
|
|
|
|
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"}];
|
|
//# sourceMappingURL=core.js.map
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/signals.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getSignals=function(){
|
|
const realtimeSignals=getRealtimeSignals();
|
|
const signals=[...SIGNALS,...realtimeSignals].map(normalizeSignal);
|
|
return signals;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const normalizeSignal=function({
|
|
name,
|
|
number:defaultNumber,
|
|
description,
|
|
action,
|
|
forced=false,
|
|
standard})
|
|
{
|
|
const{
|
|
signals:{[name]:constantSignal}}=
|
|
external_os_.constants;
|
|
const supported=constantSignal!==undefined;
|
|
const number=supported?constantSignal:defaultNumber;
|
|
return{name,number,description,supported,action,forced,standard};
|
|
};
|
|
//# sourceMappingURL=signals.js.map
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/human-signals@3.0.1/node_modules/human-signals/build/src/main.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getSignalsByName=function(){
|
|
const 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();
|
|
|
|
|
|
|
|
|
|
const getSignalsByNumber=function(){
|
|
const signals=getSignals();
|
|
const length=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})=>external_os_.constants.signals[name]===number);
|
|
|
|
if(signal!==undefined){
|
|
return signal;
|
|
}
|
|
|
|
return signals.find((signalA)=>signalA.number===number);
|
|
};
|
|
|
|
const signalsByNumber=getSignalsByNumber();
|
|
//# sourceMappingURL=main.js.map
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/error.js
|
|
|
|
|
|
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;
|
|
};
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/stdio.js
|
|
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]);
|
|
};
|
|
|
|
// `ipc` is pushed unless it is already present
|
|
const normalizeStdioNode = 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'];
|
|
};
|
|
|
|
;// CONCATENATED MODULE: external "node:os"
|
|
const external_node_os_namespaceObject = require("node:os");
|
|
// EXTERNAL MODULE: ./node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
|
|
var signal_exit = __nccwpck_require__(4199);
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/kill.js
|
|
|
|
|
|
|
|
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) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
|
|
const isSigterm = signal => signal === external_node_os_namespaceObject.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 = signal_exit(() => {
|
|
spawned.kill();
|
|
});
|
|
|
|
return timedPromise.finally(() => {
|
|
removeExitHandler();
|
|
});
|
|
};
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
|
|
function isStream(stream) {
|
|
return stream !== null
|
|
&& typeof stream === 'object'
|
|
&& typeof stream.pipe === 'function';
|
|
}
|
|
|
|
function isWritableStream(stream) {
|
|
return isStream(stream)
|
|
&& stream.writable !== false
|
|
&& typeof stream._write === 'function'
|
|
&& typeof stream._writableState === 'object';
|
|
}
|
|
|
|
function isReadableStream(stream) {
|
|
return isStream(stream)
|
|
&& stream.readable !== false
|
|
&& typeof stream._read === 'function'
|
|
&& typeof stream._readableState === 'object';
|
|
}
|
|
|
|
function isDuplexStream(stream) {
|
|
return isWritableStream(stream)
|
|
&& isReadableStream(stream);
|
|
}
|
|
|
|
function isTransformStream(stream) {
|
|
return isDuplexStream(stream)
|
|
&& typeof stream._transform === 'function';
|
|
}
|
|
|
|
// EXTERNAL MODULE: ./node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js
|
|
var get_stream = __nccwpck_require__(7337);
|
|
// EXTERNAL MODULE: ./node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
|
|
var merge_stream = __nccwpck_require__(5483);
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/stream.js
|
|
|
|
|
|
|
|
|
|
// `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 = merge_stream();
|
|
|
|
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 get_stream(stream, {encoding, maxBuffer});
|
|
}
|
|
|
|
return get_stream.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');
|
|
}
|
|
};
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/promise.js
|
|
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 => 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);
|
|
});
|
|
}
|
|
});
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/lib/command.js
|
|
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) => normalizeArgs(file, args).join(' ');
|
|
|
|
const getEscapedCommand = (file, args) => normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' ');
|
|
|
|
const SPACES_REGEXP = / +/g;
|
|
|
|
// Handle `execaCommand()`
|
|
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;
|
|
};
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/execa@6.1.0/node_modules/execa/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
|
|
|
|
const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {
|
|
const env = extendEnv ? {...external_node_process_namespaceObject.env, ...envOption} : envOption;
|
|
|
|
if (preferLocal) {
|
|
return npmRunPathEnv({env, cwd: localDir, execPath});
|
|
}
|
|
|
|
return env;
|
|
};
|
|
|
|
const handleArguments = (file, args, options = {}) => {
|
|
const parsed = cross_spawn._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 || external_node_process_namespaceObject.cwd(),
|
|
execPath: external_node_process_namespaceObject.execPath,
|
|
encoding: 'utf8',
|
|
reject: true,
|
|
cleanup: true,
|
|
all: false,
|
|
windowsHide: true,
|
|
...options,
|
|
};
|
|
|
|
options.env = getEnv(options);
|
|
|
|
options.stdio = normalizeStdio(options);
|
|
|
|
if (external_node_process_namespaceObject.platform === 'win32' && external_node_path_namespaceObject.basename(file, '.exe') === 'cmd') {
|
|
// #116
|
|
args.unshift('/q');
|
|
}
|
|
|
|
return {file, args, options, parsed};
|
|
};
|
|
|
|
const handleOutput = (options, value, error) => {
|
|
if (typeof value !== 'string' && !external_node_buffer_namespaceObject.Buffer.isBuffer(value)) {
|
|
// When `execaSync()` errors, we normalize it to '' to mimic `execa()`
|
|
return error === undefined ? undefined : '';
|
|
}
|
|
|
|
if (options.stripFinalNewline) {
|
|
return stripFinalNewline(value);
|
|
}
|
|
|
|
return value;
|
|
};
|
|
|
|
function 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 = external_node_child_process_namespaceObject.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 external_node_child_process_namespaceObject.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 || (parsed.options.signal ? parsed.options.signal.aborted : false),
|
|
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 = node_modules_onetime(handlePromise);
|
|
|
|
handleInput(spawned, parsed.options.input);
|
|
|
|
spawned.all = makeAllStream(spawned, parsed.options);
|
|
|
|
return mergePromise(spawned, handlePromiseOnce);
|
|
}
|
|
|
|
function execaSync(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 = external_node_child_process_namespaceObject.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,
|
|
};
|
|
}
|
|
|
|
function execaCommand(command, options) {
|
|
const [file, ...args] = parseCommand(command);
|
|
return execa(file, args, options);
|
|
}
|
|
|
|
function execaCommandSync(command, options) {
|
|
const [file, ...args] = parseCommand(command);
|
|
return execaSync(file, args, options);
|
|
}
|
|
|
|
function execaNode(scriptPath, args, options = {}) {
|
|
if (args && !Array.isArray(args) && typeof args === 'object') {
|
|
options = args;
|
|
args = [];
|
|
}
|
|
|
|
const stdio = normalizeStdioNode(options);
|
|
const defaultExecArgv = external_node_process_namespaceObject.execArgv.filter(arg => !arg.startsWith('--inspect'));
|
|
|
|
const {
|
|
nodePath = external_node_process_namespaceObject.execPath,
|
|
nodeOptions = defaultExecArgv,
|
|
} = options;
|
|
|
|
return execa(
|
|
nodePath,
|
|
[
|
|
...nodeOptions,
|
|
scriptPath,
|
|
...(Array.isArray(args) ? args : []),
|
|
],
|
|
{
|
|
...options,
|
|
stdin: undefined,
|
|
stdout: undefined,
|
|
stderr: undefined,
|
|
stdio,
|
|
shell: false,
|
|
},
|
|
);
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
/******/ });
|
|
/************************************************************************/
|
|
/******/ // The module cache
|
|
/******/ var __webpack_module_cache__ = {};
|
|
/******/
|
|
/******/ // The require function
|
|
/******/ function __nccwpck_require__(moduleId) {
|
|
/******/ // Check if module is in cache
|
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
/******/ if (cachedModule !== undefined) {
|
|
/******/ return cachedModule.exports;
|
|
/******/ }
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
/******/ // no module.id needed
|
|
/******/ // no module.loaded needed
|
|
/******/ exports: {}
|
|
/******/ };
|
|
/******/
|
|
/******/ // Execute the module function
|
|
/******/ var threw = true;
|
|
/******/ try {
|
|
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
|
|
/******/ threw = false;
|
|
/******/ } finally {
|
|
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
/******/ }
|
|
/******/
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
/******/
|
|
/************************************************************************/
|
|
/******/ /* webpack/runtime/define property getters */
|
|
/******/ (() => {
|
|
/******/ // define getter functions for harmony exports
|
|
/******/ __nccwpck_require__.d = (exports, definition) => {
|
|
/******/ for(var key in definition) {
|
|
/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
/******/ }
|
|
/******/ }
|
|
/******/ };
|
|
/******/ })();
|
|
/******/
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
/******/ (() => {
|
|
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
/******/ })();
|
|
/******/
|
|
/******/ /* webpack/runtime/make namespace object */
|
|
/******/ (() => {
|
|
/******/ // define __esModule on exports
|
|
/******/ __nccwpck_require__.r = (exports) => {
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
/******/ }
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
/******/ };
|
|
/******/ })();
|
|
/******/
|
|
/******/ /* webpack/runtime/compat */
|
|
/******/
|
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
/******/
|
|
/************************************************************************/
|
|
/******/
|
|
/******/ // startup
|
|
/******/ // Load entry module and return exports
|
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
/******/ var __webpack_exports__ = __nccwpck_require__(8690);
|
|
/******/ module.exports = __webpack_exports__;
|
|
/******/
|
|
/******/ })()
|
|
;
|
|
//# sourceMappingURL=index.js.map
|