Support existing CLI apple project use cases without relying on podfile existing on the disk (projects using SPM)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- react-native, typescript
- Domain
- cli
Research direction
Start by tracing findPodfilePath and findPodfilePaths in packages/cli-config-apple/src/config/index.ts and the xcodeEnv healthcheck in packages/cli-doctor/src/tools/healthchecks/xcodeEnv.ts. Compare how getProjectConfig handles project.ios.sourceDir, .spm-injected.json, .xcode.env, and Podfile. Done means SPM projects without a Podfile still resolve their project config while projects with none of these indicators return null.
Written by the indexing model from the issue text.
Description
Describe the Feature
Since RN 0.87 there's an experimental SPM support introduced
Right now when project is migrated from Cocoapods to SPM, all the commands that rely on the getProjectConfig from @react-native-community/cli-config-apple (e.g. react-native spm) will fail once the Podfile is removed from its default location. Having dead Podfile just to keep the config command work doesn't make any sense
Possible Implementations
looking at where findPodfilePath or findPodfilePaths are used, there're 2 internal use cases
https://github.com/react-native-community/cli/blob/9013a480c66aece0e23cc8082ee23f92274e3cf4/packages/cli-config-apple/src/config/index.ts#L36(getProjectConfig)https://github.com/react-native-community/cli/blob/9013a480c66aece0e23cc8082ee23f92274e3cf4/packages/cli-doctor/src/tools/healthchecks/xcodeEnv.ts#L33(relies on the project config)
One idea would be to at least prioritize user config (project.ios.sourceDir from react-native.config.js) and use it instead of always returning null config when there's no Podfile. That way the amount of changes in CLI will be minimal and SPM users will be able to just set the value to e.g. ios and to drop the Podfile.
Another idea would be to look for .spm-injected.json within the candidate directory (it's a file injected via react-native spm command) - if it's found, it means that its parent directory is in fact the one that consists .pbxproj file and the directory with swift/objc source code.
Last one I can think of is to look for .xcode.env file, which is afaik should exist in each RN project next to Podfile
The resolving order should be like this: (user-config) -> (.spm-injected.json OR .xcode.env) -> (Podfile) - if none of those exist only then return null for the project config value
Related Issues
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 949
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react-native-community/cli
-
bug report
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
react-native-community/cli#2826 ·
-
bug report
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react-native-community/cli#2825 ·
-
run-ios: "Unable to boot device in current state: Booted" alert when the simulator is already booted Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
react-native-community/cli#2820 ·
-
FASOCARD Openbug report
Difficulty 5/5 Over a week Newbie friendliness 5/100
react-native-community/cli#2855 ·
-
FASOCARD Openbug report
Difficulty 5/5 Over a week Newbie friendliness 10/100
react-native-community/cli#2854 ·
All issues in react-native-community/cli
Similar issues
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
chrisparsons83/flexspotff#153 ·