Skip to content

Commit d88fa82

Browse files
Merge branch 'refs/heads/v1.3.0'
2 parents 1294c4f + eb449c9 commit d88fa82

25 files changed

+1636
-1354
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
name: NPM Package
1+
name: Publish to NPM
22

33
on:
44
push:
5-
branches:
6-
- main
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
78

89
jobs:
910
publish:
1011
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
1115

1216
steps:
1317
- name: Checkout code
@@ -16,16 +20,37 @@ jobs:
1620
- name: Set up Node.js
1721
uses: actions/setup-node@v4
1822
with:
19-
node-version: '20.x'
23+
node-version: "24.x"
2024
registry-url: "https://registry.npmjs.org"
2125

26+
- name: Ensure npm supports trusted publishing
27+
run: npm i -g npm@11.5.1
28+
2229
- name: Install dependencies
2330
run: npm ci
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_READ_TOKEN }}
2433

2534
- name: Build
2635
run: npm run build
2736

28-
- name: Publish to NPM
29-
run: npm publish
30-
env:
31-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
- name: Check Version
38+
id: check-version
39+
run: |
40+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
41+
NPM_VERSION=$(npm view react-native-lab version 2>/dev/null || echo "0.0.0")
42+
43+
echo "Package Version: $PACKAGE_VERSION"
44+
echo "NPM Version: $NPM_VERSION"
45+
46+
if [ "$PACKAGE_VERSION" != "$NPM_VERSION" ]; then
47+
echo "New version detected. Proceeding with publish."
48+
echo "IS_NEW_VERSION=true" >> $GITHUB_ENV
49+
else
50+
echo "Version $PACKAGE_VERSION already exists on NPM. Skipping publish."
51+
echo "IS_NEW_VERSION=false" >> $GITHUB_ENV
52+
fi
53+
54+
- name: Publish to NPM (OIDC)
55+
if: env.IS_NEW_VERSION == 'true'
56+
run: npm publish --access public

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.3.0] - 2026-01-16
6+
7+
### 🚀 New Features
8+
9+
- **Revamped CLI Design**: A completely new, modern, and interactive CLI experience using `@clack/prompts`.
10+
- **CI/CD Integration**: Automatically generate GitHub Actions workflows for Linting and Testing.
11+
- **Git Initialization**: Explicit option to initialize a Git repository.
12+
- **Console Log Removal**: Added option to strip console logs in production builds.
13+
14+
### ✨ Improvements
15+
16+
- **Interactive Prompts**: Smoother and more visual prompts with better error handling and cancellation support.
17+
- **Project Setup**: clearer steps and spinners for long-running tasks.
18+
- **Validation**: Improved validation for package names and versions.
19+
520
## [1.1.0] - 2024-12-15
621

722
### New Features

README.md

Lines changed: 119 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,123 @@
1-
<h1 style="text-align: center;">React Native Lab</h1>
2-
3-
![Github License](./images/banner.jpg)
4-
5-
![Github License](https://img.shields.io/github/license/developer-sumit/react-native-lab)
6-
7-
**GITHUB** \
8-
![Github Version](https://img.shields.io/github/package-json/v/developer-sumit/react-native-lab)
9-
![Github Repo Created At](https://img.shields.io/github/created-at/developer-sumit/react-native-lab)
10-
![Github Repo Contributors](https://img.shields.io/github/contributors/developer-sumit/react-native-lab)
11-
![Github Repo Fork](https://img.shields.io/github/forks/developer-sumit/react-native-lab)
12-
[![NPM Package](https://github.com/developer-sumit/react-native-lab/actions/workflows/publish.yml/badge.svg)](https://github.com/developer-sumit/react-native-lab/actions/workflows/publish.yml)
13-
14-
**NPM** \
15-
![NPM Package Version](https://img.shields.io/npm/v/react-native-lab)
16-
![NPM Package Last Updated](https://img.shields.io/npm/last-update/react-native-lab)
17-
![NPM Package Downloads](https://img.shields.io/npm/d18m/react-native-lab)
18-
19-
`react-native-lab` is a cli tool to set up a React Native project with some pre-defined configurations. This tool helps you quickly set up a React Native development environment, including installing necessary dependencies like JDK, Android Studio.
20-
21-
This project is inspired by the simplicity and effectiveness of [create-next-app](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
22-
23-
<h2 style="text-align: center;">Table of Contents</h2>
24-
25-
- 🚀 [Features](#features)
26-
- 📸 [Screenshots](#screenshots)
27-
- ⚙️ [Prerequisites](#prerequisites)
28-
- 🏁 [Getting Started](#getting-started)
29-
- 🛠️ [Common Issues](#common-issues)
30-
- 🆘 [Getting Help](#getting-help)
31-
- 🤝 [Contributing](#contributing)
32-
- 📜 [License](#license)
33-
34-
<h2 id="features" style="text-align: center;">🚀 Features</h2>
35-
36-
1. **Installs JDK (OpenJDK)**: Automatically installs the necessary JDK for Android development.
37-
1. **Installs Android Studio**: Sets up Android Studio, including the necessary SDKs and tools.
38-
1. **Sets Environment Variables**: Configures system environment variables such as `ANDROID_HOME`, `ANDROID_SDK_ROOT`, and `JAVA_HOME`.
39-
1. **Pre-built Templates**: Choose from a variety of pre-built templates to kickstart your React Native project.
40-
41-
- `Blank`
42-
- `Bottom Navigation`
43-
- `Drawer Navigation`
44-
- `Stack Navigation`
45-
1. **Project Structure**: Creates an `src` folder for you want.
46-
1. **Cross-Platform Support**: Works on `Windows`, `macOS`, and `Linux`.
47-
1. **Environment Setup**:
48-
- Sets up a `.env` file for managing environment variables.
49-
- Offers choice between `react-native-config` and `react-native-dotenv` for handling environment variables.
50-
1. **Alias Configuration**: Configures path aliases for cleaner and more manageable imports.
51-
1. **NativeWind Integration**: Install and configure NativeWind for styling.
52-
1. **React Native Version Selection**: Allows you to set up the project with your preferred React Native version.
53-
1. **Console Remover**: Automatically removes console logs in production builds, enhancing security and slightly reducing app size.
54-
1. **Custom Hooks**: Option to include a set of useful custom hooks:
55-
- `useDebounce`: Delays invoking a function until after a wait period.
56-
- `useThrottle`: Limits the rate at which a function can fire.
57-
- `usePrevious`: Accesses the previous value of a state or prop.
58-
- `useOrientation`: Detects and responds to device orientation changes.
59-
- `useResponsiveLayout`: Provides responsive layout information based on screen size.
60-
61-
![Custom Hooks](./images/screenshots/all-prompts.png)
62-
63-
<h2 id="screenshots" style="text-align: center;">📸 Screenshots</h2>
64-
65-
Here are the available templates you can use with `react-native-lab`:
66-
67-
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; max-width: 500px;">
68-
<div style="text-align: center;">
69-
<h4>Blank Template</h4>
70-
<img src="./images/blank-template.png" alt="Blank Template" style="width: 100%; border-radius: 10px;">
71-
</div>
72-
<div style="text-align: center;">
73-
<h4>Navigation Template</h4>
74-
<img src="./images/navigation-template.png" alt="Navigation Template" style="width: 100%; border-radius: 10px;">
75-
</div>
76-
</div>
77-
78-
<h2 id="prerequisites" style="text-align: center;">⚙️ Prerequisites</h2>
79-
80-
- Node.js (v18 or higher)
81-
- npm (v6 or higher)
82-
83-
<h2 id="getting-started" style="text-align: center;">🏁 Getting Started</h2>
84-
85-
To get started with `react-native-lab`, follow these steps:
86-
87-
1. Ensure you have all the prerequisites installed on your system.
88-
2. You can use `npx` to run the tool without installing it:
89-
```sh
90-
npx react-native-lab@latest
91-
```
92-
93-
<h2 id="common-issues" style="text-align: center;">🛠️ Common Issues</h2>
94-
95-
- **Installation Errors**: Ensure you have the correct versions of Node.js and npm installed. Try clearing the npm cache:
96-
```sh
97-
npm cache clean --force
98-
```
99-
- **Permission Errors**: Run the command with elevated privileges (e.g., using `sudo` on macOS/Linux or running the terminal as an administrator on Windows).
100-
101-
<h2 id="getting-help" style="text-align: center;">🆘 Getting Help</h2>
1+
<h1 style="text-align: center;">🧪 React Native Lab</h1>
1022

103-
If you need further assistance, you can:
3+
<div align="center">
1044

105-
- Check the [GitHub Issues](https://github.com/developer-sumit/react-native-lab/issues) for similar problems.
106-
- Open a new issue with detailed information about your problem.
107-
- Reach out to the community for support.
5+
![Github License](https://img.shields.io/github/license/developer-sumit/react-native-lab?style=flat-square)
6+
![Github Version](https://img.shields.io/github/package-json/v/developer-sumit/react-native-lab?style=flat-square)
7+
![Github Repo Created At](https://img.shields.io/github/created-at/developer-sumit/react-native-lab?style=flat-square)
8+
![Github Repo Contributors](https://img.shields.io/github/contributors/developer-sumit/react-native-lab?style=flat-square)
9+
![Github Repo Fork](https://img.shields.io/github/forks/developer-sumit/react-native-lab?style=flat-square)
10+
![NPM Package Version](https://img.shields.io/npm/v/react-native-lab?style=flat-square)
11+
![NPM Package Last Updated](https://img.shields.io/npm/last-update/react-native-lab?style=flat-square)
12+
![NPM Package Downloads](https://img.shields.io/npm/dm/react-native-lab?style=flat-square)
10813

109-
By following these steps, you should be able to resolve most issues and get your React Native project up and running smoothly.
110-
111-
<h2 id="contributing" style="text-align: center;">🤝 Contributing</h2>
112-
113-
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
114-
115-
To contribute:
116-
117-
1. Fork the repository.
118-
2. Create a new branch (`git checkout -b feature`).
119-
3. Make your changes.
120-
4. Commit your changes (`git commit -m 'Add some feature'`).
121-
5. Push to the branch (`git push origin feature`).
122-
6. Open a pull request.
123-
124-
Please make sure to follow the project's coding guidelines and standards.
125-
126-
<h2 id="license" style="text-align: center;">📜 License</h2>
127-
128-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
129-
130-
<h2 id="changelog" style="text-align: center;">📜 Changelog</h2>
14+
</div>
13115

132-
For a detailed list of changes and updates, please refer to the [Changelog](./CHANGELOG.md).
16+
<p align="center">
17+
<b>The ultimate CLI to kickstart your React Native journey with professional-grade templates and tools.</b>
18+
</p>
19+
20+
---
21+
22+
`react-native-lab` automates the boring setup of React Native projects. We handle the configuration so you can start coding instantly.
23+
24+
### 🚀 Quick Start
25+
26+
```bash
27+
npx react-native-lab@latest
28+
```
29+
30+
### 💻 Usage Preview
31+
32+
_No screenshots needed! Here is how the interactive CLI guides you:_
33+
34+
```text
35+
┌ React Native Lab
36+
37+
◇ What is the name of your React Native project?
38+
│ MySuperApp
39+
40+
◇ Do you want to create a "src" folder for your files?
41+
│ Yes
42+
43+
◇ Which template would you like to use?
44+
│ Bottom Navigation
45+
46+
◇ Checking for JDK installation...
47+
│ JDK is already installed.
48+
49+
◇ Checking for Android Studio...
50+
│ Android Studio is already installed.
51+
52+
◇ Would you like to enable additional customization?
53+
│ Yes
54+
55+
◇ Which package manager would you like to use?
56+
│ npm
57+
58+
◇ What should be the package name?
59+
│ com.mysuperapp.mobile
60+
61+
◇ Would you like to install NativeWind for styling?
62+
│ Yes
63+
64+
◇ Include automatic console log removal in production?
65+
│ Yes
66+
67+
◇ Add GitHub Actions CI workflow?
68+
│ Yes
69+
70+
└ Configuration complete! Starting setup...
71+
```
72+
73+
### ✨ Comprehensive Features
74+
75+
We take care of the details so you don't have to.
76+
77+
#### 🛠️ Smart Environment Setup
78+
79+
- **Automatic JDK Install**: Checks and installs OpenJDK (Windows/Linux) if missing.
80+
- **Automatic Android Studio**: Downloads and configures Android Studio & SDKs (Windows/Linux).
81+
- **Environment Variables**: Automatically sets `JAVA_HOME`, `ANDROID_HOME`, and adds tools to `PATH`.
82+
83+
#### 🎨 Templates & Design
84+
85+
- **Multiple Layouts**:
86+
- **Blank**: A clean slate.
87+
- **Bottom Navigation**: Tab-based navigation pre-configured.
88+
- **Stack Navigation**: Standard stack navigation.
89+
- **Drawer Navigation**: Drawer menu implementation.
90+
- **NativeWind Support**: Optional integration of Tailwind CSS for React Native.
91+
92+
#### ⚙️ Project Configuration
93+
94+
- **Package Manager**: Support for `npm`, `yarn`, or `bun`.
95+
- **Custom Package Name**: Easily set your Bundle ID (e.g., `com.company.app`).
96+
- **React Native Version**: Choose between `latest` stable or a specific version.
97+
- **Project Structure**: Optional clean `src/` directory organization.
98+
- **Environment Secrets**: Choice of `react-native-config` or `react-native-dotenv`.
99+
100+
#### 🧑‍💻 Developer Experience (DX)
101+
102+
- **TypeScript First**: All code is typed by default.
103+
- **Path Aliases**: Pre-configured aliases like `@assets`, `@components`, `@screens`, `@utils`.
104+
- **Custom Hooks Library**: Optional inclusion of:
105+
- `useDebounce`
106+
- `useThrottle`
107+
- `usePrevious`
108+
- `useOrientation`
109+
- `useResponsiveLayout`
110+
111+
#### 🚀 Production Readiness
112+
113+
- **CI/CD Integration**: Automatically generates `.github/workflows/ci.yml` for linting and testing.
114+
- **Console Log Removal**: Production builds automatically strip simple `console.log` statements for security and speed.
115+
- **Git Initialization**: Auto-init Git repo and generate a tailored `.gitignore`.
116+
117+
### 🤝 Contributing
118+
119+
Contributions are welcome! Please open an issue or submit a pull request [here](https://github.com/developer-sumit/react-native-lab).
120+
121+
### 📄 License
122+
123+
MIT © [Sumit Singh Rathore](https://github.com/developer-sumit)

UPDATES.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# 🔮 Updates & Roadmap
2+
3+
This document outlines the future vision for `react-native-lab`. We prioritize features that reduce "setup fatigue" and enforce professional best practices.
4+
5+
## 📦 Package Manager Recommendation
6+
7+
For developing `react-native-lab` itself, we recommend using **npm**.
8+
9+
- **Why?** It is the default for Node.js, ensuring maximum compatibility for contributors without requiring additional tools.
10+
- **Future Consideration:** If the repository grows into a monorepo (e.g., separating templates into packages), we will migrate to **pnpm** for its workspace efficiency and disk space savings.
11+
12+
---
13+
14+
## 📅 Roadmap
15+
16+
### v1.4.0: Asset Optimization & Splash Screens 🎨
17+
18+
**Goal:** Automate the tedious process of generating app icons and splash screens.
19+
20+
- **Feature:** `npx react-native-lab generate-assets`
21+
- **Why:** Developers hate manually resizing images for Android/iOS.
22+
- **Tech:** Integrate `react-native-bootsplash` or similar tools automatically.
23+
24+
### v1.5.0: State Management Selection 🧠
25+
26+
**Goal:** Give developers options for rigorous state management beyond React Context.
27+
28+
- **Feature:** Option to add **Zustand** or **Redux Toolkit** during setup.
29+
- **Why:** As apps scale, Context API often falls short. Zustand is growing in popularity for its simplicity, while Redux remains the enterprise standard.
30+
31+
### v1.6.0: API & Networking Layer 🌐
32+
33+
**Goal:** Provide a production-ready networking setup.
34+
35+
- **Feature:** Pre-configured `TanStack Query` (React Query) + `Axios` instance.
36+
- **Why:** Dealing with caching, loading states, and error handling is mandatory in every app. We should automate the best-practice setup.
37+
38+
### v2.0.0: The Plugin System 🧩
39+
40+
**Goal:** Move from a "CLI tool" to a "Platform".
41+
42+
- **Feature:** Allow the community to create and publish their own templates (e.g., `react-native-lab init --template @user/my-template`).
43+
- **Why:** We can't maintain every possible stack. Empowering the community scales the ecosystem indefinitely.
44+
45+
### v2.1.0: Expo Support? 🤔
46+
47+
**Goal:** Support the Expo ecosystem.
48+
49+
- **Feature:** `react-native-lab init --type expo`
50+
- **Why:** Expo is becoming the default for many. Creating a unified CLI for both bare and Expo workflows would be powerful.
51+
52+
---
53+
54+
## 🛠️ Internal Improvements (Continuous)
55+
56+
- **Test Coverage:** Increase unit and E2E test coverage for the CLI.
57+
- **Telemetry:** Optional, anonymous usage tracking to see which templates are most popular (strictly no PII).

images/posters/Poster-1.jpg

-458 KB
Binary file not shown.

images/posters/Poster-2.jpg

-367 KB
Binary file not shown.

images/screenshots/all-prompts.png

-43.3 KB
Binary file not shown.
-11 KB
Binary file not shown.
-5.6 KB
Binary file not shown.
-4.32 KB
Binary file not shown.

0 commit comments

Comments
 (0)