Skip to content

Commit

Permalink
Remove unnecessary babel-runtime dependencies (#1504)
Browse files Browse the repository at this point in the history
* Remove unnecessary `babel-runtime` dependencies

We included `babel-runtime` as a dependency to a few packages because
we thought it was an undocumented dependency of `eth-query`, but we had
gotten it mixed up with `ethjs-query`. Really we only need this as a
dependency in the transaction controller.

The constraints have been updated, and all unnecessary references to
`babel-runtime` have been removed.

* Move `babel-runtime` to `peerDependencies`
  • Loading branch information
Gudahtt authored and MajorLift committed Oct 11, 2023
1 parent aeed221 commit 33b73b3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
17 changes: 13 additions & 4 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,16 @@ gen_enforced_field(WorkspaceCwd, 'publishConfig.registry', 'https://registry.npm
gen_enforced_field(WorkspaceCwd, 'publishConfig', null) :-
workspace_field(WorkspaceCwd, 'private', true).

% eth-query has an unlisted dependency on babel-runtime, so that package needs
% to be present if eth-query is present.
gen_enforced_dependency(WorkspaceCwd, 'babel-runtime', '^6.26.0', DependencyType) :-
workspace_has_dependency(WorkspaceCwd, 'eth-query', _, DependencyType).
% nonce-tracker has an unlisted dependency on babel-runtime (via `ethjs-query`), so that package
% needs to be present if nonce-tracker is present.
gen_enforced_dependency(WorkspaceCwd, 'babel-runtime', '^6.26.0', 'peerDependencies') :-
workspace_has_dependency(WorkspaceCwd, 'nonce-tracker', _, 'dependencies').
gen_enforced_dependency(WorkspaceCwd, 'babel-runtime', '^6.26.0', 'devDependencies') :-
workspace_has_dependency(WorkspaceCwd, 'nonce-tracker', _, 'dependencies').

% eth-method-registry has an unlisted dependency on babel-runtime (via `ethjs->ethjs-query`), so
% that package needs to be present if eth-method-registry is present.
gen_enforced_dependency(WorkspaceCwd, 'babel-runtime', '^6.26.0', 'peerDependencies') :-
workspace_has_dependency(WorkspaceCwd, 'eth-method-registry', _, 'dependencies').
gen_enforced_dependency(WorkspaceCwd, 'babel-runtime', '^6.26.0', 'devDependencies') :-
workspace_has_dependency(WorkspaceCwd, 'eth-method-registry', _, 'dependencies').
1 change: 0 additions & 1 deletion packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@types/uuid": "^8.3.0",
"abort-controller": "^3.0.0",
"async-mutex": "^0.2.6",
"babel-runtime": "^6.26.0",
"eth-query": "^2.1.2",
"ethereumjs-util": "^7.0.10",
"immer": "^9.0.6",
Expand Down
1 change: 0 additions & 1 deletion packages/controller-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"dependencies": {
"@metamask/utils": "^5.0.2",
"@spruceid/siwe-parser": "1.1.3",
"babel-runtime": "^6.26.0",
"eth-ens-namehash": "^2.0.8",
"eth-query": "^2.1.2",
"eth-rpc-errors": "^4.0.2",
Expand Down
1 change: 0 additions & 1 deletion packages/gas-fee-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@metamask/network-controller": "workspace:^",
"@metamask/utils": "^5.0.2",
"@types/uuid": "^8.3.0",
"babel-runtime": "^6.26.0",
"eth-query": "^2.1.2",
"ethereumjs-util": "^7.0.10",
"ethjs-unit": "^0.1.6",
Expand Down
1 change: 0 additions & 1 deletion packages/network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@metamask/swappable-obj-proxy": "^2.1.0",
"@metamask/utils": "^5.0.2",
"async-mutex": "^0.2.6",
"babel-runtime": "^6.26.0",
"eth-block-tracker": "^7.0.1",
"eth-query": "^2.1.2",
"eth-rpc-errors": "^4.0.2",
Expand Down
5 changes: 3 additions & 2 deletions packages/transaction-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@metamask/network-controller": "workspace:^",
"@metamask/utils": "^5.0.2",
"async-mutex": "^0.2.6",
"babel-runtime": "^6.26.0",
"eth-method-registry": "1.1.0",
"eth-query": "^2.1.2",
"eth-rpc-errors": "^4.0.2",
Expand All @@ -49,6 +48,7 @@
"@metamask/auto-changelog": "^3.1.0",
"@types/jest": "^27.4.1",
"@types/node": "^16.18.24",
"babel-runtime": "^6.26.0",
"deepmerge": "^4.2.2",
"ethjs-provider-http": "^0.1.6",
"jest": "^27.5.1",
Expand All @@ -60,7 +60,8 @@
},
"peerDependencies": {
"@metamask/approval-controller": "workspace:^",
"@metamask/network-controller": "workspace:^"
"@metamask/network-controller": "workspace:^",
"babel-runtime": "^6.26.0"
},
"engines": {
"node": ">=16.0.0"
Expand Down
5 changes: 1 addition & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,6 @@ __metadata:
"@types/uuid": ^8.3.0
abort-controller: ^3.0.0
async-mutex: ^0.2.6
babel-runtime: ^6.26.0
deepmerge: ^4.2.2
eth-query: ^2.1.2
ethereumjs-util: ^7.0.10
Expand Down Expand Up @@ -1422,7 +1421,6 @@ __metadata:
"@spruceid/siwe-parser": 1.1.3
"@types/jest": ^27.4.1
abort-controller: ^3.0.0
babel-runtime: ^6.26.0
deepmerge: ^4.2.2
eth-ens-namehash: ^2.0.8
eth-query: ^2.1.2
Expand Down Expand Up @@ -1699,7 +1697,6 @@ __metadata:
"@types/jest": ^27.4.1
"@types/jest-when": ^2.7.3
"@types/uuid": ^8.3.0
babel-runtime: ^6.26.0
deepmerge: ^4.2.2
eth-query: ^2.1.2
ethereumjs-util: ^7.0.10
Expand Down Expand Up @@ -1818,7 +1815,6 @@ __metadata:
"@types/jest-when": ^2.7.3
"@types/lodash": ^4.14.191
async-mutex: ^0.2.6
babel-runtime: ^6.26.0
deepmerge: ^4.2.2
eth-block-tracker: ^7.0.1
eth-query: ^2.1.2
Expand Down Expand Up @@ -2051,6 +2047,7 @@ __metadata:
peerDependencies:
"@metamask/approval-controller": "workspace:^"
"@metamask/network-controller": "workspace:^"
babel-runtime: ^6.26.0
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 33b73b3

Please sign in to comment.