Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…rebase into @salakar/v6/mlkit

# Conflicts:
#	packages/ml/package.json
#	packages/template/package.json
#	packages/template/project/package.json
#	tests/package.json

[skip ci]
  • Loading branch information
Salakar committed May 21, 2019
2 parents c737dea + e62621a commit f5a173f
Show file tree
Hide file tree
Showing 69 changed files with 761 additions and 242 deletions.
2 changes: 1 addition & 1 deletion docs/admob/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of AdMob in React Native Firebase
Install this module with Yarn:

```bash
yarn add @react-native-firebase/admob
yarn add @react-native-firebase/admob@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/analytics/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Analytics in React Native Firebase
Install this module with Yarn:

```bash
yarn add @react-native-firebase/analytics
yarn add @react-native-firebase/analytics@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/app/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of the App package in React Native Fir
Install this module with Yarn:

```bash
yarn add @react-native-firebase/app
yarn add @react-native-firebase/app@alpha
```

### Initializing Firebase
Expand Down
2 changes: 1 addition & 1 deletion docs/auth/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Authentication in React Native Fire
Install this module with Yarn:

```bash
yarn add @react-native-firebase/auth
yarn add @react-native-firebase/auth@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/config/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Remote Config in React Native Fireb
Install this module with Yarn:

```bash
yarn add @react-native-firebase/config
yarn add @react-native-firebase/config@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/crashlytics/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Crashlytics in React Native Firebas
Install this module with Yarn:

```bash
yarn add @react-native-firebase/crashlytics
yarn add @react-native-firebase/crashlytics@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/database/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Realtime Database in React Native F
Install this module with Yarn:

```bash
yarn add @react-native-firebase/database
yarn add @react-native-firebase/database@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/fiam/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Firebase In-App Messaging in React
Install this module with Yarn:

```bash
yarn add @react-native-firebase/fiam
yarn add @react-native-firebase/fiam@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Cloud Functions in React Native Fir
Install this module with Yarn:

```bash
yarn add @react-native-firebase/functions
yarn add @react-native-firebase/functions@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/iid/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Using Instance ID in your React Native application.
Install this module with Yarn:

```bash
yarn add @react-native-firebase/iid
yarn add @react-native-firebase/iid@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor>. iOS requires no additional steps.
Expand Down
2 changes: 1 addition & 1 deletion docs/invites/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Invites in React Native Firebase
Install this module with Yarn:

```bash
yarn add @react-native-firebase/invites
yarn add @react-native-firebase/invites@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/links/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Messaging in React Native Firebase
Install this module with Yarn:

```bash
yarn add @react-native-firebase/messaging
yarn add @react-native-firebase/messaging@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/messaging/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Messaging in React Native Firebase
Install this module with Yarn:

```bash
yarn add @react-native-firebase/messaging
yarn add @react-native-firebase/messaging@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/ml-kit/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of ML Kit in React Native Firebase
Install this module with Yarn:

```bash
yarn add @react-native-firebase/mlkit
yarn add @react-native-firebase/mlkit@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/notifications/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Notifications in React Native Fireb
Install this module with Yarn:

```bash
yarn add @react-native-firebase/notifications
yarn add @react-native-firebase/notifications@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/perf/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Performance Monitoring in React Nat
Install this module with Yarn:

```bash
yarn add @react-native-firebase/perf
yarn add @react-native-firebase/perf@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/storage/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of Cloud Storage in React Native Fireb
Install this module with Yarn:

```bash
yarn add @react-native-firebase/storage
yarn add @react-native-firebase/storage@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion docs/utils/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Get to grips with the basics of the Utils package in React Native F
Install this module with Yarn:

```bash
yarn add @react-native-firebase/utils
yarn add @react-native-firebase/utils@alpha
```

> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
]
}
},
"version": "6.0.0-alpha.11"
"version": "6.0.0-alpha.21"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"lerna:link": "lerna link && lerna exec -- yarn link",
"gen:reference": "node scripts/generate-typedoc.js",
"tests:packager:chrome": "cd tests && react-native start --platforms ios,android",
"tests:packager:jet": "REACT_DEBUGGER='echo nope' cd tests && react-native start",
"tests:packager:jet-reset-cache": "REACT_DEBUGGER='echo nope' cd tests && react-native start --reset-cache",
"tests:packager:jet": "cd tests && cross-env REACT_DEBUGGER=\"echo nope\" react-native start",
"tests:packager:jet-reset-cache": "cd tests & cross-env REACT_DEBUGGER=\"echo nope\" react-native start --reset-cache",
"tests:android:build": "cd tests && ./node_modules/.bin/detox build --configuration android.emu.debug",
"tests:android:build-release": "cd tests && ./node_modules/.bin/detox build --configuration android.emu.release",
"tests:android:test": "cd tests && ./node_modules/.bin/detox test --configuration android.emu.debug",
Expand Down Expand Up @@ -48,6 +48,7 @@
"@invertase/babel-preset-react-native-syntax": "^0.1.3",
"babel-eslint": "^10.0.1",
"codecov": "^3.2.0",
"cross-env": "^5.2.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'json'
package = JSON.parse(File.read('../package.json'))
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "RNFBAnalytics"
Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
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, "10.0"
s.source_files = 'RNFBAnalytics/**/*.{h,m}'
s.source_files = 'ios/**/*.{h,m}'
s.dependency 'React'
s.dependency 'Firebase/Core', '~> 5.20.2'
s.dependency 'RNFBApp'
Expand Down
8 changes: 4 additions & 4 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/analytics",
"version": "6.0.0-alpha.11",
"version": "6.0.0-alpha.21",
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
"description": "React Native Firebase - Analytics",
"main": "lib/index.js",
Expand All @@ -25,10 +25,10 @@
"@react-native-firebase/app": "*"
},
"dependencies": {
"@react-native-firebase/app-types": "6.0.0-alpha.11",
"@react-native-firebase/common": "6.0.0-alpha.11"
"@react-native-firebase/app-types": "6.0.0-alpha.21",
"@react-native-firebase/common": "6.0.0-alpha.21"
},
"gitHead": "664631546eb1775e1271f73235f9ace6c0f0c744",
"gitHead": "53e456afd3f9bdc4bf40ad385c8f3bf1cc20585c",
"publishConfig": {
"access": "public"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/app-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/app-types",
"version": "6.0.0-alpha.11",
"version": "6.0.0-alpha.21",
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
"description": "@react-native-firebase/app-types",
"files": [
Expand All @@ -13,7 +13,7 @@
"url": "https://github.com/invertase/react-native-firebase/tree/master/packages/app-types"
},
"license": "Apache-2.0",
"gitHead": "664631546eb1775e1271f73235f9ace6c0f0c744",
"gitHead": "53e456afd3f9bdc4bf40ad385c8f3bf1cc20585c",
"publishConfig": {
"access": "public"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'json'
package = JSON.parse(File.read('../package.json'))
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "RNFBApp"
Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
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, "10.0"
s.source_files = 'RNFBApp/**/*.{h,m}'
s.source_files = "ios/**/*.{h,m}"
s.dependency 'React'
s.dependency 'Firebase/Core', '~> 5.20.2'
s.static_framework = true
Expand Down
9 changes: 8 additions & 1 deletion packages/app/android/firebase-json.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ if (jsonFile != null && jsonFile.exists()) {
buildConfigField "String", "FIREBASE_JSON_RAW", jsonStr
}
}
} else {
rootProject.logger.info ":${project.name} firebase.json found with no react-native config, skipping"
android {
defaultConfig {
buildConfigField "String", "FIREBASE_JSON_RAW", '"{}"'
}
}
}
} else {
rootProject.logger.info ":${project.name} no firebase.json found, skipping"
Expand All @@ -48,4 +55,4 @@ if (jsonFile != null && jsonFile.exists()) {
buildConfigField "String", "FIREBASE_JSON_RAW", '"{}"'
}
}
}
}
2 changes: 1 addition & 1 deletion packages/app/ios_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ for plist in ${_TARGET_PLIST} ${_DSYM_PLIST} ; do
setPlistValue ${_PLIST_ENTRY_KEYS[$i]} ${_PLIST_ENTRY_TYPES[$i]} ${_PLIST_ENTRY_VALUES[$i]} ${plist}
done
else
echo "warning: A plist file was not found"
echo "warning: A Info.plist build output file was not found (${plist})"
fi
done

