hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
344 stars 286 forks source link

build: use tshy to support both CJS and ESM dist artifacts #3616

Open petermetz opened 2 weeks ago

petermetz commented 2 weeks ago

Description

We've struggled a lot with ESM/CJS incompatibilities and it's not a settled question still.

The scope of this task is to evaluate the tshy tool.

I've recently seen a new-ish tool that I haven't tried before that could help us with making CJS and ESM work together more seamlessly by refactoring the TS compilation output directory structure (or at least that's what it sounds like based on the first link)

Source 1: https://colinhacks.com/essays/live-types-typescript-monorepo Source 2: https://github.com/isaacs/tshy

Acceptance Criteria

  1. The "are the types wrong" checks are passing.
  2. Build is not slower than before (or only a little bit slower if it must be)
  3. The watch scripts still work (yarn watch-tsc)

cc: @outSH