Process for upgrading a shared dependency across a specified scope
See original GitHub issueI’m wondering what the process for updating a shared external dependency across multiple packages should be. This could be my lack of understanding and/or a feature request.
Expected Behavior
Let’s say you have a shared external dependency shared-module
which gets updated. You now want to update that dependency across two modules that use it:
$ lerna add shared-module scope=module-1,module-2 # add the latest version of shared-module to module-1 and module-2
$ lerna add shared-module@x.y.z scope=module-1,module-2 # add shared-module@x.y.z to module-1 and module-2
Current Behavior
Lerna detects that shared-module
is already a dependency of module-1
(even though it’s an older version) and does nothing:
$ lerna add shared-module@3.10.3 --scope=module-1
lerna info version 2.11.0
lerna info scope my-module
lerna WARN No packages found in scope where shared-module can be added.
Possible Solution
Perhaps some method akin to npm install
and/or npm upgrade
that can be applied across selected lerna scopes.
lerna.json
{
"lerna": "2.11.0",
"packages": [
"packages/apps/*",
"packages/lib/*",
"packages/services/*",
"packages/tools/*"
],
"version": "4.0.0"
}
Context
Trying to manage a shared, external dependency (that we can’t pull into the monorepo itself) and maintain consistent dependencies across our entire codebase
Your Environment
Executable | Version |
---|---|
lerna --version |
2.11.0 |
npm --version |
6.1.0 |
node --version |
10.3.0 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Chapter 1 Planning for Upgrades - Oracle Help Center
One of the main issues in planning the upgrade of any given Java ES component is to understand that component's dependencies on other...
Read more >Sharing dependency versions between projects
Catalogs can separate the group and name of a dependency from its actual version and use version references instead, making it possible to...
Read more >Introduction to the Dependency Mechanism - Apache Maven
Dependency scope is used to limit the transitivity of a dependency and to determine when a dependency is included in a classpath. There...
Read more >c# - Change dependency resolution for specific scope only
I can't reuse the same Scope because ItemService (and/or it's dependencies) uses other scoped services that can't be shared. Neither I want to ......
Read more >Understanding dependencies in project management - Asana
A project dependency is a task that relies on the completion of a different task. ... Scope: How much of the team's resources...
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 Free
Top 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
yeah,
lerna add
doesn’t do that right now.lerna upgrade
is not implemented yet.It’s something I’d like to do, and would certainly collaborate actively if someone wants to make a pull request.