Skip to content

Commit 80a6c27

Browse files
committed
feat: init react native boilerplate 0.0.1
1 parent 54f6364 commit 80a6c27

File tree

109 files changed

+11568
-2
lines changed

Some content is hidden

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

109 files changed

+11568
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.npmignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.DS_Store
2+
build/
3+
.idea
4+
.gradle
5+
local.properties
6+
*.iml
7+
npm-debug.log
8+
yarn-error.log
9+
node_modules
10+
template/node_modules
11+
template/ios/Pods
12+
template/android/app/build
13+
template/android/.gradle
14+
template/android/.idea
15+
template/.buckconfig
16+
template/.gitattributes
17+
template/.watchmanconfig
18+
documentation
19+
.idea
20+
.github

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
### [0.0.11](https://github.com/handi-dev/react-native-boilerplate/compare/v0.0.10...v0.0.11) (2022-07-18)
6+
7+
8+
### Bug Fixes
9+
10+
* adjust readMe ([ad29068](https://github.com/handi-dev/react-native-boilerplate/commit/ad2906895884d0d1ce5c7855429b6ccd5d7444d0))
11+
12+
### [0.0.10](https://github.com/handi-dev/react-native-boilerplate/compare/v0.0.8...v0.0.10) (2022-07-18)
13+
14+
15+
### Features
16+
17+
* adjust readme ([013bae4](https://github.com/handi-dev/react-native-boilerplate/commit/013bae40331d4735115e156cdc38a9466514598f))
18+
19+
### 0.0.8 (2022-07-18)
20+
21+
### [0.0.6](https://github.com/handi-dev/react-native-boilerplate/compare/v0.0.5...v0.0.6) (2022-04-03)
22+
23+
24+
### Features
25+
26+
* update react native 0.68 ([24968f3](https://github.com/handi-dev/react-native-boilerplate/commit/24968f37eaad7cde01f3a8464c33941c795d5cfe))
27+
28+
### [0.0.5](https://github.com/handi-dev/react-native-boilerplate/compare/v0.0.4...v0.0.5) (2022-04-03)
29+
30+
### [0.0.4](https://github.com/handi-dev/react-native-boilerplate/compare/v2.3.0...v0.0.4) (2022-04-03)
31+
32+
33+
### Features
34+
35+
* add template react native ([4a8282a](https://github.com/handi-dev/react-native-boilerplate/commit/4a8282a306951a354af7147a1f49513a0a73f884))
36+
* update react native 0.67.3 ([d4479f3](https://github.com/handi-dev/react-native-boilerplate/commit/d4479f3ae428e63f52ac4901e18ce7ed9c4f13c0))

README.md

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,73 @@
1-
# react-native-typescript-boilerplate
2-
React Native Typescript Boilerplate
1+
# react-native-typescript-boilerplate-template 2022
2+
[![npm](https://img.shields.io/npm/v/@handidev/react-native-boilerplate)](https://www.npmjs.com/package/@handidev/react-native-typescript-boilerplate)
3+
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
4+
5+
## What is React Native Typescript Boilerplate
6+
7+
It is a template that you can clone and reuse for every project. It is starting point for React Native application.
8+
9+
## React Native Typescript Boilerplate ( 0.69.1 )
10+
11+
consist of:
12+
13+
- react-native": "0.69.1"
14+
- "@react-native-masked-view/masked-view": "^0.2.7",
15+
- "@react-navigation/bottom-tabs": "^6.3.2",
16+
- "@react-navigation/material-top-tabs": "^6.2.2",
17+
- "@react-navigation/native": "^6.0.11",
18+
- "@react-navigation/native-stack": "^6.7.0",
19+
- "@react-navigation/stack": "^6.2.2",
20+
- "@reduxjs/toolkit": "^1.8.3",
21+
- "react": "18.0.0",
22+
- "react-native-gesture-handler": "^2.5.0",
23+
- "react-native-pager-view": "^5.4.25",
24+
- "react-native-safe-area-context": "^4.3.1",
25+
- "react-native-screens": "^3.15.0",
26+
- "react-native-tab-view": "^3.1.1",
27+
- "react-native-vector-icons": "^9.2.0",
28+
- "react-redux": "^8.0.2"
29+
## Requirements
30+
31+
Node 12 or greater is required. Development for iOS requires a Mac and Xcode 10 or up, and will target iOS 11 and up.
32+
33+
You also need to install the dependencies required by React Native.
34+
Go to the [React Native environment setup](https://reactnative.dev/docs/environment-setup), then select `React Native CLI Quickstart` tab.
35+
Follow instructions for your given `development OS` and `target OS`.
36+
37+
## Quick start
38+
39+
To create a new project using the boilerplate simply run :
40+
41+
```
42+
npx react-native init MyApp --template @handidev/react-native-boilerplate
43+
```
44+
45+
note: replace `MyApp` with your desired App name.
46+
47+
Assuming you have all the requirements installed, you can run the project by running:
48+
49+
- `yarn start` / `npm start -- -- reset-cache` to start the metro bundler, in a dedicated terminal
50+
- `npx react-native run-ios` / `npx react-native run-android` to run the *platform* application (remember to start a simulator or connect a device)
51+
## List of Q & A
52+
53+
#### I got error `Error: spawn ./gradlew EACCES` when run `npx react-native run-android`.
54+
55+
Run this command `chmod 755 android/gradlew` from your root project directory
56+
57+
#### I got error `Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.`
58+
59+
- Go to your Project -> Android
60+
- Create a file local.properties
61+
- Open the file
62+
- Paste your Android SDK path depending on the operating system:
63+
64+
- Windows:
65+
sdk.dir=C:\\Users\\`USERNAME`\\AppData\\Local\\Android\\sdk
66+
- Linux or MacOS
67+
sdk.dir=/Users/`USERNAME`/Library/Android/sdk
68+
69+
- Replace `USERNAME` with your PC username
70+
71+
### React Native Build Failed on M1 Macbook Pro / Air
72+
73+
try this solution: [How to Run and Build React Native on Macbook Pro M1 Apple Silicon](https://handi.dev/blog/how-run-react-native-on-macbook-m1-apple-silicon)

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@handidev/react-native-typescript-boilerplate",
3+
"version": "0.0.1",
4+
"keywords": [
5+
"react",
6+
"native",
7+
"react native typescript",
8+
"typescript boilerplate",
9+
"rn-boilerplate",
10+
"handidev",
11+
"react-native",
12+
"starter-kit",
13+
"react-native-redux-toolkit",
14+
"react-native-navigation"
15+
],
16+
"scripts": {
17+
"release": "standard-version"
18+
},
19+
"description": "React Native Boilerplate Template",
20+
"repository": "https://github.com/handi-dev/react-native-typescript-boilerplate",
21+
"author": "Handi Priyono <contact@handi.dev>",
22+
"license": "MIT",
23+
"dependencies": {},
24+
"devDependencies": {
25+
"standard-version": "^9.5.0"
26+
}
27+
}

script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
console.log("Welcome to handi.dev boilerplate");

template.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
// Placeholder used to rename and replace in files
3+
// package.json, index.json, android/, ios/
4+
placeholderName: "reactNativeBoilerplate",
5+
6+
titlePlaceholder: 'Handi.dev react native boilerplate',
7+
8+
// Directory with template
9+
templateDir: "./template",
10+
11+
// Path to script, which will be executed after init
12+
postInitScript: "./script.js"
13+
};

template/.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

template/.eslintrc.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint'],
6+
overrides: [
7+
{
8+
files: ['*.ts', '*.tsx'],
9+
rules: {
10+
'@typescript-eslint/no-shadow': ['error'],
11+
'no-shadow': 'off',
12+
'no-undef': 'off',
13+
'no-unused-vars': 'warn',
14+
'@typescript-eslint/no-unused-vars': 'warn',
15+
'prefer-template': 'error',
16+
'react/jsx-curly-brace-presence': [
17+
'off',
18+
{ props: 'never', children: 'never' },
19+
],
20+
},
21+
},
22+
],
23+
};

template/.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
34+
# node.js
35+
#
36+
node_modules/
37+
npm-debug.log
38+
yarn-error.log
39+
40+
# BUCK
41+
buck-out/
42+
\.buckd/
43+
*.keystore
44+
!debug.keystore
45+
46+
# fastlane
47+
#
48+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49+
# screenshots whenever they are needed.
50+
# For more information about the recommended setup visit:
51+
# https://docs.fastlane.tools/best-practices/source-control/
52+
53+
**/fastlane/report.xml
54+
**/fastlane/Preview.html
55+
**/fastlane/screenshots
56+
**/fastlane/test_output
57+
58+
# Bundle artifact
59+
*.jsbundle
60+
61+
# Ruby / CocoaPods
62+
/ios/Pods/
63+
/vendor/bundle/

template/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: true,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

template/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.5

template/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

template/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby '2.7.5'
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

template/android/app/_BUCK

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.reactnativetypescriptboilerplate",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.reactnativetypescriptboilerplate",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)