jsSHA icon indicating copy to clipboard operation
jsSHA copied to clipboard

Types are packaged/exposed incorrectly

Open wKovacs64 opened this issue 2 years ago • 2 comments

Your Environment

  • jsSHA version: 3.3.1
  • JavaScript engine and version: Node 18.17.1
  • How was jsSHA imported (ESM or other): all? TS/ESM for sure.

Describe the bug

https://arethetypeswrong.github.io/?p=jssha%403.3.1

Code

import jsSHA from 'jssha/dist/sha1'; // just an example

Additional context

I know, I know - the CJS/ESM/types situation is a mess across the ecosystem right now. 😢 I'll try to play around with a solution if I get the chance, just wanted to raise an issue to get the ball rolling.

wKovacs64 avatar Sep 15 '23 03:09 wKovacs64

Sigh...

It sounds like from the rollup documentation that it is impossible to have the same style import for both ESM and UMD/CJS. I'm totally open to accepting a solution for this but revisiting these problems every 6 months is draining me :\

Caligatio avatar Sep 15 '23 05:09 Caligatio

Sigh...

It sounds like from the rollup documentation that it is impossible to have the same style import for both ESM and UMD/CJS. I'm totally open to accepting a solution for this but revisiting these problems every 6 months is draining me :\

I know, it's exhausting. I'll try to find some time to take a hard look at it for this package, but if anyone else knows what they're doing and wants to take a stab at it, please do. 🙏

wKovacs64 avatar Sep 15 '23 05:09 wKovacs64