Skip to content

fix(create-react-native-library): keep generated gitignore in example apps - #952

Merged
satya164 merged 2 commits into
callstack:mainfrom
dcavalcante:fix/test-app-ignore-artifacts
Oct 21, 2026
Merged

satya164 merged 2 commits into
callstack:mainfrom
dcavalcante:fix/test-app-ignore-artifacts

Conversation

@dcavalcante

@dcavalcante dcavalcante commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

create-react-native-library generates the example app with @react-native-community/cli, react-native-test-app or create-expo-app, then removes the generated .gitignore. That loses the app-specific rules for generated local artifacts, such as .xcode.env and *.xcworkspace/ for the test app.

Fix

Keep the generated .gitignore for all example types. For Expo examples of native libraries, append the android/ and ios/ rules instead of overwriting the file, so the Expo rules stay. Older Expo SDK templates (e.g. SDK 52) don't ignore the native folders, so the rules are still needed.

Validation

  • Generated the test-app from the pre-change and current code. Only the current output retains example/.gitignore.
  • Verified the retained file includes .xcode.env and *.xcworkspace/ rules.
  • Ran ESLint, TypeScript build, and git diff --check.

Comment thread packages/create-react-native-library/templates/common/$.gitignore Outdated
@dcavalcante
dcavalcante force-pushed the fix/test-app-ignore-artifacts branch from eb10dee to 2491285 Compare September 9, 2026 12:35
@dcavalcante

Copy link
Copy Markdown
Contributor Author

Updated to preserve react-native-test-app’s generated .gitignore instead of adding its rules to the shared template. Verified pre-change has no example/.gitignore; this change preserves the test-app rules, including .xcode.env and *.xcworkspace/

@dcavalcante
dcavalcante requested a review from satya164 September 9, 2026 12:39
@dcavalcante

Copy link
Copy Markdown
Contributor Author

hey @satya164 I updated this to preserve the test app’s generated .gitignore as suggested. The old CI runs are still marked failed, but their logs/jobs have expired. When you have a chance, can you please take another look and rerun the checks?

@satya164 satya164 changed the title fix(create-react-native-library): ignore test app artifacts fix(create-react-native-library): keep generated gitignore in example apps Oct 21, 2026

@satya164 satya164 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thank you

@satya164
satya164 merged commit 1dfdfdf into callstack:main Oct 21, 2026
25 checks passed
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.

2 participants