Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supports-color as optional peerDependency #709

Closed
wants to merge 1 commit into from
Closed

Add supports-color as optional peerDependency #709

wants to merge 1 commit into from

Conversation

jgierer12
Copy link

@jgierer12 jgierer12 commented Jun 1, 2019

This is the proper way to declare this type of dependency.

Note that if peerDependenciesMeta is not supported by the package
manager (yarn < 1.13 and npm) and supports-color is not installed, a warning will be
displayed.

See peerDependencies, peerDependenciesMeta.

Without this, Yarn PnP to throws an error when debug is in the dependency tree, since PnP is very strict about requireing packages that aren't declared as dependencies.

This is the proper way to declare this type of dependency.

Note that if `peerDependenciesMeta` is not supported by the package
manager and `supports-color` is not installed, a warning will be
displayed.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 87.692% when pulling 46b89a5 on jgierer12:supports-color-optional-peer-dep into 5c7c61d on visionmedia:master.

@eps1lon
Copy link

eps1lon commented Sep 6, 2019

Quick update that peerDependenciesMeta is implemented in yarn@1.13.0, npm@6.11.0 but not yet bundled with node and pnpm@?

I'm currently not using this feature myself until node bundles npm@6.11. If there are any concerns about this feature please let me know.

original RFC

@Qix- Qix- mentioned this pull request Nov 27, 2019
@arcanis
Copy link
Contributor

arcanis commented Nov 27, 2019

Note that the situation changed since the last comment. The peerDependenciesMeta is supported by all modern package managers (at least 6 month old).

Additionally, listing peerDependenciesMeta is enough for the peer dependency to be inferred even without the peerDependencies field being set - providing a smooth adoption path even for older package managers.

CC @Qix-

@Qix-
Copy link
Member

Qix- commented May 19, 2020

Published as 4.2.0 under the beta dist-tag. Please test and make sure nothing has broken for you before I send to latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants