Skip to content

Commit d93b1b6

Browse files
committed
Initial check in of rn-starter app
0 parents  commit d93b1b6

File tree

135 files changed

+21163
-0
lines changed

Some content is hidden

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

135 files changed

+21163
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["module:metro-react-native-babel-preset"]
3+
}

.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

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.eslintrc.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
extends: [
3+
'airbnb',
4+
'plugin:flowtype/recommended',
5+
'prettier',
6+
'prettier/flowtype',
7+
'prettier/react',
8+
],
9+
parser: 'babel-eslint',
10+
plugins: ['flowtype', 'prettier'],
11+
env: {
12+
es6: true,
13+
},
14+
rules: {
15+
// The eslint import resolver doesn't work well with module aliases
16+
// so use Flow to report on any missing imports instead
17+
'import/no-unresolved': 0,
18+
19+
// This eslint rule causes issues with components called `Link`
20+
// within React Native
21+
'jsx-a11y/anchor-is-valid': 0,
22+
23+
// This is disabled to allow styles to be defined at the end of files
24+
'no-use-before-define': 0,
25+
26+
'prettier/prettier': [
27+
'error',
28+
{
29+
trailingComma: 'es5',
30+
singleQuote: true,
31+
},
32+
],
33+
34+
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
35+
'react/sort-comp': [
36+
2,
37+
{
38+
order: [
39+
'static-methods',
40+
'type-annotations',
41+
'lifecycle',
42+
'render',
43+
'everything-else',
44+
],
45+
},
46+
],
47+
},
48+
};

.flowconfig

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
16+
; Ignore polyfills
17+
.*/Libraries/polyfills/.*
18+
19+
; Ignore metro
20+
.*/node_modules/metro/.*
21+
22+
[include]
23+
24+
[libs]
25+
node_modules/react-native/Libraries/react-native/react-native-interface.js
26+
node_modules/react-native/flow/
27+
node_modules/react-native/flow-github/
28+
29+
[options]
30+
emoji=true
31+
32+
esproposal.optional_chaining=enable
33+
esproposal.nullish_coalescing=enable
34+
35+
module.system=haste
36+
module.system.haste.use_name_reducers=true
37+
# get basename
38+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
39+
# strip .js or .js.flow suffix
40+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
41+
# strip .ios suffix
42+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
43+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
44+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
45+
module.system.haste.paths.blacklist=.*/__tests__/.*
46+
module.system.haste.paths.blacklist=.*/__mocks__/.*
47+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
48+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
49+
50+
munge_underscores=true
51+
52+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
53+
54+
module.file_ext=.js
55+
module.file_ext=.jsx
56+
module.file_ext=.json
57+
module.file_ext=.native.js
58+
59+
suppress_type=$FlowIssue
60+
suppress_type=$FlowFixMe
61+
suppress_type=$FlowFixMeProps
62+
suppress_type=$FlowFixMeState
63+
64+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
65+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
66+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
67+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
68+
69+
[version]
70+
^0.78.0

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ignore pods
59+
ios/Pods

.watchmanconfig

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

App.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* @format
6+
* @flow
7+
*/
8+
9+
import React, {Component} from 'react';
10+
import {Platform, StyleSheet, Text, View} from 'react-native';
11+
12+
const instructions = Platform.select({
13+
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
14+
android:
15+
'Double tap R on your keyboard to reload,\n' +
16+
'Shake or press menu button for dev menu',
17+
});
18+
19+
type Props = {};
20+
export default class App extends Component<Props> {
21+
render() {
22+
return (
23+
<View style={styles.container}>
24+
<Text style={styles.welcome}>Welcome to React Native!</Text>
25+
<Text style={styles.instructions}>To get started, edit App.js</Text>
26+
<Text style={styles.instructions}>{instructions}</Text>
27+
</View>
28+
);
29+
}
30+
}
31+
32+
const styles = StyleSheet.create({
33+
container: {
34+
flex: 1,
35+
justifyContent: 'center',
36+
alignItems: 'center',
37+
backgroundColor: '#F5FCFF',
38+
},
39+
welcome: {
40+
fontSize: 20,
41+
textAlign: 'center',
42+
margin: 10,
43+
},
44+
instructions: {
45+
textAlign: 'center',
46+
color: '#333333',
47+
marginBottom: 5,
48+
},
49+
});

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# React Native Starter
2+
3+
---
4+
5+
A simple React Native Starter app providing the following:
6+
7+
- [React Navigation](https://reactnavigation.org/) setup
8+
- Email login and registration flow ready to integrate with your backend of choice
9+
- Flow, ESLint and Prettier setup and configuration
10+
- Multiple environment support
11+
12+
> This app provides the basis for all CS Frequency's React Native apps.
13+
14+
## Getting started
15+
16+
### Clone and install dependencies
17+
18+
1. Clone the `rn-starter` repository with the following command:
19+
20+
```
21+
git clone https://github.com/CSFrequency/rn-starter
22+
cd rn-starter
23+
```
24+
25+
2. Install dependencies:
26+
27+
Either:
28+
29+
```
30+
yarn
31+
```
32+
33+
or:
34+
35+
```
36+
npm install
37+
```
38+
39+
3. **iOS** Initialise Cocoapods
40+
41+
```
42+
cd ios
43+
pod install
44+
```
45+
46+
### Rename your app
47+
48+
We've provided a simple renaming tool that allows you to use your own application and company name.
49+
50+
Either:
51+
52+
```
53+
yarn rename
54+
```
55+
56+
or:
57+
58+
```
59+
npm run rename
60+
```
61+
62+
### Start your app
63+
64+
1. Start the React Native packager:
65+
66+
```
67+
react-native start
68+
```
69+
70+
2. **iOS** Build and run the iOS app:
71+
72+
```
73+
react-native run-ios
74+
```
75+
76+
> This will automatically start the iOS simulator for you if one is not already started.
77+
78+
3. **Android** Build and run the Android app:
79+
80+
```
81+
react-native run-android
82+
```
83+
84+
> You'll need to have an Android device attached or an emulator running already.

0 commit comments

Comments
 (0)