Skip to content

Commit 2abceee

Browse files
committed
initial commit
1 parent b9a889a commit 2abceee

File tree

63 files changed

+4031
-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.

63 files changed

+4031
-0
lines changed

example/.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+
}

example/.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

example/.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

example/.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

example/.gitattributes

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

example/.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
# RNFirebase specific
59+
#
60+
.expo/
61+
/ios/Pods/
62+
# google-services.json
63+
# GoogleService-Info.plist
64+
65+
# RNFirebaseStarter
66+
yarn.lock
67+
package-lock.json

example/.opensource/project.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "React Native Firebase Starter",
3+
"type": "sample",
4+
"platforms": ["Android", "iOS"],
5+
"content": "README.md",
6+
"related": ["invertase/react-native-firebase"]
7+
}

example/.watchmanconfig

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

example/App.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import React from 'react';
2+
import { StyleSheet, Platform, Image, Text, View, ScrollView } from 'react-native';
3+
4+
import firebase from 'react-native-firebase';
5+
6+
export default class App extends React.Component {
7+
constructor() {
8+
super();
9+
this.state = {};
10+
}
11+
12+
async componentDidMount() {
13+
// TODO: You: Do firebase things
14+
// const { user } = await firebase.auth().signInAnonymously();
15+
// console.warn('User -> ', user.toJSON());
16+
17+
// await firebase.analytics().logEvent('foo', { bar: '123'});
18+
}
19+
20+
render() {
21+
return (
22+
<ScrollView>
23+
<View style={styles.container}>
24+
<Image source={require('./assets/ReactNativeFirebase.png')} style={[styles.logo]}/>
25+
<Text style={styles.welcome}>
26+
Welcome to {'\n'} React Native Firebase
27+
</Text>
28+
<Text style={styles.instructions}>
29+
To get started, edit App.js
30+
</Text>
31+
{Platform.OS === 'ios' ? (
32+
<Text style={styles.instructions}>
33+
Press Cmd+R to reload,{'\n'}
34+
Cmd+D or shake for dev menu
35+
</Text>
36+
) : (
37+
<Text style={styles.instructions}>
38+
Double tap R on your keyboard to reload,{'\n'}
39+
Cmd+M or shake for dev menu
40+
</Text>
41+
)}
42+
<View style={styles.modules}>
43+
<Text style={styles.modulesHeader}>The following Firebase modules are pre-installed:</Text>
44+
{firebase.admob.nativeModuleExists && <Text style={styles.module}>admob()</Text>}
45+
{firebase.analytics.nativeModuleExists && <Text style={styles.module}>analytics()</Text>}
46+
{firebase.auth.nativeModuleExists && <Text style={styles.module}>auth()</Text>}
47+
{firebase.config.nativeModuleExists && <Text style={styles.module}>config()</Text>}
48+
{firebase.crashlytics.nativeModuleExists && <Text style={styles.module}>crashlytics()</Text>}
49+
{firebase.database.nativeModuleExists && <Text style={styles.module}>database()</Text>}
50+
{firebase.firestore.nativeModuleExists && <Text style={styles.module}>firestore()</Text>}
51+
{firebase.functions.nativeModuleExists && <Text style={styles.module}>functions()</Text>}
52+
{firebase.iid.nativeModuleExists && <Text style={styles.module}>iid()</Text>}
53+
{firebase.invites.nativeModuleExists && <Text style={styles.module}>invites()</Text>}
54+
{firebase.links.nativeModuleExists && <Text style={styles.module}>links()</Text>}
55+
{firebase.messaging.nativeModuleExists && <Text style={styles.module}>messaging()</Text>}
56+
{firebase.notifications.nativeModuleExists && <Text style={styles.module}>notifications()</Text>}
57+
{firebase.perf.nativeModuleExists && <Text style={styles.module}>perf()</Text>}
58+
{firebase.storage.nativeModuleExists && <Text style={styles.module}>storage()</Text>}
59+
</View>
60+
</View>
61+
</ScrollView>
62+
);
63+
}
64+
}
65+
66+
const styles = StyleSheet.create({
67+
container: {
68+
flex: 1,
69+
justifyContent: 'center',
70+
alignItems: 'center',
71+
backgroundColor: '#F5FCFF',
72+
},
73+
logo: {
74+
height: 120,
75+
marginBottom: 16,
76+
marginTop: 64,
77+
padding: 10,
78+
width: 135,
79+
},
80+
welcome: {
81+
fontSize: 20,
82+
textAlign: 'center',
83+
margin: 10,
84+
},
85+
instructions: {
86+
textAlign: 'center',
87+
color: '#333333',
88+
marginBottom: 5,
89+
},
90+
modules: {
91+
margin: 20,
92+
},
93+
modulesHeader: {
94+
fontSize: 16,
95+
marginBottom: 8,
96+
},
97+
module: {
98+
fontSize: 14,
99+
marginTop: 4,
100+
textAlign: 'center',
101+
}
102+
});

example/App.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import App from './App';
3+
4+
import renderer from 'react-test-renderer';
5+
6+
it('renders without crashing', () => {
7+
const rendered = renderer.create(<App />).toJSON();
8+
expect(rendered).toBeTruthy();
9+
});

0 commit comments

Comments
 (0)