Automatic Dependency Updates Within Monorepo
See original GitHub issueProblem
If I have @scope/package-a
, @scope/package-b
, @scope/package-c
. Both @scope/package-b
and , @scope/package-c
rely on @scope/package-a
. When I make a change to @scope/package-a
, commit & create yarn changeset
, select @scope/package-a
and update it with a patch version, then yarn changeset version
, @scope/package-a
’s version changes, but both @scope/package-b
AND @scope/package-c
’s dependencies @scope/package-a
does not get changed.
What’s the best way to ensure ALL dependents change to new latest version within its range? This happens with pre-releases for me as well as normal. I’ve tried changing package-a
to minor AND major.
chanset --version
2.11.0
node --version
v13.13.0
yarn --version
1.22.4
config.json
{
"$schema": "https://unpkg.com/@changesets/config@1.4.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Automatic Dependency Updates Within Monorepo · Issue #476
When I make a change to @scope/package-a , commit & create yarn changeset , select @scope/package-a and update it with a patch version,...
Read more >Automate dependency updates | Nicky blogs
Staying up to date with every dependency your project uses quickly turns into a chore. It's a never-ending stream of new releases.
Read more >How to Easily Manage Dependencies in a JS Monorepo
Dependency management in a JavaScript monorepo is made much simpler with pnpm ... Automatic solutions and libraries can help but usually, ...
Read more >Automate Dependency Updates With Renovate, Not With ...
It normally happens with monorepo dependencies. In such a situation, you can group update PRs of them into one PR.
Read more >Automating Dependency Updates for Your GitHub Projects
In this article, we'll be using it to automatically run tests against pull requests made by Renovate to ensure that dependency updates do...
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
I believe you have made mistakes in that example output:
pkg-a
should haveversion: 2.0.0
pkg-b
should haveversion: 1.1.0
Nevertheless, I get your point. Why the dependency ranges have changed in here? Because the packages that are being published get dependency ranges updates according to
updateInternalDependencies
setting. This makes sense because when you change the code of a dependant package it might start to depend on some fresh code in a monorepo setup from a dependency package - so it’s safer to update the range. The idea was that if u change the code of a dependency then most likely a dependant package should not be affected by this but when you change the code of a dependant package it should always use the latest version of its monorepo dependencies - otherwise, it would be fairly easy to publish broken releases. This leads to some inconsistencies around when dependency ranges are updated - might be surprising at times.As mentioned - we recognize this problem and we’d like to have it fixed, but I’m afraid that we don’t have much time to implement a solution for this ourselves currently. I’d be more than happy to assist anyone with guidance, code reviews etc if one would like to implement this.
In such a case we don’t always update dependant packages - if their dependency ranges are satisfied by a new version of
package-a
then an update is skipped.This is causing some problems/difficulties though - I was discussing this with @mitchellhamilton some time ago. From what I remember we’ve agreed on introducing an experimental flag that would change this behavior (to what you want, from what I understand) with a perspective of it becoming a default in the future.
Could you confirm that this is what you expect:
Input:
Output: