lerna-lite / lerna-lite

Subset of Lerna in a smaller & more modular project. Helps manage and publish multiple packages in a monorepo/workspace structure
MIT License
460 stars 32 forks source link

feat: add support for Yarn patch protocol #887

Closed petermetz closed 4 days ago

petermetz commented 5 days ago

Description

Introduced logic that transparently handles the patch protocol version syntax by falling back to the base version string.

https://github.com/lerna-lite/lerna-lite/issues/223 https://yarnpkg.com/cli/patch

Fixes #223

Signed-off-by: Peter Somogyvari peter.metz@unarin.com

Motivation and Context

I have third-party packages in our monorepo that ship with issues that I need to patch in a yarn v4 build setup.

Without this change lerna-lite crashes if we are using it in a project that has any yarn patch protocol usage.

https://github.com/lerna-lite/lerna-lite/issues/223

How Has This Been Tested?

  1. Manually in the repo at https://github.com/hyperledger/cacti 1.1. We made changes to third party dependencies (code in the node_modules folder) 1.2. We committed said changes with yarn patch 1.3. The build was broken 1.4. Applied this fix to lerna-lite and now the build is working again.
  2. Automated tests were added as well with our exact use-case see package-graph.spec.ts

Types of changes

Checklist:

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.96%. Comparing base (d011168) to head (413a836). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #887 +/- ## ========================================== + Coverage 97.96% 97.96% +0.01% ========================================== Files 145 145 Lines 8852 8856 +4 Branches 2224 2226 +2 ========================================== + Hits 8671 8675 +4 Misses 180 180 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ghiscoding commented 5 days ago

@petermetz apart from the 2 comments, the concept looks good, short and sweet :)

petermetz commented 4 days ago

@petermetz apart from the 2 comments, the concept looks good, short and sweet :)

@ghiscoding Thank you, I made the changes! I left the conversations unresolved: I wasn't sure if you prefer to resolve them yourself or not.

ghiscoding commented 4 days ago

Great, it looks good now, ready to merge

petermetz commented 4 days ago

Great, it looks good now, ready to merge

@ghiscoding Nice! Thank you very much for the quick turnaround!!!

ghiscoding commented 4 days ago

all good, I wanted to push a new release by tomorrow anyway so the timing is good. Now available in v3.7.0 thanks again