mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: The `codegenConfig` unified configuration for New Architecture on Android relies on the Gradle plugin finding the package.json correctly. Currently we use the `root` folder to resolve the package.json. This works fine when invoking the codegen for the app module, but it doesn't work well when invoking the codegen for modules. This extends the algo to make sure we first, look for a `package.json` in `..` and fallback to the one in the root if not found. ## Changelog [Internal] - Improve package.json search mechanism for codegenConfig support Pull Request resolved: https://github.com/facebook/react-native/pull/34298 Test Plan: It's hard to write a unit test for this as it's inside a lambda, I'll look into doing this though. I've tested this on RNNewArchitectureApp and it works fine. Reviewed By: cipolleschi Differential Revision: D38249663 Pulled By: cortinico fbshipit-source-id: 3cfd6a31e9f75d7b19b15f77bbd5131af42be9d3