berry icon indicating copy to clipboard operation
berry copied to clipboard

[Chore] Fix our peer dependency warnings

Open arcanis opened this issue 6 years ago • 3 comments

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.

arcanis avatar Aug 29 '19 08:08 arcanis

This PR will fix both warnings: https://github.com/yarnpkg/berry/pull/4935

➤ YN0060: │ @yarnpkg/monorepo@workspace:. provides eslint (pf82c3) with version 8.2.0, which doesn't satisfy what @yarnpkg/eslint-config and some of its descendants request
➤ YN0002: │ acceptance-tests@workspace:packages/acceptance-tests doesn't provide jest (pcc8ab), requested by jest-json

these are all gatsby related, many repositories have been archived and we can't do anything about them.

but these will no longer be a problem after https://github.com/yarnpkg/berry/pull/4851, I believe we have a reason to leave them alone

➤ YN0002: │ gatsby-cli@npm:3.14.0 [7243a] doesn't provide ink (p4a7fc), requested by gatsby-recipes
➤ YN0002: │ gatsby-plugin-manifest@npm:3.7.0 [118b2] doesn't provide graphql (p0cd4a), requested by gatsby-plugin-utils
➤ YN0002: │ gatsby-plugin-page-creator@npm:3.14.0 [7243a] doesn't provide graphql (pd3e76), requested by gatsby-plugin-utils
➤ YN0060: │ gatsby-recipes@npm:0.25.0 [bb88b] provides graphql (pc0633) with version 15.5.0, which doesn't satisfy what graphql-subscriptions 
➤ YN0002: │ gatsby@npm:3.14.0 [118b2] doesn't provide babel-eslint (p70342), requested by eslint-config-react-app
➤ YN0002: │ react-instantsearch-dom@npm:6.6.0 [118b2] doesn't provide algoliasearch (p65251), requested by algoliasearch-helper
➤ YN0002: │ react-instantsearch-dom@npm:6.6.0 [118b2] doesn't provide algoliasearch (p5ab0d), requested by react-instantsearch-core
➤ YN0002: │ @endemolshinegroup/cosmiconfig-typescript-loader@npm:3.0.2 [714f3] doesn't provide typescript (p88d18), requested by ts-node
➤ YN0002: │ @yarnpkg/gatsby@workspace:packages/gatsby doesn't provide @emotion/core (pa19bb), requested by gatsby-plugin-mdx
➤ YN0002: │ @yarnpkg/gatsby@workspace:packages/gatsby doesn't provide webpack (pe1aa2), requested by gatsby-plugin-favicon

I found some PRs about this: https://github.com/algolia/algoliasearch-helper-js/pull/746 https://github.com/algolia/react-instantsearch/pull/2811 https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/pull/133 https://github.com/Creatiwity/gatsby-plugin-favicon/pull/65


These are all the warnings we have, I think we can close this issue, or remove the first-good-issue tag to prevent people from spending time on it, and wait for a successful conversion to docusaurus

jj811208 avatar Oct 05 '22 06:10 jj811208

Hi @arcanis can you please assign this to me ?

ArchitGajjar avatar Jan 03 '24 22:01 ArchitGajjar

NVM, I think @jj811208 already have fixed this in his PR above 👍

ArchitGajjar avatar Jan 03 '24 22:01 ArchitGajjar