Skip to content

Conversation

@patrickkabwe
Copy link
Owner

@patrickkabwe patrickkabwe commented Sep 6, 2025

  • Pin 'react-native-nitro-modules' and 'nitro-codegen' to the latest exact published versions during init.\n- Configure ESLint to ignore unused identifiers starting with '_' for vars, args, and catch bindings.\n\nThis ensures new projects always use the latest released Nitro tools while keeping deterministic installs.

Summary by CodeRabbit

  • New Features
    • Nitro package generator now pins exact versions of nitro-codegen and react-native-nitro-modules for reproducible builds.
  • Tests
    • Split iOS/Android build tests and added dedicated Android/iOS E2E jobs with improved artifact uploads.
  • Chores
    • CI workflow modularized with parallel jobs, manual/scheduled triggers, and improved caching; added Dependabot “nitro” update group.
  • Documentation
    • Formatting improvements, clearer project structure, and streamlined troubleshooting steps.
  • Linting
    • Enforced TypeScript no-unused-vars (underscore-prefixed ignored).
  • Style
    • Broad formatting/indentation and quoting consistency across configs and source; no behavioral changes.

@coderabbitai
Copy link

coderabbitai bot commented Sep 6, 2025

Walkthrough

Broad reformatting across configs/workflows and docs. CI workflow was split into multiple jobs. Dependabot gained a “nitro” group (root and template). ESLint adds a no-unused-vars rule. Core feature: generator now resolves and pins nitro-codegen/react-native-nitro-modules versions at generation time via npm/pnpm. Minor code style tweak in NitroSpinner.

Changes

Cohort / File(s) Summary of changes
GitHub Action composites (formatting)
.github/actions/android-gradle-build/action.yml, .github/actions/install-deps/action.yml, .github/actions/ios-build-xcode/action.yml, .github/actions/run-codegen-build/action.yml, .github/actions/setup-yarn/action.yml
YAML re-indentation and structure normalization; inputs and runs blocks expressed as mappings. No command changes; behavior preserved.
Workflows: CI restructure and formatting
.github/workflows/ci-packages.yml, .github/workflows/deploy.yml, .github/workflows/release.yml
CI split into modular jobs (lint/build, generate packages, platform builds, E2E). Added matrices, artifacts, caching tweaks, triggers. Deploy/release re-indented; logic unchanged.
Dependabot configs
.github/dependabot.yml, assets/template/.github/dependabot.yml
Added “nitro” update group (nitro-codegen, react-native-nitro-modules). General formatting cleanups.
Docs and site (formatting/content tweaks)
CHANGELOG.md, docs/... (multiple: config, pages, components, CSS, JSON), docs/docs/troubleshooting.md
Formatting/indentation adjustments; changelog bullet style *-. Troubleshooting: removed one iOS and one Android bullet step. No structural doc changes otherwise.
Assets/template configs (formatting)
assets/react-native.config.js, assets/template/... (.github/workflows/release.yml, .watchmanconfig, nitro.json, release.config.cjs)
Indentation/quoting updates; JSON arrays compacted; added trailing newline; no behavior changes.
Linting and hooks
eslint.config.js, lefthook.yml
ESLint: add @typescript-eslint/no-unused-vars with underscore ignore patterns. Lefthook: indentation/quoting style changes only.
Core generator feature
src/generate-nitro-package.ts
Added version resolution (npm view, fallback pnpm) to pin nitro-codegen and react-native-nitro-modules in generated workspace and example app. New private field and helper method; integrates into nitro.json/package.json updates.
Minor code style
src/nitro-spinner.ts
Switched empty string initializer quotes from double to single; no functional impact.
Project configs formatting
tsconfig.json, tsup.config.ts
Re-indentation only; no semantic changes.
E2E spec
e2e-tests/view.e2e.yaml
Added trailing newline; content unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant CLI as NitroModuleFactory
  participant NPM as npm registry
  participant PNPM as pnpm (fallback)
  participant FS as Filesystem

  Dev->>CLI: generate nitro package
  activate CLI
  CLI->>NPM: npm view react-native-nitro-modules version
  alt npm success
    NPM-->>CLI: latest version
  else npm fails
    CLI->>PNPM: pnpm view react-native-nitro-modules version
    PNPM-->>CLI: latest or null
  end
  CLI->>NPM: npm view nitro-codegen version
  alt npm success
    NPM-->>CLI: latest version
  else npm fails
    CLI->>PNPM: pnpm view nitro-codegen version
    PNPM-->>CLI: latest or null
  end

  note over CLI: Store resolved versions (may be null)

  CLI->>FS: Write nitro.json (placeholders replaced)
  CLI->>FS: Update workspace devDependencies with pinned versions (fallback to existing/template if null)
  CLI->>FS: Update example app dependencies with pinned react-native-nitro-modules
  deactivate CLI
  CLI-->>Dev: Generation complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

In burrows of YAML I tidy and sweep,
With linting carrots in a neat little heap.
I pin nitro versions—no wildcards to chase—
Then hop through CI, each job in its place.
Thump goes the spinner, content and bright—
Ship it, my warren, the pipelines are right! 🥕🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/pin-nitro-versions-and-eslint-underscore

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (19)
docs/src/css/custom.css (1)

22-29: Indentation consistency between blocks

The dark theme block uses 4-space indentation while :root uses 2. Consider standardizing for readability.

