MetaMask / snaps

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

[snaps-sdk] Fix `.d.ts` extension usage in type declaration exports #2519

Closed MajorLift closed 3 days ago

MajorLift commented 5 days ago

We should set up ts-bridge to generate and expose unambiguous .d.cts and .d.mts type declarations only.

Using .d.ts causes issues in downstream projects that have their moduleResolution option set to Node16 or NodeNext.

e.g.

error TS2307: Cannot find module '@metamask/snaps-sdk' or its corresponding type declarations.

https://github.com/MetaMask/core/actions/runs/9668650800/job/26673339021?pr=3645

MajorLift commented 4 days ago

ts-bridge may not be a solution here since it currently does not support monorepos.