switz / driver

🏁 A typescript package for declarative finite states and commonly derived values - zero dependencies, fully typed, & framework agnostic
https://npmjs.com/package/@switz/driver
MIT License
114 stars 1 forks source link

TS auto import is broken #6

Closed switz closed 1 year ago

switz commented 1 year ago

Screenshot 2023-09-01 at 02 34 49

switz commented 1 year ago

for some reason, tsup is generating the default export as:

source:

export default function driver({ ...

output:

function driver({ ...

export { driver as default };

which is breaking auto imports – when manually changing the output to export default, auto-import works as expected.

I don't know why. tsc raw generates export default so what is tsup doing?

relevant items: https://github.com/switz/driver/blob/main/package.json https://github.com/switz/driver/blob/main/tsconfig.json https://github.com/switz/driver/blob/main/tsup.config.ts

switz commented 1 year ago

https://github.com/egoist/tsup/issues/985

switz commented 1 year ago

this is fixed by upgrading your typescript/vscode ts version to 5.2.2+