Skip to content

Commit

Permalink
Categorize type-only and controller-messaged deps correctly
Browse files Browse the repository at this point in the history
There are two special kinds of dependencies that have been frequently
miscategorized:

- Type-only dependencies: These are dependencies from which no runtime
  code is used, but only TypeScript types. Since consumers need these
  types in order to write TypeScript code, these should be listed under
  `dependencies` (not `devDependencies`).
- Controller-messaged dependencies. Say that controller A talks to
  controller B. Controller B in this case needs to be a dependency of A.
  Furthermore, a project that wants to use controller A needs to
  instantiate B before A. Because of the intercommunication between
  these controllers, in order to prevent runtime errors, the version of
  controller B that A relies on must match the version of B that the
  _project_ relies on. To enforce this, B must be listed under A's
  `peerDependencies`, even if it is also listed under its
  `dependencies`.

This commit corrects dependencies for each package in the monorepo such
that they follow the rules above. In rare cases dependencies that were
completely used in production code were listed under `devDependencies`.
These have been corrected as well.
  • Loading branch information
mcmire committed Jun 21, 2024
1 parent ca683e8 commit b7434cb
Show file tree
Hide file tree
Showing 27 changed files with 76 additions and 20 deletions.
4 changes: 4 additions & 0 deletions packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@metamask/snaps-controller` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [17.0.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@metamask/eth-snap-keyring": "^4.3.1",
"@metamask/keyring-api": "^8.0.0",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/snaps-controllers": "^8.1.1",
"@metamask/snaps-sdk": "^4.2.0",
"@metamask/snaps-utils": "^7.4.0",
"@metamask/utils": "^8.3.0",
Expand All @@ -56,7 +57,6 @@
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/snaps-controllers": "^8.1.1",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"jest": "^27.5.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@metamask/keyring-api` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))
- Add `@types/lodash` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [33.0.0]

### Added
Expand Down
4 changes: 2 additions & 2 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@metamask/contract-metadata": "^2.4.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/eth-query": "^4.0.0",
"@metamask/keyring-api": "^8.0.0",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/network-controller": "^19.0.0",
Expand All @@ -61,6 +62,7 @@
"@metamask/rpc-errors": "^6.2.1",
"@metamask/utils": "^8.3.0",
"@types/bn.js": "^5.1.5",
"@types/lodash": "^4.14.191",
"@types/uuid": "^8.3.0",
"async-mutex": "^0.5.0",
"bn.js": "^5.2.1",
Expand All @@ -73,9 +75,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/ethjs-provider-http": "^0.3.0",
"@metamask/keyring-api": "^8.0.0",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/chain-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- **BREAKING:** Add `@metamask/snaps-controllers` as a peer dependency ([#4449](https://github.com/MetaMask/core/pull/4449))
- Remove `@types/readable-stream` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [0.1.0]

### Changed
Expand Down
4 changes: 3 additions & 1 deletion packages/chain-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.9.5"
},
"peerDependencies": {
"@metamask/snaps-controllers": "^8.1.1"
},
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/composable-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `immer` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [7.0.0]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions packages/composable-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^6.0.0"
"@metamask/base-controller": "^6.0.0",
"immer": "^9.0.6"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/json-rpc-engine": "^9.0.0",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"immer": "^9.0.6",
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/ens-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@metamask/network-controller` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [12.0.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/ens-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"@ethersproject/providers": "^5.7.0",
"@metamask/base-controller": "^6.0.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/network-controller": "^19.0.0",
"@metamask/utils": "^8.3.0",
"punycode": "^2.1.1"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/network-controller": "^19.0.0",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/json-rpc-middleware-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@types/readable-stream` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [8.0.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/json-rpc-middleware-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"@metamask/json-rpc-engine": "^9.0.0",
"@metamask/safe-event-emitter": "^3.0.0",
"@metamask/utils": "^8.3.0",
"@types/readable-stream": "^2.3.0",
"readable-stream": "^3.6.2"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"deepmerge": "^4.2.2",
"extension-port-stream": "^3.0.0",
"jest": "^27.5.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/keyring-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@ethereumjs/tx` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [17.1.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@ethereumjs/tx": "^4.2.0",
"@ethereumjs/util": "^8.1.0",
"@keystonehq/metamask-airgapped-keyring": "^0.14.1",
"@metamask/base-controller": "^6.0.0",
Expand All @@ -57,7 +58,6 @@
},
"devDependencies": {
"@ethereumjs/common": "^3.2.0",
"@ethereumjs/tx": "^4.2.0",
"@keystonehq/bc-ur-registry-eth": "^0.19.0",
"@lavamoat/allow-scripts": "^3.0.4",
"@metamask/auto-changelog": "^3.4.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/notification-services-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Remove `@types/readable-stream` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [0.1.0]

### Added
Expand Down
1 change: 0 additions & 1 deletion packages/notification-services-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@lavamoat/allow-scripts": "^3.0.4",
"@metamask/auto-changelog": "^3.4.4",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/permission-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@metamask/approval-controller` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [10.0.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/permission-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/approval-controller": "^7.0.0",
"@metamask/base-controller": "^6.0.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/json-rpc-engine": "^9.0.0",
Expand All @@ -52,7 +53,6 @@
"nanoid": "^3.1.31"
},
"devDependencies": {
"@metamask/approval-controller": "^7.0.0",
"@metamask/auto-changelog": "^3.4.4",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
Expand Down
4 changes: 4 additions & 0 deletions packages/preferences-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@metamask/keyring-controller` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [13.0.0]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions packages/preferences-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
},
"dependencies": {
"@metamask/base-controller": "^6.0.0",
"@metamask/controller-utils": "^11.0.0"
"@metamask/controller-utils": "^11.0.0",
"@metamask/keyring-controller": "^17.1.0"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-controller": "^17.1.0",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/queued-request-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@metamask/network-controller` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))
- Add `@metamask/selected-network-controller` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [1.0.0]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions packages/queued-request-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"@metamask/base-controller": "^6.0.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/json-rpc-engine": "^9.0.0",
"@metamask/network-controller": "^19.0.0",
"@metamask/rpc-errors": "^6.2.1",
"@metamask/selected-network-controller": "^15.0.2",
"@metamask/swappable-obj-proxy": "^2.2.0",
"@metamask/utils": "^8.3.0"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/network-controller": "^19.0.0",
"@metamask/selected-network-controller": "^15.0.2",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"immer": "^9.0.6",
Expand Down
4 changes: 4 additions & 0 deletions packages/selected-network-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `immer` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [15.0.2]

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions packages/selected-network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
"@metamask/network-controller": "^19.0.0",
"@metamask/permission-controller": "^10.0.0",
"@metamask/swappable-obj-proxy": "^2.2.0",
"@metamask/utils": "^8.3.0"
"@metamask/utils": "^8.3.0",
"immer": "^9.0.6"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"immer": "^9.0.6",
"jest": "^27.5.1",
"lodash": "^4.17.21",
"nock": "^13.3.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Add `@types/bn.js` as a dependency ([#4449](https://github.com/MetaMask/core/pull/4449))

## [33.0.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@metamask/nonce-tracker": "^5.0.0",
"@metamask/rpc-errors": "^6.2.1",
"@metamask/utils": "^8.3.0",
"@types/bn.js": "^5.1.5",
"async-mutex": "^0.5.0",
"bn.js": "^5.2.1",
"eth-method-registry": "^4.0.0",
Expand All @@ -71,7 +72,6 @@
"@metamask/eth-json-rpc-provider": "^4.0.0",
"@metamask/ethjs-provider-http": "^0.3.0",
"@metamask/keyring-api": "^8.0.0",
"@types/bn.js": "^5.1.5",
"@types/jest": "^27.4.1",
"@types/node": "^16.18.54",
"deepmerge": "^4.2.2",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2468,14 +2468,15 @@ __metadata:
"@metamask/snaps-utils": ^7.4.0
"@metamask/utils": ^8.3.0
"@types/jest": ^27.4.1
"@types/readable-stream": ^2.3.0
deepmerge: ^4.2.2
jest: ^27.5.1
ts-jest: ^27.1.4
typedoc: ^0.24.8
typedoc-plugin-missing-exports: ^2.0.0
typescript: ~4.9.5
uuid: ^8.3.2
peerDependencies:
"@metamask/snaps-controllers": ^8.1.1
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -3256,7 +3257,6 @@ __metadata:
"@metamask/keyring-controller": ^17.1.0
"@metamask/profile-sync-controller": ^0.1.0
"@types/jest": ^27.4.1
"@types/readable-stream": ^2.3.0
bignumber.js: ^4.1.0
contentful: ^10.3.6
deepmerge: ^4.2.2
Expand Down

0 comments on commit b7434cb

Please sign in to comment.