β¬οΈ (deps) execa@9 π₯ [skip ci] #1434
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
8.0.1
->9.2.0
Release Notes
sindresorhus/execa (execa)
v9.2.0
Compare Source
This release includes a new set of methods to exchange messages between the current process and a Node.js subprocess, also known as "IPC". This allows passing and returning almost any message type to/from a Node.js subprocess. Also, debugging IPC is now much easier.
Moreover, a new
gracefulSignal
option has also been added to terminate a subprocess gracefully.For a deeper dive-in, please check and share the release post!
Thanks @βiiroj for your contribution, @βSimonSiefke and @βadymorz for reporting the bugs fixed in this release, and @βkarlhorky for improving the documentation!
Deprecations
'ipc'
to thestdio
option has been deprecated. It will be removed in the next major release. Instead, theipc: true
option should be used. (#β1056)execaCommand()
method has been deprecated. It will be removed in the next major release. If most cases, the template string syntax should be used instead.If the file and/or multiple arguments are supplied as a single string, parseCommandString(command) can split that string into an array. More info. (#β1054)
Features
gracefulSignal
option andgetCancelSignal()
method to terminate a subprocess gracefully.error.isGracefullyCanceled
was also added. (#β1109)error.isForcefullyTerminated
. It istrue
when the subprocess was terminated by theforceKillAfterDelay
option. (#β1111)subprocess.sendMessage(message)
and receives them withsubprocess.getOneMessage()
.subprocess.getEachMessage()
listens to multiple messages.sendMessage(message)
,getOneMessage()
andgetEachMessage()
instead. Those are the same methods, but imported directly from the'execa'
module.ipcInput
option sends an IPC message from the current process to the subprocess as it starts. This enables passing almost any input type to a Node.js subprocess. (#β1068)result.ipcOutput
array contains all the IPC messages sent by the subprocess to the current process. This enables returning almost any output type from a Node.js subprocess. (#β1067, #β1071, #β1075)verbose: 'full'
option now logs every IPC message sent by the subprocess, for debugging. More info here and there. (#β1063)Types
ExecaMethod
,ExecaNodeMethod
andExecaScriptMethod
,ExecaSyncMethod
andExecaScriptSyncMethod
types. (#β1066)Message
type, for IPC. (#β1059)forceKillAfterDelay: true
option. (#β1116)Bug fixes
{file}
to both thestdin
and thestdout
orstderr
options. (#β1058)cancelSignal
option. (#β1108)engines.node
field inpackage.json
. Supported Node.js version is^18.19.0
or>=20.5.0
. (by @βiiroj) (#β1101)v9.1.0
Compare Source
Features (types)
TemplateExpression
type. (#β1049)v9.0.2
Compare Source
Bug fixes (types)
--lib dom
for TypeScript users (#β1043, #β1044)reject
option (#β1046)v9.0.1
Compare Source
Bug fixes (types)
3bdab60
6cc519b
fee011d
v9.0.0
Compare Source
This major release brings many important features including:
Please check the release post for a high-level overview! For the full list of breaking changes, features and bug fixes, please read below.
Thanks @βyounggglcy, @βkoshic, @βam0o0 and @βcodesmith-emmy for your help!
One of the maintainers @βehmicky is looking for a remote full-time position. Specialized in Node.js back-ends and CLIs, he led Netlify Build, Plugins and Configuration for 2.5 years. Feel free to contact him on his website or on LinkedIn!
Breaking changes
Minimal supported Node.js version is now
18.19.0
. (834e372
)When the
encoding
option is'buffer'
, the output (result.stdout
,result.stderr
,result.all
) is now anUint8Array
instead of aBuffer
. For more information, see this blog post. (by @βyounggglcy) (#β586)encoding
option. (#β586, #β928)subprocess.pipeStdout()
,subprocess.pipeStderr()
andsubprocess.pipeAll()
has been removed. Instead, a{file: './path'}
object should be passed to thestdout
orstderr
option. (#β752)subprocess.pipeStdout()
,subprocess.pipeStderr()
andsubprocess.pipeAll()
has been removed. Instead, the stream should be passed to thestdout
orstderr
option. If the stream does not have a file descriptor,['pipe', stream]
should be passed instead. (#β752)subprocess.pipeStdout()
,subprocess.pipeStderr()
andsubprocess.pipeAll()
methods have been renamed tosubprocess.pipe()
. The command and its arguments can be passed tosubprocess.pipe()
directly, without callingexeca()
a second time. Thefrom
piping option can specify'stdout'
(the default value),'stderr'
or'all'
. (#β757)signal
option tocancelSignal
. (#β880)error.killed
toerror.isTerminated
. (#β625)subprocess.cancel()
has been removed. Please use eithersubprocess.kill()
or thecancelSignal
option instead. (#β711)forceKillAfterTimeout
option toforceKillAfterDelay
. Also, it is now passed toexeca()
instead ofsubprocess.kill()
. (#β714, #β723)verbose
option is now a string enum instead of a boolean.false
has been renamed to'none'
andtrue
has been renamed to'short'
. (#β884)execPath
option has been renamed tonodePath
. It is now a noop unless thenode
option istrue
. Also, it now works even if thepreferLocal
option isfalse
. (#β812, #β815)serialization
option is now'advanced'
instead of'json'
. In particular, when callingsubprocess.send(object)
with an object that contains functions or symbols, those were previously silently removed. Now this will throw an exception. (#β905)subprocess.stdout
,subprocess.stderr
orsubprocess.all
is manually piped, the.pipe()
call must now happen as soon assubprocess
is created. Otherwise, the output at the beginning of the subprocess might be missing. (#β658, #β747)subprocess.kill()
and to thekillSignal
option cannot be lowercase anymore. (#β1025)Features
Execution
execa()
), as opposed to only$
. Conversely,$
can now use the regular array syntax. (#β933)execa(options)
. (#β933, #β965)execa()
,execaNode()
, theinputFile
option, thenodePath
option or theshell
option. (#β630, #β631, #β632, #β635)Text lines
lines
option. (#β741, #β929, #β931, #β948, #β951, #β957)Piping multiple subprocesses
subprocess.pipe()
without callingexeca()
. A template string can also be used. (#β840, #β859, #β864)result.pipedFrom
anderror.pipedFrom
. (#β834)stdin
/stdout
/stderr
by using thefrom
andto
piping options. (#β757, #β834, #β903, #β920)unpipeSignal
piping option. (#β834, #β852)Input/output
stdin
,stdout
andstderr
options. For example,stdout: ['inherit', 'pipe']
prints the output to the terminal while still returning it asresult.stdout
. (#β643, #β765, #β941, #β954){file: './path'}
object or a file URL to thestdin
,stdout
orstderr
option. (#β610, #β614, #β621, #β671, #β1004)stdin
,stdout
orstderr
option. (#β693, #β697, #β698, #β699, #β709, #β736, #β737, #β739, #β740, #β746, #β748, #β755, #β756, #β780, #β783, #β867, #β915, #β916, #β917, #β919, #β924, #β926, #β945, #β969)Uint8Array
to theinput
orstdin
option. (834e372
, #β670, #β1029)stdin
option. (#β604, #β944)stdin
,input
andinputFile
options. (#β666)result.stdout
andresult.stderr
by usingresult.stdio
. (#β676)stdout
andstderr
with the following options:verbose
,lines
,stripFinalNewline
,maxBuffer
,buffer
. (#β966, #β970, #β971, #β972, #β973, #β974)Streams
ReadableStream
orWritableStream
to thestdin
,stdout
orstderr
option. (#β615, #β619, #β645)Duplex
, Node.jsTransform
or webTransformStream
to thestdin
,stdout
orstderr
option. (#β937, #β938)subprocess.readable()
,subprocess.writable()
orsubprocess.duplex()
. (#β912, #β922, #β958)Verbose mode
verbose: 'short'
orverbose: 'full'
option. (#β887, #β890)verbose: 'full'
option. (#β884, #β950, #β962, #β990)verbose
option. (#β883, #β893, #β894)Debugging
result.durationMs
anderror.durationMs
. (#β896)result.cwd
. Previously onlyerror.cwd
was available. Also,result.cwd
anderror.cwd
are now normalized to absolute file paths. (#β803)result.escapedCommand
in a terminal is now safe. (#β875)Errors
ExecaError
andExecaSyncError
classes are now exported. (#β911)error.cause
. (#β911)maxBuffer
option by usingerror.isMaxBuffer
. (#β963)error.message
:error.stdout
anderror.stderr
are now interleaved if theall
option istrue
. Additional file descriptors are now printed too. Also, the formatting has been improved. (#β676, #β705, #β991, #β992)error.message
are now escaped, so they don't result in visual bugs when printed in a terminal. (#β879)error
event is emitted onsubprocess.stdout
orsubprocess.stderr
. (#β814)Termination
subprocess.kill()
. (#β811, #β836, #β1023)forceKillAfterDelay
andkillSignal
options now apply to terminations due not only tosubprocess.kill()
but also to thecancelSignal
,timeout
,maxBuffer
andcleanup
options. (#β714, #β728)Node.js files
nodePath
andnodeOptions
options with any method, as opposed to onlyexecaNode()
, by passing thenode: true
option. (#β804, #β812, #β815)execaNode()
or thenode: true
option, the current Node.js version is now inherited deeply. If the subprocess spawns other subprocesses, they will all use the same Node.js version. (#β812, #β815, #β1011)Synchronous execution
all
andbuffer: false
options withexecaSync()
, as opposed to onlyexeca()
. (#β953, #β956)$.s
alias for$.sync
. (#β594)Inter-process communication
ipc: true
option, as opposed to the more verbosestdio: ['pipe', 'pipe', 'pipe', 'ipc']
option. (#β794)Input validation
input
,timeout
,cwd
,detached
,cancelSignal
andencoding
options. (#β668, #β715, #β803, #β928, #β940)execa()
and the other exported methods. (#β838, #β873, #β899)subprocess.kill()
and to thekillSignal
option. (#β1025)Bug fixes
undefined
values as options. This now uses the option's default value. (#β712)inputFile
option points to a missing file. (#β609)buffer
option isfalse
andsubprocess.stdout
errors. (#β729)'overlapped'
to thestdout
orstderr
option withexecaSync()
. (#β949)'error'
events are emitted on the subprocess. (#β790)reject: false
option not being used when the subprocess fails to spawn. (#β734)error.isTerminated
. (#β625, #β719)true
when the subprocess fails due to thetimeout
option.true
when callingprocess.kill(subprocess.pid)
, except on Windows.false
when using non-terminating signals such assubprocess.kill(0)
.error.signal
anderror.signalDescription
when the subprocess is terminated by thecancelSignal
option. (#β724)execa()
call might be modified by anotherexeca()
call. (#β796, #β806, #β911)verbose
option printing the command in the wrong order. (#β600)maxBuffer
andencoding
options. For example, when usingencoding: 'hex'
,maxBuffer
will now be measured in hexadecimal characters. Also,error.stdout
,error.stderr
anderror.all
were previously not applying themaxBuffer
option. (#β652, #β696)maxBuffer
option not truncatingresult.stdout
andresult.stderr
when usingexecaSync()
. (#β960)buffer: true
option (its default value) and iterating oversubprocess.stdout
orsubprocess.stderr
. (#β908)subprocess.all
stream incorrectly being in object mode. (#β717)subprocess.stdout
andsubprocess.stderr
are properly flushed when the subprocess fails. (#β647)timeout
option. (#β727)Types (breaking changes)
CommonOptions
type toOptions
(forexeca()
) andSyncOptions
(forexecaSync()
). (#β678, #β682)NodeOptions
type toOptions
. (#β804)KillOptions
type toOptions
. (#β714)Options
andSyncOptions
types. (#β681)ExecaChildProcess
type toResultPromise
. This is the type ofexeca()
's return value, which is both aPromise<Result>
and aSubprocess
. (#β897, #β1007, #β1009)ExecaChildPromise
type toSubprocess
. This is the type of the subprocess instance. (#β897, #β1007, #β1009)ExecaReturnBase
,ExecaReturnValue
andExecaSyncReturnValue
type toResult
(forexeca()
) andSyncResult
(forexecaSync()
). (#β897, #β1009)stdin
option fromStdioOption
toStdinOption
(forexeca()
) andStdinSyncOption
(forexecaSync()
). (#β942, #β1008, #β1012)stdout
andstderr
options fromStdioOption
toStdoutStderrOption
(forexeca()
) andStdoutStderrSyncOption
(forexecaSync()
). (#β942, #β1008, #β1012)stdio
option fromStdioOption[]
toOptions['stdio']
(forexeca()
) andSyncOptions['stdio']
(forexecaSync()
). (#β942, #β1008)Result
,SyncResult
,ExecaError
,ExecaSyncError
,ResultPromise
andSubprocess
types is now anOptions
type. (#β681)Types (improvements)
stdin
,stdout
,stderr
andstdio
options. (#β634, #β943, #β952)result.stdout
,result.stderr
,result.all
,subprocess.stdout
,subprocess.stderr
andsubprocess.all
. (#β681, #β684, #β687, #β689, #β833)execaSync()
. (#β678, #β939)reject
option. (#β688)error.signal
and thekillSignal
option. (#β1025)error.exitCode
, since that field is sometimesundefined
. (#β680)Documentation
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.