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

chore: Add duplicate package checker plugin #1282

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

ptbrowne
Copy link
Contributor

@ptbrowne ptbrowne commented Aug 22, 2019

Outputs warnings if libraries are multiple times in a bundle.

For example in contacts.

    WARNING in hoist-non-react-statics
      Multiple versions of hoist-non-react-statics found:
        2.5.5 ./~/cozy-client/~/hoist-non-react-statics
        3.3.0 ./~/hoist-non-react-statics
    
    
    WARNING in lodash
      Multiple versions of lodash found:
        4.17.13 ./~/cozy-device-helper/~/lodash
        4.17.14 ./~/cozy-client/~/lodash
        4.17.15 ./~/lodash
    
    
    WARNING in prop-types
      Multiple versions of prop-types found:
        15.6.2 ./~/cozy-client/~/prop-types
        15.7.2 ./~/prop-types
    
    
    WARNING in react
      Multiple versions of react found:
        16.7.0 ./~/cozy-client/~/react
        16.8.6 /Users/cozy/code/cozy/create-cozy-app/packages/cozy-scripts/~/react
    
    
    WARNING in regenerator-runtime
      Multiple versions of regenerator-runtime found:
        0.10.5 ./~/babel-polyfill/~/regenerator-runtime
        0.11.1 ./~/babel-runtime/~/regenerator-runtime
        0.13.2 ./~/@babel/runtime/~/regenerator-runtime
    
    
    WARNING in unist-util-visit-parents
      Multiple versions of unist-util-visit-parents found:
        1.1.2 ./~/unist-util-visit-parents
        2.1.2 ./~/unist-util-visit/~/unist-util-visit-parents
    
    
    WARNING in warning
      Multiple versions of warning found:
        3.0.0 ./~/warning
        4.0.3 ./~/node-polyglot/~/warning

Useful to detect libraries that are too strict in their package.json (mostly ours).

Copy link
Contributor

@drazik drazik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

packages/cozy-scripts/config/webpack.config.duplicates.js Outdated Show resolved Hide resolved
Copy link
Contributor

@y-lohse y-lohse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! (the feature, not the duplication in contacts)

Copy link
Contributor

@drazik drazik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some snapshots are failing now :s

@ptbrowne
Copy link
Contributor Author

The tests are not passing even on master on my machine (issue here #1283 ). Issue here, since this is not urgent, I will not investigate right now on this issue.

@ptbrowne ptbrowne force-pushed the duplicate-check-plugin branch from 2885643 to 2dc50fb Compare October 22, 2020 16:10
@ptbrowne ptbrowne requested a review from Crash-- as a code owner October 22, 2020 16:10
@ptbrowne ptbrowne added the merge label Oct 22, 2020
@probot-auto-merge probot-auto-merge bot merged commit bbf0d5e into master Oct 23, 2020
@probot-auto-merge probot-auto-merge bot deleted the duplicate-check-plugin branch October 23, 2020 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants