Skip to content

Conversation

@masterkidan
Copy link

@masterkidan masterkidan commented May 9, 2018

Hello,
This is to address the issue #19 . Essentially this PR adds a flag ignoreSameVersionDuplicates, which (if set to false) will automatically catch duplicates of the same version of the file when they are added as subdependencies.
By default ignoreSameVersionDuplicates is set to false, this is to prevent failures for the existing consumers of this plugin.

The change consists of the following updates as well:

  1. Fixed one of the UTs to work for windows file paths.
  2. Added UTs for the newly added functionality
  3. It appears that one of the cases under the 'strict' mode was incorrectly written.
    Basically, the test had the following versions of the packages
    a -> 1.0.0, 2.0.0, 2.5.0
    b -> 1.0.0, 2.0.0
    c -> 1.0.0

However the test for strict == false was assuming that there would only be 1 package with a major version change, when there are actually two (as can be seen above).

masterkidan and others added 3 commits May 9, 2018 10:15
By default duplicates of same version of the package will be ignored.
To enable the feature pass in ignoreSameVersionDuplicates: false as part of the
webpack config for the plugin.
Updating snapshot tests to fix bugs found in the tests.

Updating readme files.
@masterkidan
Copy link
Author

The yarn.lock files updates came when I installed on an ubuntu box, perhaps the original file was checked in on an OSx box?

@masterkidan
Copy link
Author

Had to explicitly specify node versions in the travis.yml file as 10.0 (latest node) seems to have incompatibilities with the current yarn.lock file
image

Mukundan Kavanur Kidambi added 9 commits May 14, 2018 12:35
Adding in an install step, so that the lib folder gets generated on install.
Babel was not being run on yarn install, as the babel was installed outside of the
root folder.
TODO: fix this up properly later on.
… pre-publish

no longer works on newer versions of npm.
As yarn installs all packages at the root folder, when traversing the module tree,
multiple packages will resolve to the same root.

Now webpack bundles by path, thus, when used with yarn the modules will
only be duplicated if they do not belong to the same path.
This is to fix travis failures on lower versions of npm
@alexangas
Copy link

This works great - thanks @masterkidan!

If I had a criticism it would be that it picks up packages in devDependencies as well as dependencies. I only care about the latter. But perhaps this is an issue with the plugin anyway?

Is this plugin still being maintained @darrenscerri? Is it possible to get this feature merged in?

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.

2 participants