styled-components / styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
https://styled-components.com
MIT License
40.11k stars 2.48k forks source link

chore: add all missing peer dependency statements #4243

Closed quantizor closed 4 months ago

quantizor commented 4 months ago

This allows for better deduping in client projects.

Might fix #4226

kachkaev commented 4 months ago

I'm afraid that this change is breaking. Example: https://github.com/kachkaev/njt/pull/549

If something is a peer dependency, not a dependency, builds would fail if the dependency is not mentioned in downstream package.json. So if we want to make something a peer dependency, I guess that a new version needs to be semver-major. A migration guide should list dependencies that need to be added to the app’s package.json.

quantizor commented 4 months ago

I added optional status (via peerDependenciesMeta, an official package.json field in the npm docs) to all of them except react itself, is the build tooling not taking that into account?

quantizor commented 4 months ago

It's odd because I tested it in pnpm and resolution worked as expected... will roll the change back.

kachkaev commented 4 months ago

Thanks for reverting! App build in https://github.com/kachkaev/njt/pull/549 worked after upgrading styled-components from from 6.1.7 to 6.1.8 👍