How to Bump Dependent Packages When a Dependency Changes
When an internal package releases, its dependents usually need a matching bump so their pinned dependency range stays valid.
If @acme/app depends on @acme/core and @acme/core gets a new version, @acme/app needs its dependency range updated and often a patch bump. Changesets does this automatically based on updateInternalDependencies.
Steps
- Set
updateInternalDependenciesin.changeset/config.json(patchorminor). - Run
changeset version; dependents get a bump and an updated dependency range. - Confirm the dependent range points at the new dependency version.
Config
.changeset/config.json
{
"updateInternalDependencies": "patch",
"bumpVersionsWithWorkspaceProtocolOnly": false
}Result
Terminal
# @acme/core bumped 1.2.0 -> 1.3.0 (minor changeset)
# @acme/app auto-bumped 4.0.1 -> 4.0.2 (patch) with:
# "dependencies": { "@acme/core": "^1.3.0" }Gotchas
- With
bumpVersionsWithWorkspaceProtocolOnly: true, onlyworkspace:ranges are rewritten, leaving pinned external ranges alone. - A cascade can touch many packages; review the Version Packages PR to see the full blast radius.
Related guides
How to Publish Only the Changed Packages in a MonorepoPublish just the packages whose version increased by letting the tool compare local package.json versions aga…
How to Publish Monorepo Packages in Topological OrderPublish packages in dependency-first (topological) order so a dependent never lands on the registry before th…