Post

Working on a course about versioning, changelog generation and releasing NPM packages with @nx.dev. This is the rough learning journey. What are you most interested in when it comes to releasing packages? I'll mostly focus on the releasing aspect, not necessarily package.json props etc

1 repost35 likes

Aaaaaand shipped!!!!! 🚢 🚀 🤩 bsky.app/profile/kent...

Kent C. Dodds 🌌@kentcdodds.com

I'm excited to announce @juri.dev as the newest Epic Instructor with his free tutorial about versioning and releasing npm packages with Nx! www.epicweb.dev/tutorials/ve... This is how I do things as well (the epic workshop app is distributed this way), so check it out!

Testing out the example repo for the course. My favorite part of the log output of nx release is the inline diff of what's gonna change

An interesting topic is automating migration versioning. When multiple people create migrations, they don’t always know the next package version but must set one in migrations.json. How can we manage package releases with dynamically bumped versions? 😊

oh, interesting one 🤔. Noted. Probably out of scope of this course, but I'm gonna have a follow-up about it 👍 I think some communication coordination might still be required and some release process. But def interesting one to simulate through

How does publishing work with CI - when commits can happen faster than the build job, if the build job has unpredictably length? If there can be several commits being built and tested at the same time, possibly out of order, at what point does publishing happen?

Oh there has to be a "cut point". Like manually triggering a release pipeline, or running the release locally which assigns a tag, pushes it, but then the publishing to NPM (including NPM provenance) happens on CI 🙂. Something like that. I'll post here once that video is released :)

Makes sense. I'm interested to find out how other teams have solved this, especially in trunk-based development environments. Feels like the solution must involve some kind of global 'semaphor' that everything synchronises on to coordinate versioning, but not yet found a solid answer.

"Automate the release on CI" sounds like fun! I want to hear more. I actually like running (other release manager package) "nx run release --dry-run" locally, then without, then "git push --follow-tags" but I'm open for improvement and look for a reason to switch to "nx release" anyway 😂

cool. what are you using right now? And what's most tricky to figure out/challenging? Trying to see whether there's something I should cover

standard-version (deprecated) So far, no challenges since we wrote our entire release pipeline ourselves with custom scripts, mono-repo same-version policy etc. years ago Reasons to switch to nx release are getting rid of a deprecation and nx can do most of our scripts out of the box 🙂