Apply this diff to match the 2-space indentation style:

 [data-theme='dark'] {
-    --ifm-color-primary: #25c2a0;
-    --ifm-color-primary-dark: #21af90;
-    --ifm-color-primary-darker: #1fa588;
-    --ifm-color-primary-darkest: #1a8870;
-    --ifm-color-primary-light: #29d5b0;
-    --ifm-color-primary-lighter: #32d8b4;
-    --ifm-color-primary-lightest: #4fddbf;
-    --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
+  --ifm-color-primary: #25c2a0;
+  --ifm-color-primary-dark: #21af90;
+  --ifm-color-primary-darker: #1fa588;
+  --ifm-color-primary-darkest: #1a8870;
+  --ifm-color-primary-light: #29d5b0;
+  --ifm-color-primary-lighter: #32d8b4;
+  --ifm-color-primary-lightest: #4fddbf;
+  --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
 }
src/nitro-spinner.ts (1)

18-18: Duplicate initialization of text

text is initialized here and again in the constructor (Line 51). Drop one to avoid churn.

-        this.text = ''
.github/actions/install-deps/action.yml (1)

15-21: Use frozen/immutable installs per package manager for deterministic CI

Aligns with the PR goal (deterministic installs). Prefer lockfile-respecting commands instead of a generic “install”.

Apply this diff:

   set -euo pipefail
   cd "${{ inputs.working-directory }}"
   case "${{ inputs.pm }}" in
     bun|yarn|pnpm|npm) ;;
     *) echo "Unsupported pm: ${{ inputs.pm }}" >&2; exit 1;;
   esac
-  ${{ inputs.pm }} install
+  case "${{ inputs.pm }}" in
+    bun)
+      # bun respects --frozen-lockfile; use if lockfile exists, otherwise still freeze
+      if [ -f bun.lockb ]; then bun install --frozen-lockfile; else bun install --frozen-lockfile; fi
+      ;;
+    yarn)
+      # Yarn Berry/3+: prefer immutable to ensure lockfile determinism
+      yarn install --immutable
+      ;;
+    pnpm)
+      pnpm install --frozen-lockfile
+      ;;
+    npm)
+      if [ -f package-lock.json ]; then npm ci; else npm install --no-audit --no-fund; fi
+      ;;
+  esac
docs/docs/usage/create-an-app-with-nitro-module-setup.md (1)

43-47: Fix nested list indentation and render tests literally

Current indentation triggers MD007 and “tests” renders as emphasis. Use backticks and 2-space nesting.

Apply this diff:

-    - **my-nitro-module/**: Example of a nitro module.
-        - **\_**_tests_**\_/**: Contains test files.
-        - **android/**: Contains the Android native module implementation.
-        - **ios/**: Contains the iOS native module implementation.
-        - **src/**: Contains the native module specs.
+  - **my-nitro-module/**: Example of a nitro module.
+    - `__tests__/`: Contains test files.
+    - **android/**: Contains the Android native module implementation.
+    - **ios/**: Contains the iOS native module implementation.
+    - **src/**: Contains the native module specs.
CHANGELOG.md (1)

61-63: Minor grammar fixes in entries

Tighten wording for clarity.

Apply this diff:

-- bum up nitro to 0.27.2
- - bump up nitro and react-native
+- bump nitro to 0.27.2
+- bump nitro and React Native
.github/actions/android-gradle-build/action.yml (1)

13-21: Add --stacktrace to Gradle invocations for better CI diagnostics

Helps triage failures without re-running jobs.

-              ./gradlew clean
-              ./gradlew generateCodegenArtifactsFromSchema
-              ./gradlew assemble${{ inputs.mode }} --no-daemon --build-cache
+              ./gradlew clean --stacktrace
+              ./gradlew generateCodegenArtifactsFromSchema --stacktrace
+              ./gradlew assemble${{ inputs.mode }} --no-daemon --build-cache --stacktrace
eslint.config.js (1)

32-39: Avoid false positives with object rest patterns

Consider enabling ignoreRestSiblings to prevent reports like const { used, ..._rest } = obj.

             '@typescript-eslint/no-unused-vars': [
                 'error',
                 {
                     argsIgnorePattern: '^_',
                     varsIgnorePattern: '^_',
                     caughtErrorsIgnorePattern: '^_',
+                    ignoreRestSiblings: true,
                 },
             ],
.github/actions/run-codegen-build/action.yml (1)

13-21: Quote pm invocation for safety

Minor robustness; avoids edge cases if pm ever carries spaces or flags via matrix inputs.

-              ${{ inputs.pm }} run build
+              "${{ inputs.pm }}" run build
.github/workflows/deploy.yml (1)

29-33: Pin Bun to a specific version for deterministic CI.

Using latest can introduce silent CI drift. Consider pinning to an exact Bun release or a repo/org variable.

-            - name: Setup Bun.js
-              uses: oven-sh/setup-bun@v2
-              with:
-                  bun-version: latest
+            - name: Setup Bun.js
+              uses: oven-sh/setup-bun@v2
+              with:
+                  # Option A: exact pin
+                  bun-version: '1.1.XX'
+                  # Option B: manage via repo variable
+                  # bun-version: ${{ vars.BUN_VERSION }}
.github/actions/setup-yarn/action.yml (2)

4-6: Make Yarn version configurable via input (keeps default pin).

Small DX improvement: allow callers to override the pinned version without editing the action.

 inputs:
-    working-directory:
+    working-directory:
         description: Directory to run yarn config
         required: true
+    yarn-version:
+        description: Yarn version to set (defaults to pinned)
+        required: false
+        default: '4.6.0'

15-18: Use the new input for the version; rest looks solid.

Quoting is fine; node-modules linker and immutable installs toggle are correct for Yarn v4.

-              yarn set version 4.6.0
+              yarn set version "${{ inputs.yarn-version }}"
.github/workflows/release.yml (2)

23-31: Pin Bun version for reproducible releases

Using bun-version: latest can break the pipeline when Bun ships breaking changes. Pin to a known-good version and update intentionally.

-              with:
-                  bun-version: latest
+              with:
+                  bun-version: '1.1.29'

26-33: Broaden cache key to include Bun’s default lockfile (.lockb)

Bun defaults to bun.lockb; your key only hashes bun.lock. Include both so cache hits remain effective regardless of lockfile format.

-                  key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
+                  key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock', '**/bun.lockb') }}
docs/docusaurus.config.ts (1)

