base project files

This commit is contained in:
Salakar 2017-02-14 16:02:54 +00:00
parent 3601a85e15
commit 2b9b198abc
14 changed files with 442 additions and 0 deletions

3
.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["react-native"]
}

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

40
.eslintrc Normal file
View File

@ -0,0 +1,40 @@
{
"extends": "airbnb",
"parser": "babel-eslint",
"ecmaFeatures": {
"jsx": true
},
"plugins": [
"flowtype"
],
"env": {
"es6": true,
"jasmine": true
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"class-methods-use-this": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"arrow-body-style": 0,
"import/prefer-default-export": 0,
"radix": 0,
"new-cap": 0,
"max-len": 0,
"no-continue": 0,
"no-console": 0,
"global-require": 0,
"import/extensions": 0,
"import/no-unresolved": 0,
"import/no-extraneous-dependencies": 0,
"react/jsx-filename-extension": 0
},
"globals": {
"__DEV__": true,
"window": true
}
}

105
.flowconfig Normal file
View File

@ -0,0 +1,105 @@
[ignore]
# Some modules have their own node_modules with overlap
.*/node_modules/node-haste/.*
# React Native problems
.*/node_modules/react-native/Libraries/Animated/src/AnimatedInterpolation.js
.*/node_modules/react-native/Libraries/Animated/src/Interpolation.js
.*/node_modules/react-native/Libraries/BugReporting/dumpReactTree.js
.*/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js
.*/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolater.js
.*/node_modules/react-native/Libraries/Experimental/WindowedListView.js
.*/node_modules/react-native/Libraries/Image/Image.io.js
.*/node_modules/react-native/Libraries/NavigationExperimental/NavigationExperimental.js
.*/node_modules/react-native/Libraries/NavigationExperimental/NavigationHeaderStyleInterpolator.js
.*/node_modules/react-native/Libraries/Network/FormData.js
.*/node_modules/react-native/Libraries/ReactIOS/YellowBox.js
# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/ErrorUtils.js
# Flow has a built-in definition for the 'react' module which we prefer to use
# over the currently-untyped source
.*/node_modules/react/react.js
.*/node_modules/react/lib/React.js
.*/node_modules/react/lib/ReactDOM.js
.*/__mocks__/.*
.*/__tests__/.*
.*/commoner/test/source/widget/share.js
# Ignore commoner tests
.*/node_modules/commoner/test/.*
# See https://github.com/facebook/flow/issues/442
.*/react-tools/node_modules/commoner/lib/reader.js
# Ignore jest
.*/node_modules/jest-cli/.*
# Ignore Website
.*/website/.*
# Ignore generators
.*/local-cli/generator.*
# Ignore BUCK generated folders
.*\.buckd/
.*/node_modules/is-my-json-valid/test/.*\.json
.*/node_modules/iconv-lite/encodings/tables/.*\.json
.*/node_modules/y18n/test/.*\.json
.*/node_modules/spdx-license-ids/spdx-license-ids.json
.*/node_modules/spdx-exceptions/index.json
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
.*/node_modules/resolve/lib/core.json
.*/node_modules/jsonparse/samplejson/.*\.json
.*/node_modules/json5/test/.*\.json
.*/node_modules/ua-parser-js/test/.*\.json
.*/node_modules/builtin-modules/builtin-modules.json
.*/node_modules/binary-extensions/binary-extensions.json
.*/node_modules/url-regex/tlds.json
.*/node_modules/joi/.*\.json
.*/node_modules/isemail/.*\.json
.*/node_modules/tr46/.*\.json
.*/node_modules/protobufjs/src/bower.json
.*/node_modules/grpc/node_modules/protobufjs/src/bower.json
[include]
node_modules/fbjs/lib
[libs]
lib/flow.js
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
node_modules/fbjs/flow/lib
[options]
module.system=haste
experimental.strict_type_args=true
unsafe.enable_getters_and_setters=true
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
munge_underscores=true
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
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'
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy

