Skip to content

Commit

Permalink
Add project files
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongrider committed Jan 13, 2022
1 parent a01940e commit 454d3dc
Show file tree
Hide file tree
Showing 124 changed files with 7,415 additions and 2,337 deletions.
6 changes: 0 additions & 6 deletions .buckconfig

This file was deleted.

4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
root: true,
extends: '@react-native-community',
rules: {
'react-native/no-unused-styles': 1,
'react-native/no-inline-styles': 0,
},
};
66 changes: 0 additions & 66 deletions .flowconfig

This file was deleted.

3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build
on: [push, pull_request]
jobs:
build-ios:
name: build-ios
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Install pods
run: cd ios && pod install
- name: Build
run: cd ios && xcodebuild -workspace reactNativeApp.xcworkspace -configuration Debug -scheme reactNativeApp -arch x86_64
build-android:
name: build-android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Install modules
run: yarn
- name: Build
run: cd android && ./gradlew assembleDebug
build-web:
name: build-web
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Build
run: yarn web:build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ build/
.gradle
local.properties
*.iml
*.hprof

# node.js
#
Expand Down
112 changes: 0 additions & 112 deletions App.js

This file was deleted.

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# React Native Boilerplate

A barebones, minimal React Native project with the following support:

- Support for iOS, Android & Web
- TypeScript
- Hermes for iOS & Android
- Reanimated 2.0
- React Navigation
- SVGs
- Github Actions

![Demo](demo.gif)

## FAQ

### Why not use Expo?
Expo is awesome, but as a native dev with experience in iOS and Android I often found myself fighting to keep my dependencies lean, and configurations easily accessible.

### Why use this boilerplate? There are a million others.
There are a ton of boilerplates for every tech stack under the sun. This boilerplate has a few unique features that I hadn't seen in others:
- Completely custom and readable babel, webpack, and metro configurations
- Native navigators for iOS and Android + web navigation intergration
- Typescript and SVG support preconfigured for all platforms

### How do I rename the project files to my app name?
You can rename this project to match yours using the `react-native-rename` package.
`npx react-native-rename <newName>`

### Are you accepting contributions?
I choosing to maintain and build on this package according to my preferences. If you have a suggestion of how something could be simpler or would like to help update a dependency, please feel free to create a PR.
3 changes: 0 additions & 3 deletions _editorconfig

This file was deleted.

21 changes: 13 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import com.android.build.OutputFile
*/

project.ext.react = [
enableHermes: false, // clean and rebuild if changing
enableHermes: true, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down Expand Up @@ -120,16 +120,16 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.blocks"
minSdkVersion rootProject.ext.minSdkVersion
Expand All @@ -156,6 +156,11 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
Expand Down Expand Up @@ -191,7 +196,7 @@ dependencies {
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
exclude group:'com.facebook.fbjni'
}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
Expand All @@ -215,7 +220,7 @@ dependencies {
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

Expand Down
2 changes: 2 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

-keep class com.facebook.react.turbomodule.** { *; }
16 changes: 15 additions & 1 deletion android/app/src/main/java/com/blocks/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.blocks;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;

import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

Expand All @@ -10,6 +14,16 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "blocks";
return "reactNativeApp";
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
Loading

0 comments on commit 454d3dc

Please sign in to comment.