Anidetrix / rollup-plugin-styles

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
243 stars 43 forks source link

chore: update `cssnano` for types #213

Closed dfreeman closed 1 year ago

dfreeman commented 2 years ago

212 removed @types/cssnano as being unnecessary, but cssnano itself didn't begin shipping types until 5.1, and those types weren't 100% compatible with what had been in @types/cssnano.

For whatever reason it looks like CI didn't run on that pull request, though, so the issue wasn't flagged.

This PR updates the cssnano dependency so that its types are available, and fixes a couple of references so that everything typechecks cleanly.

dfreeman commented 2 years ago

Hi @Anidetrix — is there anything I can do from my side to help move this and #214 forward? We'd love to be able to adopt rollup-plugin-styles for our projects but are currently blocked on needing something like #214 🙂

CxRes commented 2 years ago

I opened #216 and then I saw this PR. @dfreeman Thanks!

However I am finding that just bumping cssnano throws the following error in the tests:

src/index.ts:280:28 - error TS2352: Conversion of type 'Plugin' to type 'Processor' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
      Type 'Plugin' is missing the following properties from type 'Processor': version, plugins, use, process
dfreeman commented 2 years ago

@CxRes if you check the diff here, you can see where I had to change the code in this plugin in a couple of places to accommodate the new types—it's pretty common when shifting from DefinitelyTyped to natively-published types for a package that there is some breakage like that.