stitchesjs / stitches

[Not Actively Maintained] CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience.
https://stitches.dev
MIT License
7.72k stars 251 forks source link

fix(package.json): Add 'types/*' to package exports #1115

Open jeffberry opened 1 year ago

jeffberry commented 1 year ago

This fixes an issue that we are experiencing when setting moduleResolution in our tsconfig to NodeNext. When this is enabled, the module resolution will only allow importing from paths that are defined within the exports config. Because only types/index.d.ts is available for import, it is causing these kinds of embedded imports to fail:

import("@stitches/react/types/css-util").CSS

I think the alternative would be to ensure that all types are exported from the types/index.d.ts file.

Achaak commented 1 year ago

I confirm this need on my side to pass a lib in ESM and pass the moduleResolution in Node16

yovanoc commented 1 year ago

Please accept this PR

smol-honk commented 1 year ago

@peduarte who should we @ to get this looked at? Thank you again for your time! Love the library.

jonathantneal commented 1 year ago

This actually looks really good. If I can get some access, I could merge this and put it into a release.

peduarte commented 1 year ago

cc @hadihallak @StephenHaney

fmal commented 8 months ago

@hadihallak @StephenHaney could you please merge this in and put it into a canary release or give @jonathantneal access do do so? This doesn't seem like much effort and would unblock usage of stitches with TypeScript's moduleResolution other than node. I would really appreciate it ☮️