Skip to content

Conversation

atlj
Copy link
Collaborator

@atlj atlj commented Apr 11, 2025

Summary

facebook/react-native@98b8f17 adds support for --source flag in npx @react-native-community/cli codegen. With this flag, we can opt out of our patch. With this PR, bob checks if this flag is supported and uses it if it is.

Test plan

  1. Generate a library with a React Native version that supports --source. (The baseline is [email protected]).
  2. Run yarn prepare
  3. Make sure the command runs with no errors
  4. Check the ios/generated and make sure there are no .podspec files.

@atlj atlj requested a review from Copilot April 11, 2025 13:07
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/react-native-builder-bob/src/targets/codegen/patches/removeCodegenAppLevelCode.ts:80

  • Consider adding error handling to getCodegenCLISourceSupport to manage cases where the spawn call fails, which could otherwise lead to unhandled promise rejections.
const codegenCLIHelpOutput = await spawn('npx', ['@react-native-community/cli', 'codegen', '--help']);

@atlj atlj changed the title feat: pass source flag to codegen cli when possible fix: pass source flag to codegen cli when possible Apr 11, 2025
@atlj atlj merged commit 7724e47 into main Apr 11, 2025
20 of 21 checks passed
@atlj atlj deleted the @atlj/pass-source-arg-to-codegen-cli branch April 11, 2025 13:21
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