MetaMask / eth-snap-keyring

Snap Keyring bridge
6 stars 2 forks source link

chore(deps): replace `superstruct` imports with `@metamask/superstruct` #311

Closed MajorLift closed 1 month ago

MajorLift commented 3 months ago

Explanation

As part of the Wallet Framework Team's OKR (Q2 2024 O3KR4) for upgrading TypeScript to v5.0+ in the core monorepo, we are updating dependencies of the core repo so that they generate builds and type declarations for both CJS and ESM.

This requirement applies to nested dependencies as well, so we are also replacing superstruct with the ESM-compatible fork @metamask/superstruct in all core dependency packages.

Description

References

Changelog

## [4.3.2]
### Changed
- Bump `@metamask/eth-sig-util` from `^7.0.1` to `^7.0.3`. ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
- Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1`. ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
- Bump `@metamask/snaps-controllers` from `^4.2.0` to `^9.2.0`. ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.0.0`. ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.7.0`. ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
- Bump `@metamask/utils` from `^8.4.0` to `^9.1.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))

### Fixed
- Replace `superstruct` with ESM-compatible `@metamask/superstruct` `^3.1.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
  - This fixes the issue of this package being unusable by any TypeScript project that uses `Node16` or `NodeNext` as its `moduleResolution` option.
socket-security[bot] commented 3 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/keyring-api@8.0.1 None +1 259 kB metamaskbot
npm/@metamask/snaps-controllers@9.2.0 Transitive: environment, filesystem, network +59 14.7 MB metamaskbot
npm/@metamask/utils@9.1.0 None +3 729 kB metamaskbot

🚮 Removed packages: npm/@metamask/keyring-api@8.0.0, npm/@metamask/snaps-controllers@8.4.0, npm/@metamask/snaps-sdk@4.4.2

View full report↗︎

mcmire commented 3 months ago

Actually, question — is it not possible to bump moduleResolution in this repo?

MajorLift commented 3 months ago

@mcmire I'm seeing these errors when NodeNext is enabled: https://github.com/MetaMask/eth-snap-keyring/pull/311#issuecomment-2155673290. Fixing them is a simple issue of augmenting the message.params types, but it's weird that we'd see this from updating compiler options instead of the TypeScript version.

MajorLift commented 3 months ago

@mcmire Found the cause! https://github.com/MetaMask/eth-snap-keyring/issues/323#issuecomment-2160760043

This should be resolved by the new keyring-api release.