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 lerna as peer dependency #2441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackw
Copy link
Contributor

@jackw jackw commented Mar 4, 2024

What Changed

Added lerna as a peerDependency to auto and auto/npm as they both internally call lerna with npx.

Why

Calling lerna with npx without a local copy installed could cause bugs as it will either pull the latest version from the npm registry or use a locally cached version. By setting peer dependencies lerna will either be installed when auto is installed or show a warning telling the user that lerna is a missing dependency.

@hipstersmoothie not 💯 sure about the version of lerna to support here. Do we want to widen the semver range for something like >6.0.0 <8.0.0? I'm also unsure which type of change this should be.

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.56%. Comparing base (f6af66b) to head (7f3c773).
Report is 46 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2441      +/-   ##
==========================================
- Coverage   80.63%   80.56%   -0.08%     
==========================================
  Files          69       69              
  Lines        5680     5680              
  Branches     1277     1277              
==========================================
- Hits         4580     4576       -4     
- Misses        718      719       +1     
- Partials      382      385       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@hipstersmoothie hipstersmoothie left a comment

Choose a reason for hiding this comment

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

I think we should refactor a little bit so that all users of the all-contributors plugin don''t need to install lerna

In both places it could be an optionalPeerDep probably

@@ -79,7 +79,8 @@
"url-join": "^4.0.0"
},
"peerDependencies": {
"typescript": ">=2.7"
"typescript": ">=2.7",
"lerna": "^7.1.4"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm it probably doesn't make sense for core to depend on lerna...

Copy link
Collaborator

Choose a reason for hiding this comment

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

only the all contributors plugin depends on that.

I think we should either:

  1. move that function into a dep
  2. just copy the function into the 2 places we use it (npm and all-contributors)

I think 2 is better. then we can say lerna is an optionalPeerDep of the all-contributors plugin

@jackw
Copy link
Contributor Author

jackw commented May 24, 2024

Sorry for not getting back to this sooner, I've not forgotten about it got moved down the priority list I'm afraid. I'll try and make the refactors as per your feedback asap @hipstersmoothie. 👍

@hipstersmoothie
Copy link
Collaborator

I completely understand :D

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