Package Publishing Reading & Resources
Tags: javascript, npm
Published: 2023-01-18 00:43:29

I have big plans in the works to overhaul a few projects and, to prep for that, I’ve been doing a lot of reading up on different approaches to publishing JavaScript packages. These are a few resources I’ve found particularly useful and informative.

- [How to Publish an Updated Version of an npm Package – Cloud Four](https://cloudfour.com/thinks/how-to-publish-an-updated-version-of-an-npm-package/) - I’ve used different tools to automate releases in the past but had no idea what they were doing under the hood. This article walks through creating a release and publishing to npm and Git with detailed explanations at every step. It’s a great starting point since understanding the manual process makes evaluating different automated strategies a lot easier.
- [Automate npm publishing with GitHub Actions, proper changelog, and release notes](https://superface.ai/blog/npm-publish-gh-actions-changelog) - I'm looking for a solution that includes independently versioned monorepos so this guide isn't a perfect fit. However, using GitHub Actions to manually trigger a release and enter the correct version bump (major, minor, patch, etc.) is a really clever approach. 
- [Release Workflow | Yarn - Package Manager](https://yarnpkg.com/features/release-workflow) - Yarn's release workflow for monorepos is an experimental feature so I’m holding off for now but I hope it pans out. The section on deferred versioning and record keeping is especially intriguing.
- Tools! Trying to figure out which of these options would best serve my needs:
  - [semantic-release](https://github.com/semantic-release/semantic-release) - My current tool of choice. semantic-release depends on commit messages that follow Angular's commit message conventions for versioning. Unfortunately, it doesn't play nice with monorepos (for more details, here's a little extra credit reading [The chronicles of semantic-release and monorepos](https://dev.to/antongolub/the-chronicles-of-semantic-release-and-monorepos-5cfc)).
  - [Auto - Intuit](https://github.com/intuit/auto) - Automates releases based on pull request labels. I used this at a previous job and appreciated that it didn't require linting commit messages or any extra effort from contributors. The downside, Lerna is a must for use with monorepos.
  - [Release It!](https://github.com/release-it/release-it) - This seems promising. A CLI tool that can be used in interactive or continuous integration mode. The big appeal for me is a Yarn workspaces specific plugin.

Finally, recommendations are welcome so here’s my brief. I want to combine multiple packages that currently live in separate repos into a single monorepo using Yarn workspaces. Ideally, I’d like to independently version the packages without adding Lerna and use GitHub Actions for CI/CD. If you have a similar setup, let me know what's worked for you.

Cover photo by [Patrick Tomasso](https://unsplash.com/@impatrickt?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/photos/Oaqk7qqNh_c?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText).