new-react-native-boilerplate 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,6 +67,21 @@ Create a new project with one command:
67
67
  npx new-react-native-boilerplate
68
68
  ```
69
69
 
70
+ To make sure you get the newest version instead of a cached one:
71
+
72
+ ```bash
73
+ npx new-react-native-boilerplate@latest
74
+ ```
75
+
76
+ Or install the CLI globally and run it from anywhere:
77
+
78
+ ```bash
79
+ npm install -g new-react-native-boilerplate
80
+ new-react-native-boilerplate
81
+ ```
82
+
83
+ > **Moving from `@hardik59/rn-boilerplate`?** That package is deprecated. Use `npx new-react-native-boilerplate` instead. The template and setup steps are the same.
84
+
70
85
  The interactive wizard asks for two things:
71
86
 
72
87
  1. **Project name**, for example `MyAwesomeApp`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "new-react-native-boilerplate",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A React Native boilerplate for building cross-platform mobile apps.",
5
5
  "bin": {
6
6
  "new-react-native-boilerplate": "run.sh"
@@ -1,103 +1,101 @@
1
- This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
1
+ This project was created with [**new-react-native-boilerplate**](https://www.npmjs.com/package/new-react-native-boilerplate), a [React Native](https://reactnative.dev) starter with navigation, Redux Toolkit, theming and localization already set up.
2
+
3
+ > **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before you continue.
2
4
 
3
5
  # Getting Started
4
6
 
5
- > **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
7
+ ## Step 1: Install dependencies
6
8
 
7
- ### For getting console logs in Metro builder
9
+ The setup wizard already ran this for you. Run it again after you clone the project or change dependencies:
8
10
 
9
- ```bash
10
- yarn start-logs
11
+ ```sh
12
+ yarn
13
+ yarn asset # link fonts and images
14
+ bundle install # install CocoaPods through Bundler (first time only)
15
+ yarn podinstall # install iOS pods (after native dependency changes)
11
16
  ```
12
17
 
13
- ## Step 1: Start Metro
18
+ ## Step 2: Check the `.env` file
14
19
 
15
- First, you will need to run **Metro**, the JavaScript build tool for React Native.
20
+ The wizard creates a `.env` file at the project root. Update the values for your API:
16
21
 
17
- To start the Metro dev server, run the following command from the root of your React Native project:
22
+ ```dotenv
23
+ ENV=DEV
24
+ BASE_API_URL=https://dummyjson.com
25
+ IMAGE_URL=https://dev-tn-file-server.s3.ap-south-1.amazonaws.com
26
+ ```
18
27
 
19
- ```sh
20
- # Using npm
21
- npm start
28
+ ## Step 3: Start Metro
22
29
 
23
- # OR using Yarn
30
+ ```sh
24
31
  yarn start
25
32
  ```
26
33
 
27
- ## Step 2: Build and run your app
28
-
29
- With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
30
-
31
- ### Android
34
+ To see app console logs in the Metro terminal, use this instead:
32
35
 
33
36
  ```sh
34
- # Using npm
35
- npm run android
36
-
37
- # OR using Yarn
38
- yarn android
37
+ yarn start-logs
39
38
  ```
40
39
 
41
- ### iOS
42
-
43
- For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
40
+ ## Step 4: Build and run your app
44
41
 
45
- The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
42
+ Keep Metro running, open a new terminal in the project root, and run one of these:
46
43
 
47
- ```sh
48
- bundle install
49
- ```
50
-
51
- Then, and every time you update your native dependencies, run:
44
+ ### Android
52
45
 
53
46
  ```sh
54
- bundle exec pod install
47
+ yarn android
55
48
  ```
56
49
 
57
- For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
50
+ ### iOS
58
51
 
59
52
  ```sh
60
- # Using npm
61
- npm run ios
62
-
63
- # OR using Yarn
64
53
  yarn ios
65
- ```
66
-
67
- If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
68
-
69
- This is one way to run your app — you can also build it directly from Android Studio or Xcode.
70
-
71
- ## Step 3: Modify your app
72
54
 
73
- Now that you have successfully run the app, let's make changes!
55
+ # or on a specific simulator
56
+ yarn ios --simulator="iPhone 16 Pro"
57
+ ```
74
58
 
75
- Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
59
+ If everything is set up correctly, your app opens in the Android Emulator, the iOS Simulator, or on your connected device. You can also build it directly from Android Studio or Xcode.
76
60
 
77
- When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
61
+ ## Step 5: Modify your app
78
62
 
79
- - **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
80
- - **iOS**: Press <kbd>R</kbd> in iOS Simulator.
63
+ Open `src/App.tsx` or any screen in `src/screens/` and make a change. When you save, the app updates automatically through [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
81
64
 
82
- ## Congratulations! :tada:
65
+ To force a full reload, for example to reset the app's state:
83
66
 
84
- You've successfully run and modified your React Native App. :partying_face:
67
+ - **Android**: press <kbd>R</kbd> twice, or choose **"Reload"** from the **Dev Menu**. Open it with <kbd>Ctrl</kbd> + <kbd>M</kbd> on Windows and Linux, or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> on macOS.
68
+ - **iOS**: press <kbd>R</kbd> in the iOS Simulator.
85
69
 
86
- ### Now what?
70
+ # Available Scripts
87
71
 
88
- - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
89
- - If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
72
+ | Script | Description |
73
+ | --- | --- |
74
+ | `yarn start` | Start Metro with a cleared cache |
75
+ | `yarn start-logs` | Start Metro and stream app console logs |
76
+ | `yarn android` | Build and run the Android app |
77
+ | `yarn ios` | Build and run the iOS app |
78
+ | `yarn podinstall` | Install iOS CocoaPods through Bundler |
79
+ | `yarn asset` | Link fonts and assets |
80
+ | `yarn test` | Run the Jest test suite |
81
+ | `yarn test:report` | Run tests with coverage and a JUnit report |
82
+ | `yarn lint` | Lint `.ts` and `.tsx` files |
83
+ | `yarn tsc` | Type-check the project |
84
+ | `yarn precommit` | Run the type check and lint in parallel |
85
+ | `yarn android-bundle-release` | Build an Android release bundle |
86
+ | `yarn android-run-release` | Run the Android release variant |
90
87
 
91
88
  # Troubleshooting
92
89
 
93
- If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
90
+ - **Pods fail to install:** run `cd ios && bundle exec pod install --repo-update && cd ..`
91
+ - **`gradlew: Permission denied`:** run `chmod 755 android/gradlew`
92
+ - **Stale code or `.env` values:** restart Metro with `yarn start`, which already clears the cache.
93
+ - **Fonts or images missing:** run `yarn asset`, then rebuild the app.
94
94
 
95
- # Learn More
95
+ For anything else, see the React Native [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page or [open an issue](https://github.com/sharmahardik59/RNBoilerplate/issues).
96
96
 
97
- To learn more about React Native, take a look at the following resources:
97
+ # Learn More
98
98
 
99
- - [React Native Website](https://reactnative.dev) - learn more about React Native.
100
- - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
101
- - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
102
- - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
103
- - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
99
+ - [new-react-native-boilerplate on GitHub](https://github.com/sharmahardik59/RNBoilerplate): source code, docs and issues.
100
+ - [React Native website](https://reactnative.dev): learn more about React Native.
101
+ - [Learn the Basics](https://reactnative.dev/docs/getting-started): a guided tour of React Native.