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

Support for npm@4's new prepublish behavior #1323

Closed
Jessidhia opened this issue Oct 21, 2016 · 6 comments
Closed

Support for npm@4's new prepublish behavior #1323

Jessidhia opened this issue Oct 21, 2016 · 6 comments

Comments

@Jessidhia
Copy link

Jessidhia commented Oct 21, 2016

npm@4 was released a few minutes ago, and it deprecates the prepublish verb, renaming it to prepare, and adding a prepublishOnly (which runs only on publish).

In yarn's case, the only changes should be also running prepare wherever prepublish ran and prepublishOnly 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 on npm install and npm pack (i.e. run only on npm publish), and then an npm@>=6 should deprecate prepublishOnly by renaming it to prepublish.

@samhh
Copy link

samhh commented Feb 15, 2017

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. :-)

@timoxley
Copy link
Contributor

timoxley commented Mar 2, 2017

@samhh you may want to investigate #1499

@Jessidhia
Copy link
Author

Oh, yeah, feel free to take over that PR/branch. I've been kinda out of time to update it 😢

@timoxley
Copy link
Contributor

timoxley commented Mar 2, 2017

@Kovensky @samhh appears they're asking for an RFC https://github.com/yarnpkg/rfcs

@samhh
Copy link

samhh commented Mar 2, 2017

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 :-)

@bestander
Copy link
Member

Done in #3004

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

No branches or pull requests

6 participants