Skip to content

Commit ceec7e4

Browse files
update: bump version to 1.2.0 and add support for custom hooks and console remover
1 parent 65a4f46 commit ceec7e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+792
-323
lines changed

README.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
![Github Repo Created At](https://img.shields.io/github/created-at/developer-sumit/react-native-lab)
1010
![Github Repo Contributors](https://img.shields.io/github/contributors/developer-sumit/react-native-lab)
1111
![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)
1213

1314
**NPM** \
1415
![NPM Package Version](https://img.shields.io/npm/v/react-native-lab)
@@ -32,27 +33,38 @@ This project is inspired by the simplicity and effectiveness of [create-next-app
3233

3334
<h2 id="features" style="text-align: center;">🚀 Features</h2>
3435

35-
- **Installs JDK (OpenJDK)**: Automatically installs the necessary JDK for Android development.
36-
- **Installs Android Studio**: Sets up Android Studio, including the necessary SDKs and tools.
37-
- **Sets Environment Variables**: Configures system environment variables such as `ANDROID_HOME`, `ANDROID_SDK_ROOT`, and `JAVA_HOME`.
38-
- **Pre-built Templates**: Choose from a variety of pre-built templates to kickstart your React Native project.
39-
- `Blank`
40-
- `Bottom Navigation`
41-
- `Drawer Navigation`
42-
- `Stack Navigation`
43-
- **Project Structure**: Creates an `src` folder for you.
44-
- **Cross-Platform Support**: Works on `Windows`, `macOS`, and `Linux`.
45-
- **Environment Setup**: Sets up a `.env` file for managing environment variables.
46-
- **Navigation Setup**: Sets up React Navigation in your project.
47-
- **Alias Configuration**: Configures path aliases for cleaner and more manageable imports.
48-
- **NativeWind Integration**: Install and configure NativeWind for styling.
49-
- **React Native Version Selection**: Allows you to set up the project with your preferred React Native version.
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)
5062

5163
<h2 id="screenshots" style="text-align: center;">📸 Screenshots</h2>
5264

5365
Here are the available templates you can use with `react-native-lab`:
5466

55-
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px;">
67+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; max-width: 500px;">
5668
<div style="text-align: center;">
5769
<h4>Blank Template</h4>
5870
<img src="./images/blank-template.png" alt="Blank Template" style="width: 100%; border-radius: 10px;">

esbuild.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function copyFiles(src, dest) {
2424
const __filename = fileURLToPath(import.meta.url);
2525
const __dirname = path.dirname(__filename);
2626

27-
const templateSource = path.resolve(__dirname, "./src/templates");
28-
const templateDest = path.resolve(__dirname, "dist", "templates");
27+
const templateSource = path.resolve(__dirname, "./src/templates/project");
28+
const templateDest = path.resolve(__dirname, "dist", "templates", "project");
2929

3030
const scriptSource = path.resolve(__dirname, "./src/scripts");
3131
const scriptDist = path.resolve(__dirname, "dist", "scripts");
@@ -41,7 +41,7 @@ build({
4141
.then(() => {
4242
copyFiles(templateSource, templateDest);
4343
copyFiles(scriptSource, scriptDist);
44-
console.log("Templates copied successfully.");
44+
console.log("Templates and Scripts copied successfully.");
4545
})
4646
.catch((error) => {
4747
console.error("Error: ", error);

images/screenshots/all-prompts.png

43.3 KB
Loading
11 KB
Loading
5.6 KB
Loading
4.32 KB
Loading
5.42 KB
Loading

images/screenshots/templates.png

7.06 KB
Loading

0 commit comments

Comments
 (0)