39-49: Optional: use require.resolve for file paths

Docusaurus often recommends require.resolve for robustness across cwd changes. Not required, but a small hardening.

-                    sidebarPath: './sidebars.ts',
+                    sidebarPath: require.resolve('./sidebars.ts'),
...
-                    customCss: './src/css/custom.css',
+                    customCss: require.resolve('./src/css/custom.css'),
lefthook.yml (1)

9-21: Ensure formatted files are re-staged

If bun format writes changes, consider stage_fixed: true so Lefthook re-stages them and the commit succeeds without a second attempt.

 pre-commit:
     parallel: true
     commands:
         lint:
             glob:
                 - '*.json'
                 - '*.ts'
                 - '*.tsx'
             run: bun lint {staged_files}
         format:
+            stage_fixed: true
             glob:
                 - '*.json'
                 - '*.ts'
                 - '*.tsx'
             run: bun format {staged_files}
docs/src/components/HomepageFeatures/index.tsx (1)

63-66: Prefer stable keys over index

Using array index as key can cause unnecessary re-renders if the list changes. Title is unique here and works as a stable key.

-                    {FeatureList.map((props, idx) => (
-                        <Feature key={idx} {...props} />
+                    {FeatureList.map((props) => (
+                        <Feature key={props.title} {...props} />
                     ))}
.github/actions/ios-build-xcode/action.yml (1)

21-30: Avoid hard-coding simulator device; make it configurable.

Hard-coded 'iPhone 16' can break when the runner’s simulators differ. Expose a 'device' input and use it in -destination.

 inputs:
     ios-dir:
         description: Path to example/ios directory
         required: true
     scheme:
         description: Xcode scheme to build
         required: true
     mode:
         description: Build configuration (Debug|Release)
         required: true
+    device:
+        description: iOS Simulator device name (e.g., 'iPhone 16')
+        required: false
+        default: iPhone 16
@@
-                -destination 'platform=iOS Simulator,name=iPhone 16' \
+                -destination 'platform=iOS Simulator,name=${{ inputs.device }}' \
.github/workflows/ci-packages.yml (1)

356-367: Add timeouts to long-running jobs to avoid stuck workflows.

E2E and matrix builds can hang; set conservative timeouts per job.

 e2e-android:
-    if: always()
+    if: always()
+    timeout-minutes: 60
@@
 e2e-ios:
-    if: always()
+    if: always()
+    timeout-minutes: 75

Also applies to: 445-455

src/generate-nitro-package.ts (1)

431-435: Duplicate write to settings.gradle; remove the first write.

settings.gradle is written twice with the same content. Drop the earlier write.

-        await writeFile(
-            androidSettingsGradlePath,
-            androidSettingsGradleCode(toPascalCase(this.config.packageName)),
-            { encoding: 'utf8' }
-        )

Also applies to: 474-480

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0e0e9a and 41200c7.

📒 Files selected for processing (36)
  • .github/actions/android-gradle-build/action.yml (1 hunks)
  • .github/actions/install-deps/action.yml (1 hunks)
  • .github/actions/ios-build-xcode/action.yml (1 hunks)
  • .github/actions/run-codegen-build/action.yml (1 hunks)
  • .github/actions/setup-yarn/action.yml (1 hunks)
  • .github/dependabot.yml (1 hunks)
  • .github/workflows/ci-packages.yml (1 hunks)
  • .github/workflows/deploy.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • assets/react-native.config.js (1 hunks)
  • assets/template/.github/dependabot.yml (1 hunks)
  • assets/template/.github/workflows/release.yml (1 hunks)
  • assets/template/.watchmanconfig (1 hunks)
  • assets/template/nitro.json (1 hunks)
  • assets/template/release.config.cjs (1 hunks)
  • docs/docs/intro.md (1 hunks)
  • docs/docs/troubleshooting.md (0 hunks)
  • docs/docs/usage/_category_.json (1 hunks)
  • docs/docs/usage/create-an-app-with-nitro-module-setup.md (1 hunks)
  • docs/docusaurus.config.ts (1 hunks)
  • docs/package.json (1 hunks)
  • docs/sidebars.ts (3 hunks)
  • docs/src/components/HomepageFeatures/index.tsx (1 hunks)
  • docs/src/components/HomepageFeatures/styles.module.css (1 hunks)
  • docs/src/css/custom.css (1 hunks)
  • docs/src/pages/index.module.css (1 hunks)
  • docs/src/pages/index.tsx (1 hunks)
  • docs/tsconfig.json (1 hunks)
  • e2e-tests/view.e2e.yaml (1 hunks)
  • eslint.config.js (1 hunks)
  • lefthook.yml (1 hunks)
  • src/generate-nitro-package.ts (4 hunks)
  • src/nitro-spinner.ts (1 hunks)
  • tsconfig.json (1 hunks)
  • tsup.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • docs/docs/troubleshooting.md
🧰 Additional context used
🧬 Code graph analysis (1)
docs/src/pages/index.tsx (1)
docs/src/components/HomepageFeatures/index.tsx (1)
  • HomepageFeatures (59-71)
🪛 markdownlint-cli2 (0.17.2)
docs/docs/usage/create-an-app-with-nitro-module-setup.md

43-43: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


44-44: Unordered list indentation
Expected: 4; Actual: 8

(MD007, ul-indent)


45-45: Unordered list indentation
Expected: 4; Actual: 8

(MD007, ul-indent)


46-46: Unordered list indentation
Expected: 4; Actual: 8

(MD007, ul-indent)


47-47: Unordered list indentation
Expected: 4; Actual: 8

(MD007, ul-indent)

🪛 LanguageTool
CHANGELOG.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...75f6b2d97861ea845e26d547b4a906646d62f6)) - update Node.js engine requirement from >...

(QB_NEW_EN)


[grammar] ~14-~14: There might be a mistake here.
Context: ...503e983b4d0f612)) ### 🛠️ Other changes - android: enable RN_SERIALIZABLE_STATE ...

