nitro icon indicating copy to clipboard operation
nitro copied to clipboard

feat: add `modulePath` option to nitrogen

Open corasan opened this issue 10 months ago • 1 comments

This PR adds a new option, --modulePath, which will let you specify where the module (podspec) is located and use this path to autolink the native files. Also adds "CLI Options" section to the Nitrogen docs

Why

When using the --out option on nitrogen the CLI assumes the Module.podspec file is at the root of the project, which results in the generated files not being auto linked when using a custom folder structure in a project.

Let's say I run bunx nitro-codegen ./modules --out=modules/generated

my-project
  ios/
  android/
  src/
  modules/
    generated/
       ios/
          MyModule+autolinking.rb
         ....
    MyModule.podspec
  package.json
  ...

This will generate a MyModule+autolinking.rb file that will look for the generated files at path modules/generated/**/*.{*}, and since MyModule.podspec is at modules/ it can't find the directory modules relative to it. This will result in the files not being added to source_files, public_header_files, and private_header_files of the spec.

corasan avatar Feb 27 '25 19:02 corasan

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nitro-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:57pm

vercel[bot] avatar Feb 27 '25 19:02 vercel[bot]