cli
cli copied to clipboard
feat: Resolve workspaces native dependencies
Summary:
I would like to have autolinking respect native dependencies that defined in each workspace packages, not only on the package where we have react-native dep. I think it will be easier to manage monorepo dependencies since each package will define it's own dependencies.
Based on https://github.com/react-native-community/cli/blob/main/docs/autolinking.md#how-can-i-use-autolinking-in-a-monorepo, If we had library with native code as a dependency in components, we should also define it in mobile to make autolinking works.
On this PR, I modified findDependencies method to look up all dependencies of the workspaces so it can be included in autolinking process.
Test Plan:
I've made a playground here to demonstrate the flow. @react-native-community/datetimepicker will be included in the autolinking process even though it's defined in util package.