Conversation
- Added `@clack/prompts` and `@clack/core` as dependencies in `bun.lock` and `package.json`. - Refactored the module creation logic by moving it to a new `src/cli/create.ts` file, utilizing `@clack/prompts` for user input. - Updated the spinner handling in `generate-nitro-module.ts` for better user feedback. - Removed the old `src/create.ts` file as its functionality has been integrated into the new structure. - Adjusted the code generation functions to include user name in the generated Swift files. This refactor enhances the user experience during module creation and streamlines the codebase.
- Removed unnecessary blank lines in `src/types.ts` and `src/cli/create.ts` for improved readability. - Reformatted function calls in `src/file-generators/ios-file-generator.ts` to enhance code clarity. - Ensured a newline at the end of `src/types.ts` to comply with coding standards.
## [1.8.11-next.1](v1.8.10...v1.8.11-next.1) (2025-05-29) ### 🐛 Bug Fixes * Clean up code formatting and ensure newline at end of file ([1fa81a1](1fa81a1)) ### 🛠️ Other changes * Update dependencies and refactor module creation process ([9b57577](9b57577))
- Bump @babel/runtime to 7.27.3 - Update @changesets packages to latest versions - Upgrade @octokit/auth-token to 6.0.0 - Update @esbuild packages to version 0.25.5 - Bump debug to 4.4.1 - Upgrade fdir to 6.4.5 - Update tinyglobby to 0.2.14 - Bump semantic-release/execa to 9.6.0 This commit includes various dependency updates to improve stability and performance.
## [1.8.11-next.2](v1.8.11-next.1...v1.8.11-next.2) (2025-05-29) ### 🛠️ Other changes * **deps:** update multiple dependencies ([dcb6810](dcb6810))
## [1.8.11-next.3](v1.8.11-next.2...v1.8.11-next.3) (2025-05-29) ### 🛠️ Other changes * **release:** bump version to 2.0.0 ([0b99243](0b99243))
## [2.0.0-next.1](v1.8.11-next.3...v2.0.0-next.1) (2025-05-29) ### ⚠ BREAKING CHANGES * use `@clack/prompts` to handle prompts ### ✨ Features * use `@clack/prompts` to handle prompts ([31d414c](31d414c))
- Bump @clack/prompts to version 0.11.0 - Update CLI entry points to use the new structure in src/cli/index.ts - Remove deprecated dependencies and clean up package.json
…moduleName - Changed references from moduleName to packageName in NitroModuleFactory for consistency. - Updated messages in constants to include packageType in the creation message. - Adjusted finalPackageName generation and related configurations for improved clarity.
- Simplified CLI build step by removing conditional logic for package managers. - Added npm to the matrix strategy for package managers in the workflow.
- Modified the workflow to use 'bun' for creating Nitro modules when npm is the package manager. - Retained existing functionality for other package managers.
…ge manager from the name
…anager from the name
…manager in the name
…s from GitHub Actions
Feat/may be final
## [2.0.0-next.2](v2.0.0-next.1...v2.0.0-next.2) (2025-05-31) ### 🐛 Bug Fixes * ensure newline at end of package.json file ([b5d2d47](b5d2d47)) ### 🔄 Code Refactors * standardize naming from moduleName to packageName across the codebase ([8df59bd](8df59bd)) * update Nitro module creation to use packageName instead of moduleName ([83207f9](83207f9)) ### 📚 Documentation * add Semantic Release mention to README and documentation ([e81ba14](e81ba14)) ### 🛠️ Other changes * add Act configuration and update GitHub workflows ([57ffaff](57ffaff)) * add Act configuration and update GitHub workflows ([9a0dc4f](9a0dc4f)) * add Act configuration and update GitHub workflows ([d1800ce](d1800ce)) * add Act configuration and update GitHub workflows ([9630cb8](9630cb8)) * add Act configuration and update GitHub workflows ([7b901a5](7b901a5)) * migrate from release-it to semantic-release for version management ([947b75a](947b75a)) * refine artifact naming in GitHub workflows for consistency ([0edc112](0edc112)) * remove generate-nitro-module and generate-nitro-views workflows from GitHub Actions ([15f3ad5](15f3ad5)) * remove npm from package manager matrix in GitHub workflows ([a5f2dd4](a5f2dd4)) * rename generate-nitro-module to nitro-package ([7431ece](7431ece)) * simplify artifact naming in GitHub workflows by removing package manager from the name ([1af2d24](1af2d24)) * update artifact naming in GitHub workflows for clarity ([d0222f8](d0222f8)) * update artifact naming in GitHub workflows for clarity ([fa7b444](fa7b444)) * update artifact naming in GitHub workflows to include package manager in the name ([e8a88b5](e8a88b5)) * update artifact naming in GitHub workflows to remove package manager from the name ([4cb84c6](4cb84c6)) * update dependencies and refactor CLI entry points ([9078e13](9078e13)) * update GitHub workflow to support npm alongside bun and yarn ([a702640](a702640)) * update publishConfig in package.json to set access to public ([ea03bb0](ea03bb0)) * update workflow to conditionally use bun for npm package creation ([dbef309](dbef309)) * use capitalize function ([b6e4e3e](b6e4e3e))
chore: update GitHub workflow to support both Debug and Release modes
## [2.0.0-next.3](v2.0.0-next.2...v2.0.0-next.3) (2025-06-01) ### 🛠️ Other changes * update GitHub workflow to support both Debug and Release modes ([a8f808a](a8f808a)) * update release configuration for additional assets ([0f8bc96](0f8bc96))
Chore/add postcodegen
## [2.0.0-next.4](v2.0.0-next.3...v2.0.0-next.4) (2025-06-01) ### 🐛 Bug Fixes * workflow ([d35a0b6](d35a0b6)) ### 🛠️ Other changes * enhance GitHub workflow for code generation and CocoaPods installation ([b8c6916](b8c6916)) * update GitHub workflow and package generation scripts ([683e4f8](683e4f8))
|
Caution Review failedThe pull request is closed. WalkthroughThis update introduces a new test workflow for the Nitro CLI, adds semantic-release configuration and related documentation, and standardizes naming conventions from "module" to "package" across the codebase. It also replaces several GitHub workflows, updates dependencies, and enhances the CLI with new options and improved prompts. Several files are refactored or replaced to align with these changes. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant NitroModuleFactory
participant FileGenerators
User->>CLI: Run "create" command (optionally with --ci)
CLI->>CLI: Validate/create target directory
CLI->>CLI: Detect package manager
CLI->>User: Prompt for package details (name, desc, platforms, type, langs, pm)
CLI->>CLI: Validate user input
CLI->>NitroModuleFactory: Generate module with config
NitroModuleFactory->>FileGenerators: Generate files (Android/iOS/JS/CPP)
NitroModuleFactory-->>CLI: Return success/failure
CLI->>User: Show instructions or error
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/cli/create.tsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js src/generate-nitro-package.tsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js src/constants.tsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (6)
src/cli/create.ts (2)
76-82: Consider adding error handling for directory cleanup.The cleanup logic assumes the directory exists and can be removed. Consider wrapping the
rmSynccall in a try-catch to prevent cleanup failures from masking the original error.- if (packageName) { - const modulePath = path.join( - process.cwd(), - 'react-native-' + packageName.toLowerCase() - ) - rmSync(modulePath, { recursive: true, force: true }) - } + if (packageName) { + const modulePath = path.join( + process.cwd(), + 'react-native-' + packageName.toLowerCase() + ) + try { + rmSync(modulePath, { recursive: true, force: true }) + } catch (cleanupError) { + // Log cleanup error but don't mask the original error + console.warn('Failed to clean up directory:', cleanupError) + } + }
158-160: Consider handling undefined input in validation.The validate function should handle the case where
valuemight be undefined.validate(value) { - const packageName = value?.trim() + const packageName = value?.trim() || '' return validatePackageName(packageName) },.github/workflows/test-nitro-cli.yml (4)
3-7: Review permissions scope for least privilege
The workflow currently requestscontents: write,packages: write, andactions: write. Double-check if write access toactionsis truly needed (most workflows only requirecontents: readfor checkout and write permissions for artifacts or packages).
8-23: Validate trigger paths coverage
You’re gating the workflow to run only whensrc/**, this workflow itself,package.json, orbun.lockchanges. Ensure that other critical configuration files (e.g.,tsconfig.json,.env, or any codegen schemas) that could affect builds are included here if needed.
258-266: Remove deprecated Xcode build flag
The-UseModernBuildSystem=YESoption is no longer necessary—modern build system is default in recent Xcode versions—and may be deprecated in the future. You can safely omit it.Proposed diff:
- -UseModernBuildSystem=YES \
329-333: Ensure Android SDK availability
You configure Java 17 but don’t validate the presence of the Android SDK/tooling (e.g.,ANDROID_SDK_ROOT, platform‐tools). If builds rely on system SDKs, consider adding a step to install or verify those components to prevent downstream failures.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (23)
.actrc(1 hunks).github/workflows/generate-nitro-module.yml(0 hunks).github/workflows/generate-nitro-views.yml(0 hunks).github/workflows/test-nitro-cli.yml(1 hunks)CHANGELOG.md(1 hunks)README.md(1 hunks)assets/template/.github/workflows/release.yml(1 hunks)assets/template/package.json(2 hunks)assets/template/release.config.cjs(1 hunks)docs/docs/intro.md(1 hunks)package.json(3 hunks)src/cli/create.ts(1 hunks)src/cli/index.ts(2 hunks)src/code-snippets/code.ios.ts(2 hunks)src/constants.ts(1 hunks)src/create.ts(0 hunks)src/file-generators/android-file-generator.ts(9 hunks)src/file-generators/cpp-file-generator.ts(2 hunks)src/file-generators/ios-file-generator.ts(4 hunks)src/file-generators/js-file-generator.ts(4 hunks)src/generate-nitro-package.ts(14 hunks)src/types.ts(4 hunks)src/utils.ts(3 hunks)
💤 Files with no reviewable changes (3)
- src/create.ts
- .github/workflows/generate-nitro-module.yml
- .github/workflows/generate-nitro-views.yml
🧰 Additional context used
🧬 Code Graph Analysis (6)
src/file-generators/js-file-generator.ts (2)
src/code-snippets/code.js.ts (4)
nitroViewSpecCode(56-71)nitroViewCode(87-103)nitroModuleSpecCode(44-54)nitroModuleCode(74-84)src/utils.ts (1)
createModuleFile(159-166)
src/file-generators/cpp-file-generator.ts (2)
src/utils.ts (2)
toPascalCase(59-64)createModuleFile(159-166)src/code-snippets/code.cpp.ts (2)
cppCode(1-13)hppCode(15-27)
src/code-snippets/code.ios.ts (1)
src/utils.ts (1)
toPascalCase(59-64)
src/cli/create.ts (5)
src/types.ts (4)
CreateModuleOptions(29-34)PLATFORM_LANGUAGE_MAP(66-69)PackageManager(36-36)UserAnswers(3-10)src/utils.ts (4)
dirExist(146-153)detectPackageManager(206-213)capitalize(215-217)validatePackageName(13-38)src/generate-nitro-package.ts (1)
NitroModuleFactory(50-442)src/constants.ts (2)
messages(12-18)generateInstructions(46-94)assets/react-native.config.js (1)
path(1-1)
src/generate-nitro-package.ts (4)
src/constants.ts (6)
messages(12-18)ANDROID_NAME_SPACE_TAG(6-6)CXX_NAME_SPACE_TAG(8-8)IOS_MODULE_NAME_TAG(9-9)ANDROID_CXX_LIB_NAME_TAG(7-7)JS_PACKAGE_NAME_TAG(10-10)src/utils.ts (3)
replaceHyphen(44-46)toPascalCase(59-64)generateAutolinking(84-113)src/code-snippets/code.js.ts (1)
exampleTsConfig(142-151)src/code-snippets/code.android.ts (1)
androidSettingsGradleCode(24-32)
src/file-generators/ios-file-generator.ts (3)
src/utils.ts (2)
toPascalCase(59-64)createModuleFile(159-166)src/constants.ts (1)
IOS_MODULE_NAME_TAG(9-9)src/code-snippets/code.ios.ts (2)
getSwiftViewCode(23-44)getSwiftCode(3-21)
🔇 Additional comments (41)
.actrc (1)
1-21: LGTM! Well-configured act setup.The configuration follows best practices for local GitHub Actions testing:
- Appropriate container image selection for cross-platform compatibility
- M1 Mac architecture specification for compatibility
- Gitignore integration and verbose output for better debugging
docs/docs/intro.md (1)
22-22: Documentation update looks good.The addition of "Semantic Release" to the features list is consistent with the project's migration from release-it to semantic-release and matches the formatting of other feature list items.
README.md (1)
19-19: Consistent documentation update.The addition of "Semantic Release" feature is consistent with the corresponding change in
docs/docs/intro.mdand accurately reflects the project's new release management approach.src/cli/index.ts (2)
19-19: Good addition of CI mode option.The new
--cioption is a valuable addition that will support automated workflows and CI environments. This aligns well with the new GitHub Actions workflows mentioned in the PR.
4-4:Details
✅ Verification successful
Verify the updated import path.
The import path changed from
../package.jsonto../../package.json. Please ensure that the package.json file is actually located at this new path relative to the current file to avoid runtime import errors.
🏁 Script executed:
#!/bin/bash # Description: Verify that package.json exists at the expected location relative to src/cli/index.ts # Expected: package.json should exist at the repository root (two levels up from src/cli/) # Check if package.json exists at the root (relative to src/cli/index.ts) if [ -f "package.json" ]; then echo "✓ package.json found at repository root" echo "File path verification successful" else echo "✗ package.json not found at repository root" echo "The import path '../../package.json' from src/cli/index.ts may be incorrect" fi # Also check if there's a package.json one level up (the old path) if [ -f "src/package.json" ]; then echo "⚠ Found package.json at src/ - this might be the old location" fiLength of output: 221
Import path change verified
Thepackage.jsonfile is present at the repository root, so the importimport packageJson from '../../package.json'in
src/cli/index.tsis correct. The newly added--cioption is implemented appropriately increateModule. No further changes required.src/constants.ts (1)
13-13: LGTM! Template string supports dynamic package types.The change from a hardcoded "Module" to a dynamic
{packageType}placeholder improves flexibility and aligns with the broader renaming from "module" to "package" terminology throughout the codebase.src/file-generators/cpp-file-generator.ts (3)
43-43: LGTM! Consistent renaming from moduleName to packageName.The systematic replacement of
config.moduleNamewithconfig.packageNamealigns with the broader naming convention updates across the codebase.
65-65: LGTM! File naming updated consistently.The C++ file paths correctly use the new
packageNameproperty with proper PascalCase conversion.Also applies to: 69-69
74-74: LGTM! Code generation updated consistently.The generated C++ code and header files correctly use the new
packageNameproperty while maintaining the same functionality.Also applies to: 80-80
package.json (4)
3-3: LGTM! Major version bump reflects breaking changes.The version bump to 2.0.0-next.4 appropriately indicates breaking changes, which aligns with the systematic renaming from "module" to "package" terminology throughout the codebase.
8-8: LGTM! Migration to Bun runtime.The dev script update from
tsxtobunreflects the migration to Bun as the primary runtime and build tool, which is consistent with the removal oftsxfrom devDependencies.
40-42: LGTM! Binary paths updated for new CLI structure.The binary entry points correctly point to the new CLI structure at
./lib/cli/index.js, aligning with the source restructuring mentioned in the AI summary.
57-57: LGTM! Dependency update for improved prompts.The addition of
@clack/promptsand removal ofinquirerandorarepresents a migration to a more modern prompt handling library, which should improve the CLI user experience.src/code-snippets/code.ios.ts (2)
3-6: LGTM! Added user attribution parameter.The addition of the
userNameparameter allows proper attribution in generated Swift files, improving code traceability.
7-14: LGTM! Proper header comments added to generated Swift files.The header comments provide useful metadata including filename, project, and attribution. The use of
new Date().toLocaleDateString()will format dates according to the system locale, which is appropriate for generated code comments.Also applies to: 23-30
src/file-generators/js-file-generator.ts (1)
44-45: LGTM: Package name references updated consistently.All function calls correctly use
config.packageNameinstead of the previousconfig.moduleName. The changes maintain the same functionality while following the new naming convention.Also applies to: 50-50, 60-62, 70-70
assets/template/.github/workflows/release.yml (1)
1-52: LGTM: Well-structured release workflow with good security practices.The workflow follows GitHub Actions best practices:
- Minimal default permissions with specific job-level permissions
- Proper concurrency control to prevent overlapping releases
- Dependency caching for performance
- Secure use of secrets for authentication
The workflow aligns with the migration to semantic-release documented in the changelog.
src/file-generators/android-file-generator.ts (3)
32-32: LGTM: Android package name generation updated correctly.The changes to use
config.packageNameinstead ofconfig.moduleNameare consistent with the naming convention refactor. The logic for generating Android package names remains correct.Also applies to: 56-56
76-76: LGTM: Package type references updated consistently.All conditional logic that checks for
config.packageType === Nitro.Viewhas been updated correctly from the previousmoduleTypeproperty. This maintains the same functionality for distinguishing between module and view generation.Also applies to: 183-183, 221-221
81-91: LGTM: Template variable replacements updated consistently.All template placeholders and file generation logic correctly use
config.packageNamefor:
- Kotlin file generation
- Gradle configuration
- CMake configuration
- C++ adapter files
- Java package files
- Post-script generation
The PascalCase and hyphen replacement logic is preserved correctly.
Also applies to: 114-114, 144-144, 166-167, 181-181, 193-196, 220-220
CHANGELOG.md (1)
1-66: LGTM: Comprehensive changelog documentation.The changelog entries properly document:
- Breaking changes: Clearly marked with
⚠️ BREAKING CHANGES section for the @clack/prompts migration- Refactoring: Documents the naming standardization from moduleName to packageName
- Infrastructure: Documents the migration from release-it to semantic-release
- Workflows: Documents the GitHub Actions workflow improvements
The semantic versioning and conventional commit formatting are consistent and follow best practices.
src/file-generators/ios-file-generator.ts (3)
45-46: LGTM! Naming convention update is consistent.The change from
config.moduleNametoconfig.packageNamealigns with the broader codebase standardization effort.
55-58: Consistent property usage for podspec replacements.The replacement logic correctly uses the new naming convention with
config.packageNameandconfig.finalPackageName.
86-98: Swift file generation properly updated with new naming and parameters.The changes correctly:
- Use
config.packageTypeinstead ofconfig.moduleTypefor hybrid view detection- Use
config.packageNamefor file naming and Swift code generation- Include the
nameparameter in Swift code generation functions as expected by the function signaturessrc/types.ts (4)
1-1: Migration from ora to @clack/prompts is well-implemented.The import change supports the broader migration to @clack/prompts for improved CLI UX.
3-10: Well-structured UserAnswers interface enhances type safety.The new interface provides clear typing for user input collection, which improves code maintainability and reduces runtime errors.
30-30: CI mode support added appropriately.The optional
ciproperty enables non-interactive mode for continuous integration environments.
48-55: Naming convention standardization is consistent.The changes from
moduleName/moduleType/finalModuleNametopackageName/packageType/finalPackageNamealign with the broader codebase updates. The spinner type change to use@clack/promptsis also correct.assets/template/package.json (3)
13-13: Release script updated for semantic-release migration.The change from
release-ittosemantic-releasealigns with the new automated release workflow.
46-48: PublishConfig properly configured for public packages.The removal of
provenance: trueand addition ofaccess: "public"is appropriate for public npm packages using semantic-release.
51-62: Semantic-release dependencies properly configured.The migration includes all necessary semantic-release packages:
@semantic-release/changelogfor CHANGELOG.md generation@semantic-release/gitfor git commits during releaseconventional-changelog-conventionalcommitsfor conventional commit parsingsemantic-releasecore packageThe version ranges look appropriate and the dependency removal of release-it packages is complete.
assets/template/release.config.cjs (4)
1-8: Well-defined release rules with clear mapping.The rules array provides a clear mapping between commit types and release levels with descriptive titles for changelog sections. The emoji usage enhances readability.
10-12: Clever sorting mechanism for changelog sections.The sortMap creation ensures consistent ordering of changelog sections based on the rules array order.
18-28: Comprehensive branch and commit analysis configuration.The configuration properly:
- Supports both stable (
main) and prerelease (next) branches- Handles breaking changes and reverts appropriately
- Uses conventional commits preset for consistency
52-60: Complete plugin configuration for automated releases.The plugin chain covers all necessary aspects:
@semantic-release/npmfor package publishing@semantic-release/githubfor GitHub releases@semantic-release/gitwith proper assets for version commitsThe asset list includes all relevant files that should be committed during release.
src/utils.ts (2)
13-38: LGTM! Improved validation function with better error messages.The rename from
validateModuleNametovalidatePackageNamealigns with the overall naming convention changes. The use ofkleurfor colored error messages enhances user experience.
215-217: LGTM! Simple and effective utility function.The
capitalizefunction correctly handles string capitalization.src/cli/create.ts (1)
92-132: LGTM! Well-structured language selection logic.The function correctly handles platform-specific language options and appropriately excludes C++ for Nitro Views.
src/generate-nitro-package.ts (2)
158-158: LGTM! Correct package manager-specific syntax.The
postcodegenscript correctly handles the different command-line options for npm vs yarn/bun.
67-71: LGTM! Consistent naming convention updates.All occurrences of
moduleName/finalModuleNamehave been correctly updated topackageName/finalPackageName, maintaining consistency with the broader refactoring effort.Also applies to: 116-123, 149-152, 186-187, 234-249, 265-265, 304-304, 347-347, 360-360, 430-430
.github/workflows/test-nitro-cli.yml (1)
1-345: General approval
The consolidated workflow effectively streamlines linting, building, package generation, and multi-platform testing. The concurrency controls, matrix strategies, and artifact handling are well structured.
| async generate(config: GenerateModuleConfig): Promise<void> { | ||
| const nitroSpecFolder = | ||
| config.moduleType === Nitro.View ? '/src/views' : '/src/specs' | ||
| config.packageType === Nitro.View ? '/src/views' : '/src/specs' |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
LGTM: Naming convention update applied correctly.
The changes from moduleType to packageType are consistent with the broader codebase refactoring to standardize terminology.
Let me verify that the type definitions have been updated consistently across the codebase:
Also applies to: 26-26
🏁 Script executed:
#!/bin/bash
# Description: Verify that GenerateModuleConfig type has been updated to use packageType and packageName
# Check if the type definition uses the new property names
ast-grep --pattern 'interface GenerateModuleConfig {
$$$
packageName: $_
$$$
packageType: $_
$$$
}'
# Also check for any remaining references to the old property names
rg -n "moduleType|moduleName" --type tsLength of output: 5845
Incomplete Rename: Update Type Definitions and References from module* to package*
Our grep uncovered many remaining uses of moduleName (and related) throughout the codebase, indicating the rename isn’t complete. Please update the following:
• src/types.ts
– interface GenerateModuleConfig still uses moduleName: string (and likely moduleType)
Suggested diff:
-interface GenerateModuleConfig {
- moduleName: string;
- moduleType: Nitro.View | Nitro.Spec;
- …
-}
+interface GenerateModuleConfig {
+ packageName: string;
+ packageType: Nitro.View | Nitro.Spec;
+ …
+}• src/utils.ts (lines 85, 94–103, 111)
– References to moduleName in config mapping, code-generation helpers
• src/constants.ts (lines 47, 56)
– Commands and template literals still refer to moduleName
• src/cli/create.ts (line 63)
– moduleName: \react-native-${packageName.toLowerCase()}`` should be standardized
• All code-snippet templates under src/code-snippets/
– Function signatures and template placeholders still use moduleName
Make sure:
GenerateModuleConfig(and any related interfaces/types) usepackageNameandpackageType.- All utility functions, constants and snippet generators referring to the old properties are updated accordingly.
- Imports/exports in
js-file-generator.tsalign with the renamed types.
🤖 Prompt for AI Agents
In src/file-generators/js-file-generator.ts at line 14 and also in related files
including src/types.ts, src/utils.ts (lines 85, 94-103, 111), src/constants.ts
(lines 47, 56), src/cli/create.ts (line 63), and all code-snippet templates
under src/code-snippets/, the rename from moduleName/moduleType to
packageName/packageType is incomplete. To fix this, update the
GenerateModuleConfig interface and all references in these files to consistently
use packageName and packageType instead of the old moduleName and moduleType.
Also ensure imports and exports in js-file-generator.ts reflect these changes to
maintain consistency across the codebase.
| - name: Generate ${{ matrix.package-type }} with ${{ matrix.pm }} | ||
| continue-on-error: false | ||
| run: ${{ matrix.pm }} create nitro-module test-${{ matrix.package-type }} --skip-install --ci | ||
|
|
There was a problem hiding this comment.
Inconsistent CLI command after rename
The command still uses create nitro-module, but the codebase now standardizes on “package” instead of “module” (PR objectives). Update this to create nitro-package (or the appropriate new CLI command) to reflect the new naming convention.
🤖 Prompt for AI Agents
In .github/workflows/test-nitro-cli.yml around lines 114 to 117, the CLI command
uses `create nitro-module` which is inconsistent with the updated naming
convention that uses `package` instead of `module`. Update the command to
`create nitro-package` to align with the new standardized CLI command naming.
…package generation
…pdate spinner messages
…nner message formatting
…ption Feat/support package description
## [2.0.0-next.5](v2.0.0-next.4...v2.0.0-next.5) (2025-06-01) ### ✨ Features * add author and description placeholders to template files and update spinner messages ([1eba141](1eba141)) * add badges for version, downloads, and license to README ([ecdba90](ecdba90)) * add description and keywords to package generation ([5b9aded](5b9aded)) * add MIT License file to the project ([235ac28](235ac28)) * add ncli.tape for automated CLI module creation and improve spinner message formatting ([0dd62c4](0dd62c4)) ### 🐛 Bug Fixes * correct syntax in package generation keywords array ([2d835a1](2d835a1)) * update cache key in GitHub workflows and correct import path in package generation ([07acfc3](07acfc3)) * update nitro-module-cli.gif to improve visual representation ([79ba089](79ba089))
|
🎉 This PR is included in version 2.0.0-next.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary by CodeRabbit
New Features
.actrcfile to improve local GitHub Actions testing compatibility on M1 Macs.Bug Fixes
Documentation
Refactor
Chores