Skip to content

Commit 5d64878

Browse files
committedDec 3, 2020
Upgrade dependencies
1 parent bdbd975 commit 5d64878

File tree

7 files changed

+46
-47
lines changed

7 files changed

+46
-47
lines changed
 

‎index.d.ts

+14-15
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ declare namespace execa {
334334

335335
interface ExecaSyncError<StdoutErrorType = string>
336336
extends Error,
337-
ExecaReturnBase<StdoutErrorType> {
337+
ExecaReturnBase<StdoutErrorType> {
338338
/**
339339
Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.
340340
@@ -384,33 +384,33 @@ declare namespace execa {
384384
}
385385

386386
interface ExecaChildPromise<StdoutErrorType> {
387+
/**
388+
Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
389+
390+
This is `undefined` if either:
391+
- the `all` option is `false` (the default value)
392+
- both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
393+
*/
394+
all?: ReadableStream;
395+
387396
catch<ResultType = never>(
388397
onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>
389398
): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
390399

391400
/**
392401
Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
393402
*/
394-
kill(signal?: string, options?: execa.KillOptions): void;
403+
kill(signal?: string, options?: KillOptions): void;
395404

396405
/**
397406
Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
398407
*/
399408
cancel(): void;
400-
401-
/**
402-
Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
403-
404-
This is `undefined` if either:
405-
- the `all` option is `false` (the default value)
406-
- both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
407-
*/
408-
all?: ReadableStream;
409409
}
410410

411411
type ExecaChildProcess<StdoutErrorType = string> = ChildProcess &
412-
ExecaChildPromise<StdoutErrorType> &
413-
Promise<ExecaReturnValue<StdoutErrorType>>;
412+
ExecaChildPromise<StdoutErrorType> &
413+
Promise<ExecaReturnValue<StdoutErrorType>>;
414414
}
415415

416416
declare const execa: {
@@ -432,7 +432,6 @@ declare const execa: {
432432
console.log(stdout);
433433
//=> 'unicorns'
434434
435-
436435
// Cancelling a spawned process
437436
438437
const subprocess = execa('node');
@@ -465,7 +464,7 @@ declare const execa: {
465464
): execa.ExecaChildProcess<Buffer>;
466465
(file: string, options?: execa.Options): execa.ExecaChildProcess;
467466
(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<
468-
Buffer
467+
Buffer
469468
>;
470469

471470
/**

‎index.test-d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {expectType, expectError} from 'tsd';
2-
import {Readable as ReadableStream} from 'stream'
2+
import {Readable as ReadableStream} from 'stream';
33
import execa = require('.');
44
import {
55
ExecaReturnValue,
@@ -12,7 +12,7 @@ import {
1212
try {
1313
const execaPromise = execa('unicorns');
1414
execaPromise.cancel();
15-
expectType<ReadableStream | undefined>(execaPromise.all)
15+
expectType<ReadableStream | undefined>(execaPromise.all);
1616

1717
const unicornsResult = await execaPromise;
1818
expectType<string>(unicornsResult.command);
@@ -26,7 +26,7 @@ try {
2626
expectType<boolean>(unicornsResult.killed);
2727
expectType<string | undefined>(unicornsResult.signal);
2828
expectType<string | undefined>(unicornsResult.signalDescription);
29-
} catch (error) {
29+
} catch (error) { // eslint-disable-line @typescript-eslint/no-implicit-any-catch
3030
const execaError: ExecaError = error;
3131

3232
expectType<string>(execaError.message);
@@ -57,7 +57,7 @@ try {
5757
expectType<boolean>(unicornsResult.killed);
5858
expectType<string | undefined>(unicornsResult.signal);
5959
expectType<string | undefined>(unicornsResult.signalDescription);
60-
} catch (error) {
60+
} catch (error) { // eslint-disable-line @typescript-eslint/no-implicit-any-catch
6161
const execaError: ExecaSyncError = error;
6262

6363
expectType<string>(execaError.message);

‎lib/stdio.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
'use strict';
22
const aliases = ['stdin', 'stdout', 'stderr'];
33

4-
const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined);
4+
const hasAlias = options => aliases.some(alias => options[alias] !== undefined);
55

6-
const normalizeStdio = opts => {
7-
if (!opts) {
6+
const normalizeStdio = options => {
7+
if (!options) {
88
return;
99
}
1010

11-
const {stdio} = opts;
11+
const {stdio} = options;
1212

1313
if (stdio === undefined) {
14-
return aliases.map(alias => opts[alias]);
14+
return aliases.map(alias => options[alias]);
1515
}
1616

17-
if (hasAlias(opts)) {
17+
if (hasAlias(options)) {
1818
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`);
1919
}
2020

@@ -33,8 +33,8 @@ const normalizeStdio = opts => {
3333
module.exports = normalizeStdio;
3434

3535
// `ipc` is pushed unless it is already present
36-
module.exports.node = opts => {
37-
const stdio = normalizeStdio(opts);
36+
module.exports.node = options => {
37+
const stdio = normalizeStdio(options);
3838

3939
if (stdio === 'ipc') {
4040
return 'ipc';

‎package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,27 @@
3939
"local"
4040
],
4141
"dependencies": {
42-
"cross-spawn": "^7.0.0",
43-
"get-stream": "^5.0.0",
44-
"human-signals": "^1.1.1",
42+
"cross-spawn": "^7.0.3",
43+
"get-stream": "^6.0.0",
44+
"human-signals": "^2.1.0",
4545
"is-stream": "^2.0.0",
4646
"merge-stream": "^2.0.0",
47-
"npm-run-path": "^4.0.0",
48-
"onetime": "^5.1.0",
49-
"signal-exit": "^3.0.2",
47+
"npm-run-path": "^4.0.1",
48+
"onetime": "^5.1.2",
49+
"signal-exit": "^3.0.3",
5050
"strip-final-newline": "^2.0.0"
5151
},
5252
"devDependencies": {
53-
"@types/node": "^12.12.18",
54-
"ava": "^2.1.0",
55-
"coveralls": "^3.0.9",
56-
"get-node": "^6.6.0",
53+
"@types/node": "^14.14.10",
54+
"ava": "^2.4.0",
55+
"coveralls": "^3.1.0",
56+
"get-node": "^11.0.1",
5757
"is-running": "^2.1.0",
58-
"nyc": "^14.1.1",
59-
"p-event": "^4.1.0",
58+
"nyc": "^15.1.0",
59+
"p-event": "^4.2.0",
6060
"tempfile": "^3.0.0",
61-
"tsd": "^0.11.0",
62-
"xo": "^0.25.3"
61+
"tsd": "^0.13.1",
62+
"xo": "^0.35.0"
6363
},
6464
"nyc": {
6565
"exclude": [

‎test/error.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ test('exitCode is 0 on success', async t => {
4141
t.is(exitCode, 0);
4242
});
4343

44-
const testExitCode = async (t, num) => {
45-
const {exitCode} = await t.throwsAsync(execa('exit', [`${num}`]), {message: getExitRegExp(num)});
46-
t.is(exitCode, num);
44+
const testExitCode = async (t, number) => {
45+
const {exitCode} = await t.throwsAsync(execa('exit', [`${number}`]), {message: getExitRegExp(number)});
46+
t.is(exitCode, number);
4747
};
4848

4949
test('exitCode is 2', testExitCode, 2);

‎test/kill.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if (process.platform !== 'win32') {
6363

6464
test('`forceKillAfterTimeout` should not be NaN', t => {
6565
t.throws(() => {
66-
execa('noop').kill('SIGTERM', {forceKillAfterTimeout: NaN});
66+
execa('noop').kill('SIGTERM', {forceKillAfterTimeout: Number.NaN});
6767
}, {instanceOf: TypeError, message: /non-negative integer/});
6868
});
6969

‎test/stdio.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import util from 'util';
1+
import {inspect} from 'util';
22
import test from 'ava';
33
import normalizeStdio from '../lib/stdio';
44

@@ -13,7 +13,7 @@ const macro = (t, input, expected, func) => {
1313
t.deepEqual(func(input), expected);
1414
};
1515

16-
const macroTitle = name => (title, input) => `${name} ${(util.inspect(input))}`;
16+
const macroTitle = name => (title, input) => `${name} ${(inspect(input))}`;
1717

1818
const stdioMacro = (...args) => macro(...args, normalizeStdio);
1919
stdioMacro.title = macroTitle('execa()');

0 commit comments

Comments
 (0)
Please sign in to comment.