Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use execa for child_process calls #759

Merged
merged 24 commits into from
Apr 13, 2017
Merged

Use execa for child_process calls #759

merged 24 commits into from
Apr 13, 2017

Conversation

evocateur
Copy link
Member

@evocateur evocateur commented Apr 13, 2017

Description

execa gives us much more robust interface for child_process, with a Promise API that will make async/await much easier to migrate to.

Notables

  • execa makes calling dependency binaries a cinch.
  • Registering children takes advantage of the rich Promise API.
  • Streamed output now has prefixing via strong-log-transformer pipes (timestamps available with an option).

How Has This Been Tested?

Updated unit and integration tests, as well as local testing via yarn link.

Types of changes

  • Internal

There are cleanups to the recent CLI refactoring; unfortunately they're too tightly coupled with the other changes in the PR.

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@evocateur evocateur merged commit a201362 into lerna:master Apr 13, 2017
@evocateur evocateur deleted the execa branch April 13, 2017 07:51
if (!exists) return callback();

// Note: if rimraf moves the location of its executable, this will need to be updated
ChildProcessUtilities.spawn(require.resolve("rimraf/bin"), [filePath], {}, callback);
ChildProcessUtilities.spawn("rimraf", ["--no-glob", trailingSlash(dirPath)], {}, callback);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lost the require.resolve, so it doesn't seem to work if rimraf is not in your path or a top-level dependency.

@evocateur
Copy link
Member Author

evocateur commented Apr 18, 2017 via email

evocateur added a commit to evocateur/lerna that referenced this pull request Apr 18, 2017
To protect Windows from itself, use explicit 'node <execFile>' call style.

Refs lerna#759
Fixes lerna#708
evocateur added a commit to evocateur/lerna that referenced this pull request Apr 18, 2017
To protect Windows from itself, use explicit 'node <execFile>' call style.

Refs lerna#759
Fixes lerna#708
evocateur added a commit to evocateur/lerna that referenced this pull request Apr 18, 2017
To protect Windows from itself, use explicit 'node <execFile>' call style.

Refs lerna#759
Fixes lerna#708
@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants