Skip to content

Scan transitive dependencies when linking Node-API modules #54

Open

Description

@kraenhansen

Transitive dependencies (i.e. a dependency of a dependency of the app) aren't crawled when auto-linking, which means a library must be a direct dependency of an app to be considered when auto-linking Node-API addons. We're currently limiting the scanning for dependencies to direct dependencies of the app.

This is a known limitation of the React Native community CLI too and a design choice.
It would however be great if we could supported scanning for Node-API in dependencies of dependencies, etc: Having this would make it simpler for libraries to ship with dependencies on Node-API modules, since it could declare its dependency directly instead of using a peer dependency and asking the developer to declare the dependency on its behalf.

As a preliminary workaround, we could specify a package.json config object read when auto-linking a direct dependency of an app, which could enumerate transitive dependencies that needed to be scanned as well.

Activity

  1. added
    Linking 🔗
    on May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking 🔗

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions