Thank you for your interest in contributing to react-native-lab! This guide provides instructions on how to set up your development environment and use the internal tools to ensure your changes work as expected.
-
Clone the repository:
git clone https://github.com/developer-sumit/react-native-lab.git cd react-native-lab -
Install dependencies:
npm install
-
Build the project:
npm run build
-
Test locally: Link the package globally to test it as a CLI command.
npm link npx react-native-lab
We have created a dedicated Admin CLI to assist with maintenance and testing. This tool is located in scripts/admin.ts.
Ensure that the hardcoded template dependencies (e.g., react-native, nativewind, react-navigation) are up to date with the latest versions on npm.
npx tsx scripts/admin.ts check-updatesOutput:
Checking dependencies...
Package Current Latest Status
================================================================================
react-native 0.76.1 0.77.0 Outdated
nativewind 2.0.11 2.0.11 OK
...
To verify that the CLI generates a working project without manually answering prompts every time, use the test-gen command. This uses a headless configuration to generate a full project.
npx tsx scripts/admin.ts test-gen [ProjectName]Example:
npx tsx scripts/admin.ts test-gen TestAppThis will:
- Clean up any existing folder named
TestApp. - Run the CLI in non-interactive mode using a preset configuration.
- Generate the project in the current directory.
- TypeScript: We use TypeScript for everything. Ensure strict typing where possible.
- Prompts: Use
@clack/promptsfor all user interactions. - Formatting: We use Prettier/ESLint. Run
npm run lintbefore committing.
The project is configured to automatically publish to npm when the version in package.json is bumped and pushed to main.
- Update version in
package.json. - Update
CHANGELOG.md. - Push to
main. - The GitHub Action will handle the rest.