Bump TypeScript to `^5.0.4` and set `module`, `moduleResolution` to `NodeNext`
Explanation
As part of the Wallet Framework Team's OKRs (Q2 2024 O3KR4), we are upgrading TypeScript to v5.0+ for all packages in the core monorepo.
References
-
Closes https://github.com/MetaMask/core/issues/3651
-
Blocked by:
-
eth-simple-keyring:- [x] https://github.com/MetaMask/eth-simple-keyring/pull/177
- [x] https://github.com/MetaMask/eth-simple-keyring/pull/178
→
keyring-controller
-
chain-api:- [x] https://github.com/MetaMask/accounts-chain-api/pull/5
- [x] https://github.com/MetaMask/accounts-chain-api/releases/tag/v0.1.0
→
chain-controller
-
rpc-errors:- [x] https://github.com/MetaMask/rpc-errors/pull/147
- [x] https://github.com/MetaMask/rpc-errors/pull/148
→
json-rpc-engine: publish as individual release →snaps-controllers→profile-sync-controller→ all pkgs downstream ofjson-rpc-enginethat are used in snaps:- core:
eth-json-rpc-provider,json-rpc-middleware-stream,permission-controller - snaps:
snaps-execution-environment,snaps-jest,snaps-rpc-methods,snaps-simulator - external:
providers,eth-json-rpc-middleware
- core:
-
providers, ~rpc-errors~ →snaps-sdk→keyring-api: https://github.com/MetaMask/keyring-api/pull/328 →eth-snap-keyring: https://github.com/MetaMask/eth-snap-keyring/pull/311 →accounts-controller,assets-controllers,chain-controller,keyring-controller,transaction-controller
-
Changelog
@metamask/accounts-controller
### Changed
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.0.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.7.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/approval-controller
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/assets-controllers (major)
### Changed
- **BREAKING:** `getIpfsCIDv1AndPath`, `getFormattedIpfsUrl` are now async functions. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Add `immer` `^9.0.6` as a new dependency. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/abi-utils` from `^2.0.2` to `^2.0.3`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `multiformats` from `^9.5.2` to `^13.1.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/chain-controller
### Changed
- Bump `@metamask/chain-api` from `^0.1.0` to `^0.1.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.0.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.7.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/eth-json-rpc-provider
### Changed
- Bump `@metamask/json-rpc-engine` from `^9.0.0` to `^9.0.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/json-rpc-engine (patch)
## [9.0.1]
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/json-rpc-middleware-stream
### Changed
- Bump `@metamask/json-rpc-engine` from `^9.0.0` to `^9.0.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/keyring-controller
### Changed
- Bump `@metamask/eth-simple-keyring` from `^6.0.1` to `^6.0.2`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/network-controller (minor)
### Added
- Newly exports the following types: `AutoManagedNetworkClient`, `NetworkClientConfiguration`, `InfuraNetworkClientConfiguration`, `CustomNetworkClientConfiguration`. ([#3645](https://github.com/MetaMask/core/pull/3645))
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/permission-controller
### Changed
- Bump `@metamask/json-rpc-engine` from `^9.0.0` to `^9.0.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/profile-sync-controller
### Changed
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.0.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.7.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/queued-request-controller
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/rate-limit-controller
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/signature-controller
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/transaction-controller
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
@metamask/user-operation-controller
### Changed
- Bump `@metamask/rpc-errors` from `^6.2.1` to `^6.3.1`. ([#3645](https://github.com/MetaMask/core/pull/3645))
- Bump `@metamask/utils` from `^8.3.0` to `^9.0.0`. ([#3645](https://github.com/MetaMask/core/pull/3645))
### Fixed
- Replace `superstruct` with ESM-compatible `@metamask/superstruct` `^3.0.0` ([#3645](https://github.com/MetaMask/snaps/pull/3645))
- This fixes the issue of this package being unusable by any TypeScript project that uses `Node16` or `NodeNext` as its `moduleResolution` option.
In addition to the above, the changelogs for the following packages need an entry about the @metamask/utils version bump:
address-book-controller, base-controller, build-utils, controller-utils, ens-controller, gas-fee-controller, message-manager, name-controller, notification-controller, permission-log-controller, polling-controller, selected-network-controller
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 highlighted breaking changes using the "BREAKING" category above as appropriate
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@aashutoshrathi/[email protected], npm/@babel/[email protected], npm/@endo/[email protected], npm/@metamask/[email protected], npm/@noble/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]
I worked on this a bit and by bumping some packages and also using a local copy of utils which makes use of @metamask/superstruct instead of superstruct, I managed to get yarn build:types working. I created a separate branch and made a commit there with the necessary changes, and you can see the package bumps here: https://github.com/MetaMask/core/commit/df14ce8a9485671cca1460f6a318bb3cfa494219. You'll want to use your own local copy of utils with the use-metamask-superstruct branch checked out (make sure to run yarn build first).
I haven't tried running yarn test yet, so I don't know if that works. I will try that next.
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎
To accept the risk, merge this PR and you will not be notified again.
| Alert | Package | Note |
|---|---|---|
| New author | npm/[email protected] |
|
| New author | npm/[email protected] |
|
| Network access | npm/[email protected] |
|
| Network access | npm/[email protected] |
|
| Network access | npm/[email protected] |
|
| Shell access | npm/[email protected] |
|
Next steps
What is new author?
A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.
What is network access?
This module accesses the network.
Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.
What is shell access?
This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.
Take a deeper look at the dependency
Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.
Remove the package
If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.
Mark a package as acceptable risk
To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all
@SocketSecurity ignore npm/[email protected]@SocketSecurity ignore npm/[email protected]@SocketSecurity ignore npm/[email protected]@SocketSecurity ignore npm/[email protected]