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 command-line argument to hide dedupe warnings #7094

Closed
wants to merge 1 commit into from
Closed

Add command-line argument to hide dedupe warnings #7094

wants to merge 1 commit into from

Conversation

kaiyoma
Copy link

@kaiyoma kaiyoma commented Mar 9, 2019

Summary

yarn's "could be deduped from" warnings are unhelpful, noisy, and annoying. There's no clear path to fixing them and the deluge of output obfuscates other issues that would normally be seen easily. This commit adds a simple command-line flag to suppress these warnings from appearing in the output and the final count.

More details and complaining here: #2287

Test plan

Before this change, yarn check would result in hundreds of warnings in our project:

$ yarn check
yarn check v1.13.0
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^0.1.2"
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
warning "@babel/helper-create-class-features-plugin##@babel/core@^7.0.0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-async-to-generator##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-block-scoping##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-classes##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-modules-systemjs##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"

...

warning "istanbul-reports#handlebars#async@^2.5.0" could be deduped from "2.6.2" to "async@2.6.2"
warning "jest-jasmine2#jest-each#chalk@^2.0.1" could be deduped from "2.4.2" to "chalk@2.4.2"
warning "@storybook/mantra-core#@storybook/react-simple-di##prop-types@^15.6.0" could be deduped from "15.7.2" to "prop-types@15.7.2"
warning "react-treebeard#velocity-react#prop-types@^15.5.8" could be deduped from "15.7.2" to "prop-types@15.7.2"
info Found 295 warnings.
success Folder in sync.
Done in 11.38s.

After this change, only legitimate warnings are shown:

$ yarn check --no-dedupe-warnings
yarn check v1.16.0-0
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^0.1.2"
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
warning Resolution field "braces@2.3.1" is incompatible with requested version "karma#expand-braces#braces@^0.1.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-cli#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-config#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "test-exclude#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-runtime#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-message-util#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-haste-map#micromatch#braces@^1.8.2"
info Found 7 warnings.
success Folder in sync.
Done in 10.33s.

@kaiyoma
Copy link
Author

kaiyoma commented Mar 11, 2019

continuous-integration/appveyor/pr Expected — Waiting for status to be reported

That status hasn't changed for a few days now. Is this expected?

@arcanis
Copy link
Member

arcanis commented Mar 23, 2019

Note that yarn check is kinda deprecated (yarnpkg/rfcs#106). Are there warnings with yarn check that you need and that yarn install doesn't report?

@kaiyoma
Copy link
Author

kaiyoma commented Mar 23, 2019

@arcanis Ah! I didn't realize that yarn check was being deprecated. We've been using it for several years now in our project and by this point, it's infiltrated a lot of our CI tasks and shell scripts to help developers avoid situations where their local packages are out of sync. It sounds like we should replace all those calls with yarn install instead. Is that the recommended approach from the yarn team?

@kaiyoma
Copy link
Author

kaiyoma commented Mar 25, 2019

No longer needed as yarn check is being deprecated.

@kaiyoma kaiyoma closed this Mar 25, 2019
@arcanis
Copy link
Member

arcanis commented Mar 25, 2019

Is that the recommended approach from the yarn team?

Yep. We also advise you to add --frozen-lockfile on your CI to block PRs that forgot to update the lockfile.

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

Successfully merging this pull request may close these issues.

None yet

2 participants