Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
4
node_modules/execa/index.d.ts
generated
vendored
4
node_modules/execa/index.d.ts
generated
vendored
|
|
@ -27,7 +27,7 @@ export type CommonOptions<EncodingType> = {
|
|||
|
||||
If you `$ npm install foo`, you can then `execa('foo')`.
|
||||
|
||||
@default `true` with `$`/`$.sync`, `false` otherwise
|
||||
@default `true` with `$`, `false` otherwise
|
||||
*/
|
||||
readonly preferLocal?: boolean;
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ export type CommonOptions<EncodingType> = {
|
|||
/**
|
||||
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
||||
|
||||
@default 'pipe'
|
||||
@default `inherit` with `$`, `pipe` otherwise
|
||||
*/
|
||||
readonly stdin?: StdioOption;
|
||||
|
||||
|
|
|
|||
26
node_modules/execa/index.js
generated
vendored
26
node_modules/execa/index.js
generated
vendored
|
|
@ -232,25 +232,39 @@ export function execaSync(file, args, options) {
|
|||
};
|
||||
}
|
||||
|
||||
const normalizeScriptStdin = ({input, inputFile, stdio}) => input === undefined && inputFile === undefined && stdio === undefined
|
||||
? {stdin: 'inherit'}
|
||||
: {};
|
||||
|
||||
const normalizeScriptOptions = (options = {}) => ({
|
||||
preferLocal: true,
|
||||
...normalizeScriptStdin(options),
|
||||
...options,
|
||||
});
|
||||
|
||||
function create$(options) {
|
||||
function $(templatesOrOptions, ...expressions) {
|
||||
if (Array.isArray(templatesOrOptions)) {
|
||||
const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
||||
return execa(file, args, options);
|
||||
if (!Array.isArray(templatesOrOptions)) {
|
||||
return create$({...options, ...templatesOrOptions});
|
||||
}
|
||||
|
||||
return create$({...options, ...templatesOrOptions});
|
||||
const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
|
||||
return execa(file, args, normalizeScriptOptions(options));
|
||||
}
|
||||
|
||||
$.sync = (templates, ...expressions) => {
|
||||
if (!Array.isArray(templates)) {
|
||||
throw new TypeError('Please use $(options).sync`command` instead of $.sync(options)`command`.');
|
||||
}
|
||||
|
||||
const [file, ...args] = parseTemplates(templates, expressions);
|
||||
return execaSync(file, args, options);
|
||||
return execaSync(file, args, normalizeScriptOptions(options));
|
||||
};
|
||||
|
||||
return $;
|
||||
}
|
||||
|
||||
export const $ = create$({preferLocal: true});
|
||||
export const $ = create$();
|
||||
|
||||
export function execaCommand(command, options) {
|
||||
const [file, ...args] = parseCommand(command);
|
||||
|
|
|
|||
42
node_modules/execa/lib/command.js
generated
vendored
42
node_modules/execa/lib/command.js
generated
vendored
|
|
@ -76,21 +76,45 @@ const parseExpression = expression => {
|
|||
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
||||
};
|
||||
|
||||
const parseTemplate = (template, index, templates, expressions) => {
|
||||
const concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0
|
||||
? [...tokens, ...nextTokens]
|
||||
: [
|
||||
...tokens.slice(0, -1),
|
||||
`${tokens[tokens.length - 1]}${nextTokens[0]}`,
|
||||
...nextTokens.slice(1),
|
||||
];
|
||||
|
||||
const parseTemplate = ({templates, expressions, tokens, index, template}) => {
|
||||
const templateString = template ?? templates.raw[index];
|
||||
const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
|
||||
const newTokens = concatTokens(
|
||||
tokens,
|
||||
templateTokens,
|
||||
templateString.startsWith(' '),
|
||||
);
|
||||
|
||||
if (index === expressions.length) {
|
||||
return templateTokens;
|
||||
return newTokens;
|
||||
}
|
||||
|
||||
const expression = expressions[index];
|
||||
|
||||
return Array.isArray(expression)
|
||||
? [...templateTokens, ...expression.map(expression => parseExpression(expression))]
|
||||
: [...templateTokens, parseExpression(expression)];
|
||||
const expressionTokens = Array.isArray(expression)
|
||||
? expression.map(expression => parseExpression(expression))
|
||||
: [parseExpression(expression)];
|
||||
return concatTokens(
|
||||
newTokens,
|
||||
expressionTokens,
|
||||
templateString.endsWith(' '),
|
||||
);
|
||||
};
|
||||
|
||||
export const parseTemplates = (templates, expressions) => {
|
||||
let tokens = [];
|
||||
|
||||
for (const [index, template] of templates.entries()) {
|
||||
tokens = parseTemplate({templates, expressions, tokens, index, template});
|
||||
}
|
||||
|
||||
return tokens;
|
||||
};
|
||||
|
||||
export const parseTemplates = (templates, expressions) => templates.flatMap(
|
||||
(template, index) => parseTemplate(template, index, templates, expressions),
|
||||
);
|
||||
|
|
|
|||
2
node_modules/execa/package.json
generated
vendored
2
node_modules/execa/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "execa",
|
||||
"version": "7.1.0",
|
||||
"version": "7.1.1",
|
||||
"description": "Process execution for humans",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/execa",
|
||||
|
|
|
|||
4
node_modules/execa/readme.md
generated
vendored
4
node_modules/execa/readme.md
generated
vendored
|
|
@ -467,7 +467,7 @@ Kill the spawned process when the parent process exits unless either:
|
|||
#### preferLocal
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true` with [`$`](#command)/[`$.sync`](#synccommand), `false` otherwise
|
||||
Default: `true` with [`$`](#command), `false` otherwise
|
||||
|
||||
Prefer locally installed binaries when looking for a binary to execute.\
|
||||
If you `$ npm install foo`, you can then `execa('foo')`.
|
||||
|
|
@ -521,7 +521,7 @@ If the input is not a file, use the [`input` option](#input) instead.
|
|||
#### stdin
|
||||
|
||||
Type: `string | number | Stream | undefined`\
|
||||
Default: `pipe`
|
||||
Default: `inherit` with [`$`](#command), `pipe` otherwise
|
||||
|
||||
Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue