Closed transitive-bullshit closed 4 months ago
@rileytomasek what do you think of switching all example usage to import from @dexaai/dexter
? We can keep the ESM exports to remain backwards compatible.
Reasoning:
tsup
OR requiring moduleResolution: "bundler"
, which I feel like is a non-starter for a general NPM package"moduleResolution": "node"
is not the correct configuration for an ESM project — the correct values are bundler
, node16
, or nodenext
. Sindre explains more here. Our time is better spend improving the library that providing compatibility with legacy CJS.
Adding root exports will likely just make this even harder to debug because then the import may work and it will fail deeper into the code.
Using
"moduleResolution": "node"
in the consuming project, which is very common, seems to break dexter's typing exports as tsserver can't find them.Example:
This will probably surprise anyone who tries to use this package, since before 2 weeks ago, I had never used
"moduleResolution": "node"
.It would be nice to use
tsc
only, but I wonder if we'd be better off using something liketsup
for output compatibility?