Skip to content

fix(create-react-native-library): ignore test app artifacts - #952

Open
dcavalcante wants to merge 1 commit into
callstack:mainfrom
dcavalcante:fix/test-app-ignore-artifacts
Open

fix(create-react-native-library): ignore test app artifacts#952
dcavalcante wants to merge 1 commit into
callstack:mainfrom
dcavalcante:fix/test-app-ignore-artifacts

Conversation

@dcavalcante

@dcavalcante dcavalcante commented Aug 29, 2026

Copy link
Copy Markdown

Problem

create-react-native-library generates the test app with react-native-test-app, then removes its generated .gitignore. That loses test-app-specific rules for generated local artifacts.

Fix

Preserve the generated .gitignore only for the test-app example. Other example flows retain their existing cleanup behavior and manage their own ignore rules where applicable.

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.
  • Exercised the non-test-app cleanup branch; it removes the upstream file and retains Expo's generated replacement rules.
  • Ran ESLint, TypeScript build, and git diff --check.

Comment on lines +30 to +33
# Generated by CocoaPods for the test app.
example/ios/*.xcworkspace/
# Generated by react-native-test-app and contains the local Node path.
example/ios/.xcode.env

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.

these are ignored for all templates but only relevant for test app, and could be important for other templates. e.g. .xcode.env is intended for source control for regular react native apps.

a better approach maybe to keep the example's .gitignore instead of deleting it to keep example specific ignores.

@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
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
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