(QB_NEW_EN)


[grammar] ~44-~44: There might be a mistake here.
Context: ...838ef76fa91248cca152f2344d819c2bb6fd63)) - add support for --package-type which c...

(QB_NEW_EN)


[grammar] ~47-~47: There might be a mistake here.
Context: ...155654e4883d41cb7888)) ### 🐛 Bug Fixes - ci: update e2e workflow to use dynamic...

(QB_NEW_EN)


[grammar] ~55-~55: There might be a mistake here.
Context: ...c34ed109282efaf)) ### 🔄 Code Refactors - improve formatting and readability in cr...

(QB_NEW_EN)


[grammar] ~59-~59: There might be a mistake here.
Context: ...91d8eb4e7bd3909)) ### 🛠️ Other changes - add xcpretty installation step to CI wor...

(QB_NEW_EN)


[grammar] ~91-~91: There might be a mistake here.
Context: ...t.2) (2025-07-31) ### 🛠️ Other changes - update package.json dependencies and add...

(QB_NEW_EN)


[grammar] ~99-~99: There might be a mistake here.
Context: ...838ef76fa91248cca152f2344d819c2bb6fd63)) - add support for --package-type which c...

(QB_NEW_EN)


[grammar] ~102-~102: There might be a mistake here.
Context: ...155654e4883d41cb7888)) ### 🐛 Bug Fixes - ci: update e2e workflow to use dynamic...

(QB_NEW_EN)


[grammar] ~110-~110: There might be a mistake here.
Context: ...c34ed109282efaf)) ### 🔄 Code Refactors - improve formatting and readability in cr...

(QB_NEW_EN)


[grammar] ~114-~114: There might be a mistake here.
Context: ...91d8eb4e7bd3909)) ### 🛠️ Other changes - add xcpretty installation step to CI wor...

(QB_NEW_EN)


[grammar] ~142-~142: There might be a mistake here.
Context: ...0.3) (2025-07-06) ### 🛠️ Other changes - deps: downgrade react-native from 0.80...

(QB_NEW_EN)


[grammar] ~148-~148: There might be a mistake here.
Context: ...0.2) (2025-07-05) ### 🛠️ Other changes - deps-dev: bump @typescript-eslint/esli...

(QB_NEW_EN)


[grammar] ~150-~150: There might be a mistake here.
Context: ...c290e1ad47bb228446c89587ae8af77d094757)) - deps-dev: bump eslint-plugin-n from 17...

(QB_NEW_EN)


[grammar] ~151-~151: There might be a mistake here.
Context: ...aa1bb4e95cb32032090efb985572634cc448cc)) - deps-dev: bump semantic-release from 2...

(QB_NEW_EN)


[grammar] ~152-~152: There might be a mistake here.
Context: ...c99713f9b6a70e177b64c303eff79f0be381e5)) - deps-dev: bump semantic-release in /as...

(QB_NEW_EN)


[grammar] ~157-~157: There might be a mistake here.
Context: .....v3.0.1) (2025-07-01) ### 🐛 Bug Fixes - remove or overwrite existing folder only...

(QB_NEW_EN)


[grammar] ~161-~161: There might be a mistake here.
Context: ...d5cdb55cee2e822)) ### 🛠️ Other changes - add clean step to Android build workflow...

(QB_NEW_EN)


[grammar] ~180-~180: There might be a mistake here.
Context: ...n field. ### ✨ Features - add support for pnpm package manager ([a456841](https:/...

(QB_NEW_EN)


[grammar] ~182-~182: There might be a mistake here.
Context: ...e8e5b69d0984cfa95696)) ### 🐛 Bug Fixes - add .npmrc file for pnpm configuration a...

(QB_NEW_EN)


[grammar] ~187-~187: There might be a mistake here.
Context: ...cce87ae96a22bcd2)) ### 📚 Documentation - add pnpm support to README and documenta...

(QB_NEW_EN)


[grammar] ~191-~191: There might be a mistake here.
Context: ...751942b0d2f4b92)) ### 🛠️ Other changes - add pnpm to package manager selection in...

(QB_NEW_EN)


[grammar] ~193-~193: There might be a mistake here.
Context: ...561bec1ce12a98c911014bb0b799fff6f735f6)) - deps-dev: bump @typescript-eslint/pars...

(QB_NEW_EN)


[grammar] ~200-~200: There might be a mistake here.
Context: ...1.3) (2025-06-13) ### 🛠️ Other changes - deps-dev: bump @types/node from 22.15....

(QB_NEW_EN)


[grammar] ~206-~206: There might be a mistake here.
Context: ...1.2) (2025-06-07) ### 🛠️ Other changes - deps: update nitro-codegen and react-n...

(QB_NEW_EN)


[grammar] ~208-~208: There might be a mistake here.
Context: ...adf9a8aa1689cbf727aee39cd4544e58d6f857)) - deps: update nitro-codegen and react-n...

(QB_NEW_EN)


[grammar] ~213-~213: There might be a mistake here.
Context: ...1.1) (2025-06-05) ### 🛠️ Other changes - deps-dev: bump @typescript-eslint/esli...

(QB_NEW_EN)


[grammar] ~215-~215: There might be a mistake here.
Context: ...22c3e259aa0dc9231d59dfb1567d64db97fb74)) - deps-dev: bump eslint from 9.27.0 to 9...

(QB_NEW_EN)


[grammar] ~216-~216: There might be a mistake here.
Context: ...e7ace904dc65a92dcafed794dca46293fddd01)) - deps-dev: bump eslint-plugin-n from 17...

(QB_NEW_EN)


[grammar] ~227-~227: There might be a mistake here.
Context: ...08c4b7cdc1f2b0db49573417e5260ff9c7f092)) - package and readme description ([b033671...

(QB_NEW_EN)


[grammar] ~230-~230: There might be a mistake here.
Context: ...4c95327f10fd779)) ### 🔄 Code Refactors - improve code readability in installDepen...

(QB_NEW_EN)


[grammar] ~232-~232: There might be a mistake here.
Context: ...e Refactors - improve code readability in installDependenciesAndRunCodegen method...

(QB_NEW_EN)


[grammar] ~235-~235: There might be a mistake here.
Context: ...d05bc8de8817957)) ### 🛠️ Other changes - update ESLint configuration to use defin...

(QB_NEW_EN)


[grammar] ~256-~256: There might be a mistake here.
Context: ...81e01cff985870340524)) ### 🐛 Bug Fixes - Clean up code formatting and ensure newl...

(QB_NEW_EN)


[grammar] ~265-~265: There might be a mistake here.
Context: ...61d2bda8ddcaa0b)) ### 🔄 Code Refactors - standardize naming from moduleName to pa...

(QB_NEW_EN)


[grammar] ~270-~270: There might be a mistake here.
Context: ...87ef7880767216f2)) ### 📚 Documentation - add Semantic Release mention to README a...

(QB_NEW_EN)


[grammar] ~274-~274: There might be a mistake here.
Context: ...7e51efabb8be986)) ### 🛠️ Other changes - add Act configuration and update GitHub ...

(QB_NEW_EN)


[grammar] ~322-~322: There might be a mistake here.
Context: ...6ebef9d07997480fc486)) ### 🐛 Bug Fixes - correct syntax in package generation key...

(QB_NEW_EN)


[grammar] ~330-~330: There might be a mistake here.
Context: ...0-next.4) (2025-06-01) ### 🐛 Bug Fixes - workflow ([d35a0b6](https://github.com/p...

(QB_NEW_EN)


[grammar] ~334-~334: There might be a mistake here.
Context: ...61d2bda8ddcaa0b)) ### 🛠️ Other changes - enhance GitHub workflow for code generat...

(QB_NEW_EN)


[grammar] ~341-~341: There might be a mistake here.
Context: ...t.3) (2025-06-01) ### 🛠️ Other changes - update GitHub workflow to support both D...

(QB_NEW_EN)


[grammar] ~348-~348: There might be a mistake here.
Context: ...0-next.2) (2025-05-31) ### 🐛 Bug Fixes - ensure newline at end of package.json fi...

(QB_NEW_EN)


[grammar] ~352-~352: There might be a mistake here.
Context: ...c2e738d14fab589)) ### 🔄 Code Refactors - standardize naming from moduleName to pa...

(QB_NEW_EN)


[grammar] ~357-~357: There might be a mistake here.
Context: ...87ef7880767216f2)) ### 📚 Documentation - add Semantic Release mention to README a...

(QB_NEW_EN)


[grammar] ~361-~361: There might be a mistake here.
Context: ...7e51efabb8be986)) ### 🛠️ Other changes - add Act configuration and update GitHub ...

(QB_NEW_EN)


[grammar] ~396-~396: There might be a mistake here.
Context: ....10) (2025-05-29) ### 🛠️ Other changes - deps: bump commander from 13.1.0 to 14...

(QB_NEW_EN)


[grammar] ~398-~398: There might be a mistake here.
Context: ...fc5a7ffe2123745f91bb690e6ad6d8e5d89b69)) - deps: bump inquirer from 12.6.1 to 12....

(QB_NEW_EN)


[grammar] ~399-~399: There might be a mistake here.
Context: ...35eb696f69d3183d6f8625d8e0fe4776fb5aab)) - deps: bump tsup from 8.4.0 to 8.5.0 ([...

(QB_NEW_EN)


[grammar] ~404-~404: There might be a mistake here.
Context: ...8.9) (2025-05-29) ### 🛠️ Other changes - deps-dev: bump conventional-changelog-...

(QB_NEW_EN)


[grammar] ~410-~410: There might be a mistake here.
Context: ...8.8) (2025-05-25) ### 🛠️ Other changes - deps-dev: bump eslint from 9.26.0 to 9...

