yarnpkg / yarnpkg/berry

[Chore] Fix our peer dependency warnings

Open
#418 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
TypeScript
Stars
8.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

We have various peer dependency warnings displayed when running yarn install inside our own repository. It would be great if we could fix the upstream packages to stop it from happening, as it's a matter of time before it causes more serious issues:

image

Given a warning:

X doesn't provide Y requested by Z

The best fix is generally to either:

  • Upgrade the faulty package in our codebase to get rid of the warning. Some of those may have already been fixed.

    • For example, upgrading Gatsby might fix the 2.0.0-printer-fix.2 error.
  • Mark Y as an optional peer dependency in Z, if Z doesn't need Y to work. If Z's maintainers are concerned about potential warnings being shown to their users, tell them that optional peer dependencies are supported by Yarn, npm 6.1+, and pnpm. It's a feature they should use.

  • Add Y as a peer dependency of X. This will move the warning up by one level, but by doing this it's possible that the peer dependency will be met in a satisfying way. For example, if react-bar as a peer depencency on react and is a dependency of react-foo, then you can add react to the peer dependencies of react-foo. Then it'll be up to whoever depends on react-foo to depends on react as well.

    • For example, I strongly suspect it's the case of jest-jasmine2 which should have a peer dependency on jest-haste-map.
  • Add Y as regular dependency of X if it's just a matter of a peer dependency having been omitted by mistake.

    • For example, html-react-parser should probably have regular dependencies on both object-assign and fbjs to satisfy the requirements of react-dom-core.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running yarn install in the repository and cataloguing each peer dependency warning. Trace each warning to the named packages and their dependency metadata, then update or report the appropriate package relationships until the install completes without these warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.