MetaMask / snaps

Extend the functionality of MetaMask using Snaps
https://metamask.io/snaps/
Other
724 stars 557 forks source link

Set tsconfig `module{,Resolution}` options to `NodeNext` #2514

Closed MajorLift closed 2 weeks ago

MajorLift commented 3 months ago

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.

The purpose of this update is to ensure that these dependencies can be imported into projects using the Node16 or NodeNext options for their moduleResolution TypeScript compiler setting.

Because the effects of these changes apply to nested dependencies as well, we are enabling the NodeNext moduleResolution option in all affected repos, to ensure that all projects further downstream can be set to NodeNext without issue.

Looking upstream, we also need to make changes for dependencies that are ESM-only. Because snaps is a CJS project, we either need to update these dependencies to expose a CJS build, or replace our static import statements for these dependencies with dynamic import syntax.

See https://www.typescriptlang.org/docs/handbook/modules/reference.html#interoperability-rules

References

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/abi-utils@2.0.3 Transitive: network +9 1.81 MB metamaskbot

🚮 Removed packages: npm/@metamask/abi-utils@2.0.2

View full report↗︎

socket-security[bot] commented 3 months ago

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

MajorLift commented 2 weeks ago

Closed by https://github.com/MetaMask/snaps/pull/2682