Solution for Dual DTS Issue in ESM Projects Using Fast-Check
I think I found the structural fix for the dual dts problem, exposed when you start using
fast-check
fast-check
with schema from an esm project. the problem appears to stem from that a single dts file exposed from package.json can only be interpeted either as cjs or as esm, which will dictate which dts it will load from external packages, which for better or worse, can have different .d.ts files for esm and cjs. in the case of schema that turns out to be the cjs version of fast-check, leading to the problem once you mix it from an esm source.
the fix is by creating individual proxy .d.ts for cjs and esm, but re-exporting from a single source of dts truth, so that symbols remain unique: https://github.com/Effect-TS/build-utils/pull/60