62
.gitignore vendored Normal file
View File

@ -0,0 +1,62 @@
node_modules
npm-debug.log
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/
# Android
# Built application files
android/*/build/
# Crashlytics configuations
android/com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
android/local.properties
# Gradle generated files
android/.gradle/
# Signing files
android/.signing/
# User-specific configurations
android/.idea/gradle.xml
android/.idea/libraries/
android/.idea/workspace.xml
android/.idea/tasks.xml
android/.idea/.name
android/.idea/compiler.xml
android/.idea/copyright/profiles_settings.xml
android/.idea/encodings.xml
android/.idea/misc.xml
android/.idea/modules.xml
android/.idea/scopes/scope_settings.xml
android/.idea/vcs.xml
android/*.iml
ios/RnFirebase.xcodeproj/xcuserdata
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.dbandroid/gradle
android/gradlew
android/build
android/gradlew.bat
android/gradle/
.idea
.idea
coverage
yarn.lock

14
.npmignore Normal file
View File

@ -0,0 +1,14 @@
*.swp
*~
*.iml
.*.haste_cache.*
.DS_Store
.idea
.babelrc
.eslintrc
npm-debug.log
src/
examples/
public/
scripts/
test/

11
.watchmanconfig Normal file
View File

@ -0,0 +1,11 @@
{
"ignore_dirs": [
".git",
"node_modules",
"android/build",
"android/.idea",
"android/.gradle",
"android/gradle",
".idea"
]
}

19
LICENSE Normal file
View File

@ -0,0 +1,19 @@
Copyright (c) 2017 Mike Diarmid <mike@invertase.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

49
README.md Normal file
View File

@ -0,0 +1,49 @@
# React Native Firebase
RNFirebase makes using the latest [Firebase](http://firebase.com) with React Native straight-forward.
```
npm i react-native-firebase --save
```
[![Gitter](https://badges.gitter.im/invertase/react-native-firebase.svg)](https://gitter.im/invertase/react-native-firebase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![npm version](https://img.shields.io/npm/v/react-native-firebase.svg)](https://www.npmjs.com/package/react-native-firebase)
[![License](https://img.shields.io/npm/l/react-native-firebase.svg)](/LICENSE)
RNFirebase is a _light-weight_ layer sitting on-top of the native Firebase libraries for both iOS and Android which mirrors the React Native JS api as closely as possible.
Featuring; authentication, storage, real-time database, presence, analytics, cloud messaging, remote configuration, redux support and more!
## RNFirebase vs Firebase JS lib
Although the [Firebase](https://www.npmjs.com/package/firebase) JavaScript library will work with React Native, it is mainly designed for the web.
The native SDK's are much better for performance compared to the web SDK. The web SDK will run on the same thread as your apps ([JS thread](https://facebook.github.io/react-native/docs/performance.html#javascript-frame-rate)) therefore limiting your JS framerate, potentially affecting things touch events and transitions/animations.
The native SDK's also contains functionality that the web SDK's do not, for example [Analytics](/docs/api/analytics.md) and [Remote Config](/docs/api/remote-config.md).
## Example app
We have a working application example available in at [invertase/firebase-app](https://github.com/invertase/firebase-app). Check it out for more details about how to use firebase with react native.
## Documentation
* Installation
* [iOS](docs/installation.ios.md)
* [Android](docs/installation.android.md)
* [Firebase Setup](docs/firebase-setup.md)
* API
* [Authentication](docs/api/authentication.md)
* [Analytics](docs/api/analytics.md)
* [Storage](docs/api/storage.md)
* [Realtime Database](docs/api/database.md)
* [Presence](docs/api/presence.md)
* [ServerValue](docs/api/server-value.md)
* [Cloud Messaging](docs/api/cloud-messaging.md)
* [Remote Config](docs/api/remote-config.md)
* [Events](docs/api/events.md)
* [Redux](docs/redux.md)
## Contributing
- TODO

28
RNFirebase.podspec Normal file
View File

@ -0,0 +1,28 @@
require 'json'
package = JSON.parse(File.read('package.json'))
Pod::Spec.new do |s|
s.name = "RNFirebase"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
Wanna integrate firebase into your app using React Native?
DESC
s.homepage = "http://invertase.io"
s.license = package['license']
s.author = "Mike Diarmid"
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" }
s.social_media_url = 'http://twitter.com/invertaseio'
s.platform = :ios, "8.0"
s.header_dir = 'ios/RNFirebase'
s.preserve_paths = 'README.md', 'package.json', '*.js'
s.source_files = 'ios/RNFirebase/*.{h,m}'
s.dependency 'React'
s.dependency 'Firebase/Auth'
s.dependency 'Firebase/Core'
s.dependency 'Firebase/Database'
s.dependency 'Firebase/Messaging'
s.dependency 'Firebase/RemoteConfig'
s.dependency 'Firebase/Storage'
end

5
firebase.android.js Normal file
View File

@ -0,0 +1,5 @@
/**
* @flow
*/
import firebase from './lib/firebase';
export default firebase;

