Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

managing 2 npm lib releases - of the same lib - in one registry?

One of our apps (my-app) dependencies is an npm lib we publish to npm (my-lib).

name: my-app;
version: <my-app-version>
dependencies: {
   my-lib: <my-lib-version>
}

As a company we are committed to support the current version and 1 older version. my-app 1.0.0 depends on my-lib 1.0.0

 name: my-app;
 version: 1.0.0
 dependencies: {
   my-lib: 1.0.0
 }

my-app 2.0.0 depends on latest my-lib which is 3.1.0

 name: my-app;
 version: 2.0.0
 dependencies: {
   my-lib: 3.1.0
 }

We have a bug in my-lib which we must fix for both. The easy thing to do would be fixing in 3.1.0, but my-app 1.0.0 can't adopt 3.1.0 as it introduces breaking changes, and must stay in version 1.X.X. What's the standard way to fix my-lib in both?

like image 412
Mattan Bitner Avatar asked Nov 08 '22 16:11

Mattan Bitner


1 Answers

If you decide to update both 1.x.x and 3.x.x versions, you might keep working on 2 separated GIT branches and publish 2 separate patch releases on NPM.

like image 132
Andrea Carraro Avatar answered Nov 14 '22 22:11

Andrea Carraro