-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support for npm@4's new prepublish behavior #1323
Comments
I'm happy to take this one. What's Yarn's approach to compatibility with older versions of npm (or is that a non-issue regards how Yarn works?)? I ask because if we change the publish script to prepublishOnly then you lose support for npm <4. If we keep prepublish, then there's no point in adding prepublishOnly as it will be renamed back to prepublish eventually as you said, and presumably in the meantime for npm 4+5 prepublish as an alias for prepare will still do whatever prepublishOnly does. So for the time being all I've done is add prepare after prepublish in the install phase, the only other place where prepublish appears. And I think that's all that needed doing? Do correct me if I'm wrong, first contribution to Yarn. :-) |
Oh, yeah, feel free to take over that PR/branch. I've been kinda out of time to update it 😢 |
@Kovensky @samhh appears they're asking for an RFC https://github.com/yarnpkg/rfcs |
Just started a new job, not convinced I'll have the time to do this anymore. If anyone else does have the time do grab it :-) |
Done in #3004 |
npm@4 was released a few minutes ago, and it deprecates the
prepublish
verb, renaming it toprepare
, and adding aprepublishOnly
(which runs only on publish).In yarn's case, the only changes should be also running
prepare
whereverprepublish
ran andprepublishOnly
on publish (if yarn can publish?).prepublish
should still be run, but probably should get a deprecation warning.npm@5 is expected to stop running
prepublish
entirely onnpm install
andnpm pack
(i.e. run only onnpm publish
), and then an npm@>=6 should deprecateprepublishOnly
by renaming it toprepublish
.The text was updated successfully, but these errors were encountered: