Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move deps to devDeps for types + use peerDep for keyring-api #131

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .syncpackrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"label": "use workspace version of the keyring-api",
"dependencyTypes": ["!local"],
"dependencyTypes": ["!peer", "!local"],
"dependencies": ["@metamask/keyring-api"],
"pinVersion": "workspace:^"
},
Expand Down Expand Up @@ -57,5 +57,12 @@
"dependencies": ["@metamask/keyring-utils"],
"pinVersion": "workspace:^"
},
{
"label": "use same range than @metamask/providers for webextension-polyfill",
"packages": ["**"],
"dependencyTypes": ["peer"],
"dependencies": ["webextension-polyfill"],
"range": "^0.10.0 || ^0.11.0 || ^0.12.0"
}
]
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ linkStyle default opacity:0.5
keyring_snap_sdk(["@metamask/keyring-snap-sdk"]);
keyring_utils(["@metamask/keyring-utils"]);
keyring_api --> keyring_utils;
keyring_internal_api --> keyring_api;
keyring_internal_api --> keyring_utils;
keyring_internal_snap_client --> keyring_api;
keyring_internal_api --> keyring_api;
keyring_internal_snap_client --> keyring_snap_client;
keyring_internal_snap_client --> keyring_utils;
eth_snap_keyring --> keyring_api;
keyring_internal_snap_client --> keyring_api;
eth_snap_keyring --> keyring_internal_api;
eth_snap_keyring --> keyring_internal_snap_client;
eth_snap_keyring --> keyring_utils;
keyring_snap_client --> keyring_api;
eth_snap_keyring --> keyring_api;
keyring_snap_client --> keyring_utils;
keyring_snap_client --> keyring_api;
keyring_snap_sdk --> keyring_utils;
keyring_snap_sdk --> keyring_api;
```
Expand Down
1 change: 0 additions & 1 deletion packages/keyring-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"@ts-bridge/cli": "^0.6.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.12",
"@types/webextension-polyfill": "^0.12.1",
"deepmerge": "^4.2.2",
"depcheck": "^1.4.7",
"jest": "^29.5.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/keyring-eth-hd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"@ts-bridge/cli": "^0.6.1",
"@types/jest": "^29.5.12",
"deepmerge": "^4.2.2",
"jest": "^29.5.0"
"jest": "^29.5.0",
"typescript": "~5.6.3"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed as of now, but since this package has already been "future-proof" for ts-bridge we might wanna add typescript as well.

},
"engines": {
"node": "^18.18 || >=20"
Expand Down
7 changes: 5 additions & 2 deletions packages/keyring-eth-trezor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
"@metamask/eth-sig-util": "^8.1.2",
"@trezor/connect-plugin-ethereum": "^9.0.3",
"@trezor/connect-web": "^9.1.11",
"hdkey": "^2.1.0",
"tslib": "^2.6.2"
"hdkey": "^2.1.0"
},
"devDependencies": {
"@ethereumjs/common": "^3.2.0",
Expand All @@ -76,9 +75,13 @@
"sinon": "^19.0.2",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typedoc": "^0.25.13",
"typescript": "~5.6.3"
},
"peerDependencies": {
"tslib": "^2.6.2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been a peerDependencies since the introduction of @trezor/connect-web.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be in both devDependencies and peerDependencies?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to follow the same pattern than for core which is to re-declare (explicitly) peerDependencies in the package if we are not providing it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if we get rid of it in the devDependencies we get a warning from Yarn.. So I'd say we need it here yes

},
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/keyring-internal-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/keyring-api": "workspace:^",
"@metamask/keyring-utils": "workspace:^",
"@metamask/superstruct": "^3.1.0",
"@metamask/utils": "^11.0.1"
Expand All @@ -54,6 +53,7 @@
"@lavamoat/allow-scripts": "^3.2.1",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-api": "workspace:^",
"@ts-bridge/cli": "^0.6.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.12",
Expand All @@ -68,6 +68,9 @@
"typedoc": "^0.25.13",
"typescript": "~5.6.3"
},
"peerDependencies": {
"@metamask/keyring-api": "^13.0.0"
},
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
11 changes: 6 additions & 5 deletions packages/keyring-internal-snap-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/keyring-api": "workspace:^",
"@metamask/keyring-snap-client": "workspace:^",
"@metamask/keyring-utils": "workspace:^",
"@metamask/snaps-controllers": "^9.10.0",
"@metamask/snaps-sdk": "^6.7.0",
"@metamask/snaps-utils": "^8.3.0",
"webextension-polyfill": "^0.12.0"
"@metamask/snaps-utils": "^8.3.0"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.2.1",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-api": "workspace:^",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to dev since we only need the keyring-api for tests here.

"@metamask/providers": "^18.3.1",
"@metamask/utils": "^11.0.1",
"@ts-bridge/cli": "^0.6.1",
Expand All @@ -71,10 +70,12 @@
"ts-node": "^10.9.2",
"tsd": "^0.31.0",
"typedoc": "^0.25.13",
"typescript": "~5.6.3"
"typescript": "~5.6.3",
"webextension-polyfill": "^0.12.0"
},
"peerDependencies": {
"@metamask/providers": "^18.3.1"
"@metamask/providers": "^18.3.1",
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
17 changes: 8 additions & 9 deletions packages/keyring-snap-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"dependencies": {
"@ethereumjs/tx": "^4.2.0",
"@metamask/eth-sig-util": "^8.1.2",
"@metamask/keyring-api": "workspace:^",
"@metamask/keyring-internal-api": "workspace:^",
"@metamask/keyring-internal-snap-client": "workspace:^",
"@metamask/keyring-utils": "workspace:^",
Expand All @@ -48,18 +47,16 @@
"@metamask/snaps-utils": "^8.3.0",
"@metamask/superstruct": "^3.1.0",
"@metamask/utils": "^11.0.1",
"@types/uuid": "^9.0.8",
"uuid": "^9.0.1",
"webextension-polyfill": "^0.12.0"
"uuid": "^9.0.1"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.2.1",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-api": "workspace:^",
"@metamask/providers": "^18.3.1",
"@ts-bridge/cli": "^0.6.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.12",
"@types/uuid": "^9.0.8",
"deepmerge": "^4.2.2",
"depcheck": "^1.4.7",
"jest": "^29.5.0",
Expand All @@ -68,11 +65,13 @@
"ts-node": "^10.9.2",
"tsd": "^0.31.0",
"typedoc": "^0.25.13",
"typescript": "~5.6.3"
"typescript": "~5.6.3",
"webextension-polyfill": "^0.12.0"
},
"peerDependencies": {
"@metamask/keyring-api": "workspace:^",
"@metamask/providers": "^18.3.1"
"@metamask/keyring-api": "^13.0.0",
"@metamask/providers": "^18.3.1",
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-snap-bridge/src/SnapKeyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { KeyringSnapControllerClient } from '@metamask/keyring-internal-snap-cli
import { strictMask } from '@metamask/keyring-utils';
import type { SnapController } from '@metamask/snaps-controllers';
import type { SnapId } from '@metamask/snaps-sdk';
import { type Snap } from '@metamask/snaps-utils';
import type { Snap } from '@metamask/snaps-utils';
import { assert, mask, object, string } from '@metamask/superstruct';
import type { Json } from '@metamask/utils';
import {
Expand Down
9 changes: 4 additions & 5 deletions packages/keyring-snap-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,20 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/keyring-api": "workspace:^",
"@metamask/keyring-utils": "workspace:^",
"@metamask/superstruct": "^3.1.0",
"@types/uuid": "^9.0.8",
"uuid": "^9.0.1",
"webextension-polyfill": "^0.12.0"
"uuid": "^9.0.1"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.2.1",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/providers": "^18.3.1",
"@metamask/keyring-api": "workspace:^",
"@metamask/utils": "^11.0.1",
"@ts-bridge/cli": "^0.6.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.12",
"@types/uuid": "^9.0.8",
"deepmerge": "^4.2.2",
"depcheck": "^1.4.7",
"jest": "^29.5.0",
Expand All @@ -73,6 +71,7 @@
"typescript": "~5.6.3"
},
"peerDependencies": {
"@metamask/keyring-api": "^13.0.0",
"@metamask/providers": "^18.3.1"
},
"engines": {
Expand Down
10 changes: 6 additions & 4 deletions packages/keyring-snap-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"@metamask/keyring-utils": "workspace:^",
"@metamask/snaps-sdk": "^6.7.0",
"@metamask/superstruct": "^3.1.0",
"@metamask/utils": "^11.0.1",
"webextension-polyfill": "^0.12.0"
"@metamask/utils": "^11.0.1"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.2.1",
Expand All @@ -69,10 +68,13 @@
"ts-node": "^10.9.2",
"tsd": "^0.31.0",
"typedoc": "^0.25.13",
"typescript": "~5.6.3"
"typescript": "~5.6.3",
"webextension-polyfill": "^0.12.0"
},
"peerDependencies": {
"@metamask/providers": "^18.3.1"
"@metamask/keyring-api": "^13.0.0",
"@metamask/providers": "^18.3.1",
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
24 changes: 11 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,7 @@ __metadata:
deepmerge: "npm:^4.2.2"
ethereum-cryptography: "npm:^2.1.2"
jest: "npm:^29.5.0"
typescript: "npm:~5.6.3"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -1994,8 +1995,6 @@ __metadata:
resolution: "@metamask/eth-snap-keyring@workspace:packages/keyring-snap-bridge"
dependencies:
"@ethereumjs/tx": "npm:^4.2.0"
"@lavamoat/allow-scripts": "npm:^3.2.1"
"@lavamoat/preinstall-always-fail": "npm:^2.1.0"
"@metamask/auto-changelog": "npm:^3.4.4"
"@metamask/eth-sig-util": "npm:^8.1.2"
"@metamask/keyring-api": "workspace:^"
Expand Down Expand Up @@ -2024,8 +2023,9 @@ __metadata:
uuid: "npm:^9.0.1"
webextension-polyfill: "npm:^0.12.0"
peerDependencies:
"@metamask/keyring-api": "workspace:^"
"@metamask/keyring-api": ^13.0.0
"@metamask/providers": ^18.3.1
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -2062,6 +2062,8 @@ __metadata:
tslib: "npm:^2.6.2"
typedoc: "npm:^0.25.13"
typescript: "npm:~5.6.3"
peerDependencies:
tslib: ^2.6.2
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -2150,7 +2152,6 @@ __metadata:
"@ts-bridge/cli": "npm:^0.6.1"
"@types/jest": "npm:^29.5.12"
"@types/node": "npm:^20.12.12"
"@types/webextension-polyfill": "npm:^0.12.1"
bech32: "npm:^2.0.0"
deepmerge: "npm:^4.2.2"
depcheck: "npm:^1.4.7"
Expand Down Expand Up @@ -2188,6 +2189,8 @@ __metadata:
tsd: "npm:^0.31.0"
typedoc: "npm:^0.25.13"
typescript: "npm:~5.6.3"
peerDependencies:
"@metamask/keyring-api": ^13.0.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -2222,6 +2225,7 @@ __metadata:
webextension-polyfill: "npm:^0.12.0"
peerDependencies:
"@metamask/providers": ^18.3.1
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
languageName: unknown
linkType: soft

Expand All @@ -2234,7 +2238,6 @@ __metadata:
"@metamask/auto-changelog": "npm:^3.4.4"
"@metamask/keyring-api": "workspace:^"
"@metamask/keyring-utils": "workspace:^"
"@metamask/providers": "npm:^18.3.1"
"@metamask/superstruct": "npm:^3.1.0"
"@metamask/utils": "npm:^11.0.1"
"@ts-bridge/cli": "npm:^0.6.1"
Expand All @@ -2252,8 +2255,8 @@ __metadata:
typedoc: "npm:^0.25.13"
typescript: "npm:~5.6.3"
uuid: "npm:^9.0.1"
webextension-polyfill: "npm:^0.12.0"
peerDependencies:
"@metamask/keyring-api": ^13.0.0
"@metamask/providers": ^18.3.1
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -2286,7 +2289,9 @@ __metadata:
typescript: "npm:~5.6.3"
webextension-polyfill: "npm:^0.12.0"
peerDependencies:
"@metamask/keyring-api": ^13.0.0
"@metamask/providers": ^18.3.1
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -3678,13 +3683,6 @@ __metadata:
languageName: node
linkType: hard

"@types/webextension-polyfill@npm:^0.12.1":
version: 0.12.1
resolution: "@types/webextension-polyfill@npm:0.12.1"
checksum: 10/80c1f81af272d378098474a41e0941bf9375261423ea289cd8250efc9a628cec4fa6083cb9cd5c62ff0f828ac235a044c0b95543c0606e894dfd485cea55b0aa
languageName: node
linkType: hard

"@types/ws@npm:^7.2.0, @types/ws@npm:^7.4.4":
version: 7.4.7
resolution: "@types/ws@npm:7.4.7"
Expand Down
Loading