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

feat(template): add Yarn files to .gitignore #42313

Conversation

szymonrybczak
Copy link
Contributor

Summary:

Recently inside React Native Community CLI we added bumping Yarn version inside init command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in .gitignore for new projects created.

Changelog:

[GENERAL] [ADDED] - Add Yarn files to .gitignore in template

Test Plan:

  1. Follow Contributing guide from React Native Community CLI repository to setup locally newest version of CLI.
  2. Run this command:
node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template
  1. Appropriate should be ignored.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 16, 2024
@@ -64,3 +64,11 @@ yarn-error.log

# testing
/coverage

# Yarn
.yarn/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Which version of Yarn is creating those files? Asking as I never saw them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yarn v3, the one that is set by default in CLI starting from next version.

@robhogan
Copy link
Contributor

robhogan commented Jan 17, 2024

I don't have much experience with Yarn2+ personally, but isn't their recommendation to check in at least some of .yarn (eg, as Jest does)?

https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

(I don't like the churn this creates in userland code tbh, but we ought to have a justification for deviating from the packager's recommendation)

@szymonrybczak
Copy link
Contributor Author

but isn't their recommendation to check in at least some of .yarn (eg, as Jest does)?

Yeah, sure. I've taken this into account, and appropriate paths are added:

!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

Copy link
Contributor

@robhogan robhogan left a comment

Choose a reason for hiding this comment

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

Oh, apologies, I misread the diff on mobile, didn't scroll past @cortinico's comment 😅. Yeah, this LGTM then.

I hope we can get pnpm support in to give folks a choice before the branch cut because I (personally) find modern Yarn a bit untidy in this respect, but that shouldn't block.

@cortinico
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the feat/template/add-yarn-files-to-gitignore branch from 420daf4 to 978c2a9 Compare January 18, 2024 11:54
@analysis-bot
Copy link

analysis-bot commented Jan 18, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 16,794,699 -3
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 20,186,010 +6
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: ea0e826
Branch: main

@cortinico
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the feat/template/add-yarn-files-to-gitignore branch from 978c2a9 to f632bbe Compare January 19, 2024 11:05
@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 19, 2024
@facebook-github-bot
Copy link
Contributor

@cortinico merged this pull request in 965f2eb.

@szymonrybczak szymonrybczak deleted the feat/template/add-yarn-files-to-gitignore branch January 22, 2024 08:33
blakef pushed a commit to blakef/template that referenced this pull request Feb 28, 2024
Summary:
Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created.

## Changelog:

[GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template

Pull Request resolved: facebook/react-native#42313

Test Plan:
1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI.
2. Run this command:

```sh
node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template
```
3. Appropriate should be ignored.

Reviewed By: NickGerleman

Differential Revision: D52907962

Pulled By: cortinico

fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446

Original: facebook/react-native@965f2eb
blakef pushed a commit to react-native-community/template that referenced this pull request Feb 29, 2024
Summary:
Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created.

## Changelog:

[GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template

Pull Request resolved: facebook/react-native#42313

Test Plan:
1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI.
2. Run this command:

```sh
node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template
```
3. Appropriate should be ignored.

Reviewed By: NickGerleman

Differential Revision: D52907962

Pulled By: cortinico

fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446

Original-Commit: facebook/react-native@965f2eb
blakef pushed a commit to react-native-community/template that referenced this pull request Feb 29, 2024
Summary:
Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created.

## Changelog:

[GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template

Pull Request resolved: facebook/react-native#42313

Test Plan:
1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI.
2. Run this command:

```sh
node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template
```
3. Appropriate should be ignored.

Reviewed By: NickGerleman

Differential Revision: D52907962

Pulled By: cortinico

fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446

Original-Commit: facebook/react-native@965f2eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants