sergeysova / styled-normalize

normalize.css for styled-components
https://npmjs.com/styled-normalize
MIT License
446 stars 19 forks source link

styled-normalize@8.0.3 types are incompatible with styled-components@<4 #9

Closed elektronik2k5 closed 5 years ago

elektronik2k5 commented 5 years ago

Hello and thanks for creating this package! :bowing_man:

I tried upgrading styled-normalize from 8.0.2 to 8.0.3 with the latest styled-components@3. Because https://github.com/sergeysova/styled-normalize/blob/bb1b9e1296be41980e51fb00cb66dd02fa675c2e/index.d.ts#L1 imports styled-components@4's GlobalStyleClass, DefaultTheme, which don't exist in v3 - TS compilation fails.

I don't really see a way around this, except for fixing peerDependencies to exclude styled-components@4 in styled-normalize@>=8.0.3.

I think this also warrants a new major version and unpublishing of styled-normalize@8.0.3, since it's broken for TS users.

sergeysova commented 5 years ago

@elektronik2k5 Thank you. styled-normalize not follows semver. Version x.y matches normalize.css https://github.com/sergeysova/styled-normalize/releases/tag/v8.0.0.

I'm going to release patch version with the fix (8.0.4)

sergeysova commented 5 years ago

@elektronik2k5 Please, use https://github.com/sergeysova/styled-normalize/releases/tag/v8.0.4

But now, styled-normalize only supports styled-components@4

sergeysova commented 5 years ago

@elektronik2k5 If you need styled-components@v3 you can install prev version:

npm install styled-normalize@prev

https://github.com/sergeysova/styled-normalize/releases/tag/v8.0.4-prev

sergeysova commented 5 years ago

Also fixed in #10

elektronik2k5 commented 5 years ago

Thanks @sergeysova ! I suggest we add this to README.md, since right now it isn't clear what should styled-components@3 users do. Would you like a PR for that?

sergeysova commented 5 years ago

If you have some time, please, make PR.

elektronik2k5 commented 5 years ago

I see it's documented already. Thanks!