(QB_NEW_EN)


[grammar] ~412-~412: There might be a mistake here.
Context: ...49ca45b9539400306968ad6e4b63d69a991604)) - deps-dev: bump semantic-release from 2...

(QB_NEW_EN)


[grammar] ~417-~417: There might be a mistake here.
Context: ...8.7) (2025-05-24) ### 🛠️ Other changes - deps-dev: bump @types/node from 22.15....

(QB_NEW_EN)


[grammar] ~423-~423: There might be a mistake here.
Context: .....v1.8.6) (2025-05-19) ### 🐛 Bug Fixes - release workflow ([2f8ddb8](https://gith...

(QB_NEW_EN)


[grammar] ~425-~425: There might be a mistake here.
Context: ...8ddb83c3b556754d704c24c19e8653303c2c53)) - release workflow ([1d76a6f](https://gith...

(QB_NEW_EN)


[grammar] ~428-~428: There might be a mistake here.
Context: ...fe565941917d826)) ### 🛠️ Other changes - update semantic-release configuration an...

(QB_NEW_EN)

🔇 Additional comments (35)
docs/src/css/custom.css (1)

9-17: LGTM — formatting-only change with no styling impact

No functional differences; variables and values are unchanged.

tsconfig.json (1)

2-13: Formatting-only change; no semantic impact.

Indentation update looks fine; compiler options remain unchanged.

docs/docs/intro.md (1)

43-43: Minor docs formatting tweak is OK.

Trailing newline after the code fence improves consistency.

e2e-tests/view.e2e.yaml (1)

5-5: YAML formatting is acceptable.

Indentation under assertVisible: remains valid for a nested mapping.

docs/docs/usage/_category_.json (1)

2-8: JSON reindent only; semantics unchanged.

Looks good.

assets/template/.watchmanconfig (1)

1-1: EOF newline addition is fine.

No behavioral change.

tsup.config.ts (1)

4-8: Formatting-only change — LGTM

No behavioral impact.

docs/src/pages/index.module.css (1)

7-11: Whitespace/indent updates — LGTM

No CSS semantics changed.

Also applies to: 14-16, 20-23

docs/src/components/HomepageFeatures/styles.module.css (1)

2-6: Re-indentation — LGTM

Pure formatting.

Also applies to: 9-10

docs/tsconfig.json (1)

2-7: Formatting-only change — LGTM

No semantic differences; safe to merge.

CHANGELOG.md (1)

5-6: Bullet style normalization — LGTM

Switching to dashes is consistent and harmless.

assets/template/.github/dependabot.yml (2)

53-56: Nice: added Nitro update group

Keeps nitro-codegen and react-native-nitro-modules aligned in a single PR. Looks good.


31-57: No action needed: root .github/dependabot.yml already defines the “nitro” group with both nitro-codegen and react-native-nitro-modules patterns.

.github/actions/android-gradle-build/action.yml (1)

4-9: Formatting-only change — OK

Re-indentation of inputs preserves semantics. No behavior change.

assets/react-native.config.js (1)

8-17: Formatting-only change — OK

Indentation/whitespace tweaks only. No runtime or CLI behavior change.

eslint.config.js (1)

32-39: Underscore-prefixed unuseds: looks good

This matches the PR goal and uses the canonical @typescript-eslint rule config.

assets/template/.github/workflows/release.yml (1)

52-55: Quoting change is safe

Single quotes around expressions keep GitHub expressions functional and do not alter behavior.

.github/actions/run-codegen-build/action.yml (1)

4-9: Formatting-only change — OK

Inputs block re-indented without semantic impact.

.github/workflows/deploy.yml (2)

55-58: LGTM: environment URL wiring matches Pages deploy pattern.

Referencing steps.deployment.outputs.page_url is the standard pattern for Pages.


25-27: actions/checkout@v5 is published and stable (v5.0.0 on Aug 11, 2025); remove the v4 fallback.

assets/template/release.config.cjs (2)

2-7: Formatting-only change—no functional impact.

Rules/readability improvements look good.


18-59: Semantic-release config reads clearly and remains equivalent.

No behavior change detected; sorting and grouping logic preserved.

.github/dependabot.yml (2)

3-9: LGTM: GitHub Actions ecosystem block.

Daily cadence and label are fine.


10-34: Ignore conversion suggestion; original Dependabot config is valid
Dependabot supports package-ecosystem: bun and the directories key for multiple paths—no need to switch to npm or split into separate entries.

Likely an incorrect or invalid review comment.

docs/sidebars.ts (2)

1-1: LGTM: type-only import formatting.


16-18: LGTM: consistent sidebar config formatting; no behavior change.

.github/workflows/release.yml (1)

41-50: Release env looks sound

GITHUB_TOKEN, NPM_TOKEN, and provenance/id-token are set correctly; author/committer vars are fine. No action needed.

docs/docusaurus.config.ts (1)

35-50: Config changes are formatting-only—LGTM

Contents and types (satisfies Preset.Options/ThemeConfig) remain equivalent. Safe.

lefthook.yml (1)

1-5: Commit-msg hook looks good

commitlint via Bun is straightforward. No changes needed.

docs/src/components/HomepageFeatures/index.tsx (1)

14-42: Formatting-only—LGTM

