Skip to content

Next#211

Merged
patrickkabwe merged 56 commits intomainfrom
next
Jun 1, 2025
Merged

Next#211
patrickkabwe merged 56 commits intomainfrom
next

Conversation

@patrickkabwe
Copy link
Owner

@patrickkabwe patrickkabwe commented Jun 1, 2025

Summary by CodeRabbit

  • New Features

    • Added support for semantic release with new configuration and release workflow.
    • Introduced a CI mode option and enhanced interactive Nitro package creation with improved prompts and validation.
    • Added a comprehensive GitHub Actions workflow for linting, building, package generation, and iOS/Android build testing.
    • Added a new .actrc file to improve local GitHub Actions testing compatibility on M1 Macs.
  • Bug Fixes

    • Improved local GitHub Actions container configuration for macOS simulation on M1 Macs.
  • Documentation

    • Updated README and docs to include semantic release feature.
    • Extended changelog with detailed release notes and workflow enhancements.
  • Refactor

    • Renamed all "module" references to "package" across codebase and templates.
    • Updated package name validation and user messaging.
    • Refined CLI entry points and switched dependencies to Bun.
  • Chores

    • Migrated release process from release-it to semantic-release.
    • Added MIT License template and updated package metadata with author and description placeholders.
    • Removed deprecated GitHub workflows for module and view generation.
    • Improved caching and environment setup in workflows.

patrickkabwe and others added 30 commits May 10, 2025 06:05
- 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.
patrickkabwe and others added 11 commits June 1, 2025 00:07
## [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))
## [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))
@coderabbitai
Copy link

coderabbitai bot commented Jun 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This 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

File(s) Change Summary
.github/workflows/test-nitro-cli.yml
.github/workflows/release.yml
assets/template/.github/workflows/release.yml
Added new GitHub Actions workflows for testing the Nitro CLI and for semantic-release-based publishing; updated release workflow cache key to include both bun.lock and bun.lockb.
.github/workflows/generate-nitro-module.yml
.github/workflows/generate-nitro-views.yml
Deleted old GitHub Actions workflows for module and view generation/build/test.
.actrc Added Act configuration file for local GitHub Actions testing.
CHANGELOG.md Added release notes for version 2.0.0-next.5 documenting new features, bug fixes, and workflow improvements including semantic-release migration and automated CLI module creation.
README.md
docs/docs/intro.md
Updated feature list to mention semantic-release support.
assets/template/package.json
assets/template/release.config.cjs
Switched release management from release-it to semantic-release, updated scripts, dependencies, and added semantic-release configuration.
assets/template/LICENSE
assets/template/README.md
ncli.tape
Added MIT License template file, enhanced README template with description placeholder and npm badges, and introduced an automated CLI creation terminal script.
package.json Bumped version to 2.0.0-next.5, changed dev script to use Bun, updated CLI entry points, replaced dependencies (@clack/prompts for inquirer/ora), and removed tsx.
src/cli/create.ts Added new CLI module creation logic with improved prompts, validation, CI mode, and error handling.
src/cli/index.ts Changed package.json import path, added --ci CLI option.
src/code-snippets/code.ios.ts Updated Swift code generation to include user name and date in file headers; changed function signatures accordingly.
src/constants.ts Added new template tags for author and description; changed creation message to use a {packageType} template string; removed emoji prefixes from some messages.
src/create.ts Deleted old module creation script.
src/file-generators/android-file-generator.ts
src/file-generators/cpp-file-generator.ts
src/file-generators/ios-file-generator.ts
src/file-generators/js-file-generator.ts
Standardized naming: replaced all moduleName/moduleType with packageName/packageType in file generation logic. Updated template replacements and internal logic accordingly, including passing user name to iOS Swift code generation.
src/generate-nitro-package.ts Unified naming to packageName/packageType, updated spinner usage, added new template files including LICENSE and release config, improved example app generation and template file updates.
src/types.ts Refactored types: renamed fields from moduleName/moduleType to packageName/packageType, changed spinner type, added UserAnswers interface and ci option, added required description field.
src/utils.ts Renamed and improved validation function for package names with enhanced error messages using colors; added a capitalize utility function.

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
Loading

Possibly related PRs

  • Next #211: Introduces the same .actrc configuration file for local GitHub Actions testing, aligning container images, architecture, and verbosity settings for Nitro CLI.

Poem

