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

Warn on package lock json #5920

Merged
merged 2 commits into from Jun 1, 2018
Merged

Conversation

jmorrell
Copy link
Contributor

Summary

This is a first pass at resolving #5654 by adding a warning when npm lockfiles already exist in the directory when yarn is run

Test plan

  • Added integration tests and fixtures that check to make sure warning is printed to the console
  • Ran locally using yarn-local alias:

hyper 2018-05-31 16-49-42

hyper 2018-05-31 16-52-16

@jmorrell
Copy link
Contributor Author

Ideally I'd like to make the warning message more prominent, but it's not clear what mechanism I'd use to do that.

Happy to iterate on any part of this

@imsnif imsnif self-assigned this Jun 1, 2018
Copy link
Member

@imsnif imsnif left a comment

Choose a reason for hiding this comment

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

This looks great.

We have accurate tests, it pops when it needs to (with an existing yarn.lock file, when creating a new yarn.lock file) and does not pop when it doesn't need to (when importing to a new yarn.lock file).
The messages are verbose and provide a clear action to be performed to remedy the situation.

@imsnif
Copy link
Member

imsnif commented Jun 1, 2018

@jmorrell - while I agree that the message should be more prominent (I'd personally like to see this become an error that fails the install as a breaking change), there is currently some disagreement on this subject.
I don't think we have a facility to not fail the install while being more prominent than a warning.
I think the best way to proceed right now would be to merge this, and upon its release in the next version, try to see if it reduces the deployment errors you mentioned in #5654
If after a while we feel this has not made a big enough dent in them, we can consider more drastic measures. What do you think?

@jmorrell
Copy link
Contributor Author

jmorrell commented Jun 1, 2018

@imsnif I agree with everything you've said :)

@imsnif
Copy link
Member

imsnif commented Jun 1, 2018

Great. Thanks for this patch!

@imsnif imsnif merged commit 726bda5 into yarnpkg:master Jun 1, 2018
@jmorrell jmorrell deleted the warn-on-package-lock-json branch June 1, 2018 16:10
@arcanis
Copy link
Member

arcanis commented Jul 25, 2018

😍

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.

None yet

3 participants