chore(deps): replace execa with tinyexec#6454
chore(deps): replace execa with tinyexec#6454sheremet-va merged 15 commits intovitest-dev:mainfrom pralkarz:execa-to-tinyexec
execa with tinyexec#6454Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
| await execa(command, allArgs, { | ||
| stdout: 'inherit', | ||
| stderr: 'inherit', | ||
| await x(command, allArgs, { | ||
| nodeOptions: { | ||
| stdio: ['pipe', 'inherit', 'inherit'], | ||
| }, |
There was a problem hiding this comment.
tinyexec doesn't provide a wrapper that passes the options along to stdio, so we pass them directly. pipe is used for stdin (first item in the array) as it was the default in execa: https://github.com/sindresorhus/execa/blob/HEAD/docs/api.md#optionsstdin.
| const result = await x('git', args, { nodeOptions: { cwd } }) | ||
|
|
||
| return resolve(cwd, result.stdout) | ||
| return resolve(cwd, result.stdout.trim()) |
There was a problem hiding this comment.
execa trims the leading newline by default, while tinyexec doesn't. Without trimming, we'd try to launch git with invalid cwd (due to the leading newline) which broke the functionality.
| cwd: root, | ||
| stdio: 'pipe', | ||
| }, | ||
| throwOnError: false, |
There was a problem hiding this comment.
From what I've investigated in both execa and tinyexec, this should be roughly equivalent to reject: false. Relevant PR: tinylibs/tinyexec#34.
| const child = x(typecheck.checker, args, { | ||
| nodeOptions: { | ||
| cwd: root, | ||
| stdio: 'pipe', |
There was a problem hiding this comment.
stdio: 'pipe' is equivalent to stdio: ['pipe', 'pipe', 'pipe'] which is the default in execa.
execa with tinyexecexeca with tinyexec
That's just so you don't publish a random lockfile. If you update dependency, it's ok to update the lockfile. |
|
Thank you! |
Co-authored-by: Vladimir Sheremet <[email protected]>
Co-authored-by: Vladimir Sheremet <[email protected]>
Description
This PR replaces
execawith a lightertinyexecas discussed here: #5713. Some notes inline as a code review, please let me know whether it'd make sense to comment the code accordingly in those places.Not sure how to handle the third item in the checklist – should I revert the changes that remove the
execadependency?Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.