Update dependencies (major) (major)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @sindresorhus/slugify | 1.1.2 -> 2.2.1 |
||||
| chalk | 4.1.2 -> 5.3.0 |
||||
| execa | 5.1.1 -> 9.5.1 |
||||
| husky | 7.0.4 -> 9.1.6 |
||||
| node-fetch | 2.7.0 -> 3.3.2 |
||||
| prettier (source) | 2.8.8 -> 3.3.3 |
||||
| typescript (source) | 4.9.5 -> 5.6.3 |
Release Notes
sindresorhus/slugify (@βsindresorhus/slugify)
v2.2.1
- Improve compatibility with partial strings
v2.2.0
v2.1.1
v2.1.0
- Add
preserveTrailingDashoption (#β57)2aa5659
v2.0.0
Breaking
chalk/chalk (chalk)
v5.3.0
v5.2.0
- Improve Deno compatibility (#β579)
7443e9f - Detect true-color support for GitHub Actions (#β579)
7443e9f - Detect true-color support for Kitty terminal (#β579)
7443e9f - Fix test for Azure DevOps environment (#β579)
7443e9f
v5.1.2
v5.1.1
- Improved the names of exports introduced in 5.1.0 (#β567)
6e0df05- We of course preserved the old names.
v5.1.0
v5.0.1
- Add
mainfield to package.json for backwards compatibility with some developer tools85f7e96
v5.0.0
Breaking
-
This package is now pure ESM. Please read this.
- If you use TypeScript, you need to use TypeScript 4.7 or later. Why.
- If you use a bundler, make sure it supports ESM and that you have correctly configured it for ESM.
- The Chalk issue tracker is not a support channel for your favorite build/bundler tool.
- It's totally fine to stay on Chalk v4. It's been stable for years.
- Require Node.js 12.20
fa16f4e - Move some properties off the default export to individual named exports:
-
chalk.InstanceβChalk -
chalk.supportsColorβsupportsColor -
chalk.stderrβchalkStderr -
chalk.stderr.supportsColorβsupportsColorStderr
-
- Remove
.keyword(),.hsl(),.hsv(),.hwb(), and.ansi()coloring methods (#β433)4cf2e40- These were not commonly used and added a lot of bloat to Chalk. You can achieve the same by using the
color-convertpackage.
- These were not commonly used and added a lot of bloat to Chalk. You can achieve the same by using the
- The tagged template literal support moved into a separate package:
chalk-template(#β524)c987c61
-import chalk from 'chalk';
+import chalkTemplate from 'chalk-template';
-chalk`2 + 3 = {bold ${2 + 3}}`;
+chalkTemplate`2 + 3 = {bold ${2 + 3}}`;
Improvements
sindresorhus/execa (execa)
v9.5.1
v9.5.0
v9.4.1
Bug fixes
v9.4.0
Features
- We've created a separate package called nano-spawn. It is similar to Execa but with fewer features, for a much smaller package size. More info.
Bug fixes
- Both
execaNode()and thepreferLocaloption modify thePATHenvironment variable. This release includes some minor improvements to ensure that environment variable remains small (https://github.com/sindresorhus/npm-run-path/pull/20). It also handles a few related edge cases better (https://github.com/sindresorhus/npm-run-path/pull/21).
Documentation
- Small documentation typo fix, thanks @βrrthomas! (#β1153)
v9.3.1
v9.3.0
Features
- The
verboseoption can now be a function to customize logging. (#β1130)
v9.2.0
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 gracefulCancel 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
- Passing
'ipc'to thestdiooption has been deprecated. It will be removed in the next major release. Instead, theipc: trueoption should be used. (#β1056)
- await execa('npm', ['run', 'build'], {stdio: ['pipe', 'pipe', 'pipe', 'ipc']});
+ await execa('npm', ['run', 'build'], {ipc: true});
- The
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.
- import {execaCommand} from 'execa';
+ import {execa} from 'execa';
- await execaCommand('npm run build');
+ await execa`npm run build`;
const taskName = 'build';
- await execaCommand(`npm run ${taskName}`);
+ await execa`npm run ${taskName}`;
const commandArguments = ['run', 'task with space'];
await execa`npm ${commandArguments}`;
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)
- import {execaCommand} from 'execa';
+ import {execa, parseCommandString} from 'execa';
const commandString = 'npm run task';
- await execaCommand(commandString);
+ const commandArray = parseCommandString(commandString); // ['npm', 'run', 'task']
+ await execa`${commandArray}`;
// Or alternatively:
const [file, ...commandArguments] = commandArray;
await execa(file, commandArguments);
Features
- Add
gracefulCanceloption andgetCancelSignal()method to terminate a subprocess gracefully.error.isGracefullyCanceledwas also added. (#β1109) - Add
error.isForcefullyTerminated. It istruewhen the subprocess was terminated by theforceKillAfterDelayoption. (#β1111) - New methods to simplify exchanging messages between the current process and the subprocess. More info. (#β1059, #β1061, #β1076, #β1077, #β1079, #β1082, #β1083, #β1086, #β1087, #β1088, #β1089, #β1090, #β1091, #β1092, #β1094, #β1095, #β1098, #β1104, #β1107)
- The current process sends messages with
subprocess.sendMessage(message)and receives them withsubprocess.getOneMessage().subprocess.getEachMessage()listens to multiple messages. - The subprocess uses
sendMessage(message),getOneMessage()andgetEachMessage()instead. Those are the same methods, but imported directly from the'execa'module.
- The current process sends messages with
- The
ipcInputoption 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) - The
result.ipcOutputarray 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) - The error message now contains every IPC message sent by the subprocess. (#β1067)
- The
verbose: 'full'option now logs every IPC message sent by the subprocess, for debugging. More info here and there. (#β1063)
Types
- Add
ExecaMethod,ExecaNodeMethodandExecaScriptMethod,ExecaSyncMethodandExecaScriptSyncMethodtypes. (#β1066) - Export the
Messagetype, for IPC. (#β1059) - Fix type of
forceKillAfterDelay: trueoption. (#β1116)
Bug fixes
- Fix passing a
{file}to both thestdinand thestdoutorstderroptions. (#β1058) - Fix multiple minor problems with the
cancelSignaloption. (#β1108) - Fix accidental publishing of Vim backup files. (#β1074)
- Fix
engines.nodefield inpackage.json. Supported Node.js version is^18.19.0or>=20.5.0. (by @βiiroj) (#β1101)
v9.1.0
Features (types)
- Export
TemplateExpressiontype. (#β1049)
v9.0.2
Bug fixes (types)
- Do not require using
--lib domfor TypeScript users (#β1043, #β1044) - Fix type of the
rejectoption (#β1046)
v9.0.1
Bug fixes (types)
- Fix types not being importable (#β1033)
3bdab60 - Fix complexity bug with types (#β1037)
6cc519b - Fix complexity bug with types (#β1035)
fee011d
v9.0.0
This major release brings many important features including:
- Split the output into lines, or progressively iterate over them.
- Transform or filter the input/output using simple functions.
- Print the output to the terminal while still retrieving it programmatically.
- Redirect the input/output from/to a file.
- Advanced piping between multiple subprocesses.
- Improved verbose mode, for debugging.
- More detailed errors, including when terminating subprocesses.
- Enhanced template string syntax.
- Global/shared options.
- Web streams and Transform streams support.
- Convert the subprocess to a stream.
- New documentation with many examples.
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
encodingoption is'buffer', the output (result.stdout,result.stderr,result.all) is now anUint8Arrayinstead of aBuffer. For more information, see this blog post. (by @βyounggglcy) (#β586)
const {stdout} = await execa('node', ['file.js'], {encoding: 'buffer'});
console.log(stdout); // This is now an Uint8Array
- await execa('node', ['file.js'], {encoding: null});
+ await execa('node', ['file.js'], {encoding: 'buffer'});
- await execa('node', ['file.js'], {encoding: 'utf-8'});
+ await execa('node', ['file.js'], {encoding: 'utf8'});
- await execa('node', ['file.js'], {encoding: 'UTF8'});
+ await execa('node', ['file.js'], {encoding: 'utf8'});
- await execa('node', ['file.js'], {encoding: 'utf-16le'});
+ await execa('node', ['file.js'], {encoding: 'utf16le'});
- await execa('node', ['file.js'], {encoding: 'ucs2'});
+ await execa('node', ['file.js'], {encoding: 'utf16le'});
- await execa('node', ['file.js'], {encoding: 'ucs-2'});
+ await execa('node', ['file.js'], {encoding: 'utf16le'});
- await execa('node', ['file.js'], {encoding: 'binary'});
+ await execa('node', ['file.js'], {encoding: 'latin1'});
- Passing a file path to
subprocess.pipeStdout(),subprocess.pipeStderr()andsubprocess.pipeAll()has been removed. Instead, a{file: './path'}object should be passed to thestdoutorstderroption. (#β752)
- await execa('node', ['file.js']).pipeStdout('output.txt');
+ await execa('node', ['file.js'], {stdout: {file: 'output.txt'}});
- await execa('node', ['file.js']).pipeStderr('output.txt');
+ await execa('node', ['file.js'], {stderr: {file: 'output.txt'}});
- await execa('node', ['file.js']).pipeAll('output.txt');
+ await execa('node', ['file.js'], {
+ stdout: {file: 'output.txt'},
+ stderr: {file: 'output.txt'},
+});
- Passing a writable stream to
subprocess.pipeStdout(),subprocess.pipeStderr()andsubprocess.pipeAll()has been removed. Instead, the stream should be passed to thestdoutorstderroption. If the stream does not have a file descriptor,['pipe', stream]should be passed instead. (#β752)
- await execa('node', ['file.js']).pipeStdout(stream);
+ await execa('node', ['file.js'], {stdout: ['pipe', stream]});
- await execa('node', ['file.js']).pipeStderr(stream);
+ await execa('node', ['file.js'], {stderr: ['pipe', stream]});
- await execa('node', ['file.js']).pipeAll(stream);
+ await execa('node', ['file.js'], {
+ stdout: ['pipe', stream],
+ stderr: ['pipe', stream],
+});
- The
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. Thefrompiping option can specify'stdout'(the default value),'stderr'or'all'. (#β757)
- await execa('node', ['file.js']).pipeStdout(execa('node', ['other.js']));
+ await execa('node', ['file.js']).pipe('node', ['other.js']);
- await execa('node', ['file.js']).pipeStderr(execa('node', ['other.js']));
+ await execa('node', ['file.js']).pipe('node', ['other.js'], {from: 'stderr'});
- await execa('node', ['file.js']).pipeAll(execa('node', ['other.js']));
+ await execa('node', ['file.js']).pipe('node', ['other.js'], {from: 'all'});
- Renamed the
signaloption tocancelSignal. (#β880)
- await execa('node', ['file.js'], {signal: abortController.signal});
+ await execa('node', ['file.js'], {cancelSignal: abortController.signal});
- Renamed
error.killedtoerror.isTerminated. (#β625)
try {
await execa('node', ['file.js']);
} catch (error) {
- if (error.killed) {
+ if (error.isTerminated) {
// ...
}
}
-
subprocess.cancel()has been removed. Please use eithersubprocess.kill()or thecancelSignaloption instead. (#β711)
- subprocess.cancel();
+ subprocess.kill();
- Renamed the
forceKillAfterTimeoutoption toforceKillAfterDelay. Also, it is now passed toexeca()instead ofsubprocess.kill(). (#β714, #β723)
- const subprocess = execa('node', ['file.js']);
- subprocess.kill('SIGTERM', {forceKillAfterTimeout: 1000});
+ const subprocess = execa('node', ['file.js'], {forceKillAfterDelay: 1000});
+ subprocess.kill('SIGTERM');
- The
verboseoption is now a string enum instead of a boolean.falsehas been renamed to'none'andtruehas been renamed to'short'. (#β884)
- await execa('node', ['file.js'], {verbose: false});
+ await execa('node', ['file.js'], {verbose: 'none'});
- await execa('node', ['file.js'], {verbose: true});
+ await execa('node', ['file.js'], {verbose: 'short'});
- The
execPathoption has been renamed tonodePath. It is now a noop unless thenodeoption istrue. Also, it now works even if thepreferLocaloption isfalse. (#β812, #β815)
- await execa('node', ['file.js'], {execPath: './path/to/node'});
+ await execa('node', ['file.js'], {nodePath: './path/to/node'});
- The default value for the
serializationoption 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.send({example: true, getExample() {}});
+ subprocess.send({example: true});
- If
subprocess.stdout,subprocess.stderrorsubprocess.allis manually piped, the.pipe()call must now happen as soon assubprocessis created. Otherwise, the output at the beginning of the subprocess might be missing. (#β658, #β747)
const subprocess = execa('node', ['file.js']);
- setTimeout(() => {
subprocess.stdout.pipe(process.stdout);
- }, 0);
- Signals passed to
subprocess.kill()and to thekillSignaloption cannot be lowercase anymore. (#β1025)
- const subprocess = execa('node', ['file.js'], {killSignal: 'sigterm'});
+ const subprocess = execa('node', ['file.js'], {killSignal: 'SIGTERM'});
- subprocess.kill('sigterm');
+ subprocess.kill('SIGTERM');
Features
Execution
- Use the template string syntax with any method (including
execa()), as opposed to only$. Conversely,$can now use the regular array syntax. (#β933) - A command's template string can span multiple lines. (#β843)
-
Share options between multiple calls, or set global options, by using
execa(options). (#β933, #β965) - Pass a file URL (as opposed to a file path string) to
execa(),execaNode(), theinputFileoption, thenodePathoption or theshelloption. (#β630, #β631, #β632, #β635)
Text lines
-
Split the output into text lines by using the
linesoption. (#β741, #β929, #β931, #β948, #β951, #β957) - Subprocess is now an async iterable, iterating over the output lines while the subprocess is running. (#β923)
Piping multiple subprocesses
- Simpler syntax: pass the command directly to
subprocess.pipe()without callingexeca(). A template string can also be used. (#β840, #β859, #β864) - Wait for both subprocesses to complete. Error handling has been improved too. (#β757, #β778, #β834, #β854)
- Retrieve the result of each subprocess (not only the last one) by using
result.pipedFromanderror.pipedFrom. (#β834) - Pipe 1 or many subprocesses to 1 or many subprocesses. (#β834)
- Pipe subprocesses using other file descriptors than
stdin/stdout/stderrby using thefromandtopiping options. (#β757, #β834, #β903, #β920) -
Cancel piping subprocesses by using the
unpipeSignalpiping option. (#β834, #β852)
Input/output
- Pass an array with multiple values to the
stdin,stdoutandstderroptions. For example,stdout: ['inherit', 'pipe']prints the output to the terminal while still returning it asresult.stdout. (#β643, #β765, #β941, #β954) - Redirect the input/output from/to a file by passing a
{file: './path'}object or a file URL to thestdin,stdoutorstderroption. (#β610, #β614, #β621, #β671, #β1004) -
Transform or filter the input/output by passing a generator function to the
stdin,stdoutorstderroption. (#β693, #β697, #β698, #β699, #β709, #β736, #β737, #β739, #β740, #β746, #β748, #β755, #β756, #β780, #β783, #β867, #β915, #β916, #β917, #β919, #β924, #β926, #β945, #β969) - Provide some binary input by passing an
Uint8Arrayto theinputorstdinoption. (834e372, #β670, #β1029) - Provide some progressive input by passing a sync/async iterable to the
stdinoption. (#β604, #β944) - Provide multiple inputs by combining the
stdin,inputandinputFileoptions. (#β666) - Return other file descriptors than
result.stdoutandresult.stderrby usingresult.stdio. (#β676) -
Specify different values for
stdoutandstderrwith the following options:verbose,lines,stripFinalNewline,maxBuffer,buffer. (#β966, #β970, #β971, #β972, #β973, #β974)
Streams
- Redirect the input/output from/to a web stream by passing a
ReadableStreamorWritableStreamto thestdin,stdoutorstderroption. (#β615, #β619, #β645) -
Transform or filter the input/output by passing a
Duplex, Node.jsTransformor webTransformStreamto thestdin,stdoutorstderroption. (#β937, #β938) -
Convert the subprocess to a stream by using
subprocess.readable(),subprocess.writable()orsubprocess.duplex(). (#β912, #β922, #β958)
Verbose mode
- Print the subprocess' completion, duration and errors with the
verbose: 'short'orverbose: 'full'option. (#β887, #β890) - Print the subprocess' output with the
verbose: 'full'option. (#β884, #β950, #β962, #β990) - Prettier formatting and colors with the
verboseoption. (#β883, #β893, #β894)
Debugging
- Retrieve the subprocess' duration by using
result.durationMsanderror.durationMs. (#β896) - Retrieve the subprocess' current directory by using
result.cwd. Previously onlyerror.cwdwas available. Also,result.cwdanderror.cwdare now normalized to absolute file paths. (#β803) - Printing
result.escapedCommandin a terminal is now safe. (#β875)
Errors
- The
ExecaErrorandExecaSyncErrorclasses are now exported. (#β911) - Find the subprocess failure's root cause by using
error.cause. (#β911) - Know whether the subprocess failed due to the
maxBufferoption by usingerror.isMaxBuffer. (#β963) - Improved
error.message:error.stdoutanderror.stderrare now interleaved if thealloption istrue. Additional file descriptors are now printed too. Also, the formatting has been improved. (#β676, #β705, #β991, #β992) -
Control characters in
error.messageare now escaped, so they don't result in visual bugs when printed in a terminal. (#β879) - Improved stack trace when an
errorevent is emitted onsubprocess.stdoutorsubprocess.stderr. (#β814)
Termination
- Specify an error message or stack trace when terminating a subprocess by passing an error instance to
subprocess.kill(). (#β811, #β836, #β1023) - The
forceKillAfterDelayandkillSignaloptions now apply to terminations due not only tosubprocess.kill()but also to thecancelSignal,timeout,maxBufferandcleanupoptions. (#β714, #β728)
Node.js files
- Use the
nodePathandnodeOptionsoptions with any method, as opposed to onlyexecaNode(), by passing thenode: trueoption. (#β804, #β812, #β815) - When using
execaNode()or thenode: trueoption, 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
- Use the
allandbuffer: falseoptions withexecaSync(), as opposed to onlyexeca(). (#β953, #β956) - Added the
$.salias for$.sync. (#β594)
Inter-process communication
- Use the
ipc: trueoption, as opposed to the more verbosestdio: ['pipe', 'pipe', 'pipe', 'ipc']option. (#β794)
Input validation
- Improved the validation of the
input,timeout,cwd,detached,cancelSignalandencodingoptions. (#β668, #β715, #β803, #β928, #β940) - Improved the validation of the arguments passed to
execa()and the other exported methods. (#β838, #β873, #β899) - Improved the validation of signals passed to
subprocess.kill()and to thekillSignaloption. (#β1025)
Bug fixes
- Fixed passing
undefinedvalues as options. This now uses the option's default value. (#β712) - Fixed the process crashing when the
inputFileoption points to a missing file. ([#β609](https://redirect.g
Configuration
π Schedule: Branch creation - "before 8am on Wednesday" (UTC), 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.
π» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
π Dependency issues cleared. Learn more about Socket for GitHub βοΈ
This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.
New and removed dependencies detected. Learn more about Socket for GitHub βοΈ
| Package | New capabilities | Transitives | Size | Publisher |
|---|