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 RFC for script run hooks #70

Merged
merged 1 commit into from
Jun 29, 2017
Merged

add RFC for script run hooks #70

merged 1 commit into from
Jun 29, 2017

Conversation

deecewan
Copy link
Contributor

This was spurred by yarnpkg/yarn#3209 (comment) to try and normalise the hooks that run and when.

- `shrinkwrap`
- before `shrinkwrap`
- confusing, but runs *before* the shrinkwrap is created
- I'm not sure `yarn` needs to include this, given that `shrinkwrap` is not
Copy link
Member

Choose a reason for hiding this comment

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

yeah, we don't need shrinkwraps.

Choose a reason for hiding this comment

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

the shrinkwrap scripts also run when creating the new package-lock.json, so yarn should also run if when creating the yarn.lock file, for a closer 1-to-1 match

@bestander
Copy link
Member

Great work, @deecewan!

@bestander
Copy link
Member

Let me summon a few folks who have more context

@bestander
Copy link
Member

My opinion - this looks fine, we should just match npm@5 and move forward.
Are there any tricks we need to address here?
I remember seeing a few issues where people are expecting to run post/preinstall scripts when reinstalling node_modules.

@deecewan
Copy link
Contributor Author

AFAIK, from the docs and from testing, I've enumerated how everything works. I might make a couple of test scripts for npm@5 to 'codify' the expected behaviours.

@bestander
Copy link
Member

Great job, @deecewan!
Let's do it! Are you up to send a few PRs?
Tests would be very important to make sure we don't regress

@deecewan
Copy link
Contributor Author

yeah, keen!

I'll do what I can 👍

@andreineculau
Copy link

FYI a programmatic comparison of which hooks run and in what order, along with the toold can now be found at https://github.com/andreineculau/package-json-scripts

@bestander
Copy link
Member

@deecewan, any chance you've had a crack at this?
@andreineculau, do you want to help out?

@andreineculau
Copy link

@bestander I'm both limited by time and incentive as I do not use yarn in my routine. I've done the package-json-scripts investigation because we intend to have git dependencies, and I've seen inconsistencies. My first npm alternative to try out is pnpm actually, so trying out and even committing to yarn is too much in the future.

What I can help out with, no doubt, is doing one final manual testing of whatever new behaviour lands or is about to land in yarn, if nobody wants to run https://github.com/andreineculau/package-json-scripts themselves.

@deecewan
Copy link
Contributor Author

@bestander i started taking a look at this. yarn already does 95% of theses hooks in the correct order. I went through and figured out which hooks run and when, and then went through yarn and checked on them.

from memory, i think there were only 1 or 2 changes. i'll take another look after work tonight.

@bestander
Copy link
Member

@deecewan, awesome, thank you very much.
Do you think you could set up a couple of tests that cover this contract?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants