build: use tshy to support both CJS and ESM dist artifacts #3616
Open
Description
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
- The "are the types wrong" checks are passing.
- Build is not slower than before (or only a little bit slower if it must be)
- The watch scripts still work (
yarn watch-tsc
)
cc: @outSH