How to Manage Versioning in a Monorepo with Shared Libraries?

0
11
Asked By CuriousCoder92 On

I have two applications, A and B, that both rely on a shared UI library. If I need to make significant changes to the UI library, how can I version it in such a way that application A uses the new version while application B continues to use the old version? Any advice would be appreciated!

4 Answers

Answered By TechWizard99 On

It's generally recommended to keep all internal packages updated to the latest version in a monorepo. If you change the UI library and it breaks application B, you shouldn't publish anything until you fix B. This ensures that all applications are in sync and working properly.

Answered By DevNinja66 On

In a monorepo, the ideal situation is to keep everything at the same version. If you start wanting different versions for different apps, you might be better off separating them into individual repositories. This way, each can manage its own dependencies without conflict.

Answered By CodeMasterX On

You should consider using a CLI tool that can check the versions of all your monorepo packages and update them accordingly. This can help with versioning when making major changes. Just remember, consistency is key — everything should ideally use the same version to avoid complications.

Answered By DevEnthusiast21 On

If you're temporarily migrating and need different versions, you can pin specific versions in each app's package.json instead of using `workspace:*`. This method works as a short-term solution. Just be careful — that's not a long-term fix. It's best to prioritize updating all apps to the latest version eventually.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.