Skip to content

Commit 784fdf9

Browse files
authored
fix: Ensure peer dependencies reflect latest breaking changes (#6652)
## Explanation Our constraints for `peerDependencies` previously only required the major version to match. However, this was problematic for pre-1.0 packages because it allowed for situations where we cannot update a package without introducing a peer dependency error, since pre-1.0 packages can have breaking changes in minor or patch releases. The constraint has been updated to require the most significant part of the version to be synchronized for peer dependencies, and all resulting constraint errors have been auto-fixed. ## References N/A ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes - Extension: MetaMask/metamask-extension#36093 - Mobile: MetaMask/metamask-mobile#20044
1 parent 8289934 commit 784fdf9

File tree

10 files changed

+29
-10
lines changed

10 files changed

+29
-10
lines changed

packages/account-tree-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- **BREAKING:** Bump peer dependency `@metamask/multichain-account-service` from `^0.8.0` to `^0.11.0` ([#6652](https://github.com/MetaMask/core/pull/6652))
13+
1014
## [0.18.1]
1115

1216
### Fixed

packages/account-tree-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"@metamask/account-api": "^0.12.0",
7979
"@metamask/accounts-controller": "^33.0.0",
8080
"@metamask/keyring-controller": "^23.0.0",
81-
"@metamask/multichain-account-service": "^0.8.0",
81+
"@metamask/multichain-account-service": "^0.11.0",
8282
"@metamask/profile-sync-controller": "^25.0.0",
8383
"@metamask/providers": "^22.0.0",
8484
"@metamask/snaps-controllers": "^14.0.0",

packages/assets-controllers/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- **BREAKING:** Bump peer dependency `@metamask/account-tree-controller` from `^0.7.0` to `^0.18.0` ([#6652](https://github.com/MetaMask/core/pull/6652))
13+
1014
## [75.2.0]
1115

1216
### Added

packages/assets-controllers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"webextension-polyfill": "^0.12.0"
112112
},
113113
"peerDependencies": {
114-
"@metamask/account-tree-controller": "^0.7.0",
114+
"@metamask/account-tree-controller": "^0.18.0",
115115
"@metamask/accounts-controller": "^33.0.0",
116116
"@metamask/approval-controller": "^7.0.0",
117117
"@metamask/keyring-controller": "^23.0.0",

packages/earn-controller/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16+
- **BREAKING:** Bump peer dependency `@metamask/account-tree-controller` from `^0.12.1` to `^0.18.0` ([#6652](https://github.com/MetaMask/core/pull/6652))
1617
- Bump `@metamask/controller-utils` from `^11.12.0` to `^11.14.0` ([#6620](https://github.com/MetaMask/core/pull/6620), [#6629](https://github.com/MetaMask/core/pull/6629))
1718
- Bump `@metamask/base-controller` from `^8.2.0` to `^8.4.0` ([#6465](https://github.com/MetaMask/core/pull/6465), [#6632](https://github.com/MetaMask/core/pull/6632))
1819
- Bump `@metamask/keyring-api` from `^20.1.0` to `^21.0.0` ([#6560](https://github.com/MetaMask/core/pull/6560))

packages/earn-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"typescript": "~5.2.2"
7070
},
7171
"peerDependencies": {
72-
"@metamask/account-tree-controller": "^0.12.1",
72+
"@metamask/account-tree-controller": "^0.18.0",
7373
"@metamask/network-controller": "^24.0.0"
7474
},
7575
"engines": {

packages/network-enablement-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- **BREAKING:** Bump peer dependency `@metamask/multichain-network-controller` from `^0.11.0` to `^0.12.0` ([#6652](https://github.com/MetaMask/core/pull/6652))
13+
1014
## [1.2.0]
1115

1216
### Changed

packages/network-enablement-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"reselect": "^5.1.1"
6868
},
6969
"peerDependencies": {
70-
"@metamask/multichain-network-controller": "^0.11.0",
70+
"@metamask/multichain-network-controller": "^0.12.0",
7171
"@metamask/network-controller": "^24.0.0",
7272
"@metamask/transaction-controller": "^60.0.0"
7373
},

yarn.config.cjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,16 @@ function expectUpToDateWorkspacePeerDependencies(Yarn, workspace) {
663663
dependency.range,
664664
)
665665
) {
666-
// We allow "non-stable" peer dependency to be set to any range
667-
// until they are being "stable" (^1.0.0).
666+
// Ensure peer dependency includes latest breaking changes.
667+
//
668+
// Technically pre-1.0 versions can make breaking changes in patch releases, but
669+
// conventionally we always bump the most significant digit for breaking changes.
668670
if (dependencyWorkspaceVersion.major > 0) {
669671
dependency.update(`^${dependencyWorkspaceVersion.major}.0.0`);
672+
} else if (dependencyWorkspaceVersion.minor > 0) {
673+
dependency.update(`^0.${dependencyWorkspaceVersion.minor}.0`);
674+
} else {
675+
dependency.update(`^0.0.${dependencyWorkspaceVersion.patch}`);
670676
}
671677
}
672678
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@ __metadata:
24352435
"@metamask/account-api": ^0.12.0
24362436
"@metamask/accounts-controller": ^33.0.0
24372437
"@metamask/keyring-controller": ^23.0.0
2438-
"@metamask/multichain-account-service": ^0.8.0
2438+
"@metamask/multichain-account-service": ^0.11.0
24392439
"@metamask/profile-sync-controller": ^25.0.0
24402440
"@metamask/providers": ^22.0.0
24412441
"@metamask/snaps-controllers": ^14.0.0
@@ -2639,7 +2639,7 @@ __metadata:
26392639
uuid: "npm:^8.3.2"
26402640
webextension-polyfill: "npm:^0.12.0"
26412641
peerDependencies:
2642-
"@metamask/account-tree-controller": ^0.7.0
2642+
"@metamask/account-tree-controller": ^0.18.0
26432643
"@metamask/accounts-controller": ^33.0.0
26442644
"@metamask/approval-controller": ^7.0.0
26452645
"@metamask/keyring-controller": ^23.0.0
@@ -3068,7 +3068,7 @@ __metadata:
30683068
typedoc-plugin-missing-exports: "npm:^2.0.0"
30693069
typescript: "npm:~5.2.2"
30703070
peerDependencies:
3071-
"@metamask/account-tree-controller": ^0.12.1
3071+
"@metamask/account-tree-controller": ^0.18.0
30723072
"@metamask/network-controller": ^24.0.0
30733073
languageName: unknown
30743074
linkType: soft
@@ -4056,7 +4056,7 @@ __metadata:
40564056
typedoc-plugin-missing-exports: "npm:^2.0.0"
40574057
typescript: "npm:~5.2.2"
40584058
peerDependencies:
4059-
"@metamask/multichain-network-controller": ^0.11.0
4059+
"@metamask/multichain-network-controller": ^0.12.0
40604060
"@metamask/network-controller": ^24.0.0
40614061
"@metamask/transaction-controller": ^60.0.0
40624062
languageName: unknown

0 commit comments

Comments
 (0)