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

Install release-it globally #105

Closed
webpro opened this issue Jun 29, 2020 · 5 comments · Fixed by #108
Closed

Install release-it globally #105

webpro opened this issue Jun 29, 2020 · 5 comments · Fixed by #108

Comments

@webpro
Copy link

webpro commented Jun 29, 2020

First of all, nice repo! :)

I saw a step in the release process saying "install release-it globally", and I traced it down to this repository. But I wonder whether this is the best option?

Generally it's good practice to add release-it to the devDependencies, so it will also automatically receive updates. Also, it's one manual step less in this process.

This could all be automated from the script in this repo, only the command to release would change from release-it to e.g. npm run release (or yarn release).

What do you think?

@rwjblue
Copy link
Owner

rwjblue commented Jun 29, 2020

@webpro - Hey thanks for taking a look!

This could all be automated from the script in this repo, only the command to release would change from release-it to e.g. npm run release (or yarn release).

This has non-trivial issues when using yarn. Specifically, even with publishOptions with registry set (which we do), calling yarn release does not work properly.

Generally it's good practice to add release-it to the devDependencies, so it will also automatically receive updates. Also, it's one manual step less in this process.

I actually do add release-it in devDependencies (see here).

I saw a step in the release process saying "install release-it globally", and I traced it down to this repository. But I wonder whether this is the best option?

My workflow is actually to use volta install release-it, which is not a normal global (it automatically uses the project local version if present, see this blog post). A comparable workflow (without volta) would be to use npx release-it since npx will intentionally defer to a project local node_modules/.bin if one is present, which is exactly what my normal volta based setup does as well.

Either way, I totally agree that we don't really want npm install -g release-it / yarn add --global release-it being done. I'm happy to tweak the language in the generated RELEASE.md files to make the npx workflow clearer (and plausibly even the only thing we mention).

@rwjblue
Copy link
Owner

rwjblue commented Jun 29, 2020

#9 removed the scripts section, and has a bit more info (though sadly not exact error messages / stack traces):

yarn release (even with publishConfig setting the registry) will think it is not authenticated properly.

@webpro
Copy link
Author

webpro commented Jun 29, 2020

Thanks for explaining everything!

So both npx release-it and npm run release strategies work without installing release-it globally. My issue with the description currently is that, by also supporting Yarn, the regular npm users may think they need to install this package globally. So making this more clear in the description would be great indeed. I think everyone is better off by users updating their dependencies (more frequently) :-)

@webpro
Copy link
Author

webpro commented Jun 30, 2020

Thanks @rwjblue! I was actually looking at ./RELEASE.md when I opened this ticket, but obviously the template file is what's being used by the script.

@rwjblue
Copy link
Owner

rwjblue commented Jun 30, 2020

Ah, good call, I’ll update this repos RELEASE.md as well.

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 a pull request may close this issue.

2 participants