MetaMask / providers

An Ethereum Provider that connects over a stream, as injected into websites by MetaMask
MIT License
224 stars 124 forks source link

Fix `.d.ts` extension usage in type declaration exports #335

Closed MajorLift closed 2 months ago

MajorLift commented 3 months 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/providers' or its corresponding type declarations.

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

mcmire commented 3 months ago

@MajorLift I believe that this is one of the design goals of ts-bridge and so it does this by default. If you view the latest version of @metamask/utils you can see separate .d.cts and .d.mts files: https://npmfs.com/package/@metamask/utils/8.5.0/dist/