As stated above, I have a couple of projects built with Spring + Angular architecture. It was all going smoothly when we started, but once I started updating Angular versions to keep it current, things started getting complicated; the usual dependencies angular cli / core/ material design, etc were causing issues.

I was thinking of making use of Angular Workspaces. Do I need to checkout all my angular folder into a separate workspace and update them from within the workspace ?

Couldn't find much material on this, any leads would be greatly appreciated.

1

There are 1 best solutions below

0
On

When creating an angular library, the library package.json state

"peerDependencies": {
    "@angular/common": "^12.1.1",
    ...
}
  • The ^ means @angular/common 12.x.x.
  • A ~12.1.1 means @example/my-package 12.1.x

So when using the library in an application that would use angular 13, npm install will fail to execute.

That being said, when creating/versioning angular libraries, try giving it the same major version number as the angular version you're targetting in your library. When next you create an angular 12 application, you install some version 12 of your library/package, which targets angular 12.