[doctor] check if native files in local Expo modules are being ignored #28484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
An issue we've run into a few times is where someone creates a local module, but set their gitignore file to ignore their app's native project folders, but they made that match too greedy, so it ignores all android and ios folders.
The errors can be a little confusing when this happens... you'll get all the way to Fastlane and it'll be like, "I can't find this Cocoapod".
Matches like
/ios
orios/**
are fine, butios
is not.How
Check for:
a) does the modules folder exist?
b) if so, do any files match
modules/**/ios/*.podspec
ormodules/**/android/buld.gradle
?c) if so, are any of those files gitignored?
Optimally, I'd check .easignore, as well, but this should catch most cases. AFAIK, checking .easignore would require reading the file and using
minimatch
, so a completely different mechanism than the existing gitignore check, which is pretty thorough because it usesgit check-ignore
from the top level. A good long-term goal would be to refactor into a general-purpose ignore check that reports back what exactly is ignoring a file and can be used by multiple checks..Test Plan
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).