-
Notifications
You must be signed in to change notification settings - Fork 5
feat: enable per-platform language selection and match with new nitro version #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
patrickkabwe
merged 8 commits into
patrickkabwe:main
from
DaveyEke:feat/per-platform-language-selection
Mar 16, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b91c42b
feat: enable per-platform language selection and match with new nitro…
DaveyEke 0d1b3f0
chore: bump up nitrogen and react-native-nitro-modules to version 0.35.2
patrickkabwe 93c60a3
fix: correct C++ language reference
patrickkabwe 0b65245
chore: format code
patrickkabwe 9882216
Merge branch 'main' into pr/470
patrickkabwe 001f36c
fix: c++ with swift or kotlin modules creation
patrickkabwe d73e2ef
fix: include cpp header files to `CMakeLists.txt` when building on an…
patrickkabwe ca6ffce
fix: include cpp header files to `CMakeLists.txt` when building on an…
patrickkabwe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the configured output directory for existence checks and cleanup.
Line 220 and Line 273 hardcode
process.cwd(). With--module-dir, this can check/delete the wrong folder (including unrelated directories) while generation runs elsewhere.Proposed fix
export const createModule = async ( packageName: string, options: CreateModuleOptions ) => { let packageType = Nitro.Module let moduleFactory: NitroModuleFactory | null = null let spinnerStarted = false + let shouldCleanup = false const spinner = p.spinner() + const outputRoot = options.moduleDir || process.cwd() try { @@ moduleFactory = new NitroModuleFactory({ @@ - cwd: options.moduleDir || process.cwd(), + cwd: outputRoot, @@ const modulePath = path.join( - process.cwd(), + outputRoot, `react-native-${packageName.toLowerCase()}` ) @@ spinner.start( messages.creating.replace('{packageType}', capitalize(packageType)) ) spinnerStarted = true + shouldCleanup = true await moduleFactory.createNitroModule() @@ } catch (error) { - if (packageName) { + if (shouldCleanup && packageName) { const modulePath = path.join( - process.cwd(), + outputRoot, `react-native-${packageName.toLowerCase()}` ) rmSync(modulePath, { recursive: true, force: true }) }Also applies to: 273-274
🤖 Prompt for AI Agents