-
Notifications
You must be signed in to change notification settings - Fork 986
chore: do not check in lockfiles but cache them #1896
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: do not check in lockfiles but cache them #1896
Conversation
a327432 to
834c655
Compare
Codecov Report
@@ Coverage Diff @@
## main #1896 +/- ##
==========================================
+ Coverage 92.72% 92.80% +0.07%
==========================================
Files 174 167 -7
Lines 6038 5669 -369
Branches 1283 1196 -87
==========================================
- Hits 5599 5261 -338
+ Misses 439 408 -31 |
|
I wonder why we hit those issues when updating them. I personally use them (with yarn instead of npm) without any problem with different monorepos. |
|
I think the main issue is that you can't just update a single subproject because this would add the lerna managed dependencies into the lockfile. #1890 is for sure a special case as it touches more or less all package.json files and as a result a lot package-lock.json files are effected. We could wait a while to see if this gets better. |
Not sure what you mean here. Can you give an example?
Lockfiles are not used at all for a customer install. The latest version of dependencies which match the package.json will be used (or version specified in the customer's lockfile).
#1770 could also help quite a bit. |
consider you change a dependency in core. Then delete node_modules folder + package-lock.json there and type |
ah yes. this has always been an issue. in that case though a bootstrap should be fast as the other projects will be ignored |
|
lets get this merge asap, there are more and more PRs that are modifying lock files and conflicts are inevitable. |
LOOKING FOR VOTES
Is this a good idea? Give this a 👍 or 👎
Problem Summary
After checking in lockfiles in #1829 there have been some concerns raised:
Simply checking in the node_modules will bring back the old issues. Namely that the caching step took a very long time in the old CI because caching so many small and deeply nested files in the node_modules structure was a very expensive operation.
Proposed Solution
This PR attempts to bridge the gap between what we had before and what we had with lockfiles by caching the lockfiles using the github cache instead of caching the node modules. On a cache hit,
npm ciis used to enable a drastically faster install process, otherwise we fall back onnpm install.It keeps the root
package-lock.jsonfile as this file is not touched by lerna and enables drastically faster local and ci builds.TL;DR
lerna bootstrap --cito speed up bootstrapCache Hit
Cache Miss