Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think I found the structural fix for the dual dts problem, exposed for example when you start using
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