-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix-679: empty lockfiles with no dependencies #1703
Conversation
How about a unit test? |
Yes, I was going to, but it was super late already, added it now. I'm sorry, should have made that clear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @verth, thanks for adding a test case.
I am currently working on a fix that would refactor this inSync
section and we won't need writeEmpty flag case.
However it would be great to add your test anyway, could you rebase your PR after the other one is merged?
I'll add a link here in an hour
Cool, cool! Will keep my eye on it |
Ping #1712 is merged |
I tried to kill the commits and merge master with the test only but it was not passing. When testing install manually without dependencies it also did not write the lockfile for me (with v.0.18.0 last commit 15d0112). Would you know something more by any chance, intentional? (not pushed yet to keep fix alive atm) |
@verth, I don't think we had intentional behavior around edge cases with no dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase needed
@bestander, rebased and dropped the "code fix" in PR to rely on |
@verth, currently yarn does not write lockfile if there are no dependencies. |
@bestander Reimplemented a fix now as-well. My bad this was dragged out so long, thought you only wanted to keep the test in this PR, I probably misinterpreted "currently working on a fix [...] However it would be great to add your test anyway". |
Summary
No lockfile is written with empty dependencies, which causes check to fail. Act the same with manifest & lockfile, so write an empty file as-well when no dependencies are going to be installed
dependencies: {}
.This will solve: #679
Test plan