Bump @ava/typescript from 3.0.1 to 4.0.0 (#1576)

* Bump @ava/typescript from 3.0.1 to 4.0.0

Bumps [@ava/typescript](https://github.com/avajs/typescript) from 3.0.1 to 4.0.0.
- [Release notes](https://github.com/avajs/typescript/releases)
- [Commits](https://github.com/avajs/typescript/compare/v3.0.1...v4.0.0)

---
updated-dependencies:
- dependency-name: "@ava/typescript"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@github.com>
This commit is contained in:
dependabot[bot]
2023-03-13 14:10:40 -07:00
committed by GitHub
parent ec298233c1
commit 19f00dc212
68 changed files with 2374 additions and 1754 deletions

119
node_modules/execa/index.js generated vendored
View File

@@ -1,16 +1,19 @@
'use strict';
const path = require('path');
const childProcess = require('child_process');
const crossSpawn = require('cross-spawn');
const stripFinalNewline = require('strip-final-newline');
const npmRunPath = require('npm-run-path');
const onetime = require('onetime');
const makeError = require('./lib/error');
const normalizeStdio = require('./lib/stdio');
const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = require('./lib/kill');
const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream');
const {mergePromise, getSpawnedPromise} = require('./lib/promise');
const {joinCommand, parseCommand, getEscapedCommand} = require('./lib/command');
import {Buffer} from 'node:buffer';
import path from 'node:path';
import childProcess from 'node:child_process';
import process from 'node:process';
import crossSpawn from 'cross-spawn';
import stripFinalNewline from 'strip-final-newline';
import {npmRunPathEnv} from 'npm-run-path';
import onetime from 'onetime';
import {makeError} from './lib/error.js';
import {normalizeStdio, normalizeStdioNode} from './lib/stdio.js';
import {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} from './lib/kill.js';
import {addPipeMethods} from './lib/pipe.js';
import {handleInput, getSpawnedResult, makeAllStream, handleInputSync} from './lib/stream.js';
import {mergePromise, getSpawnedPromise} from './lib/promise.js';
import {joinCommand, parseCommand, parseTemplates, getEscapedCommand} from './lib/command.js';
import {logCommand, verboseDefault} from './lib/verbose.js';
const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;
@@ -18,7 +21,7 @@ const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) =>
const env = extendEnv ? {...process.env, ...envOption} : envOption;
if (preferLocal) {
return npmRunPath.env({env, cwd: localDir, execPath});
return npmRunPathEnv({env, cwd: localDir, execPath});
}
return env;
@@ -43,7 +46,8 @@ const handleArguments = (file, args, options = {}) => {
cleanup: true,
all: false,
windowsHide: true,
...options
verbose: verboseDefault,
...options,
};
options.env = getEnv(options);
@@ -60,7 +64,7 @@ const handleArguments = (file, args, options = {}) => {
const handleOutput = (options, value, error) => {
if (typeof value !== 'string' && !Buffer.isBuffer(value)) {
// When `execa.sync()` errors, we normalize it to '' to mimic `execa()`
// When `execaSync()` errors, we normalize it to '' to mimic `execa()`
return error === undefined ? undefined : '';
}
@@ -71,10 +75,11 @@ const handleOutput = (options, value, error) => {
return value;
};
const execa = (file, args, options) => {
export function execa(file, args, options) {
const parsed = handleArguments(file, args, options);
const command = joinCommand(file, args);
const escapedCommand = getEscapedCommand(file, args);
logCommand(escapedCommand, parsed.options);
validateTimeout(parsed.options);
@@ -94,9 +99,10 @@ const execa = (file, args, options) => {
parsed,
timedOut: false,
isCanceled: false,
killed: false
killed: false,
}));
return mergePromise(dummySpawned, errorPromise);
mergePromise(dummySpawned, errorPromise);
return dummySpawned;
}
const spawnedPromise = getSpawnedPromise(spawned);
@@ -126,8 +132,8 @@ const execa = (file, args, options) => {
escapedCommand,
parsed,
timedOut,
isCanceled: context.isCanceled,
killed: spawned.killed
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
killed: spawned.killed,
});
if (!parsed.options.reject) {
@@ -147,31 +153,32 @@ const execa = (file, args, options) => {
failed: false,
timedOut: false,
isCanceled: false,
killed: false
killed: false,
};
};
const handlePromiseOnce = onetime(handlePromise);
handleInput(spawned, parsed.options.input);
handleInput(spawned, parsed.options);
spawned.all = makeAllStream(spawned, parsed.options);
return mergePromise(spawned, handlePromiseOnce);
};
addPipeMethods(spawned);
mergePromise(spawned, handlePromiseOnce);
return spawned;
}
module.exports = execa;
module.exports.sync = (file, args, options) => {
export function execaSync(file, args, options) {
const parsed = handleArguments(file, args, options);
const command = joinCommand(file, args);
const escapedCommand = getEscapedCommand(file, args);
logCommand(escapedCommand, parsed.options);
validateInputSync(parsed.options);
const input = handleInputSync(parsed.options);
let result;
try {
result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);
result = childProcess.spawnSync(parsed.file, parsed.args, {...parsed.options, input});
} catch (error) {
throw makeError({
error,
@@ -183,7 +190,7 @@ module.exports.sync = (file, args, options) => {
parsed,
timedOut: false,
isCanceled: false,
killed: false
killed: false,
});
}
@@ -202,7 +209,7 @@ module.exports.sync = (file, args, options) => {
parsed,
timedOut: result.error && result.error.code === 'ETIMEDOUT',
isCanceled: false,
killed: result.signal !== null
killed: result.signal !== null,
});
if (!parsed.options.reject) {
@@ -221,32 +228,52 @@ module.exports.sync = (file, args, options) => {
failed: false,
timedOut: false,
isCanceled: false,
killed: false
killed: false,
};
};
}
module.exports.command = (command, options) => {
function create$(options) {
function $(templatesOrOptions, ...expressions) {
if (Array.isArray(templatesOrOptions)) {
const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
return execa(file, args, options);
}
return create$({...options, ...templatesOrOptions});
}
$.sync = (templates, ...expressions) => {
const [file, ...args] = parseTemplates(templates, expressions);
return execaSync(file, args, options);
};
return $;
}
export const $ = create$({preferLocal: true});
export function execaCommand(command, options) {
const [file, ...args] = parseCommand(command);
return execa(file, args, options);
};
}
module.exports.commandSync = (command, options) => {
export function execaCommandSync(command, options) {
const [file, ...args] = parseCommand(command);
return execa.sync(file, args, options);
};
return execaSync(file, args, options);
}
module.exports.node = (scriptPath, args, options = {}) => {
export function execaNode(scriptPath, args, options = {}) {
if (args && !Array.isArray(args) && typeof args === 'object') {
options = args;
args = [];
}
const stdio = normalizeStdio.node(options);
const stdio = normalizeStdioNode(options);
const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));
const {
nodePath = process.execPath,
nodeOptions = defaultExecArgv
nodeOptions = defaultExecArgv,
} = options;
return execa(
@@ -254,7 +281,7 @@ module.exports.node = (scriptPath, args, options = {}) => {
[
...nodeOptions,
scriptPath,
...(Array.isArray(args) ? args : [])
...(Array.isArray(args) ? args : []),
],
{
...options,
@@ -262,7 +289,7 @@ module.exports.node = (scriptPath, args, options = {}) => {
stdout: undefined,
stderr: undefined,
stdio,
shell: false
}
shell: false,
},
);
};
}