Skip to content

Conversation

@patrickkabwe
Copy link

@patrickkabwe patrickkabwe commented Oct 25, 2025

Summary

Add opt-in support for autolinking native peer dependencies (closes #870). At the moment the CLI only autolinks packages that are listed directly in an app’s package.json, so native peers declared by a library remain invisible unless every app developer installs them manually. This change introduces a dependency.autolinkTransitiveDependencies flag that a library can set in its react-native.config.js. When enabled, the CLI reads the library’s own package.json, discovers its peer dependencies, and links any native peers that are already present in node_modules.

The approach stays entirely inside the autolinking pipeline unlike PR #2054’s --dependency-check, which mutates app dependencies so it avoids surprise installs, CI failures, and extra workflow steps. Once a library opts in, every app automatically benefits. The updates touch the config loader, schema, public types, documentation, and add loadConfigAsync test coverage.

Test Plan

yarn test packages/cli-config/src/__tests__/index-test.ts

Checklist

  • Documentation is up to date.
  • Follows commit message convention described in CONTRIBUTING.md.
  • For functional changes, my test plan has linked these CLI changes into a local react-native checkout (instructions).

@github-actions github-actions bot added docs Documentation change feature labels Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation change feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: Simplify workflow for native dependencies for libraries

1 participant