No semantic changes to FeatureList or rendering. All good.

docs/src/pages/index.tsx (2)

12-30: HomepageHeader reformat—LGTM

Pure formatting. Behavior unchanged.


34-45: Home component reformat—LGTM

No functional changes. Safe to merge.

.github/actions/ios-build-xcode/action.yml (1)

24-30: Verify availability of “iPhone 16” simulator on the runner
Ensure that the macOS GitHub Actions image includes “iPhone 16”; otherwise, xcodebuild will fail. On the runner, run:

xcrun simctl list devices available | grep 'iPhone 16'

and update the -destination flag if the device is missing.

assets/template/nitro.json (1)

3-12: LGTM — formatting only.

Inline arrays are fine and keep schema-compatible. No functional impact.

src/generate-nitro-package.ts (1)

187-205: Nice: pinning nitro-codegen and nitro-modules in the workspace.

Parallel resolution and fallback to template devDependencies is solid.

Comment on lines +119 to +131
- name: Build CLI and Link Locally
run: |
bun run build
${{matrix.pm}} link
- name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }}
if: matrix.pm != 'pnpm'
run: ${{ matrix.pm }} create nitro-module test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}

- name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }} (pnpm)
if: matrix.pm == 'pnpm'
run: create-nitro-module test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

CI is invoking the published generator, not the local PR build.

Using “bun|yarn create nitro-module …” fetches from npm and bypasses your local changes, so the workflow doesn’t validate this PR. Call the built CLI directly.

-            - name: Build CLI and Link Locally
-              run: |
-                  bun run build
-                  ${{matrix.pm}} link
+            - name: Build CLI
+              run: bun run build
@@
-            - name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }}
-              if: matrix.pm != 'pnpm'
-              run: ${{ matrix.pm }} create nitro-module test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}
+            - name: Generate ${{ matrix.package-type }} with local CLI
+              run: node lib/cli/index.js create test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}
@@
-            - name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }} (pnpm)
-              if: matrix.pm == 'pnpm'
-              run: create-nitro-module test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}
+            # (pnpm path no longer needed when invoking CLI directly)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build CLI and Link Locally
run: |
bun run build
${{matrix.pm}} link
- name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }}
if: matrix.pm != 'pnpm'
run: ${{ matrix.pm }} create nitro-module test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}
- name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }} (pnpm)
if: matrix.pm == 'pnpm'
run: create-nitro-module test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}
- name: Build CLI
run: bun run build
- name: Generate ${{ matrix.package-type }} with local CLI
run: node lib/cli/index.js create test-${{ matrix.package-type }} --skip-install --ci --package-type ${{ matrix.package-type }}
# (pnpm path no longer needed when invoking CLI directly)
🤖 Prompt for AI Agents
.github/workflows/ci-packages.yml lines 119-131: the workflow currently uses
package manager "create" commands which fetch the published generator from npm
(bypassing the local build) — replace those run steps so they invoke the locally
built CLI artifact produced by the preceding build step (call the built
binary/executable in the repo output directory for both the pnpm and non-pnpm
branches) instead of "bun|yarn create" or the package manager wrapper, ensuring
the local build is used to generate the test-${{ matrix.package-type }} modules.

Comment on lines +183 to +186
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix runner labels casing: macOS runners are “macos-*”.

“macOS-latest/macOS-15” are invalid and will not match any runner.

-        runs-on: macOS-latest
+        runs-on: macos-latest
@@
-        runs-on: macOS-15
+        runs-on: macos-15

Also applies to: 449-450

🤖 Prompt for AI Agents
.github/workflows/ci-packages.yml around lines 183-186 (and also update lines
449-450): the workflow uses incorrect runner labels with upper-case "macOS-"
(e.g., "macOS-latest" / "macOS-15") which are invalid; change them to the
correct lowercase labels "macos-latest" and "macos-15" (or the appropriate
macos-* label used elsewhere) so the runner names match GitHub Actions' expected
casing, and ensure both occurrences at 183-186 and 449-450 are updated
consistently.

Comment on lines +2 to +46
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.6.3",
"@docusaurus/tsconfig": "3.6.3",
"@docusaurus/types": "3.6.3",
"typescript": "~5.6.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Reformatting — LGTM; ensure Node engine stays consistent repo-wide

If root/package engines differ from ">=18.0", align or document exceptions.

Run to compare all package.json engine fields:


🏁 Script executed:

#!/bin/bash
fd -a package.json | xargs -I {} sh -c 'echo {}; jq -r ".engines.node // empty" "{}"; echo'

Length of output: 227


Align Node engine versions across package.json files
The root package.json specifies "node": ">=22", docs/package.json defines "node": ">=18.0", and assets/template/package.json omits the engines field. Update docs/package.json and assets/template/package.json to match the root engines.node (>=22), or document valid exceptions.

🤖 Prompt for AI Agents
In docs/package.json (lines 2-46) and assets/template/package.json, the Node
engine requirement is inconsistent with the root package.json (which requires
"node": ">=22"); update both files' "engines.node" field to ">=22" to match the
root (or add the same "engines" block if missing in
assets/template/package.json), ensure JSON remains valid, and run a quick
lint/typecheck to confirm no other mismatches.

