Managing peerDependency versions at the root
See original GitHub issueExpected Behavior
As a developer, I’d like to be able to manage SOME of my packages’ peerDependencies at the root of my project.
Directory structure
package.json
| -- packages
| -- foo
| -- package.json
| -- bar
| -- package.json
foo’s package.json
{
...
"peerDependencies": {
"@angular/core": "NG_VERSION"
}
...
}
bar’s package.json
{
...
"peerDependencies": {
"@angular/core": "NG_VERSION"
}
...
}
root package.json
{
...
"dependencies": {
"@angular/core": "^8.0.0"
}
...
}
Current Behavior
I couldn’t find anything in the docs regarding this model, and as it stands, this makes version management of common packages across a large number of libraries extremely painful.
Possible Solution
Provide a way to link the peerDependency of a package to the root’s version.
lerna.json
{
"packages": [
"apps/*",
"libs/*"
],
"version": "0.0.1"
}
Context
I’d like to make common version management of my packages easier.
Your Environment
lerna --version
3.13.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Understanding Peer Dependencies in JavaScript
In this case, you would declare React as a peer dependency for your components, because you want the host project to have the...
Read more >npm Peer Dependencies - Fathom
When specifying the allowed versions of a package in a peer dependency in our package.json , we often want to specify more liberal...
Read more >npm Peer Dependencies - JavaScript inDepth
Peer Dependencies are used to specify that our package is compatible with a specific version of an npm package. Good examples are Angular...
Read more >npm: refer to a peer dependency; how to align the version ...
I'm using the root function from that library and, in fact, if dependency-A bumps the version, I'd like to align with it and...
Read more >[Fixed] NPM conflicting peer dependency error
NPM is a great tool to manage packages for your projects, ... Installing NPM modules using NPM version 7.11.1 npm ERR! code ERESOLVE...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MunifTanjim what I’m saying is that when I run
lerna publish
I would like to use the variable version from the root as opposed to having to manage the samepeerDependency
in each package that depends upon it within my monorepo.Apologies for the lack of clarity.
For example, if you publish fifteen libraries that depend on
"react" : "^6.0.0"
from the same monorepo, I would like to make sure that I don’t have to increment thereact
peerDependency in every single package when react publishes a new major version. I would instead like to be able to define it at the root and utilize the root version at publish time forlerna publish
.would even be sufficient.
FEATURE