release-it icon indicating copy to clipboard operation
release-it copied to clipboard

Auto bump linked dependencies of monorepo

Open phucdph opened this issue 2 years ago • 5 comments

Greeting. Thanks for this amazing tool.

I used release-it on my mono repo project as an example below: . ├── ... ├── packages
│ ├── package-a
│ ├── package-b

And package-b uses package-a internally. Currently. When using release-it to the new version with @release-it-plugins/workspaces. All the packages will share the same version.

My question is: Is there any way these packages have a different version? Only bump when have any changes to it. In the example above, this is how it works:

package-a on 0.2.0 package-b on 0.2.3

I made some changes to package-a, so will be bumped to 0.2.1, and package-b will automatically be bumped to 0.2.4. (like changesets)

Thanks for your help.

phucdph avatar Aug 29 '23 17:08 phucdph

Sounds like an issue for the https://github.com/release-it-plugins/workspaces repo, right? It's a separate project not maintained by me :)

webpro avatar Aug 29 '23 17:08 webpro

Yes. It is definitely an issue of release-it-plugins/workspaces. But following the monorepo recipe (not using release-it-plugins/workspaces anymore). Is there any way to archive that release behavior? @webpro

phucdph avatar Aug 29 '23 18:08 phucdph

Yes, it's the default behavior when you use that recipe, it just runs the release-it process for each workspace separately

webpro avatar Aug 29 '23 18:08 webpro

Yes, it's the default behavior when you use that recipe, it just runs the release-it process for each workspace separately

Hmm. I see the docs write "If all workspaces should be bumped to the same version and are published at the same time, then follow the two steps in this guide.". That means the behavior is not like I mentioned before. Am I missing something?

phucdph avatar Aug 29 '23 19:08 phucdph

It depends. The release-it process runs for each package separately, so you can version them independently. Indeed the main thing for you here, "auto bump linked dependencies" would need to be resolved differently. So it's not something you can just copy as-is indeed.

Perhaps you could defer the npm publish step to Changesets? I think it does this?

webpro avatar Aug 30 '23 04:08 webpro

Closing due to inactivity

webpro avatar Jul 08 '24 17:07 webpro