Comment on lines +109 to +123
private async getLatestVersion(pkg: string): Promise<string | null> {
try {
const { stdout } = await execAsync(`npm view ${pkg} version`)
const v = stdout?.toString().trim()
return v?.length ? v : null
} catch (_) {
try {
const { stdout } = await execAsync(`pnpm view ${pkg} version`)
const v = stdout?.toString().trim()
return v?.length ? v : null
} catch {
return null
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Harden version resolution: add timeouts and pin registry.

External commands can hang or be influenced by custom registries. Add short timeouts and use the npmjs registry explicitly.

-    private async getLatestVersion(pkg: string): Promise<string | null> {
+    private async getLatestVersion(pkg: string): Promise<string | null> {
         try {
-            const { stdout } = await execAsync(`npm view ${pkg} version`)
+            const { stdout } = await execAsync(
+                `npm view ${pkg} version --registry=https://registry.npmjs.org`,
+                { timeout: 15000 }
+            )
             const v = stdout?.toString().trim()
             return v?.length ? v : null
         } catch (_) {
             try {
-                const { stdout } = await execAsync(`pnpm view ${pkg} version`)
+                const { stdout } = await execAsync(
+                    `pnpm view ${pkg} version --registry=https://registry.npmjs.org`,
+                    { timeout: 15000 }
+                )
                 const v = stdout?.toString().trim()
                 return v?.length ? v : null
             } catch {
                 return null
             }
         }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private async getLatestVersion(pkg: string): Promise<string | null> {
try {
const { stdout } = await execAsync(`npm view ${pkg} version`)
const v = stdout?.toString().trim()
return v?.length ? v : null
} catch (_) {
try {
const { stdout } = await execAsync(`pnpm view ${pkg} version`)
const v = stdout?.toString().trim()
return v?.length ? v : null
} catch {
return null
}
}
}
private async getLatestVersion(pkg: string): Promise<string | null> {
try {
const { stdout } = await execAsync(
`npm view ${pkg} version --registry=https://registry.npmjs.org`,
{ timeout: 15000 }
)
const v = stdout?.toString().trim()
return v?.length ? v : null
} catch (_) {
try {
const { stdout } = await execAsync(
`pnpm view ${pkg} version --registry=https://registry.npmjs.org`,
{ timeout: 15000 }
)
const v = stdout?.toString().trim()
return v?.length ? v : null
} catch {
return null
}
}
}
🤖 Prompt for AI Agents
In src/generate-nitro-package.ts around lines 109 to 123, the version lookup
uses external npm/pnpm commands without timeouts or a pinned registry; update
the two execAsync calls to include a short timeout (e.g. 5s) and pass the
registry flag (--registry=https://registry.npmjs.org) to the command strings so
the lookup cannot hang or be redirected by custom registries, and keep the
existing stdout trimming/length checks and catch blocks intact.

Comment on lines 360 to 364
const nitroKey = `react-native-nitro-modules`
exampleAppPackageJson.dependencies = {
...exampleAppPackageJson.dependencies,
[nitroKey]: templatePackageJson.devDependencies[nitroKey] ?? '*',
[nitroKey]: this.nitroModulesVersion ?? '*',
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid '*' fallback in example app; use the workspace-pinned version.

Falling back to '*' breaks determinism if resolution fails. Prefer the version you pinned in the workspace or template.

-        const nitroKey = `react-native-nitro-modules`
+        const nitroKey = `react-native-nitro-modules`
+        // Read the workspace's pinned version as a deterministic fallback
+        const workspacePkg = JSON.parse(
+            await readFile(path.join(this.config.cwd, 'package.json'), { encoding: 'utf8' })
+        )
+        const pinnedNitroFromWorkspace =
+            workspacePkg?.devDependencies?.[nitroKey] ??
+            templatePackageJson.devDependencies[nitroKey]
@@
         exampleAppPackageJson.dependencies = {
             ...exampleAppPackageJson.dependencies,
-            [nitroKey]: this.nitroModulesVersion ?? '*',
+            [nitroKey]: this.nitroModulesVersion ?? pinnedNitroFromWorkspace,
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const nitroKey = `react-native-nitro-modules`
exampleAppPackageJson.dependencies = {
...exampleAppPackageJson.dependencies,
[nitroKey]: templatePackageJson.devDependencies[nitroKey] ?? '*',
[nitroKey]: this.nitroModulesVersion ?? '*',
}
const nitroKey = `react-native-nitro-modules`
// Read the workspace's pinned version as a deterministic fallback
const workspacePkg = JSON.parse(
await readFile(path.join(this.config.cwd, 'package.json'), { encoding: 'utf8' })
)
const pinnedNitroFromWorkspace =
workspacePkg?.devDependencies?.[nitroKey] ??
templatePackageJson.devDependencies[nitroKey]
exampleAppPackageJson.dependencies = {
...exampleAppPackageJson.dependencies,
[nitroKey]: this.nitroModulesVersion ?? pinnedNitroFromWorkspace,
}
🤖 Prompt for AI Agents
In src/generate-nitro-package.ts around lines 360 to 364, the code currently
falls back to '*' for react-native-nitro-modules when this.nitroModulesVersion
is undefined; replace that fallback with the workspace-pinned version from the
workspace/template (e.g., read it from the root/template package.json or the
generator's pinned versions map) so the dependency becomes [nitroKey]:
this.nitroModulesVersion ?? workspacePinnedVersion; if the workspace-pinned
version is also missing, surface an explicit error or fail the build rather than
using '*'.

@patrickkabwe patrickkabwe merged commit 08a05a2 into main Sep 6, 2025
28 checks passed
@patrickkabwe patrickkabwe deleted the feat/pin-nitro-versions-and-eslint-underscore branch September 6, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants