primer / brand

React components and Primitives for GitHub marketing websites
https://primer.style/brand
MIT License
59 stars 30 forks source link

Missing `Animation.module.css` in the build and published artifact #409

Open echarles opened 11 months ago

echarles commented 11 months ago

If you build, the imported ./Animation.module.css CSS by useAnimation.ts is not present in the lib folder, nor in the publish npm package, which break consumer of react-brand, especially the ones using Typescript (had build failure while trying to use a Card component).

Screenshot 2023-08-27 at 17 06 40 Screenshot 2023-08-27 at 17 07 32
echarles commented 11 months ago

This is the error I receive when building:

./node_modules/@primer/react-brand/lib/animation/useAnimation.d.ts:3:20 - error TS2307: Cannot find module './Animation.module.css' or its corresponding type declarations.

3 import styles from './Animation.module.css';
                     ~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in ./node_modules/@primer/react-brand/lib/animation/useAnimation.d.ts:3
fcollonval commented 7 months ago

The type files for css are generated in the src folder but are not exported in the lib folder. If you can provide pointers to fix this, I can look at fixing it.

I think running tcm with a different output path could do it. But as I'm not familiar with that tool, your input would be appreciated.