Skip to content

Handle ranges of peer dependencies#4

Merged
nathanhleung merged 3 commits intonathanhleung:masterfrom
lancefisher:fix-join-set
Mar 7, 2017
Merged

Handle ranges of peer dependencies#4
nathanhleung merged 3 commits intonathanhleung:masterfrom
lancefisher:fix-join-set

Conversation

@lancefisher
Copy link
Copy Markdown
Contributor

@lancefisher lancefisher commented Mar 6, 2017

Problem

Running

install-peerdeps eslint-config-airbnb --dev --yarn

mentions that it will run:

install-peerdeps v1.1.2
Installing peerdeps for eslint-config-airbnb@14.1.0.
yarn add eslint-config-airbnb eslint@^3.15.0 eslint-plugin-jsx-a11y@^3.0.2 || ^4.0.0 eslint-plugin-import@^2.2.0 eslint-plugin-react@^6.9.0 --dev

eslint-plugin-jsx-a11y@^3.0.2 || ^4.0.0 is problematic here, and the following error occurs:

yarn add v0.19.1
[1/4] 🔍  Resolving packages...
error Couldn't find package "^4.0.0" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
ERR The install process exited with error code 1.

Solution

If a peer dependency is a range like ^3.0.2 || ^4.0.0, just install the last mentioned comparator. i.e. ^4.0.0.

This also works for ranges specified as >=1.2.7 <1.3.0.

Lance Fisher added 2 commits March 5, 2017 21:49
If a peer dependency is '^3.0.2 || ^4.0.0', just install the first
mentioned comparator. i.e. '^3.0.2'
@nathanhleung
Copy link
Copy Markdown
Owner

Thanks for the pull! It looks good to me, but for future pulls I want to set up CI and tests, so just hang tight while I put that together.

@nathanhleung
Copy link
Copy Markdown
Owner

I added another commit to the pull to get the linting to pass and made one variable a little more clear — thanks again for your contribution!

@nathanhleung nathanhleung reopened this Mar 7, 2017
@nathanhleung nathanhleung merged commit 30b0867 into nathanhleung:master Mar 7, 2017
@lancefisher lancefisher deleted the fix-join-set branch March 7, 2017 00:41
@lancefisher
Copy link
Copy Markdown
Contributor Author

@nathanhleung Great! Thanks for this tool!

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