Skip to content

Add /.bundle/ to gitignore and remove .bundle/config#209

Open
leotm wants to merge 2 commits intoreact-native-community:mainfrom
leotm:patch-1
Open

Add /.bundle/ to gitignore and remove .bundle/config#209
leotm wants to merge 2 commits intoreact-native-community:mainfrom
leotm:patch-1

Conversation

@leotm
Copy link
Contributor

@leotm leotm commented Feb 26, 2026

Summary:

  • update .gitignore to include /.bundle/
  • remove /.bundle/config

bundle install --deployment dirtifies the git state
causing the tracked local Bundler config yaml to drift overwriting it

from

BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1

to

---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: "1"
BUNDLE_DEPLOYMENT: "true"

in ephemeral CI environments and local testing (unintended afaik)

official convention is to gitignore /.bundle/
https://github.com/github/gitignore/blob/main/Ruby.gitignore#L42
and standard convention https://devcenter.heroku.com/articles/bundler-configuration

was likely an oversight to force it in VC earlier

if still wanting to isolate the path from the global OS folder
bundle config set --local path 'vendor/bundle' (run once per project)
BUNDLE_PATH=vendor/bundle bundle install (or in CI or a script)
bundle install --path vendor/bundle (deprecated)

however this also means running once per project
bundle config set --local force_ruby_platform true
meaning if Gemfile.lock were recreated PLATFORMS stick to ruby
so perhaps we don't want this change

a compromise could be
phase 1 add /.bundle/ to gitignore in template
phase 2 run both bundle config commands under-the-hood on RNCLI init (or simpler add the config strings w touch)
phase 3 [dust settles] remove .bundle/config from template

nit: adding to gitignore also prevents release.yaml from detecting then creating accidental commits of CI-specific Bundler state

if [ -z "$("${GIT[@]}" status --porcelain)" ]; then
echo "No changes, a previous release might have failed at the publish step. Continue to retry."
exit 0
fi

if one of the /scripts run earlier were to trigger a Ruby command

Changelog:

[GENERAL] [FIXED] - Add /.bundle/ to .gitignore and remove local Bundler config

Test Plan:

Before

npx @react-native-community/cli@latest init AwesomeProject
.bundle/config exists
bundle install # creates local project vendor folder, 33MB for empty project

After

npx @react-native-community/cli@latest init AwesomeProject
.bundle/config # no longer pollutes the repo to create git conflicts
bundle install # no longer creates local project vendor folder

Unchanged

bundle install --deployment # still creates local project vendor folder as expected
bundle config set deployment true && bundle install # still creates local project vendor folder as expected
BUNDLE_PATH="vendor/bundle" bundle install # still creates local project vendor folder as expected, opt-in

@leotm leotm marked this pull request as ready for review February 26, 2026 20:45
@leotm leotm changed the title Add /.bundle/ to gitignore and untrack /.bundle/config Add /.bundle/ to gitignore and remove .bundle/config Feb 26, 2026
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Feb 26, 2026
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Feb 26, 2026
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Feb 27, 2026
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Feb 27, 2026
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Mar 4, 2026
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Mar 4, 2026
- add to 'setup' script (DevEx, iOS CI)
- skip RubyGems Bundler config on Ubuntu

Ref: react-native-community/template#209
leotm added a commit to leotm/react-native-template-new-architecture that referenced this pull request Mar 4, 2026
- add to 'setup' script (DevEx, iOS CI)
- skip on Ubuntu CI, only call allow-scripts
  - prefix bin call with yarn for local deterministic CI exec

Ref: react-native-community/template#209
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.

1 participant