Skip to content

Control pathSuffix option via configuration file(s)Β #153

@kraenhansen

Description

@kraenhansen

We're performing a transformation of the Node-API addon dynamic library paths on disk to their dynamic library names as they're linked into the host package.

Here's the documentation for the pathSuffix option of the NamingStrategy:

Controls how the path of the addon inside a package is transformed into a library name.
The transformation is needed to disambiguate and avoid conflicts between addons with the same name (but in different sub-paths or packages).

As an example, if the package name is my-pkg and the path of the addon within the package is build/Release/my-addon.node:

  • "omit": Only the package name is used and the library name will be my-pkg.
  • "strip": Path gets stripped to its basename and the library name will be my-pkg--my-addon.
  • "keep": The full path is kept and the library name will be my-pkg--build-Release-my-addon.

In the current state, this pathSuffix option is passed to the babel plugin as well as to the host package's CLI (either through a CLI runtime option or more likely the NODE_API_PATH_SUFFIX environment variable while running pod install or the Gradle build) and they need to match for the app to find the dynamic library files at runtime.

It would be more flexible and less brittle if ☝ was instead determined by

  • a single app-wide configuration setting, either in configuration file (or a key in the App's package.json) and / or
  • by individual per-library configuration files (or a key in their package.json files)

Note

This will likely all change once #104 merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Host 🏑Our `react-native-node-api-modules` packageLinking πŸ”—Discovering and copying prebuilds from packages into the hostenhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions