Rename some types (#1009)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent c6ce870 · Browse files · 21 files·+238 added−238 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
21 files+238 added−238 removed
- other:+238 added−238 removed
Provenance
- Commit
2ef9186- Tree
7cfa408- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
c6ce870
21 files changed+238 added−238 removed
modified:docs/api.md+9 added-9 removed
13 unmodified lines14 15 `file`: `string | URL`\16 `arguments`: `string[]`\17 `options`: [`Options`](#options)\18-_Returns_: [`ExecaResultPromise`](#return-value)18+_Returns_: [`ResultPromise`](#return-value)19 20 Executes a command using `file ...arguments`.21 22 More info on the [syntax](execution.md#array-syntax) and [escaping](escaping.md#array-syntax).2 unmodified lines25 ### execa(options)\`command\`26 27 `command`: `string`\28 `options`: [`Options`](#options)\29-_Returns_: [`ExecaResultPromise`](#return-value)29+_Returns_: [`ResultPromise`](#return-value)30 31 Executes a command. `command` is a [template string](execution.md#template-string-syntax) that includes both the `file` and its `arguments`.32 33 More info on the [syntax](execution.md#template-string-syntax) and [escaping](escaping.md#template-string-syntax).9 unmodified lines43 44 ### execaSync(file, arguments?, options?)45 ### execaSync\`command\`46 47-_Returns_: [`ExecaSyncResult`](#return-value)47+_Returns_: [`SyncResult`](#return-value)48 49 Same as [`execa()`](#execafile-arguments-options) but synchronous.50 51 Returns or throws a subprocess [`result`](#result). The [`subprocess`](#subprocess) is not returned: its methods and properties are not available.4 unmodified lines56 57 `file`: `string | URL`\58 `arguments`: `string[]`\59 `options`: [`Options`](#options)\60-_Returns_: [`ExecaResultPromise`](#return-value)60+_Returns_: [`ResultPromise`](#return-value)61 62 Same as [`execa()`](#execafile-arguments-options) but using [script-friendly default options](scripts.md#script-files).63 64 Just like `execa()`, this can use the [template string syntax](execution.md#template-string-syntax) or [bind options](execution.md#globalshared-options). It can also be [run synchronously](#execasyncfile-arguments-options) using `$.sync()` or `$.s()`.6 unmodified lines71 72 `scriptPath`: `string | URL`\73 `arguments`: `string[]`\74 `options`: [`Options`](#options)\75-_Returns_: [`ExecaResultPromise`](#return-value)75+_Returns_: [`ResultPromise`](#return-value)76 77 Same as [`execa()`](#execafile-arguments-options) but using the [`node: true`](#optionsnode) option.78 Executes a Node.js file using `node scriptPath ...arguments`.79 6 unmodified lines86 ### execaCommand(command, options?)87 88 `command`: `string`\89 `options`: [`Options`](#options)\90-_Returns_: [`ExecaResultPromise`](#return-value)90+_Returns_: [`ResultPromise`](#return-value)91 92 Executes a command. `command` is a string that includes both the `file` and its `arguments`.93 94 This is only intended for very specific cases, such as a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop). This should be avoided otherwise.3 unmodified lines98 [More info.](escaping.md#user-defined-input)99 100 ## Return value101 102-_Type_: `ExecaResultPromise`102+_Type_: `ResultPromise`103 104 The return value of all [asynchronous methods](#methods) is both:105 - the [subprocess](#subprocess).106 - a `Promise` either resolving with its successful [`result`](#result), or rejecting with its [`error`](#execaerror).1 unmodified line108 [More info.](execution.md#subprocess)109 110 ## Subprocess111 112-_Type_: `ExecaSubprocess`112+_Type_: `Subprocess`113 114 [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following methods and properties.115 116 ### subprocess\[Symbol.asyncIterator\]()38 unmodified lines155 [More info.](pipe.md#template-string-syntax)156 157 ### subprocess.pipe(secondSubprocess, pipeOptions?)158 159-`secondSubprocess`: [`ExecaResultPromise`](#return-value)\159+`secondSubprocess`: [`ResultPromise`](#return-value)\160 `pipeOptions`: [`PipeOptions`](#pipeoptions)\161 _Returns_: [`Promise<Result>`](#result)162 163 Like [`subprocess.pipe(file, arguments?, options?)`](#subprocesspipefile-arguments-options) but using the [return value](#return-value) of another [`execa()`](#execafile-arguments-options) call instead.880 unmodified linesmodified:test-d/methods/command.test-d.ts+23 added-23 removed
123456756789101112131415161617181920212223242425262728293031293031323334353435363738394 unmodified lines4445464748494849505152535454555657582 unmodified lines616263646565666768696970717273747575767778798077787980818283842 unmodified lines87888990919291929394959697989999100import {expectType, expectError, expectAssignable} from 'tsd';import { execaCommand, execaCommandSync, type ExecaResult, type ExecaResultPromise, type ExecaSyncResult, type Result, type ResultPromise, type SyncResult,} from '../../index.js';
const fileUrl = new URL('file:///test');const stringArray = ['foo', 'bar'] as const;
expectError(execaCommand());expectError(execaCommand(true));expectError(execaCommand(['unicorns', 'arg']));expectAssignable<ExecaResultPromise>(execaCommand('unicorns'));expectAssignable<ResultPromise>(execaCommand('unicorns'));expectError(execaCommand(fileUrl));
expectError(execaCommand('unicorns', []));expectError(execaCommand('unicorns', ['foo']));expectError(execaCommand('unicorns', 'foo'));expectError(execaCommand('unicorns', [true]));
expectAssignable<ExecaResultPromise>(execaCommand('unicorns', {}));expectAssignable<ResultPromise>(execaCommand('unicorns', {}));expectError(execaCommand('unicorns', [], {}));expectError(execaCommand('unicorns', [], []));expectError(execaCommand('unicorns', {other: true}));
expectAssignable<ExecaResultPromise>(execaCommand`unicorns`);expectType<ExecaResult<{}>>(await execaCommand('unicorns'));expectType<ExecaResult<{}>>(await execaCommand`unicorns`);expectAssignable<ResultPromise>(execaCommand`unicorns`);expectType<Result<{}>>(await execaCommand('unicorns'));expectType<Result<{}>>(await execaCommand`unicorns`);
expectAssignable<typeof execaCommand>(execaCommand({}));expectAssignable<ExecaResultPromise>(execaCommand({})('unicorns'));expectAssignable<ExecaResultPromise>(execaCommand({})`unicorns`);expectAssignable<ResultPromise>(execaCommand({})('unicorns'));expectAssignable<ResultPromise>(execaCommand({})`unicorns`);
expectAssignable<{stdout: string}>(await execaCommand('unicorns'));expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns', {encoding: 'buffer'}));expectAssignable<{stdout: string}>(await execaCommand({})('unicorns'));4 unmodified linesexpectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})`unicorns`);expectAssignable<{stdout: Uint8Array}>(await execaCommand({})({encoding: 'buffer'})`unicorns`);expectAssignable<{stdout: Uint8Array}>(await execaCommand({encoding: 'buffer'})({})`unicorns`);
expectType<ExecaResult<{}>>(await execaCommand`${'unicorns'}`);expectType<ExecaResult<{}>>(await execaCommand`unicorns ${'foo'}`);expectType<Result<{}>>(await execaCommand`${'unicorns'}`);expectType<Result<{}>>(await execaCommand`unicorns ${'foo'}`);expectError(await execaCommand`unicorns ${'foo'} ${'bar'}`);expectError(await execaCommand`unicorns ${1}`);expectError(await execaCommand`unicorns ${stringArray}`);expectError(await execaCommand`unicorns ${[1, 2]}`);expectType<ExecaResult<{}>>(await execaCommand`unicorns ${false.toString()}`);expectType<Result<{}>>(await execaCommand`unicorns ${false.toString()}`);expectError(await execaCommand`unicorns ${false}`);
expectError(await execaCommand`unicorns ${await execaCommand`echo foo`}`);expectError(await execaCommand`unicorns ${execaCommand`echo foo`}`);2 unmodified lines
expectError(execaCommandSync());expectError(execaCommandSync(true));expectError(execaCommandSync(['unicorns', 'arg']));expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns'));expectType<SyncResult<{}>>(execaCommandSync('unicorns'));expectError(execaCommandSync(fileUrl));expectError(execaCommandSync('unicorns', []));expectError(execaCommandSync('unicorns', ['foo']));expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns', {}));expectType<SyncResult<{}>>(execaCommandSync('unicorns', {}));expectError(execaCommandSync('unicorns', [], {}));expectError(execaCommandSync('unicorns', 'foo'));expectError(execaCommandSync('unicorns', [true]));expectError(execaCommandSync('unicorns', [], []));expectError(execaCommandSync('unicorns', {other: true}));expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns`);expectType<SyncResult<{}>>(execaCommandSync`unicorns`);expectAssignable<typeof execaCommandSync>(execaCommandSync({}));expectType<ExecaSyncResult<{}>>(execaCommandSync({})('unicorns'));expectType<ExecaSyncResult<{}>>(execaCommandSync({})`unicorns`);expectType<ExecaSyncResult<{}>>(execaCommandSync('unicorns'));expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns`);expectType<SyncResult<{}>>(execaCommandSync({})('unicorns'));expectType<SyncResult<{}>>(execaCommandSync({})`unicorns`);expectType<SyncResult<{}>>(execaCommandSync('unicorns'));expectType<SyncResult<{}>>(execaCommandSync`unicorns`);expectAssignable<{stdout: string}>(execaCommandSync('unicorns'));expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns', {encoding: 'buffer'}));expectAssignable<{stdout: string}>(execaCommandSync({})('unicorns'));expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})('unicorns'));2 unmodified linesexpectAssignable<{stdout: string}>(execaCommandSync({})`unicorns`);expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})`unicorns`);expectAssignable<{stdout: Uint8Array}>(execaCommandSync({})({encoding: 'buffer'})`unicorns`);expectAssignable<{stdout: Uint8Array}>(execaCommandSync({encoding: 'buffer'})({})`unicorns`);expectType<ExecaSyncResult<{}>>(execaCommandSync`${'unicorns'}`);expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns ${'foo'}`);expectType<SyncResult<{}>>(execaCommandSync`${'unicorns'}`);expectType<SyncResult<{}>>(execaCommandSync`unicorns ${'foo'}`);expectError(execaCommandSync`unicorns ${'foo'} ${'bar'}`);expectError(execaCommandSync`unicorns ${1}`);expectError(execaCommandSync`unicorns ${stringArray}`);expectError(execaCommandSync`unicorns ${[1, 2]}`);expectError(execaCommandSync`unicorns ${execaCommandSync`echo foo`}`);expectError(execaCommandSync`unicorns ${[execaCommandSync`echo foo`, 'bar']}`);expectType<ExecaSyncResult<{}>>(execaCommandSync`unicorns ${false.toString()}`);expectType<SyncResult<{}>>(execaCommandSync`unicorns ${false.toString()}`);expectError(execaCommandSync`unicorns ${false}`);modified:test-d/methods/main-async.test-d.ts+21 added-21 removed
122345678910111011121314131415161718191819202122232425232425262728292829303132336 unmodified lines4041424344454647484950444546474849505152535354555556import {expectType, expectError, expectAssignable} from 'tsd';import {execa, type ExecaResult, type ExecaResultPromise} from '../../index.js';import {execa, type Result, type ResultPromise} from '../../index.js';
const fileUrl = new URL('file:///test');const stringArray = ['foo', 'bar'] as const;
expectError(execa());expectError(execa(true));expectError(execa(['unicorns', 'arg']));expectAssignable<ExecaResultPromise>(execa('unicorns'));expectAssignable<ExecaResultPromise>(execa(fileUrl));expectAssignable<ResultPromise>(execa('unicorns'));expectAssignable<ResultPromise>(execa(fileUrl));
expectAssignable<ExecaResultPromise>(execa('unicorns', []));expectAssignable<ExecaResultPromise>(execa('unicorns', ['foo']));expectAssignable<ResultPromise>(execa('unicorns', []));expectAssignable<ResultPromise>(execa('unicorns', ['foo']));expectError(execa('unicorns', 'foo'));expectError(execa('unicorns', [true]));
expectAssignable<ExecaResultPromise>(execa('unicorns', {}));expectAssignable<ExecaResultPromise>(execa('unicorns', [], {}));expectAssignable<ResultPromise>(execa('unicorns', {}));expectAssignable<ResultPromise>(execa('unicorns', [], {}));expectError(execa('unicorns', [], []));expectError(execa('unicorns', {other: true}));
expectAssignable<ExecaResultPromise>(execa`unicorns`);expectType<ExecaResult<{}>>(await execa('unicorns'));expectType<ExecaResult<{}>>(await execa`unicorns`);expectAssignable<ResultPromise>(execa`unicorns`);expectType<Result<{}>>(await execa('unicorns'));expectType<Result<{}>>(await execa`unicorns`);
expectAssignable<typeof execa>(execa({}));expectAssignable<ExecaResultPromise>(execa({})('unicorns'));expectAssignable<ExecaResultPromise>(execa({})`unicorns`);expectAssignable<ResultPromise>(execa({})('unicorns'));expectAssignable<ResultPromise>(execa({})`unicorns`);
expectAssignable<{stdout: string}>(await execa('unicorns'));expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', {encoding: 'buffer'}));expectAssignable<{stdout: string}>(await execa('unicorns', ['foo']));6 unmodified linesexpectAssignable<{stdout: Uint8Array}>(await execa({encoding: 'buffer'})`unicorns`);expectAssignable<{stdout: Uint8Array}>(await execa({})({encoding: 'buffer'})`unicorns`);expectAssignable<{stdout: Uint8Array}>(await execa({encoding: 'buffer'})({})`unicorns`);
expectType<ExecaResult<{}>>(await execa`${'unicorns'}`);expectType<ExecaResult<{}>>(await execa`unicorns ${'foo'}`);expectType<ExecaResult<{}>>(await execa`unicorns ${'foo'} ${'bar'}`);expectType<ExecaResult<{}>>(await execa`unicorns ${1}`);expectType<ExecaResult<{}>>(await execa`unicorns ${stringArray}`);expectType<ExecaResult<{}>>(await execa`unicorns ${[1, 2]}`);expectType<ExecaResult<{}>>(await execa`unicorns ${false.toString()}`);expectType<Result<{}>>(await execa`${'unicorns'}`);expectType<Result<{}>>(await execa`unicorns ${'foo'}`);expectType<Result<{}>>(await execa`unicorns ${'foo'} ${'bar'}`);expectType<Result<{}>>(await execa`unicorns ${1}`);expectType<Result<{}>>(await execa`unicorns ${stringArray}`);expectType<Result<{}>>(await execa`unicorns ${[1, 2]}`);expectType<Result<{}>>(await execa`unicorns ${false.toString()}`);expectError(await execa`unicorns ${false}`);
expectType<ExecaResult<{}>>(await execa`unicorns ${await execa`echo foo`}`);expectType<Result<{}>>(await execa`unicorns ${await execa`echo foo`}`);expectError(await execa`unicorns ${execa`echo foo`}`);expectType<ExecaResult<{}>>(await execa`unicorns ${[await execa`echo foo`, 'bar']}`);expectType<Result<{}>>(await execa`unicorns ${[await execa`echo foo`, 'bar']}`);expectError(await execa`unicorns ${[execa`echo foo`, 'bar']}`);modified:test-d/methods/main-sync.test-d.ts+21 added-21 removed
1 import {expectType, expectError, expectAssignable} from 'tsd';2-import {execaSync, type ExecaSyncResult} from '../../index.js';2+import {execaSync, type SyncResult} from '../../index.js';3 4 const fileUrl = new URL('file:///test');5 const stringArray = ['foo', 'bar'] as const;6 7 expectError(execaSync());8 expectError(execaSync(true));9 expectError(execaSync(['unicorns', 'arg']));10-expectType<ExecaSyncResult<{}>>(execaSync('unicorns'));11-expectType<ExecaSyncResult<{}>>(execaSync(fileUrl));10+expectType<SyncResult<{}>>(execaSync('unicorns'));11+expectType<SyncResult<{}>>(execaSync(fileUrl));12 13-expectType<ExecaSyncResult<{}>>(execaSync('unicorns', []));14-expectType<ExecaSyncResult<{}>>(execaSync('unicorns', ['foo']));13+expectType<SyncResult<{}>>(execaSync('unicorns', []));14+expectType<SyncResult<{}>>(execaSync('unicorns', ['foo']));15 expectError(execaSync('unicorns', 'foo'));16 expectError(execaSync('unicorns', [true]));17 18-expectType<ExecaSyncResult<{}>>(execaSync('unicorns', {}));19-expectType<ExecaSyncResult<{}>>(execaSync('unicorns', [], {}));18+expectType<SyncResult<{}>>(execaSync('unicorns', {}));19+expectType<SyncResult<{}>>(execaSync('unicorns', [], {}));20 expectError(execaSync('unicorns', [], []));21 expectError(execaSync('unicorns', {other: true}));22 23-expectType<ExecaSyncResult<{}>>(execaSync`unicorns`);24-expectType<ExecaSyncResult<{}>>(execaSync('unicorns'));25-expectType<ExecaSyncResult<{}>>(execaSync`unicorns`);23+expectType<SyncResult<{}>>(execaSync`unicorns`);24+expectType<SyncResult<{}>>(execaSync('unicorns'));25+expectType<SyncResult<{}>>(execaSync`unicorns`);26 27 expectAssignable<typeof execaSync>(execaSync({}));28-expectType<ExecaSyncResult<{}>>(execaSync({})('unicorns'));29-expectType<ExecaSyncResult<{}>>(execaSync({})`unicorns`);28+expectType<SyncResult<{}>>(execaSync({})('unicorns'));29+expectType<SyncResult<{}>>(execaSync({})`unicorns`);30 31 expectAssignable<{stdout: string}>(execaSync('unicorns'));32 expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', {encoding: 'buffer'}));33 expectAssignable<{stdout: string}>(execaSync('unicorns', ['foo']));6 unmodified lines40 expectAssignable<{stdout: Uint8Array}>(execaSync({encoding: 'buffer'})`unicorns`);41 expectAssignable<{stdout: Uint8Array}>(execaSync({})({encoding: 'buffer'})`unicorns`);42 expectAssignable<{stdout: Uint8Array}>(execaSync({encoding: 'buffer'})({})`unicorns`);43 44-expectType<ExecaSyncResult<{}>>(execaSync`${'unicorns'}`);45-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${'foo'}`);46-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${'foo'} ${'bar'}`);47-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${1}`);48-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${stringArray}`);49-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${[1, 2]}`);50-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${false.toString()}`);44+expectType<SyncResult<{}>>(execaSync`${'unicorns'}`);45+expectType<SyncResult<{}>>(execaSync`unicorns ${'foo'}`);46+expectType<SyncResult<{}>>(execaSync`unicorns ${'foo'} ${'bar'}`);47+expectType<SyncResult<{}>>(execaSync`unicorns ${1}`);48+expectType<SyncResult<{}>>(execaSync`unicorns ${stringArray}`);49+expectType<SyncResult<{}>>(execaSync`unicorns ${[1, 2]}`);50+expectType<SyncResult<{}>>(execaSync`unicorns ${false.toString()}`);51 expectError(execaSync`unicorns ${false}`);52 53-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${execaSync`echo foo`}`);54-expectType<ExecaSyncResult<{}>>(execaSync`unicorns ${[execaSync`echo foo`, 'bar']}`);53+expectType<SyncResult<{}>>(execaSync`unicorns ${execaSync`echo foo`}`);54+expectType<SyncResult<{}>>(execaSync`unicorns ${[execaSync`echo foo`, 'bar']}`);modified:test-d/methods/node.test-d.ts+23 added-23 removed
1 import {expectType, expectError, expectAssignable} from 'tsd';2-import {execaNode, type ExecaResult, type ExecaResultPromise} from '../../index.js';2+import {execaNode, type Result, type ResultPromise} from '../../index.js';3 4 const fileUrl = new URL('file:///test');5 const stringArray = ['foo', 'bar'] as const;6 7 expectError(execaNode());8 expectError(execaNode(true));9 expectError(execaNode(['unicorns', 'arg']));10-expectAssignable<ExecaResultPromise>(execaNode('unicorns'));11-expectAssignable<ExecaResultPromise>(execaNode(fileUrl));10+expectAssignable<ResultPromise>(execaNode('unicorns'));11+expectAssignable<ResultPromise>(execaNode(fileUrl));12 13-expectAssignable<ExecaResultPromise>(execaNode('unicorns', []));14-expectAssignable<ExecaResultPromise>(execaNode('unicorns', ['foo']));13+expectAssignable<ResultPromise>(execaNode('unicorns', []));14+expectAssignable<ResultPromise>(execaNode('unicorns', ['foo']));15 expectError(execaNode('unicorns', 'foo'));16 expectError(execaNode('unicorns', [true]));17 18-expectAssignable<ExecaResultPromise>(execaNode('unicorns', {}));19-expectAssignable<ExecaResultPromise>(execaNode('unicorns', [], {}));18+expectAssignable<ResultPromise>(execaNode('unicorns', {}));19+expectAssignable<ResultPromise>(execaNode('unicorns', [], {}));20 expectError(execaNode('unicorns', [], []));21 expectError(execaNode('unicorns', {other: true}));22 23-expectAssignable<ExecaResultPromise>(execaNode`unicorns`);24-expectType<ExecaResult<{}>>(await execaNode('unicorns'));25-expectType<ExecaResult<{}>>(await execaNode`unicorns`);23+expectAssignable<ResultPromise>(execaNode`unicorns`);24+expectType<Result<{}>>(await execaNode('unicorns'));25+expectType<Result<{}>>(await execaNode`unicorns`);26 27 expectAssignable<typeof execaNode>(execaNode({}));28-expectAssignable<ExecaResultPromise>(execaNode({})('unicorns'));29-expectAssignable<ExecaResultPromise>(execaNode({})`unicorns`);28+expectAssignable<ResultPromise>(execaNode({})('unicorns'));29+expectAssignable<ResultPromise>(execaNode({})`unicorns`);30 31 expectAssignable<{stdout: string}>(await execaNode('unicorns'));32 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {encoding: 'buffer'}));33 expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo']));6 unmodified lines40 expectAssignable<{stdout: Uint8Array}>(await execaNode({encoding: 'buffer'})`unicorns`);41 expectAssignable<{stdout: Uint8Array}>(await execaNode({})({encoding: 'buffer'})`unicorns`);42 expectAssignable<{stdout: Uint8Array}>(await execaNode({encoding: 'buffer'})({})`unicorns`);43 44-expectType<ExecaResult<{}>>(await execaNode`${'unicorns'}`);45-expectType<ExecaResult<{}>>(await execaNode`unicorns ${'foo'}`);46-expectType<ExecaResult<{}>>(await execaNode`unicorns ${'foo'} ${'bar'}`);47-expectType<ExecaResult<{}>>(await execaNode`unicorns ${1}`);48-expectType<ExecaResult<{}>>(await execaNode`unicorns ${stringArray}`);49-expectType<ExecaResult<{}>>(await execaNode`unicorns ${[1, 2]}`);50-expectType<ExecaResult<{}>>(await execaNode`unicorns ${false.toString()}`);44+expectType<Result<{}>>(await execaNode`${'unicorns'}`);45+expectType<Result<{}>>(await execaNode`unicorns ${'foo'}`);46+expectType<Result<{}>>(await execaNode`unicorns ${'foo'} ${'bar'}`);47+expectType<Result<{}>>(await execaNode`unicorns ${1}`);48+expectType<Result<{}>>(await execaNode`unicorns ${stringArray}`);49+expectType<Result<{}>>(await execaNode`unicorns ${[1, 2]}`);50+expectType<Result<{}>>(await execaNode`unicorns ${false.toString()}`);51 expectError(await execaNode`unicorns ${false}`);52 53-expectType<ExecaResult<{}>>(await execaNode`unicorns ${await execaNode`echo foo`}`);53+expectType<Result<{}>>(await execaNode`unicorns ${await execaNode`echo foo`}`);54 expectError(await execaNode`unicorns ${execaNode`echo foo`}`);55-expectType<ExecaResult<{}>>(await execaNode`unicorns ${[await execaNode`echo foo`, 'bar']}`);55+expectType<Result<{}>>(await execaNode`unicorns ${[await execaNode`echo foo`, 'bar']}`);56 expectError(await execaNode`unicorns ${[execaNode`echo foo`, 'bar']}`);57 58-expectAssignable<ExecaResultPromise>(execaNode('unicorns', {nodePath: './node'}));59-expectAssignable<ExecaResultPromise>(execaNode('unicorns', {nodePath: fileUrl}));58+expectAssignable<ResultPromise>(execaNode('unicorns', {nodePath: './node'}));59+expectAssignable<ResultPromise>(execaNode('unicorns', {nodePath: fileUrl}));60 expectAssignable<{stdout: string}>(await execaNode('unicorns', {nodeOptions: ['--async-stack-traces']}));61 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));62 expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces']}));63 expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));modified:test-d/methods/script-s.test-d.ts+23 added-23 removed
1 import {expectType, expectError, expectAssignable} from 'tsd';2-import {$, type ExecaSyncResult} from '../../index.js';2+import {$, type SyncResult} from '../../index.js';3 4 const fileUrl = new URL('file:///test');5 const stringArray = ['foo', 'bar'] as const;6 7 expectError($.s());8 expectError($.s(true));9 expectError($.s(['unicorns', 'arg']));10-expectType<ExecaSyncResult<{}>>($.s('unicorns'));11-expectType<ExecaSyncResult<{}>>($.s(fileUrl));10+expectType<SyncResult<{}>>($.s('unicorns'));11+expectType<SyncResult<{}>>($.s(fileUrl));12 13-expectType<ExecaSyncResult<{}>>($.s('unicorns', []));14-expectType<ExecaSyncResult<{}>>($.s('unicorns', ['foo']));13+expectType<SyncResult<{}>>($.s('unicorns', []));14+expectType<SyncResult<{}>>($.s('unicorns', ['foo']));15 expectError($.s('unicorns', 'foo'));16 expectError($.s('unicorns', [true]));17 18-expectType<ExecaSyncResult<{}>>($.s('unicorns', {}));19-expectType<ExecaSyncResult<{}>>($.s('unicorns', [], {}));18+expectType<SyncResult<{}>>($.s('unicorns', {}));19+expectType<SyncResult<{}>>($.s('unicorns', [], {}));20 expectError($.s('unicorns', [], []));21 expectError($.s('unicorns', {other: true}));22 23-expectType<ExecaSyncResult<{}>>($.s`unicorns`);24-expectType<ExecaSyncResult<{}>>($.s('unicorns'));25-expectType<ExecaSyncResult<{}>>($.s`unicorns`);23+expectType<SyncResult<{}>>($.s`unicorns`);24+expectType<SyncResult<{}>>($.s('unicorns'));25+expectType<SyncResult<{}>>($.s`unicorns`);26 27 expectAssignable<typeof $.s>($.s({}));28-expectType<ExecaSyncResult<{}>>($.s({})('unicorns'));29-expectType<ExecaSyncResult<{}>>($({}).s('unicorns'));30-expectType<ExecaSyncResult<{}>>($.s({})`unicorns`);31-expectType<ExecaSyncResult<{}>>($({}).s`unicorns`);28+expectType<SyncResult<{}>>($.s({})('unicorns'));29+expectType<SyncResult<{}>>($({}).s('unicorns'));30+expectType<SyncResult<{}>>($.s({})`unicorns`);31+expectType<SyncResult<{}>>($({}).s`unicorns`);32 33 expectAssignable<{stdout: string}>($.s('unicorns'));34 expectAssignable<{stdout: Uint8Array}>($.s('unicorns', {encoding: 'buffer'}));35 expectAssignable<{stdout: string}>($.s('unicorns', ['foo']));14 unmodified lines50 expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).s`unicorns`);51 expectAssignable<{stdout: Uint8Array}>($.s({encoding: 'buffer'})({})`unicorns`);52 expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).s({})`unicorns`);53 54-expectType<ExecaSyncResult<{}>>($.s`${'unicorns'}`);55-expectType<ExecaSyncResult<{}>>($.s`unicorns ${'foo'}`);56-expectType<ExecaSyncResult<{}>>($.s`unicorns ${'foo'} ${'bar'}`);57-expectType<ExecaSyncResult<{}>>($.s`unicorns ${1}`);58-expectType<ExecaSyncResult<{}>>($.s`unicorns ${stringArray}`);59-expectType<ExecaSyncResult<{}>>($.s`unicorns ${[1, 2]}`);60-expectType<ExecaSyncResult<{}>>($.s`unicorns ${false.toString()}`);54+expectType<SyncResult<{}>>($.s`${'unicorns'}`);55+expectType<SyncResult<{}>>($.s`unicorns ${'foo'}`);56+expectType<SyncResult<{}>>($.s`unicorns ${'foo'} ${'bar'}`);57+expectType<SyncResult<{}>>($.s`unicorns ${1}`);58+expectType<SyncResult<{}>>($.s`unicorns ${stringArray}`);59+expectType<SyncResult<{}>>($.s`unicorns ${[1, 2]}`);60+expectType<SyncResult<{}>>($.s`unicorns ${false.toString()}`);61 expectError($.s`unicorns ${false}`);62 63-expectType<ExecaSyncResult<{}>>($.s`unicorns ${$.s`echo foo`}`);64-expectType<ExecaSyncResult<{}>>($.s`unicorns ${[$.s`echo foo`, 'bar']}`);63+expectType<SyncResult<{}>>($.s`unicorns ${$.s`echo foo`}`);64+expectType<SyncResult<{}>>($.s`unicorns ${[$.s`echo foo`, 'bar']}`);modified:test-d/methods/script-sync.test-d.ts+23 added-23 removed
1 import {expectType, expectError, expectAssignable} from 'tsd';2-import {$, type ExecaSyncResult} from '../../index.js';2+import {$, type SyncResult} from '../../index.js';3 4 const fileUrl = new URL('file:///test');5 const stringArray = ['foo', 'bar'] as const;6 7 expectError($.sync());8 expectError($.sync(true));9 expectError($.sync(['unicorns', 'arg']));10-expectType<ExecaSyncResult<{}>>($.sync('unicorns'));11-expectType<ExecaSyncResult<{}>>($.sync(fileUrl));10+expectType<SyncResult<{}>>($.sync('unicorns'));11+expectType<SyncResult<{}>>($.sync(fileUrl));12 13-expectType<ExecaSyncResult<{}>>($.sync('unicorns', []));14-expectType<ExecaSyncResult<{}>>($.sync('unicorns', ['foo']));13+expectType<SyncResult<{}>>($.sync('unicorns', []));14+expectType<SyncResult<{}>>($.sync('unicorns', ['foo']));15 expectError($.sync('unicorns', 'foo'));16 expectError($.sync('unicorns', [true]));17 18-expectType<ExecaSyncResult<{}>>($.sync('unicorns', {}));19-expectType<ExecaSyncResult<{}>>($.sync('unicorns', [], {}));18+expectType<SyncResult<{}>>($.sync('unicorns', {}));19+expectType<SyncResult<{}>>($.sync('unicorns', [], {}));20 expectError($.sync('unicorns', [], []));21 expectError($.sync('unicorns', {other: true}));22 23-expectType<ExecaSyncResult<{}>>($.sync`unicorns`);24-expectType<ExecaSyncResult<{}>>($.sync('unicorns'));25-expectType<ExecaSyncResult<{}>>($.sync`unicorns`);23+expectType<SyncResult<{}>>($.sync`unicorns`);24+expectType<SyncResult<{}>>($.sync('unicorns'));25+expectType<SyncResult<{}>>($.sync`unicorns`);26 27 expectAssignable<typeof $.sync>($.sync({}));28-expectType<ExecaSyncResult<{}>>($.sync({})('unicorns'));29-expectType<ExecaSyncResult<{}>>($({}).sync('unicorns'));30-expectType<ExecaSyncResult<{}>>($.sync({})`unicorns`);31-expectType<ExecaSyncResult<{}>>($({}).sync`unicorns`);28+expectType<SyncResult<{}>>($.sync({})('unicorns'));29+expectType<SyncResult<{}>>($({}).sync('unicorns'));30+expectType<SyncResult<{}>>($.sync({})`unicorns`);31+expectType<SyncResult<{}>>($({}).sync`unicorns`);32 33 expectAssignable<{stdout: string}>($.sync('unicorns'));34 expectAssignable<{stdout: Uint8Array}>($.sync('unicorns', {encoding: 'buffer'}));35 expectAssignable<{stdout: string}>($.sync('unicorns', ['foo']));14 unmodified lines50 expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync`unicorns`);51 expectAssignable<{stdout: Uint8Array}>($.sync({encoding: 'buffer'})({})`unicorns`);52 expectAssignable<{stdout: Uint8Array}>($({encoding: 'buffer'}).sync({})`unicorns`);53 54-expectType<ExecaSyncResult<{}>>($.sync`${'unicorns'}`);55-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${'foo'}`);56-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${'foo'} ${'bar'}`);57-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${1}`);58-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${stringArray}`);59-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${[1, 2]}`);60-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${false.toString()}`);54+expectType<SyncResult<{}>>($.sync`${'unicorns'}`);55+expectType<SyncResult<{}>>($.sync`unicorns ${'foo'}`);56+expectType<SyncResult<{}>>($.sync`unicorns ${'foo'} ${'bar'}`);57+expectType<SyncResult<{}>>($.sync`unicorns ${1}`);58+expectType<SyncResult<{}>>($.sync`unicorns ${stringArray}`);59+expectType<SyncResult<{}>>($.sync`unicorns ${[1, 2]}`);60+expectType<SyncResult<{}>>($.sync`unicorns ${false.toString()}`);61 expectError($.sync`unicorns ${false}`);62 63-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${$.sync`echo foo`}`);64-expectType<ExecaSyncResult<{}>>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);63+expectType<SyncResult<{}>>($.sync`unicorns ${$.sync`echo foo`}`);64+expectType<SyncResult<{}>>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);modified:test-d/methods/script.test-d.ts+21 added-21 removed
1 import {expectType, expectError, expectAssignable} from 'tsd';2-import {$, type ExecaResult, type ExecaResultPromise} from '../../index.js';2+import {$, type Result, type ResultPromise} from '../../index.js';3 4 const fileUrl = new URL('file:///test');5 const stringArray = ['foo', 'bar'] as const;6 7 expectError($());8 expectError($(true));9 expectError($(['unicorns', 'arg']));10-expectAssignable<ExecaResultPromise>($('unicorns'));11-expectAssignable<ExecaResultPromise>($(fileUrl));10+expectAssignable<ResultPromise>($('unicorns'));11+expectAssignable<ResultPromise>($(fileUrl));12 13-expectAssignable<ExecaResultPromise>($('unicorns', []));14-expectAssignable<ExecaResultPromise>($('unicorns', ['foo']));13+expectAssignable<ResultPromise>($('unicorns', []));14+expectAssignable<ResultPromise>($('unicorns', ['foo']));15 expectError($('unicorns', 'foo'));16 expectError($('unicorns', [true]));17 18-expectAssignable<ExecaResultPromise>($('unicorns', {}));19-expectAssignable<ExecaResultPromise>($('unicorns', [], {}));18+expectAssignable<ResultPromise>($('unicorns', {}));19+expectAssignable<ResultPromise>($('unicorns', [], {}));20 expectError($('unicorns', [], []));21 expectError($('unicorns', {other: true}));22 23-expectAssignable<ExecaResultPromise>($`unicorns`);24-expectType<ExecaResult<{}>>(await $('unicorns'));25-expectType<ExecaResult<{}>>(await $`unicorns`);23+expectAssignable<ResultPromise>($`unicorns`);24+expectType<Result<{}>>(await $('unicorns'));25+expectType<Result<{}>>(await $`unicorns`);26 27 expectAssignable<typeof $>($({}));28-expectAssignable<ExecaResultPromise>($({})('unicorns'));29-expectAssignable<ExecaResultPromise>($({})`unicorns`);28+expectAssignable<ResultPromise>($({})('unicorns'));29+expectAssignable<ResultPromise>($({})`unicorns`);30 31 expectAssignable<{stdout: string}>(await $('unicorns'));32 expectAssignable<{stdout: Uint8Array}>(await $('unicorns', {encoding: 'buffer'}));33 expectAssignable<{stdout: string}>(await $('unicorns', ['foo']));6 unmodified lines40 expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})`unicorns`);41 expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})`unicorns`);42 expectAssignable<{stdout: Uint8Array}>(await $({encoding: 'buffer'})({})`unicorns`);43 44-expectType<ExecaResult<{}>>(await $`${'unicorns'}`);45-expectType<ExecaResult<{}>>(await $`unicorns ${'foo'}`);46-expectType<ExecaResult<{}>>(await $`unicorns ${'foo'} ${'bar'}`);47-expectType<ExecaResult<{}>>(await $`unicorns ${1}`);48-expectType<ExecaResult<{}>>(await $`unicorns ${stringArray}`);49-expectType<ExecaResult<{}>>(await $`unicorns ${[1, 2]}`);50-expectType<ExecaResult<{}>>(await $`unicorns ${false.toString()}`);44+expectType<Result<{}>>(await $`${'unicorns'}`);45+expectType<Result<{}>>(await $`unicorns ${'foo'}`);46+expectType<Result<{}>>(await $`unicorns ${'foo'} ${'bar'}`);47+expectType<Result<{}>>(await $`unicorns ${1}`);48+expectType<Result<{}>>(await $`unicorns ${stringArray}`);49+expectType<Result<{}>>(await $`unicorns ${[1, 2]}`);50+expectType<Result<{}>>(await $`unicorns ${false.toString()}`);51 expectError(await $`unicorns ${false}`);52 53-expectType<ExecaResult<{}>>(await $`unicorns ${await $`echo foo`}`);53+expectType<Result<{}>>(await $`unicorns ${await $`echo foo`}`);54 expectError(await $`unicorns ${$`echo foo`}`);55-expectType<ExecaResult<{}>>(await $`unicorns ${[await $`echo foo`, 'bar']}`);55+expectType<Result<{}>>(await $`unicorns ${[await $`echo foo`, 'bar']}`);56 expectError(await $`unicorns ${[$`echo foo`, 'bar']}`);modified:test-d/return/result-main.test-d.ts+14 added-14 removed
2 unmodified lines3 execa,4 execaSync,5 ExecaError,6 ExecaSyncError,7- type ExecaResult,8- type ExecaSyncResult,7+ type Result,8+ type SyncResult,9 } from '../../index.js';10 11 type AnyChunk = string | Uint8Array | string[] | unknown[] | undefined;12-expectType<AnyChunk>({} as ExecaResult['stdout']);13-expectType<AnyChunk>({} as ExecaResult['stderr']);14-expectType<AnyChunk>({} as ExecaResult['all']);15-expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as ExecaResult['stdio']);16-expectType<AnyChunk>({} as ExecaSyncResult['stdout']);17-expectType<AnyChunk>({} as ExecaSyncResult['stderr']);18-expectType<AnyChunk>({} as ExecaSyncResult['all']);19-expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as ExecaSyncResult['stdio']);12+expectType<AnyChunk>({} as Result['stdout']);13+expectType<AnyChunk>({} as Result['stderr']);14+expectType<AnyChunk>({} as Result['all']);15+expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as Result['stdio']);16+expectType<AnyChunk>({} as SyncResult['stdout']);17+expectType<AnyChunk>({} as SyncResult['stderr']);18+expectType<AnyChunk>({} as SyncResult['all']);19+expectAssignable<[undefined, AnyChunk, AnyChunk, ...AnyChunk[]]>({} as SyncResult['stdio']);20 21 const unicornsResult = await execa('unicorns', {all: true});22-expectAssignable<ExecaResult>(unicornsResult);22+expectAssignable<Result>(unicornsResult);23 expectType<string>(unicornsResult.command);24 expectType<string>(unicornsResult.escapedCommand);25 expectType<number | undefined>(unicornsResult.exitCode);26 expectType<boolean>(unicornsResult.failed);4 unmodified lines31 expectType<string | undefined>(unicornsResult.signal);32 expectType<string | undefined>(unicornsResult.signalDescription);33 expectType<string>(unicornsResult.cwd);34 expectType<number>(unicornsResult.durationMs);35-expectType<ExecaResult[]>(unicornsResult.pipedFrom);35+expectType<Result[]>(unicornsResult.pipedFrom);36 37 const unicornsResultSync = execaSync('unicorns', {all: true});38-expectAssignable<ExecaSyncResult>(unicornsResultSync);38+expectAssignable<SyncResult>(unicornsResultSync);39 expectType<string>(unicornsResultSync.command);40 expectType<string>(unicornsResultSync.escapedCommand);41 expectType<number | undefined>(unicornsResultSync.exitCode);42 expectType<boolean>(unicornsResultSync.failed);25 unmodified lines68 expectType<string>(error.shortMessage);69 expectType<string>(error.originalMessage);70 expectType<string | undefined>(error.code);71 expectType<unknown>(error.cause);72- expectType<ExecaResult[]>(error.pipedFrom);72+ expectType<Result[]>(error.pipedFrom);73 }74 75 const errorSync = new Error('.');76 if (errorSync instanceof ExecaSyncError) {19 unmodified linesmodified:test-d/subprocess/stdio.test-d.ts+5 added-5 removed
1 import type {Readable, Writable} from 'node:stream';2 import {expectType, expectError} from 'tsd';3-import {execa, type ExecaSubprocess} from '../../index.js';3+import {execa, type Subprocess} from '../../index.js';4 5-expectType<Writable | null>({} as ExecaSubprocess['stdin']);6-expectType<Readable | null>({} as ExecaSubprocess['stdout']);7-expectType<Readable | null>({} as ExecaSubprocess['stderr']);8-expectType<Readable | undefined>({} as ExecaSubprocess['all']);5+expectType<Writable | null>({} as Subprocess['stdin']);6+expectType<Readable | null>({} as Subprocess['stdout']);7+expectType<Readable | null>({} as Subprocess['stderr']);8+expectType<Readable | undefined>({} as Subprocess['all']);9 10 const bufferSubprocess = execa('unicorns', {encoding: 'buffer', all: true});11 expectType<Writable>(bufferSubprocess.stdin);12 expectType<Writable>(bufferSubprocess.stdio[0]);29 unmodified linesmodified:test-d/subprocess/subprocess.test-d.ts+3 added-3 removed
1 import {expectType, expectError, expectAssignable} from 'tsd';2-import {execa, type ExecaSubprocess} from '../../index.js';2+import {execa, type Subprocess} from '../../index.js';3 4 const subprocess = execa('unicorns');5-expectAssignable<ExecaSubprocess>(subprocess);5+expectAssignable<Subprocess>(subprocess);6 7 expectType<number | undefined>(subprocess.pid);8 9 expectType<boolean>(subprocess.kill());10 unmodified lines20 expectError(subprocess.kill('SIGKILL', {}));21 expectError(subprocess.kill(null, new Error('test')));22 23 const ipcSubprocess = execa('unicorns', {ipc: true});24-expectAssignable<ExecaSubprocess>(subprocess);24+expectAssignable<Subprocess>(subprocess);25 26 expectType<boolean>(ipcSubprocess.send({}));27 execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}).send({});28 execa('unicorns', {stdio: ['pipe', 'pipe', 'ipc', 'pipe']}).send({});6 unmodified linesmodified:test-d/pipe.test-d.ts+3 added-3 removed
2 unmodified lines3 import {4 execa,5 execaSync,6 $,7- type ExecaResult,7+ type Result,8 } from '../index.js';9 10 const fileUrl = new URL('file:///test');11 const stringArray = ['foo', 'bar'] as const;4 unmodified lines16 const scriptSubprocess = $`unicorns`;17 18 const bufferResult = await bufferSubprocess;19 type BufferExecaReturnValue = typeof bufferResult;20-type EmptyExecaReturnValue = ExecaResult<{}>;21-type ShortcutExecaReturnValue = ExecaResult<typeof pipeOptions>;20+type EmptyExecaReturnValue = Result<{}>;21+type ShortcutExecaReturnValue = Result<typeof pipeOptions>;22 23 expectNotType<BufferExecaReturnValue>(await subprocess.pipe(subprocess));24 expectNotType<BufferExecaReturnValue>(await scriptSubprocess.pipe(subprocess));25 expectType<BufferExecaReturnValue>(await subprocess.pipe(bufferSubprocess));229 unmodified linesmodified:types/methods/command.d.ts+8 added-8 removed
1 import type {Options, SyncOptions} from '../arguments/options';2-import type {ExecaSyncResult} from '../return/result';3-import type {ExecaResultPromise} from '../subprocess/subprocess';2+import type {SyncResult} from '../return/result';3+import type {ResultPromise} from '../subprocess/subprocess';4 import type {SimpleTemplateString} from './template';5 6 type ExecaCommand<OptionsType extends Options> = {7 <NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaCommand<OptionsType & NewOptionsType>;8 9- (...templateString: SimpleTemplateString): ExecaResultPromise<OptionsType>;9+ (...templateString: SimpleTemplateString): ResultPromise<OptionsType>;10 11 <NewOptionsType extends Options = {}>(12 command: string,13 options?: NewOptionsType,14- ): ExecaResultPromise<OptionsType & NewOptionsType>;14+ ): ResultPromise<OptionsType & NewOptionsType>;15 };16 17 /**18 Executes a command. `command` is a string that includes both the `file` and its `arguments`.2 unmodified lines21 22 Just like `execa()`, this can bind options. It can also be run synchronously using `execaCommandSync()`.23 24 @param command - The program/script to execute and its arguments.25-@returns An `ExecaResultPromise` that is both:25+@returns A `ResultPromise` that is both:26 - the subprocess.27 - a `Promise` either resolving with its successful `result`, or rejecting with its `error`.28 @throws `ExecaError`29 10 unmodified lines40 41 type ExecaCommandSync<OptionsType extends SyncOptions> = {42 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaCommandSync<OptionsType & NewOptionsType>;43 44- (...templateString: SimpleTemplateString): ExecaSyncResult<OptionsType>;44+ (...templateString: SimpleTemplateString): SyncResult<OptionsType>;45 46 <NewOptionsType extends SyncOptions = {}>(47 command: string,48 options?: NewOptionsType,49- ): ExecaSyncResult<OptionsType & NewOptionsType>;49+ ): SyncResult<OptionsType & NewOptionsType>;50 };51 52 /**53 Same as `execaCommand()` but synchronous.54 55 Returns or throws a subprocess `result`. The `subprocess` is not returned: its methods and properties are not available.56 57 @param command - The program/script to execute and its arguments.58-@returns `ExecaSyncResult`58+@returns `SyncResult`59 @throws `ExecaSyncError`60 61 @example62 ```8 unmodified linesmodified:types/methods/main-async.d.ts+5 added-5 removed
1 import type {Options} from '../arguments/options';2-import type {ExecaResultPromise} from '../subprocess/subprocess';2+import type {ResultPromise} from '../subprocess/subprocess';3 import type {TemplateString} from './template';4 5 type Execa<OptionsType extends Options> = {6 <NewOptionsType extends Options = {}>(options: NewOptionsType): Execa<OptionsType & NewOptionsType>;7 8- (...templateString: TemplateString): ExecaResultPromise<OptionsType>;8+ (...templateString: TemplateString): ResultPromise<OptionsType>;9 10 <NewOptionsType extends Options = {}>(11 file: string | URL,12 arguments?: readonly string[],13 options?: NewOptionsType,14- ): ExecaResultPromise<OptionsType & NewOptionsType>;14+ ): ResultPromise<OptionsType & NewOptionsType>;15 16 <NewOptionsType extends Options = {}>(17 file: string | URL,18 options?: NewOptionsType,19- ): ExecaResultPromise<OptionsType & NewOptionsType>;19+ ): ResultPromise<OptionsType & NewOptionsType>;20 };21 22 /**23 Executes a command using `file ...arguments`.3 unmodified lines27 `execa(options)` can be used to return a new instance of Execa but with different default `options`. Consecutive calls are merged to previous ones.28 29 @param file - The program/script to execute, as a string or file URL30 @param arguments - Arguments to pass to `file` on execution.31-@returns An `ExecaResultPromise` that is both:31+@returns A `ResultPromise` that is both:32 - the subprocess.33 - a `Promise` either resolving with its successful `result`, or rejecting with its `error`.34 @throws `ExecaError`35 207 unmodified linesmodified:types/methods/main-sync.d.ts+5 added-5 removed
1 import type {SyncOptions} from '../arguments/options';2-import type {ExecaSyncResult} from '../return/result';2+import type {SyncResult} from '../return/result';3 import type {TemplateString} from './template';4 5 type ExecaSync<OptionsType extends SyncOptions> = {6 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaSync<OptionsType & NewOptionsType>;7 8- (...templateString: TemplateString): ExecaSyncResult<OptionsType>;8+ (...templateString: TemplateString): SyncResult<OptionsType>;9 10 <NewOptionsType extends SyncOptions = {}>(11 file: string | URL,12 arguments?: readonly string[],13 options?: NewOptionsType,14- ): ExecaSyncResult<OptionsType & NewOptionsType>;14+ ): SyncResult<OptionsType & NewOptionsType>;15 16 <NewOptionsType extends SyncOptions = {}>(17 file: string | URL,18 options?: NewOptionsType,19- ): ExecaSyncResult<OptionsType & NewOptionsType>;19+ ): SyncResult<OptionsType & NewOptionsType>;20 };21 22 /**23 Same as `execa()` but synchronous.1 unmodified line25 Returns or throws a subprocess `result`. The `subprocess` is not returned: its methods and properties are not available.26 27 @param file - The program/script to execute, as a string or file URL28 @param arguments - Arguments to pass to `file` on execution.29-@returns `ExecaSyncResult`29+@returns `SyncResult`30 @throws `ExecaSyncError`31 32 @example33 9 unmodified linesmodified:types/methods/node.d.ts+5 added-5 removed
1 import type {Options} from '../arguments/options';2-import type {ExecaResultPromise} from '../subprocess/subprocess';2+import type {ResultPromise} from '../subprocess/subprocess';3 import type {TemplateString} from './template';4 5 type ExecaNode<OptionsType extends Options> = {6 <NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaNode<OptionsType & NewOptionsType>;7 8- (...templateString: TemplateString): ExecaResultPromise<OptionsType>;8+ (...templateString: TemplateString): ResultPromise<OptionsType>;9 10 <NewOptionsType extends Options = {}>(11 scriptPath: string | URL,12 arguments?: readonly string[],13 options?: NewOptionsType,14- ): ExecaResultPromise<OptionsType & NewOptionsType>;14+ ): ResultPromise<OptionsType & NewOptionsType>;15 16 <NewOptionsType extends Options = {}>(17 scriptPath: string | URL,18 options?: NewOptionsType,19- ): ExecaResultPromise<OptionsType & NewOptionsType>;19+ ): ResultPromise<OptionsType & NewOptionsType>;20 };21 22 /**23 Same as `execa()` but using the `node: true` option.4 unmodified lines28 This is the preferred method when executing Node.js files.29 30 @param scriptPath - Node.js script to execute, as a string or file URL31 @param arguments - Arguments to pass to `scriptPath` on execution.32-@returns An `ExecaResultPromise` that is both:32+@returns A `ResultPromise` that is both:33 - the subprocess.34 - a `Promise` either resolving with its successful `result`, or rejecting with its `error`.35 @throws `ExecaError`36 12 unmodified linesmodified:types/methods/script.d.ts+9 added-9 removed
2 unmodified lines3 Options,4 SyncOptions,5 StricterOptions,6 } from '../arguments/options';7-import type {ExecaSyncResult} from '../return/result';8-import type {ExecaResultPromise} from '../subprocess/subprocess';7+import type {SyncResult} from '../return/result';8+import type {ResultPromise} from '../subprocess/subprocess';9 import type {TemplateString} from './template';10 11 type ExecaScriptCommon<OptionsType extends CommonOptions> = {12 <NewOptionsType extends CommonOptions = {}>(options: NewOptionsType): ExecaScript<OptionsType & NewOptionsType>;13 14- (...templateString: TemplateString): ExecaResultPromise<StricterOptions<OptionsType, Options>>;14+ (...templateString: TemplateString): ResultPromise<StricterOptions<OptionsType, Options>>;15 16 <NewOptionsType extends Options = {}>(17 file: string | URL,18 arguments?: readonly string[],19 options?: NewOptionsType,20- ): ExecaResultPromise<StricterOptions<OptionsType & NewOptionsType, Options>>;20+ ): ResultPromise<StricterOptions<OptionsType & NewOptionsType, Options>>;21 22 <NewOptionsType extends Options = {}>(23 file: string | URL,24 options?: NewOptionsType,25- ): ExecaResultPromise<StricterOptions<OptionsType & NewOptionsType, Options>>;25+ ): ResultPromise<StricterOptions<OptionsType & NewOptionsType, Options>>;26 };27 28 type ExecaScriptSync<OptionsType extends CommonOptions> = {29 <NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaScriptSync<OptionsType & NewOptionsType>;30 31- (...templateString: TemplateString): ExecaSyncResult<StricterOptions<OptionsType, SyncOptions>>;31+ (...templateString: TemplateString): SyncResult<StricterOptions<OptionsType, SyncOptions>>;32 33 <NewOptionsType extends SyncOptions = {}>(34 file: string | URL,35 arguments?: readonly string[],36 options?: NewOptionsType,37- ): ExecaSyncResult<StricterOptions<OptionsType & NewOptionsType, SyncOptions>>;37+ ): SyncResult<StricterOptions<OptionsType & NewOptionsType, SyncOptions>>;38 39 <NewOptionsType extends SyncOptions = {}>(40 file: string | URL,41 options?: NewOptionsType,42- ): ExecaSyncResult<StricterOptions<OptionsType & NewOptionsType, SyncOptions>>;42+ ): SyncResult<StricterOptions<OptionsType & NewOptionsType, SyncOptions>>;43 };44 45 type ExecaScript<OptionsType extends CommonOptions> = {46 sync: ExecaScriptSync<OptionsType>;6 unmodified lines53 Just like `execa()`, this can use the template string syntax or bind options. It can also be run synchronously using `$.sync()` or `$.s()`.54 55 This is the preferred method when executing multiple commands in a script file.56 57-@returns An `ExecaResultPromise` that is both:57+@returns A `ResultPromise` that is both:58 - the subprocess.59 - a `Promise` either resolving with its successful `result`, or rejecting with its `error`.60 @throws `ExecaError`61 29 unmodified linesmodified:types/return/result.d.ts+3 added-3 removed
50 unmodified lines51 Results of the other subprocesses that were piped into this subprocess.52 53 This array is initially empty and is populated each time the `subprocess.pipe()` method resolves.54 */55- pipedFrom: Unless<IsSync, ExecaResult[], []>;55+ pipedFrom: Unless<IsSync, Result[], []>;56 57 /**58 The file and arguments that were run.59 */118 unmodified lines178 Result of a subprocess successful execution.179 180 When the subprocess fails, it is rejected with an `ExecaError` instead.181 */182-export type ExecaResult<OptionsType extends Options = Options> = SuccessResult<false, OptionsType>;182+export type Result<OptionsType extends Options = Options> = SuccessResult<false, OptionsType>;183 184 /**185 Result of a subprocess successful execution.186 187 When the subprocess fails, it is rejected with an `ExecaError` instead.188 */189-export type ExecaSyncResult<OptionsType extends SyncOptions = SyncOptions> = SuccessResult<true, OptionsType>;189+export type SyncResult<OptionsType extends SyncOptions = SyncOptions> = SuccessResult<true, OptionsType>;modified:types/subprocess/subprocess.d.ts+5 added-5 removed
1 import type {ChildProcess} from 'node:child_process';2 import type {Readable, Writable, Duplex} from 'node:stream';3 import type {StdioOptionsArray} from '../stdio/type';4 import type {Options} from '../arguments/options';5-import type {ExecaResult} from '../return/result';5+import type {Result} from '../return/result';6 import type {PipableSubprocess} from '../pipe';7 import type {8 ReadableOptions,9 WritableOptions,107 unmodified lines117 118 /**119 [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with additional methods and properties.120 */121-export type ExecaSubprocess<OptionsType extends Options = Options> =121+export type Subprocess<OptionsType extends Options = Options> =122 & Omit<ChildProcess, keyof ExecaCustomSubprocess<OptionsType>>123 & ExecaCustomSubprocess<OptionsType>;124 125 /**126 The return value of all asynchronous methods is both:127 - the subprocess.128 - a `Promise` either resolving with its successful `result`, or rejecting with its `error`.129 */130-export type ExecaResultPromise<OptionsType extends Options = Options> =131- & ExecaSubprocess<OptionsType>132- & Promise<ExecaResult<OptionsType>>;130+export type ResultPromise<OptionsType extends Options = Options> =131+ & Subprocess<OptionsType>132+ & Promise<Result<OptionsType>>;modified:types/pipe.d.ts+7 added-7 removed
1 import type {Options} from './arguments/options';2-import type {ExecaResult} from './return/result';2+import type {Result} from './return/result';3 import type {FromOption, ToOption} from './arguments/fd-options';4-import type {ExecaResultPromise} from './subprocess/subprocess';4+import type {ResultPromise} from './subprocess/subprocess';5 import type {TemplateExpression} from './methods/template';6 7 // `subprocess.pipe()` options8 type PipeOptions = {25 unmodified lines34 pipe<OptionsType extends Options & PipeOptions = {}>(35 file: string | URL,36 arguments?: readonly string[],37 options?: OptionsType,38- ): Promise<ExecaResult<OptionsType>> & PipableSubprocess;38+ ): Promise<Result<OptionsType>> & PipableSubprocess;39 pipe<OptionsType extends Options & PipeOptions = {}>(40 file: string | URL,41 options?: OptionsType,42- ): Promise<ExecaResult<OptionsType>> & PipableSubprocess;42+ ): Promise<Result<OptionsType>> & PipableSubprocess;43 44 /**45 Like `subprocess.pipe(file, arguments?, options?)` but using a `command` template string instead. This follows the same syntax as `$`.46 */47 pipe(templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[]):48- Promise<ExecaResult<{}>> & PipableSubprocess;48+ Promise<Result<{}>> & PipableSubprocess;49 pipe<OptionsType extends Options & PipeOptions = {}>(options: OptionsType):50 (templates: TemplateStringsArray, ...expressions: readonly TemplateExpression[])51- => Promise<ExecaResult<OptionsType>> & PipableSubprocess;51+ => Promise<Result<OptionsType>> & PipableSubprocess;52 53 /**54 Like `subprocess.pipe(file, arguments?, options?)` but using the return value of another `execa()` call instead.55 */56- pipe<Destination extends ExecaResultPromise>(destination: Destination, options?: PipeOptions):56+ pipe<Destination extends ResultPromise>(destination: Destination, options?: PipeOptions):57 Promise<Awaited<Destination>> & PipableSubprocess;58 };modified:index.d.ts+2 added-2 removed
3 unmodified lines4 StdoutStderrOption,5 StdoutStderrOptionSync,6 } from './types/stdio/type';7 export type {Options, SyncOptions} from './types/arguments/options';8-export type {ExecaResult, ExecaSyncResult} from './types/return/result';9-export type {ExecaResultPromise, ExecaSubprocess} from './types/subprocess/subprocess';8+export type {Result, SyncResult} from './types/return/result';9+export type {ResultPromise, Subprocess} from './types/subprocess/subprocess';10 /* eslint-disable import/extensions */11 export {ExecaError, ExecaSyncError} from './types/return/final-error';12 export {execa} from './types/methods/main-async';13 export {execaSync} from './types/methods/main-sync';4 unmodified lines