-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Add Yarn files to .gitignore #47083
Add Yarn files to .gitignore #47083
Conversation
/rebase |
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.
@zhongwuzw How are you configuring Yarn here? Yarn should not generate any v3/v4 files in .yarn/
when it detects a Yarn Classic (1.x) project such as this repository. (Happy to be corrected on if this behaviour has changed.)
Are you instead aiming to ignore .yarn/
files in a newly created React Native project via the Community CLI? (cc @szymonrybczak)
@huntie I don't change any configs in my react-native repo, maybe because my yarn version is v3?
No, I did some work in react-native repo , not a rn project via cli. |
@zhongwuzw Thanks for clarifying! Interesting. Can you share more about how you installed Yarn on your system? On my Mac, I've used I tried out a Corepack install (i.e. following modern Yarn's current install process). If I spin up a fresh GitHub Codespace and try this, it also resolves to Yarn The main thing to note here is this repository requires Yarn 1.x. I'll open a separate PR which helps programatically manage this via Corepack. And perhaps we should also update our contributing docs. |
Summary: Prompted by facebook#47083, this change adds a `"packageManager"` field to the root `package.json` specifying `yarn@1.22.22`. This will configure a compatible, predictable version of Yarn for users using [Corepack](https://nodejs.org/api/corepack.html) via the Yarn Modern install process. See https://yarnpkg.com/getting-started/install and https://nodejs.org/api/corepack.html. Tested on a fresh system (GitHub Codespaces). Changelog: [Internal] Differential Revision: D64536673
@huntie Sorry I forgot how to install and upgrade my yarn on my Mac :) , and I don't use any yml to specify yarn's version. |
@zhongwuzw Okay 🙂 Curious if you could try again with the change from #47091. |
@huntie I applied the changes of #47091, I removed the .yarn directory and exec |
@zhongwuzw Can you also check and remove any Annoyingly, if globally configured (example is contrived), Yarn can self-upgrade itself in the repo, ignoring
Either way, we require Yarn 1.x in this repo, so I won't be able to accept this |
Not have any
No.
@huntie I tried it and applied your #47091, it also creates .yarn directory.
ok, I'll add the gitignore on my local env. I'll close it. |
Summary: Pull Request resolved: #47091 Prompted by #47083, this change adds a `"packageManager"` field to the root `package.json` specifying `yarn@1.22.22`. This will configure a compatible, predictable version of Yarn for users using [Corepack](https://nodejs.org/api/corepack.html) via the Yarn Modern install process. See https://yarnpkg.com/getting-started/install and https://nodejs.org/api/corepack.html. Tested on a fresh system (GitHub Codespaces). Changelog: [Internal] Reviewed By: robhogan Differential Revision: D64536673 fbshipit-source-id: 535c0ca725172e4a06de04b19c6cd2d31788f5a4
Summary:
After running yarn install in the root directory of a React Native project, cached files from Yarn appear when checking Git changes, which can be a bit annoying. Let's ignore them! :)
This commit references #42313.
Changelog:
[GENERAL] [ADDED] - Add Yarn files to .gitignore in react-native
Test Plan:
yarn cached files should ignore after exec pod install