In the burrow, code hops anew,
With packages named fresh and true.
Workflows pruned, releases semantic,
Prompts now sparkle—less frantic!
Bun and clack, the tools we choose,
Rabbits rejoice—no time to snooze!
Next release? We’re ready—let’s cruise! 🐇✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/cli/create.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

src/generate-nitro-package.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

src/constants.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

  • 1 others

📜 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 116db9b and c430744.

⛔ Files ignored due to path filters (1)
  • assets/nitro-module-cli.gif is excluded by !**/*.gif
📒 Files selected for processing (11)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/test-nitro-cli.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • assets/template/LICENSE (1 hunks)
  • assets/template/README.md (1 hunks)
  • ncli.tape (1 hunks)
  • package.json (3 hunks)
  • src/cli/create.ts (1 hunks)
  • src/constants.ts (1 hunks)
  • src/generate-nitro-package.ts (15 hunks)
  • src/types.ts (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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

@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 (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 rmSync call 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 value might 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 requests contents: write, packages: write, and actions: write. Double-check if write access to actions is truly needed (most workflows only require contents: read for checkout and write permissions for artifacts or packages).


8-23: Validate trigger paths coverage
You’re gating the workflow to run only when src/**, this workflow itself, package.json, or bun.lock changes. 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=YES option 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d62ea5 and 116db9b.

⛔ Files ignored due to path filters (1)
  • bun.lock is 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.md and accurately reflects the project's new release management approach.

src/cli/index.ts (2)

19-19: Good addition of CI mode option.

The new --ci option 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.json to ../../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"
fi

Length of output: 221


Import path change verified
The package.json file is present at the repository root, so the import

import packageJson from '../../package.json'

in src/cli/index.ts is correct. The newly added --ci option is implemented appropriately in createModule. 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.moduleName with config.packageName aligns with the broader naming convention updates across the codebase.


65-65: LGTM! File naming updated consistently.

The C++ file paths correctly use the new packageName property 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 packageName property 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 tsx to bun reflects the migration to Bun as the primary runtime and build tool, which is consistent with the removal of tsx from 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/prompts and removal of inquirer and ora represents 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 userName parameter 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.packageName instead of the previous config.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.packageName instead of config.moduleName are 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.View has been updated correctly from the previous moduleType property. 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.packageName for:

  • 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.moduleName to config.packageName aligns 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.packageName and config.finalPackageName.


86-98: Swift file generation properly updated with new naming and parameters.

The changes correctly:

  • Use config.packageType instead of config.moduleType for hybrid view detection
  • Use config.packageName for file naming and Swift code generation
  • Include the name parameter in Swift code generation functions as expected by the function signatures
src/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 ci property enables non-interactive mode for continuous integration environments.


48-55: Naming convention standardization is consistent.

The changes from moduleName/moduleType/finalModuleName to packageName/packageType/finalPackageName align with the broader codebase updates. The spinner type change to use @clack/prompts is also correct.

assets/template/package.json (3)

13-13: Release script updated for semantic-release migration.

The change from release-it to semantic-release aligns with the new automated release workflow.


46-48: PublishConfig properly configured for public packages.

The removal of provenance: true and addition of access: "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/changelog for CHANGELOG.md generation
  • @semantic-release/git for git commits during release
  • conventional-changelog-conventionalcommits for conventional commit parsing
  • semantic-release core package

The 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/npm for package publishing
  • @semantic-release/github for GitHub releases
  • @semantic-release/git with proper assets for version commits

The 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 validateModuleName to validatePackageName aligns with the overall naming convention changes. The use of kleur for colored error messages enhances user experience.


215-217: LGTM! Simple and effective utility function.

The capitalize function 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 postcodegen script correctly handles the different command-line options for npm vs yarn/bun.


67-71: LGTM! Consistent naming convention updates.

All occurrences of moduleName/finalModuleName have been correctly updated to packageName/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'
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

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 ts

Length 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) use packageName and packageType.
  • All utility functions, constants and snippet generators referring to the old properties are updated accordingly.
  • Imports/exports in js-file-generator.ts align 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.

Comment on lines +114 to +117
- 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

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

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.

patrickkabwe and others added 10 commits June 1, 2025 11:05
## [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))
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2025

🎉 This PR is included in version 2.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@patrickkabwe patrickkabwe merged commit 287d36b into main Jun 1, 2025
1 check was pending
@patrickkabwe patrickkabwe deleted the next branch June 1, 2025 11:20
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2025

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@patrickkabwe patrickkabwe restored the next branch June 1, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants