Skip to content

Feat/upgrade nitro#40

Merged
patrickkabwe merged 4 commits intomainfrom
feat/upgrade-nitro
Jun 5, 2025
Merged

Feat/upgrade nitro#40
patrickkabwe merged 4 commits intomainfrom
feat/upgrade-nitro

Conversation

@patrickkabwe
Copy link
Copy Markdown
Owner

@patrickkabwe patrickkabwe commented Jun 5, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Corrected an error message to accurately reflect file read failures.
    • Removed unnecessary console log output during file operations.
  • Chores
    • Updated dependencies to newer versions for improved compatibility.
    • Added a new script for running pod commands in the example project.
    • Minor formatting adjustments in script definitions.

- Bump versions of nitro-codegen and react-native-nitro-modules to 0.26.1
- Update Podfile.lock to reflect NitroFS and NitroModules version changes
- Refactor code generation command in package.json to include a new 'postcodegen' script
- Adjust file copy logic in App.tsx for better clarity and functionality
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2025

Walkthrough

The updates include dependency version bumps for "react-native-nitro-modules" and "nitro-codegen" in both the main and example package files, a new npm script addition, a correction to an error message in Swift code, and a change in file path handling and logging within an example TypeScript file.

Changes

File(s) Summary of Changes
example/App.tsx Changed destination path logic for file copy; removed a console log statement.
example/package.json,
package.json
Updated "react-native-nitro-modules" dependency from 0.25.2 to 0.26.1.
package.json Added "postcodegen" script; updated "nitro-codegen" version; minor formatting in "codegen" script.
ios/HybridNitroFs.swift Corrected error message in readFile catch block to accurately reflect read operation.

Possibly related PRs

  • Feat/download file #30: Adds full download file support including new downloadFile methods and platform implementations; related by feature area and example/App.tsx usage but no direct code overlap.

Poem

A hop and a skip, the versions ascend,
Error messages now honestly send.
File paths are tidier, logs trimmed with care,
New scripts for the bunny devs everywhere!
With every commit, the garden grows bright—
CodeRabbit’s changes, a coder’s delight!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba80df6 and cf74404.

📒 Files selected for processing (1)
  • package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Android Example App (old architecture)
  • GitHub Check: Build Android Example App (new architecture)

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e56d5a4 and ba80df6.

⛔ Files ignored due to path filters (3)
  • bun.lock is excluded by !**/*.lock
  • example/ios/Podfile.lock is excluded by !**/*.lock
  • nitrogen/generated/ios/NitroFS-Swift-Cxx-Umbrella.hpp is excluded by !**/generated/**
📒 Files selected for processing (4)
  • example/App.tsx (1 hunks)
  • example/package.json (1 hunks)
  • ios/HybridNitroFs.swift (1 hunks)
  • package.json (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
example/App.tsx (1)
src/specs/nitro-fs.nitro.ts (1)
  • NitroFS (5-125)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Android Example App (new architecture)
  • GitHub Check: Build Android Example App (old architecture)
🔇 Additional comments (4)
package.json (2)

16-17: LGTM: Script improvements enhance the build process.

The addition of the trailing comma in the codegen script follows JSON formatting conventions, and the new postcodegen script automates pod installation in the example directory after code generation, which streamlines the development workflow.


60-60:

Details

❓ Verification inconclusive

Verify dependency versions for security and compatibility.

The upgrades from 0.25.2 to 0.26.1 for both nitro-codegen and react-native-nitro-modules align with the PR objectives. However, please verify these versions are valid and free from security vulnerabilities.

Also applies to: 64-64


🏁 Script executed:

#!/bin/bash
# Description: Verify the dependency versions exist and check for security advisories

echo "Checking nitro-codegen version 0.26.1..."
npm view nitro-codegen@0.26.1 version 2>/dev/null || echo "Version 0.26.1 not found for nitro-codegen"

echo "Checking react-native-nitro-modules version 0.26.1..."
npm view react-native-nitro-modules@0.26.1 version 2>/dev/null || echo "Version 0.26.1 not found for react-native-nitro-modules"

echo "Checking for security advisories..."
npm audit --audit-level=moderate --json | jq '.vulnerabilities | keys[]' 2>/dev/null || echo "No audit data available"

Length of output: 876


Confirm dependency availability and audit vulnerabilities

  • nitro-codegen@0.26.1 and react-native-nitro-modules@0.26.1 are both published on npm and resolve correctly.
  • No security advisories were reported because there is no lockfile in the sandbox. Please generate one and rerun the audit to ensure there are no moderate-or-higher vulnerabilities.

Next steps:

  • At the repo root, run:
    npm install --package-lock-only
    npm audit --audit-level=moderate
  • Address any findings before merging.

Locations to verify:

  • package.json: line 60 ("nitro-codegen": "0.26.1",)
  • package.json: line 64 ("react-native-nitro-modules": "0.26.1",)
example/package.json (1)

16-16: LGTM: Dependency version aligned with root package.

The upgrade of react-native-nitro-modules to 0.26.1 maintains consistency with the root package.json dependency versions.

ios/HybridNitroFs.swift (1)

44-44: LGTM: Error message correction improves debugging accuracy.

The error message now correctly reflects the actual operation (reading vs writing), which will make debugging file operation failures much clearer.

Comment thread example/App.tsx
NitroFS.copy(
fileToUpload,
NitroFS.DOCUMENT_DIR + `/testDir/test${Date.now()}.txt`,
NitroFS.DOCUMENT_DIR + `/testDir/${fileToUpload}`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix destination path construction to avoid nested directories.

Using the full fileToUpload path as the filename will create unintended nested directory structures. For example, if fileToUpload is /documents/largefile.txt, the destination becomes /documents/testDir//documents/largefile.txt.

Extract just the filename from the source path:

-            NitroFS.DOCUMENT_DIR + `/testDir/${fileToUpload}`,
+            NitroFS.DOCUMENT_DIR + `/testDir/${fileToUpload.split('/').pop()}`,

Or alternatively, use a library like path for more robust path handling:

+import { basename } from 'path';

// Then in the copy call:
-            NitroFS.DOCUMENT_DIR + `/testDir/${fileToUpload}`,
+            NitroFS.DOCUMENT_DIR + `/testDir/${basename(fileToUpload)}`,
🤖 Prompt for AI Agents
In example/App.tsx at line 81, the destination path is constructed by
concatenating NitroFS.DOCUMENT_DIR with the full fileToUpload path, causing
unintended nested directories. To fix this, extract only the filename from
fileToUpload before appending it to the destination path, for example by using a
path handling library like 'path' to get the basename. Replace the current
concatenation with one that uses just the filename to avoid creating nested
directory structures.

@patrickkabwe patrickkabwe merged commit 381d9f6 into main Jun 5, 2025
5 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2025

🎉 This PR is included in version 0.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant