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

Add runScriptSync for use in version lifecycle methods #1030

Merged
merged 1 commit into from Sep 28, 2017
Merged

Add runScriptSync for use in version lifecycle methods #1030

merged 1 commit into from Sep 28, 2017

Conversation

cwmoo740
Copy link
Contributor

@cwmoo740 cwmoo740 commented Sep 27, 2017

follow up for #1029 and #774

Makes npm preversion/version/postversion scripts synchronous

Description

Add Package.runScriptSync, NpmUtilities.runScriptInDirSync
Converted Publish.js to use these to run lifecycle scripts at appropriate times

Motivation and Context

The prior pr ran the scripts async, which is slightly confusing when a preversion/version script performs side effects like git add abc.

How Has This Been Tested?

Added tests for all three edited files.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

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

It would be nice to run all the preversion/version/postversion scripts in parallel instead of sequentially, but still block on them. I thought about doing this but there were significant code changes needed that would add promises everywhere. If that's preferred I can do that too.

@evocateur
Copy link
Member

I think we would want to use the concurrent batched async loop for this, rather than sync executions? It's a sticky part of the codebase, to be sure, but matching what the other lifecycle executions do should be sufficient?

@gustaff-weldon
Copy link
Contributor

#1029 (review)

@evocateur I believe in this case the whole point of being able to add eg. custom changelog is to wait for preversion/version/postversion scripts to be done before proceeding with anything else.

@evocateur
Copy link
Member

Indeed, I totally spaced that the publish command does not generally worry about parallelism, unlike bootstrap, for example.

Copy link
Member

@evocateur evocateur left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the quick turnaround.

@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.

None yet

3 participants