5
firebase.ios.js Normal file
View File

@ -0,0 +1,5 @@
/**
* @flow
*/
import firebase from './lib/firebase';
export default firebase;

2
index.js Normal file
View File

@ -0,0 +1,2 @@
import Firebase from './firebase';
export default Firebase;

89
package.json Normal file
View File

@ -0,0 +1,89 @@
{
"name": "react-native-firebase",
"version": "1.0.0-alpha",
"author": "Invertase <contact@invertase.io> (http://invertase.io)",
"description": "A react native firebase adapter supporting android and ios.",
"main": "index",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"build": "./node_modules/.bin/babel --source-maps=true --out-dir=dist .",
"dev": "npm run compile -- --watch",
"lint": "eslint ./src",
"publish_pages": "gh-pages -d public/",
"test": "./node_modules/.bin/mocha",
"watchcpx": "echo 'See https://github.com/wix/wml for watching changes. \r\n'"
},
"repository": {
"type": "git",
"url": "https://github.com/invertase/react-native-firebase.git"
},
"jest": {
"preset": "jest-react-native",
"setupFiles": [],
"unmockedModulePathPatterns": [
"./node_modules/react",
"./node_modules/react-native",
"./node_modules/react-native-mock",
"./node_modules/react-addons-test-utils"
]
},
"license": "MIT",
"keywords": [
"react",
"react-native",
"react-native-firebase",
"firebase",
"fcm",
"analytics",
"messaging",
"database",
"android",
"ios",
"crash",
"firestack"
],
"peerDependencies": {
"react": "*",
"react-native": "*"
},
"rnpm": {
"commands": {
"prelink": "node_modules/react-native-firebase/bin/prepare.sh",
"postlink": "node_modules/react-native-firebase/bin/cocoapods.sh"
},
"ios": {
"project": "ios/Firebase.xcodeproj"
},
"android": {
"packageInstance": "new FirebasePackage()"
}
},
"devDependencies": {
"babel-eslint": "^7.0.0",
"babel-jest": "^14.1.0",
"babel-preset-react-native": "^1.9.0",
"cpx": "^1.5.0",
"debug": "^2.2.0",
"enzyme": "^2.4.1",
"eslint": "^3.8.1",
"eslint-config-airbnb": "^12.0.0",
"eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-import": "^2.0.1",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.4.1",
"flow-bin": "^0.35.0",
"jest": "^14.1.0",
"jest-react-native": "^14.1.3",
"mocha": "^3.0.2",
"react": "^15.3.0",
"react-dom": "^15.3.0",
"react-native-mock": "^0.2.6",
"react-test-renderer": "^15.3.0",
"should": "^11.1.0",
"sinon": "^2.0.0-pre.2"
},
"dependencies": {
"bows": "^1.6.0",
"es6-symbol": "^3.1.0"
}
}