question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Process for upgrading a shared dependency across a specified scope

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
evocateurcommented, Jun 14, 2018

yeah, lerna add doesn’t do that right now. lerna upgrade is not implemented yet.

1reaction
evocateurcommented, Dec 28, 2018

It’s something I’d like to do, and would certainly collaborate actively if someone wants to make a pull request.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found