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

fix: prevent yarn usage #2858

Conversation

Gumichocopengin8
Copy link
Contributor

  • prevent to use yarn instead of npm
  • these days, many people use yarn, so it can be possible to make a mistake to use yarn instead of npm
  • in order to avoid the annoying mistake, I created this PR.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sgrif (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Gumichocopengin8
Copy link
Contributor Author

@bors @Turbo87
Hello, hope you're doing well.
I'd appreciate it if you'd review this PR.
Thank you.

@@ -115,6 +115,7 @@
},
"engines": {
"node": "^12.9.1",
"npm": "^6.10.2"
"npm": "^6.10.2",
"yarn": "please_use_npm"
Copy link
Member

Choose a reason for hiding this comment

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

what's the effect of this?

technically using yarn should be fine. the only downside would be that the lockfile is not taken into account when installing through yarn.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this helps you - https://stackoverflow.com/questions/57328593/prevent-yarn-install-from-running-in-project-i-e-force-npm-install
In my opinion , we should stick to yarn or npm, not both because of lock file. So far, this repo is using npm, so I just added a restriction that prevents using yarn.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of this PR, but the implementation seems to add even more confusing error message. Currently, if you run yarn you get a warning at the top about the presence of an npm lockfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@locks
I don't think it is confusing. yarnpkg/yarn#4895 (comment) suggests this too.
I think a warning is not sufficient to prevent yarn because some ppl don't pay attention to warnings.

What do you think, @Turbo87?

Copy link
Member

Choose a reason for hiding this comment

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

even though I'm using npm to install the dependencies I usually still use things like yarn test and yarn start:live because I'm used to using yarn from other projects and have several shell aliases set up for things like this.

while I appreciate the idea and effort, I think I would prefer to not merge this 😞

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Turbo87
I see. That makes sense. Thank you for reviewing it anyways!
I'll close this PR.

@Gumichocopengin8 Gumichocopengin8 deleted the feature/prevent-yarn branch March 3, 2022 09:22
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.

5 participants