Expand Down
8 changes: 4 additions & 4 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-firebase/app",
"version": "6.0.0-alpha.11",
"version": "6.0.0-alpha.21",
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
"description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.",
"main": "lib/index.js",
Expand Down Expand Up @@ -53,15 +53,15 @@
"react-native": "*"
},
"dependencies": {
"@react-native-firebase/app-types": "6.0.0-alpha.11",
"@react-native-firebase/common": "6.0.0-alpha.11",
"@react-native-firebase/app-types": "6.0.0-alpha.21",
"@react-native-firebase/common": "6.0.0-alpha.21",
"opencollective-postinstall": "^2.0.1"
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/react-native-firebase"
},
"gitHead": "664631546eb1775e1271f73235f9ace6c0f0c744",
"gitHead": "53e456afd3f9bdc4bf40ad385c8f3bf1cc20585c",
"publishConfig": {
"access": "public"
}
Expand Down
64 changes: 33 additions & 31 deletions packages/app/pod_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,48 @@
#

require 'json'

class String
def red; "\e[31m#{self}\e[0m" end
def green; "\e[32m#{self}\e[0m" end
def brown; "\e[33m#{self}\e[0m" end
def cyan; "\e[36m#{self}\e[0m" end
def gray; "\e[37m#{self}\e[0m" end
def bold; "\e[1m#{self}\e[22m" end
def underline; "\e[4m#{self}\e[24m" end
end
require 'pathname'

def react_native_firebase!(config = {})
react_native_firebase_path = config.fetch(:react_native_firebase_path, '../node_modules/@react-native-firebase')
known_firebase_modules = %w(app auth analytics config crashlytics fiam functions firestore iid invites perf utils storage)
discovered_firebase_modules = Pathname.new(react_native_firebase_path).children.select(&:directory?).sort

# TODO(salakar): validate versions / set pod versions
app_package = JSON.parse(File.read("#{react_native_firebase_path}/#{known_firebase_modules[0]}/package.json"))
app_package_version = app_package['version']
app_package = JSON.parse(File.read(File.join(react_native_firebase_path, 'app', 'package.json')))
app_version = app_package['version']

puts "Using React Native Firebase version '#{app_package_version}'".cyan
puts " -> Detecting Firebase modules...".cyan
Pod::UI.puts "Using React Native Firebase version '#{app_version}'"
Pod::UI.puts ' -> Detecting Firebase modules...'

known_firebase_modules.each {|firebase_module|
firebase_module_name = firebase_module.slice(0, 1).capitalize + firebase_module.slice(1..-1)
firebase_module_pod = "RNFB#{firebase_module_name}"
firebase_module_dir = "#{react_native_firebase_path}/#{firebase_module}"
firebase_module_build_script = "#{react_native_firebase_path}/#{firebase_module}/ios_config.sh"
discovered_firebase_modules.each do |module_dir|
module_name = File.basename(module_dir)
module_podspec_name = "RNFB#{module_name.capitalize}"
next if %w[private-tests-helpers app-types template common].include? module_name

if File.directory?(firebase_module_dir) then
pod firebase_module_pod, :path => "#{firebase_module_dir}/ios"
module_podspec_path = File.join(module_dir, "#{module_podspec_name}.podspec")
next unless File.exist?(module_podspec_path)

module_spec = Pod::Specification.from_file(module_podspec_path)
next if current_target_definition.dependencies.find do |existing_dep|
existing_dep.name.split('/').first == module_spec.name
end

if File.exist?(firebase_module_build_script) then
puts " ✓ #{firebase_module_name} (+ build script)".green
script_phase :name => "RNFB #{firebase_module_name} Build Script", :script => File.read(firebase_module_build_script), :execution_position => :after_compile, :input_files => ['$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)']
else
puts " ✓ #{firebase_module_name}".green
end
pod module_podspec_name, :path => module_dir

module_build_script = File.join(module_dir, 'ios_config.sh')
module_package_json = JSON.parse(File.read(File.join(module_dir, 'package.json')))
module_version = module_package_json['version']

if module_version != app_version
Pod::UI.warn "Firebase #{module_name} has a different version than the Core/App Firebase module:"
Pod::UI.warn " -> Found #{module_version} but expected #{app_version}"
Pod::UI.warn ' -> Mixing versions is not recommended and may cause some incompatibility issues'
end

if File.exist?(module_build_script)
Pod::UI.puts " ✓ Discovered '#{module_name}' (+ build script)"
script_phase :name => "RNFB #{module_name} Build Script", :script => File.read(module_build_script), :execution_position => :after_compile, :input_files => ['$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)']
else
puts " x #{firebase_module_name}".brown
Pod::UI.puts " ✓ Discovered '#{module_name}'"
end
}
end
end
Loading

0 comments on commit f5a173f

Please sign in to comment.