Merge branch 'rn-0.59x' into 'master'

React Native 0.59.x

See merge request edb/dusken-client!3
This commit is contained in:
nikolark committed 2019-05-04 23:46:20 +02:00
commit ab77f9dea9
69 files changed
+6351 -3505

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
{
"presets": ["react-native"]
}
+1
View File
@@ -1,3 +1,4 @@
[android] [android]
target = Google Inc.:Google APIs:23 target = Google Inc.:Google APIs:23
+27 -6
View File
@@ -16,6 +16,9 @@
; Ignore polyfills ; Ignore polyfills
.*/Libraries/polyfills/.* .*/Libraries/polyfills/.*
; Ignore metro
.*/node_modules/metro/.*
[include] [include]
[libs] [libs]
@@ -25,24 +28,42 @@ node_modules/react-native/flow/
[options] [options]
emoji=true emoji=true
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
module.system=haste module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
munge_underscores=true munge_underscores=true
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' 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'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
suppress_type=$FlowIssue suppress_type=$FlowIssue
suppress_type=$FlowFixMe suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState suppress_type=$FlowFixMeState
suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true
[version] [version]
^0.57.0 ^0.92.0
+92 -76
View File
@@ -1,84 +1,89 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
CFPropertyList (2.3.6) CFPropertyList (3.0.0)
activesupport (4.2.10) activesupport (4.2.11.1)
i18n (~> 0.7) i18n (~> 0.7)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.5.2) addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0) public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.3)
babosa (1.0.2) babosa (1.0.2)
claide (1.0.2) claide (1.0.2)
cocoapods (1.3.1) cocoapods (1.6.1)
activesupport (>= 4.0.2, < 5) activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0) claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.3.1) cocoapods-core (= 1.6.1)
cocoapods-deintegrate (>= 1.0.1, < 2.0) cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.1.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.2.0, < 2.0) cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1) colored2 (~> 3.1)
escape (~> 0.0.4) escape (~> 0.0.4)
fourflusher (~> 2.0.1) fourflusher (>= 2.2.0, < 3.0)
gh_inspector (~> 1.0) gh_inspector (~> 1.0)
molinillo (~> 0.5.7) molinillo (~> 0.6.6)
nap (~> 1.0) nap (~> 1.0)
ruby-macho (~> 1.1) ruby-macho (~> 1.4)
xcodeproj (>= 1.5.1, < 2.0) xcodeproj (>= 1.8.1, < 2.0)
cocoapods-core (1.3.1) cocoapods-core (1.6.1)
activesupport (>= 4.0.2, < 6) activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4) fuzzy_match (~> 2.0.4)
nap (~> 1.0) nap (~> 1.0)
cocoapods-deintegrate (1.0.1) cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.1.3) cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0) cocoapods-plugins (1.0.0)
nap nap
cocoapods-search (1.0.0) cocoapods-search (1.0.0)
cocoapods-stats (1.0.0) cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.0) cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0) nap (>= 0.8, < 2.0)
netrc (~> 0.11) netrc (~> 0.11)
cocoapods-try (1.1.0) cocoapods-try (1.1.0)
colored (1.2) colored (1.2)
colored2 (3.1.2) colored2 (3.1.2)
commander-fastlane (4.4.5) commander-fastlane (4.4.6)
highline (~> 1.7.2) highline (~> 1.7.2)
concurrent-ruby (1.0.5) concurrent-ruby (1.1.5)
declarative (0.0.10) declarative (0.0.10)
declarative-option (0.1.0) declarative-option (0.1.0)
domain_name (0.5.20170404) digest-crc (0.4.1)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1) dotenv (2.7.2)
emoji_regex (1.0.1)
escape (0.0.4) escape (0.0.4)
excon (0.60.0) excon (0.64.0)
faraday (0.13.1) faraday (0.15.4)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6) faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4) faraday (>= 0.7.4)
http-cookie (~> 1.0.0) http-cookie (~> 1.0.0)
faraday_middleware (0.12.2) faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0) faraday (>= 0.7.4, < 1.0)
fastimage (2.1.1) fastimage (2.1.5)
fastlane (2.73.0) fastlane (2.122.0)
CFPropertyList (>= 2.3, < 3.0.0) CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0) addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0) babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0) bundler (>= 1.12.0, < 3.0.0)
colored colored
commander-fastlane (>= 4.4.5, < 5.0.0) commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0) dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 2.0)
excon (>= 0.45.0, < 1.0.0) excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9) faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6) faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9) faraday_middleware (~> 0.9)
fastimage (>= 2.1.0, < 3.0.0) fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.0.1, < 2.0.0) gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.13.1, < 0.14.0) google-api-client (>= 0.21.2, < 0.24.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0) highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0) json (< 3.0.0)
mini_magick (~> 4.5.1) mini_magick (~> 4.5.1)
@@ -87,100 +92,111 @@ GEM
multipart-post (~> 2.0.0) multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0) plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0) public_suffix (~> 2.0.0)
rubyzip (>= 1.1.0, < 2.0.0) rubyzip (>= 1.2.2, < 2.0.0)
security (= 0.1.3) security (= 0.1.3)
slack-notifier (>= 1.3, < 2.0.0) simctl (~> 1.6.3)
terminal-notifier (>= 1.6.2, < 2.0.0) slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0) terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0) tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.7.0, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0) word_wrap (~> 1.0.0)
xcodeproj (>= 1.5.2, < 2.0.0) xcodeproj (>= 1.8.1, < 2.0.0)
xcpretty (>= 0.2.4, < 1.0.0) xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3) xcpretty-travis-formatter (>= 0.0.3)
fourflusher (2.0.1) fourflusher (2.2.0)
fuzzy_match (2.0.4) fuzzy_match (2.0.4)
gh_inspector (1.0.3) gh_inspector (1.1.3)
google-api-client (0.13.6) google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1) addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.5) googleauth (>= 0.5, < 0.7.0)
httpclient (>= 2.8.1, < 3.0) httpclient (>= 2.8.1, < 3.0)
mime-types (~> 3.0) mime-types (~> 3.0)
representable (~> 3.0) representable (~> 3.0)
retriable (>= 2.0, < 4.0) retriable (>= 2.0, < 4.0)
googleauth (0.6.2) signet (~> 0.9)
google-cloud-core (1.3.0)
google-cloud-env (~> 1.0)
google-cloud-env (1.0.5)
faraday (~> 0.11)
google-cloud-storage (1.16.0)
digest-crc (~> 0.4)
google-api-client (~> 0.23)
google-cloud-core (~> 1.2)
googleauth (>= 0.6.2, < 0.10.0)
googleauth (0.6.7)
faraday (~> 0.12) faraday (~> 0.12)
jwt (>= 1.4, < 3.0) jwt (>= 1.4, < 3.0)
logging (~> 2.0) memoist (~> 0.16)
memoist (~> 0.12)
multi_json (~> 1.11) multi_json (~> 1.11)
os (~> 0.9) os (>= 0.9, < 2.0)
signet (~> 0.7) signet (~> 0.7)
highline (1.7.10) highline (1.7.10)
http-cookie (1.0.3) http-cookie (1.0.3)
domain_name (~> 0.5) domain_name (~> 0.5)
httpclient (2.8.3) httpclient (2.8.3)
i18n (0.9.1) i18n (0.9.5)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.1.0) json (2.2.0)
jwt (2.1.0) jwt (2.1.0)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
memoist (0.16.0) memoist (0.16.0)
mime-types (3.1) mime-types (3.2.2)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2019.0331)
mini_magick (4.5.1) mini_magick (4.5.1)
minitest (5.11.1) minitest (5.11.3)
molinillo (0.5.7) molinillo (0.6.6)
multi_json (1.12.2) multi_json (1.13.1)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.0.0) multipart-post (2.0.0)
nanaimo (0.2.3) nanaimo (0.2.6)
nap (1.1.0) nap (1.1.0)
naturally (2.2.0)
netrc (0.11.0) netrc (0.11.0)
os (0.9.6) os (1.0.1)
plist (3.4.0) plist (3.5.0)
public_suffix (2.0.5) public_suffix (2.0.5)
representable (3.0.4) representable (3.0.4)
declarative (< 0.1.0) declarative (< 0.1.0)
declarative-option (< 0.2.0) declarative-option (< 0.2.0)
uber (< 0.2.0) uber (< 0.2.0)
retriable (3.1.1) retriable (3.1.2)
rouge (2.0.7) rouge (2.0.7)
ruby-macho (1.1.0) ruby-macho (1.4.0)
rubyzip (1.2.1) rubyzip (1.2.2)
security (0.1.3) security (0.1.3)
signet (0.8.1) signet (0.11.0)
addressable (~> 2.3) addressable (~> 2.3)
faraday (~> 0.9) faraday (~> 0.9)
jwt (>= 1.5, < 3.0) jwt (>= 1.5, < 3.0)
multi_json (~> 1.10) multi_json (~> 1.10)
slack-notifier (1.5.1) simctl (1.6.5)
terminal-notifier (1.8.0) CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0) terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1) unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6) thread_safe (0.3.6)
tty-cursor (0.5.0) tty-cursor (0.6.1)
tty-screen (0.6.4) tty-screen (0.6.5)
tty-spinner (0.7.0) tty-spinner (0.9.0)
tty-cursor (>= 0.5.0) tty-cursor (~> 0.6.0)
tzinfo (1.2.4) tzinfo (1.2.5)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uber (0.1.0) uber (0.1.0)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.4) unf_ext (0.0.7.6)
unicode-display_width (1.3.0) unicode-display_width (1.5.0)
word_wrap (1.0.0) word_wrap (1.0.0)
xcodeproj (1.5.4) xcodeproj (1.9.0)
CFPropertyList (~> 2.3.3) CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0) claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1) colored2 (~> 3.1)
nanaimo (~> 0.2.3) nanaimo (~> 0.2.6)
xcpretty (0.2.8) xcpretty (0.3.0)
rouge (~> 2.0.7) rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0) xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7) xcpretty (~> 0.2, >= 0.0.7)
+6 -2
View File
@@ -12,12 +12,16 @@
## Development ## Development
# Improve compile times # Improve compile times
touch ~/.gradle/gradle.properties && echo -e "org.gradle.daemon=true\norg.gradle.jvmargs=-Xmx2048M" >> ~/.gradle/gradle.properties touch ~/.gradle/gradle.properties && echo -e "org.gradle.daemon=true\norg.gradle.jvmargs=-Xmx2048M" >> ~/.gradle/gradle.properties
# Run android emulator (first avd) # Run android emulator (first avd)
yarn emulator yarn emulator
# Make sure you have hw.keyboard=yes in your avd config.ini (in $HOME/.android/avd/.../) for reloading when pressing R twice to work. # Make sure you have hw.keyboard=yes in your avd config.ini (in $HOME/.android/avd/.../) for reloading when pressing R twice to work.
### Linking native dependencies
We use a Podfile to install the stripe ios library, but not for anything else.
Before running any `react-native link` commands, rename `ios/Podfile` to something else before running, then rename the file back when you are done.
This is to let the react-native CLI know we use the Dusken xcode project and not cocoapods for managing all other dependencies.
This avoids alot of issues resulting from poor cocoapods support by react native.
## Prepare release build ## Prepare release build
# Fastlane # Fastlane
bundle update bundle update
+2
View File
@@ -1,6 +1,8 @@
import 'react-native'; import 'react-native';
import React from 'react'; import React from 'react';
import App from '../src/App'; import App from '../src/App';
import 'isomorphic-fetch'; import 'isomorphic-fetch';
// Note: test renderer must be required after react-native. // Note: test renderer must be required after react-native.
+4 -14
View File
@@ -8,23 +8,13 @@
# - `buck install -r android/app` - compile, install and run application # - `buck install -r android/app` - compile, install and run application
# #
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
lib_deps = [] lib_deps = []
for jarfile in glob(['libs/*.jar']): create_aar_targets(glob(["libs/*.aar"]))
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
for aarfile in glob(['libs/*.aar']): create_jar_targets(glob(["libs/*.jar"]))
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
android_library( android_library(
name = "all-libs", name = "all-libs",
+23 -34
View File
@@ -78,7 +78,6 @@ project.ext.react = [
] ]
apply from: "../../node_modules/react-native/react.gradle" apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
/** /**
* Set this to true to create two separate APKs instead of one: * Set this to true to create two separate APKs instead of one:
@@ -96,47 +95,34 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false def enableProguardInReleaseBuilds = false
android { android {
compileSdkVersion 26 compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion "26.0.2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig { defaultConfig {
applicationId "no.neuf.chateau" applicationId "no.neuf.chateau"
minSdkVersion 16 minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion 23 targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 21 versionCode 21
versionName "1.2.2" versionName "1.2.2"
ndk {
abiFilters "armeabi-v7a", "x86"
}
manifestPlaceholders = [
tipsiStripeRedirectScheme: "wedontusethis"
]
} }
splits { splits {
abi { abi {
reset() reset()
enable enableSeparateBuildPerCPUArchitecture enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86" include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
} }
} }
signingConfigs { signingConfigs {
release { release {
// locally storeFile file(DUSKEN_RELEASE_STORE_FILE)
if (project.hasProperty('DUSKEN_RELEASE_STORE_FILE')) { storePassword DUSKEN_RELEASE_STORE_PASSWORD
storeFile file(DUSKEN_RELEASE_STORE_FILE) keyAlias DUSKEN_RELEASE_KEY_ALIAS
storePassword DUSKEN_RELEASE_STORE_PASSWORD keyPassword DUSKEN_RELEASE_KEY_PASSWORD
keyAlias DUSKEN_RELEASE_KEY_ALIAS
keyPassword DUSKEN_RELEASE_KEY_PASSWORD
}
// bitrise.io
else if (System.getenv('BITRISEIO_ANDROID_KEYSTORE_URL')) {
storeFile file(System.getenv("HOME") + "/keystores/my_keystore.jks")
storePassword System.getenv("BITRISEIO_ANDROID_KEYSTORE_PASSWORD")
keyAlias System.getenv("BITRISEIO_ANDROID_KEYSTORE_ALIAS")
keyPassword System.getenv("BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD")
}
} }
} }
buildTypes { buildTypes {
@@ -151,7 +137,7 @@ android {
variant.outputs.each { output -> variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here: // For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2] def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI) def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride = output.versionCodeOverride =
@@ -162,12 +148,15 @@ android {
} }
dependencies { dependencies {
compile project(':tipsi-stripe') implementation project(':@react-native-community_async-storage')
compile project(':react-native-sentry') implementation project(':react-native-sentry')
compile project(':react-native-config') implementation project(':tipsi-stripe')
compile fileTree(dir: "libs", include: ["*.jar"]) implementation project(':react-native-vector-icons')
compile "com.android.support:appcompat-v7:23.0.1" implementation project(':react-native-config')
compile "com.facebook.react:react-native:+" // From node_modules implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
} }
// Run this once to be able to run the application with BUCK // Run this once to be able to run the application with BUCK
+19
View File
@@ -0,0 +1,19 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
-53
View File
@@ -15,56 +15,3 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *; # public *;
#} #}
# Disabling obfuscation is useful if you collect stack traces from production crashes
# (unless you are using a system that supports de-obfuscate the stack traces).
-dontobfuscate
# React Native
# Keep our interfaces so they can be used by other ProGuard rules.
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
}
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
void set*(***);
*** get*();
}
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
-dontwarn com.facebook.react.**
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout
# okhttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
# okio
-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<!-- These are added by React Native for debug mode, but actually aren't needed in release mode -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" tools:node="remove" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
</manifest>
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
</manifest>
+2 -16
View File
@@ -1,27 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="no.neuf.chateau">
package="no.neuf.chateau"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- These permissions are added implicitly by android-jsc, see https://github.com/facebook/android-jsc/pull/12 -->
<!-- The following lines can be removed after android-jsc is updated in react-native -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application <application
android:name=".MainApplication" android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View File
File mode changed.
@@ -3,10 +3,12 @@ package no.neuf.chateau;
import android.app.Application; import android.app.Application;
import com.facebook.react.ReactApplication; import com.facebook.react.ReactApplication;
import com.gettipsi.stripe.StripeReactPackage; import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import io.sentry.RNSentryPackage; import io.sentry.RNSentryPackage;
import com.gettipsi.stripe.StripeReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import com.facebook.react.ReactInstanceManager; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage; import com.facebook.react.shell.MainReactPackage;
@@ -27,9 +29,12 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() { protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList( return Arrays.<ReactPackage>asList(
new MainReactPackage(), new MainReactPackage(),
new AsyncStoragePackage(),
new RNSentryPackage(),
new StripeReactPackage(), new StripeReactPackage(),
new RNSentryPackage(MainApplication.this), new VectorIconsPackage(),
new ReactNativeConfigPackage() new ReactNativeConfigPackage(),
new RNGestureHandlerPackage()
); );
} }
+10 -4
View File
@@ -1,11 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories { repositories {
google()
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
@@ -16,10 +24,8 @@ allprojects {
repositories { repositories {
// Add jitpack repository (added by tipsi-stripe) // Add jitpack repository (added by tipsi-stripe)
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven {
url "https://maven.google.com"
}
mavenLocal() mavenLocal()
google()
jcenter() jcenter()
maven { maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
+5 -3
View File
@@ -3,9 +3,7 @@
# update_fastlane # update_fastlane
fastlane_version "2.73.0" default_platform(:android)
default_platform :android
platform :android do platform :android do
desc "Submit a new build to the Google Play Beta track" desc "Submit a new build to the Google Play Beta track"
@@ -18,4 +16,8 @@ platform :android do
slack(message: "Chateau Neuf app build uploaded to Google Play") slack(message: "Chateau Neuf app build uploaded to Google Play")
end end
lane :build do
gradle(task: "assembleRelease")
end
end end
+10 -7
View File
@@ -8,13 +8,11 @@ Make sure you have the latest version of the Xcode command line tools installed:
xcode-select --install xcode-select --install
``` ```
## Choose your installation method: Install _fastlane_ using
```
| Method | OS support | Description | [sudo] gem install fastlane -NV
|----------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| ```
| [Homebrew](http://brew.sh) | macOS | `brew cask install fastlane` | or alternatively using `brew cask install fastlane`
| Installer Script | macOS | [Download the zip file](https://download.fastlane.tools). Then double click on the `install` script (or run it in a terminal window). |
| RubyGems | macOS or Linux with Ruby 2.0.0 or above | `sudo gem install fastlane -NV` |
# Available Actions # Available Actions
## Android ## Android
@@ -23,6 +21,11 @@ xcode-select --install
fastlane android beta fastlane android beta
``` ```
Submit a new build to the Google Play Beta track Submit a new build to the Google Play Beta track
### android build
```
fastlane android build
```
---- ----
-2
View File
@@ -16,5 +16,3 @@
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
android.useDeprecatedNdk=true
Binary file not shown.
+1 -1
View File
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+59 -51
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
############################################################################## ##############################################################################
## ##
@@ -6,47 +6,6 @@
## ##
############################################################################## ##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" PRG="$0"
@@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
fi fi
done done
SAVED="`pwd`" SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&- cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`" APP_HOME="`pwd -P`"
cd "$SAVED" >&- cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -90,7 +89,7 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n` MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Escape application args
function splitJvmOpts() { save () {
JVM_OPTS=("$@") for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
} }
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS APP_ARGS=$(save "$@")
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" # Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
+4 -10
View File
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail goto fail
:init :init
@rem Get command-line arguments, handling Windowz variants @rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args :win9xME_args
@rem Slurp the command line arguments. @rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%* set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute :execute
@rem Setup the command line @rem Setup the command line
+8 -2
View File
@@ -1,9 +1,15 @@
rootProject.name = 'Dusken' rootProject.name = 'Dusken'
include ':tipsi-stripe' include ':@react-native-community_async-storage'
project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android') project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':react-native-sentry' include ':react-native-sentry'
project(':react-native-sentry').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentry/android') project(':react-native-sentry').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentry/android')
include ':tipsi-stripe'
project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-config' include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android') project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':app' include ':app'
+2 -2
View File
@@ -1,4 +1,4 @@
{ {
"name": "Dusken", "name": "Dusken",
"displayName": "Dusken" "displayName": "Chateau Neuf"
} }
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
+3 -1
View File
@@ -3,8 +3,10 @@ import { AppRegistry } from "react-native";
import { Sentry } from 'react-native-sentry'; import { Sentry } from 'react-native-sentry';
import Config from 'react-native-config'; import Config from 'react-native-config';
import {name as appName} from './app.json';
if(Config.SENTRY_DSN) { if(Config.SENTRY_DSN) {
Sentry.config(Config.SENTRY_DSN).install(); Sentry.config(Config.SENTRY_DSN).install();
} }
AppRegistry.registerComponent('Dusken', () => App); AppRegistry.registerComponent(appName, () => App);
File diff suppressed because it is too large. Load diff
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0820" LastUpgradeVersion = "0940"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "NO" parallelizeBuildables = "NO"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0620" LastUpgradeVersion = "0940"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "NO" parallelizeBuildables = "NO"
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+5 -6
View File
@@ -1,15 +1,14 @@
/** /**
* Copyright (c) 2015-present, Facebook, Inc. * Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
*/ */
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate> @interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window; @property (nonatomic, strong) UIWindow *window;
+17 -20
View File
@@ -1,36 +1,24 @@
/** /**
* Copyright (c) 2015-present, Facebook, Inc. * Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
*/ */
#import "AppDelegate.h" #import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h> #import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h> #import <React/RCTRootView.h>
#if __has_include(<React/RNSentry.h>)
#import <React/RNSentry.h> // This is used for versions of react >= 0.40
#else
#import "RNSentry.h" // This is used for versions of react < 0.40
#endif
@implementation AppDelegate @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
NSURL *jsCodeLocation; RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; moduleName:@"Dusken"
initialProperties:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Dusken"
initialProperties:nil
launchOptions:launchOptions];
[RNSentry installWithRootView:rootView];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
@@ -42,4 +30,13 @@
return YES; return YES;
} }
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end @end
+8 -3
View File
@@ -32,6 +32,8 @@
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key> <key>NSExceptionDomains</key>
<dict> <dict>
<key>localhost</key> <key>localhost</key>
@@ -45,16 +47,19 @@
<string></string> <string></string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
<array> <array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string> <string>Entypo.ttf</string>
<string>EvilIcons.ttf</string> <string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string> <string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string> <string>Foundation.ttf</string>
<string>Ionicons.ttf</string> <string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string> <string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string> <string>Octicons.ttf</string>
<string>Roboto_medium.ttf</string>
<string>Roboto.ttf</string>
<string>rubicon-icon-font.ttf</string>
<string>SimpleLineIcons.ttf</string> <string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string> <string>Zocial.ttf</string>
</array> </array>
+3 -5
View File
@@ -1,10 +1,8 @@
/** /**
* Copyright (c) 2015-present, Facebook, Inc. * Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
*/ */
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
+3 -5
View File
@@ -1,10 +1,8 @@
/** /**
* Copyright (c) 2015-present, Facebook, Inc. * Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
*/ */
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
+1 -1
View File
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
+2 -1
View File
@@ -1,5 +1,6 @@
platform :ios, '9.0' platform :ios, '9.0'
target 'Dusken' do target 'Dusken' do
pod 'Stripe', '~> 11.2.0' pod 'Stripe', '~> 14.0.0'
inherit! :search_paths
end end
+9 -5
View File
@@ -1,12 +1,16 @@
PODS: PODS:
- Stripe (11.2.0) - Stripe (14.0.0)
DEPENDENCIES: DEPENDENCIES:
- Stripe (~> 11.2.0) - Stripe (~> 14.0.0)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Stripe
SPEC CHECKSUMS: SPEC CHECKSUMS:
Stripe: 898f83a95d72180c6eb4acd65b2ae6158fc6a8bd Stripe: db29ad197c74aca6fb981e4e8355cf7ebd0fca5a
PODFILE CHECKSUM: 273d0fa628aa24ffc6ca337ff5541ea938e9910c PODFILE CHECKSUM: efbda7a8dd746948fda0c0f77d2a6025b23adc55
COCOAPODS: 1.3.1 COCOAPODS: 1.6.1
+5 -7
View File
@@ -17,7 +17,7 @@ platform :ios do
lane :beta do lane :beta do
increment_build_number increment_build_number
increment_version_number increment_version_number
build_app(scheme: "Dusken") # more options available build_app(scheme: "Dusken")
upload_to_testflight(skip_waiting_for_build_processing: true) upload_to_testflight(skip_waiting_for_build_processing: true)
slack(message: "Chateau Neuf app build uploaded to TestFlight") slack(message: "Chateau Neuf app build uploaded to TestFlight")
end end
@@ -27,16 +27,14 @@ platform :ios do
increment_build_number increment_build_number
increment_version_number increment_version_number
# capture_screenshots # capture_screenshots
build_app(scheme: "Dusken") # more options available build_app(scheme: "Dusken")
upload_to_app_store(force: true) upload_to_app_store(force: true)
# frame_screenshots # frame_screenshots
slack(message: "Chateau Neuf app build uploaded to App Store") slack(message: "Chateau Neuf app build uploaded to App Store")
end end
error do |lane, exception| lane :build do
# slack( build_app(scheme: "Dusken")
# message: exception.message,
# success: false
# )
end end
end end
+9
View File
@@ -0,0 +1,9 @@
module.exports = {
preset: "react-native",
setupFiles: [
"<rootDir>/jestSetup.js"
],
transformIgnorePatterns: [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-navigation|react-navigation-tabs|react-navigation-stack|native-base|@shoutem|tipsi-stripe|redux-persist|@react-native-community)"
]
};
-6
View File
@@ -1,6 +0,0 @@
jest.doMock('tipsi-stripe', () => ({
init: jest.fn(),
}));
jest.doMock('react-dom/server', () => {}, {virtual: true})
global.fetch = require('jest-fetch-mock');
+15
View File
@@ -0,0 +1,15 @@
jest.doMock('tipsi-stripe', () => ({
setOptions: jest.fn(),
}));
jest.doMock('react-dom/server', () => {}, {virtual: true})
global.fetch = require('jest-fetch-mock');
// ref https://github.com/kmagiera/react-native-gesture-handler/issues/344#issuecomment-489208684
import { NativeModules } from 'react-native';
NativeModules.RNGestureHandlerModule = {};
// ref https://github.com/react-native-community/react-native-async-storage/blob/master/docs/Jest-integration.md
import mockAsyncStorage from '@react-native-community/async-storage/jest/async-storage-mock';
jest.mock('@react-native-community/async-storage', () => mockAsyncStorage);
+17
View File
@@ -0,0 +1,17 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
+42 -46
View File
@@ -1,58 +1,54 @@
{ {
"name": "Dusken", "name": "dusken",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start", "android": "react-native run-android",
"test": "jest", "build:android": "cd android && ./gradlew assembleRelease",
"emulator": "emulator -avd $(emulator -list-avds | head)&", "emulator": "emulator -avd $(emulator -list-avds | head)&",
"build-android": "cd android && ./gradlew assembleRelease", "ios": "react-native run-ios",
"release-android": "cd android && bundle exec fastlane beta", "release:android": "cd android && bundle exec fastlane beta",
"release-ios": "cd ios && bundle exec fastlane beta" "release:ios": "cd ios && bundle exec fastlane beta",
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
}, },
"dependencies": { "dependencies": {
"apollo-cache-inmemory": "^1.1.0", "@react-native-community/async-storage": "^1.3.4",
"apollo-client": "^2.0.2", "apollo-cache-inmemory": "^1.5.1",
"apollo-link-http": "^1.1.0", "apollo-client": "^2.5.1",
"email-validator": "^1.1.1", "apollo-link-http": "^1.5.14",
"graphql": "^0.11.7", "email-validator": "^2.0.4",
"graphql-tag": "^2.5.0", "graphql": "^14.2.1",
"moment": "^2.19.4", "graphql-tag": "^2.10.1",
"native-base": "^2.3.5", "moment": "^2.24.0",
"prop-types": "^15.5.10", "native-base": "^2.12.1",
"react": "16.0.0", "prop-types": "^15.7.2",
"react-apollo": "^2.0.0", "react": "16.8.3",
"react-native": "0.51.0", "react-apollo": "^2.5.5",
"react-native-confetti": "^0.0.6", "react-native": "0.59.5",
"react-native-config": "^0.11.2", "react-native-confetti": "^0.1.0",
"react-native-htmlview": "^0.12.1", "react-native-config": "^0.11.7",
"react-native-sentry": "^0.32.0", "react-native-gesture-handler": "^1.2.1",
"react-native-vector-icons": "~4.4.2", "react-native-htmlview": "^0.14.0",
"react-navigation": "^1.0.0-beta.21", "react-native-screens": "^1.0.0-alpha.22",
"react-redux": "^5.0.6", "react-native-sentry": "^0.42.0",
"redux": "^3.7.2", "react-native-vector-icons": "^6.4.2",
"redux-logger": "^3.0.6", "react-navigation": "^3.9.1",
"redux-persist": "^4.10.2", "react-navigation-hooks": "^1.0.0-alpha.2",
"redux-thunk": "^2.2.0", "react-redux": "^7.0.3",
"tipsi-stripe": "^4.5.1" "redux": "^4.0.1",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"tipsi-stripe": "^7.5.0"
}, },
"devDependencies": { "devDependencies": {
"babel-jest": "21.2.0", "@babel/core": "^7.4.4",
"jest": "21.2.1", "@babel/runtime": "^7.4.4",
"babel-jest": "^24.7.1",
"jest": "^24.7.1",
"jest-fetch-mock": "^1.6.5", "jest-fetch-mock": "^1.6.5",
"react-dom": "^16.0.0", "metro-react-native-babel-preset": "^0.54.0",
"react-test-renderer": "16.2.0" "react-dom": "16.8.3",
}, "react-test-renderer": "16.8.3"
"jest": {
"preset": "react-native",
"setupFiles": [
"<rootDir>/jest/setup.js"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|react-navigation|native-base|@shoutem|tipsi-stripe)"
]
},
"resolutions": {
"@sentry/cli": "1.27.0"
} }
} }
+7 -18
View File
@@ -1,10 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Provider} from 'react-redux'; import {Provider} from 'react-redux';
import {applyMiddleware, createStore} from 'redux'; import {PersistGate} from 'redux-persist/es/integration/react'
import logger from 'redux-logger';
import thunk from 'redux-thunk';
import {autoRehydrate, persistStore} from 'redux-persist'
import {AsyncStorage} from 'react-native'
import Config from 'react-native-config'; import Config from 'react-native-config';
import {ApolloClient} from 'apollo-client'; import {ApolloClient} from 'apollo-client';
import {HttpLink} from 'apollo-link-http'; import {HttpLink} from 'apollo-link-http';
@@ -12,15 +8,9 @@ import {InMemoryCache} from 'apollo-cache-inmemory';
import {ApolloProvider} from "react-apollo"; import {ApolloProvider} from "react-apollo";
import Dusken from "./Dusken"; import Dusken from "./Dusken";
import duskenApp from "./reducers"; import {store, persistor} from './reduxStore';
let store = createStore(
duskenApp,
applyMiddleware(...[logger, thunk]),
autoRehydrate()
);
const apolloClient = new ApolloClient({ const apolloClient = new ApolloClient({
link: new HttpLink({uri: `${Config.DUSKEN_API_URL}/api/graphql/`}), link: new HttpLink({uri: `${Config.DUSKEN_API_URL}/api/graphql/`}),
cache: new InMemoryCache() cache: new InMemoryCache()
@@ -30,13 +20,12 @@ export default class App extends Component {
render() { render() {
return ( return (
<Provider store={store}> <Provider store={store}>
<ApolloProvider client={apolloClient}> <PersistGate loading={null} persistor={persistor}>
<Dusken /> <ApolloProvider client={apolloClient}>
</ApolloProvider> <Dusken />
</ApolloProvider>
</PersistGate>
</Provider> </Provider>
) )
} }
} }
// begin periodically persisting the store
persistStore(store, {storage: AsyncStorage});
+5 -4
View File
@@ -6,13 +6,14 @@ import {
userDataFailure, userDataRequest, userDataSuccess, userDataFailure, userDataRequest, userDataSuccess,
membershipChargeFailure, membershipChargeRequest, membershipChargeSuccess, membershipChargeFailure, membershipChargeRequest, membershipChargeSuccess,
} from "./actions"; } from "./actions";
import { fetchWithTimeout } from "./utils";
export function requestLogin(username, password) { export function requestLogin(username, password) {
return (dispatch) => { return (dispatch) => {
// We are now logging in // We are now logging in
dispatch(loginRequest()); dispatch(loginRequest());
return fetch(`${Config.DUSKEN_API_URL}/auth/obtain-token/`, { return fetchWithTimeout(`${Config.DUSKEN_API_URL}/auth/obtain-token/`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Accept': 'application/json', 'Accept': 'application/json',
@@ -47,7 +48,7 @@ export function requestUserData(auth_token) {
// We are now fetching user data // We are now fetching user data
dispatch(userDataRequest()); dispatch(userDataRequest());
return fetch(`${Config.DUSKEN_API_URL}/api/me/`, { return fetchWithTimeout(`${Config.DUSKEN_API_URL}/api/me/`, {
method: 'GET', method: 'GET',
headers: { headers: {
'Accept': 'application/json', 'Accept': 'application/json',
@@ -77,7 +78,7 @@ export function requestRegisterUser(firstName, lastName, email, phoneNumber, pas
return (dispatch) => { return (dispatch) => {
dispatch(registerUserRequest()); dispatch(registerUserRequest());
return fetch(`${Config.DUSKEN_API_URL}/api/user/register/`, { return fetchWithTimeout(`${Config.DUSKEN_API_URL}/api/user/register/`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Accept': 'application/json', 'Accept': 'application/json',
@@ -113,7 +114,7 @@ export function requestMembershipCharge(auth_token, stripe_token, membership_typ
return (dispatch) => { return (dispatch) => {
dispatch(membershipChargeRequest()); dispatch(membershipChargeRequest());
return fetch(`${Config.DUSKEN_API_URL}/api/membership/charge/`, { return fetchWithTimeout(`${Config.DUSKEN_API_URL}/api/membership/charge/`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Accept': 'application/json', 'Accept': 'application/json',
+3 -2
View File
@@ -1,4 +1,5 @@
import {StyleSheet, View, SectionList, Platform} from "react-native"; import {StyleSheet, View, Platform} from "react-native";
import {SectionList} from 'react-navigation';
import {Card, ListItem, CardItem, Body, Text as Text, Left, Right, Icon, Button, Content, Spinner} from 'native-base'; import {Card, ListItem, CardItem, Body, Text as Text, Left, Right, Icon, Button, Content, Spinner} from 'native-base';
import React, { Component } from 'react'; import React, { Component } from 'react';
import moment from "moment"; import moment from "moment";
@@ -118,4 +119,4 @@ const styles = StyleSheet.create({
listHeader: { listHeader: {
paddingTop: 8, paddingTop: 8,
} }
}); });
+1 -1
View File
@@ -9,7 +9,7 @@ import Proof from "./Proof";
import {requestMembershipCharge} from "../../api"; import {requestMembershipCharge} from "../../api";
stripe.init({ stripe.setOptions({
publishableKey: Config.STRIPE_PUBLISHABLE_KEY || '', publishableKey: Config.STRIPE_PUBLISHABLE_KEY || '',
}); });
+1 -1
View File
@@ -261,4 +261,4 @@ const styles = StyleSheet.create({
paddingTop: 2, paddingTop: 2,
paddingBottom: 12, paddingBottom: 12,
} }
}); });
@@ -1,5 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {connect} from "react-redux"; import {connect} from "react-redux";
import UserRegister from "./UserRegister"; import UserRegister from "./UserRegister";
import {requestRegisterUser} from "../../api"; import {requestRegisterUser} from "../../api";
@@ -45,4 +46,4 @@ function storeToProps(store) {
export default connect( export default connect(
storeToProps, storeToProps,
{requestRegisterUser} {requestRegisterUser}
)(UserRegisterContainer); )(UserRegisterContainer);
+23 -12
View File
@@ -1,5 +1,5 @@
import {Platform, StyleSheet} from 'react-native'; import {Platform, StyleSheet} from 'react-native';
import {TabNavigator, StackNavigator} from "react-navigation"; import {createBottomTabNavigator, createStackNavigator, createAppContainer, getActiveChildNavigationOptions} from "react-navigation";
import AboutScreen from "./screens/AboutScreen"; import AboutScreen from "./screens/AboutScreen";
import EventDetailScreen from "./screens/EventDetailScreen"; import EventDetailScreen from "./screens/EventDetailScreen";
@@ -9,9 +9,9 @@ import MembershipScreen from "./screens/MembershipScreen";
import UserRegisterScreen from "./screens/UserRegisterScreen"; import UserRegisterScreen from "./screens/UserRegisterScreen";
const tabBarRoutes = { const tabBarRoutes = {
EventList: { screen: EventListScreen }, EventList: EventListScreen,
Membership: { screen: MembershipScreen }, Membership: MembershipScreen,
About: { screen: AboutScreen }, About: AboutScreen,
}; };
const tabBarOptions = { const tabBarOptions = {
@@ -41,16 +41,27 @@ const tabBarOptions = {
} }
}), }),
}, },
} },
navigationOptions: ({ navigation, screenProps }) => ({
// get header title from active child screen
...getActiveChildNavigationOptions(navigation, screenProps),
headerStyle: {
backgroundColor: '#f58220',
},
headerTitleStyle: {
color: 'white',
},
headerTintColor: 'white',
})
}; };
const tabNav = TabNavigator(tabBarRoutes, tabBarOptions); const tabNav = createBottomTabNavigator(tabBarRoutes, tabBarOptions);
const DuskenNavigation = StackNavigator({ const DuskenNavigation = createStackNavigator({
Root: { screen: tabNav }, Root: tabNav,
Login: { screen: LoginScreen }, Login: LoginScreen,
UserRegister: { screen: UserRegisterScreen }, UserRegister: UserRegisterScreen,
EventDetail: { screen: EventDetailScreen }, EventDetail: EventDetailScreen,
}); });
export default DuskenNavigation; export default createAppContainer(DuskenNavigation);
+26
View File
@@ -0,0 +1,26 @@
import { applyMiddleware, createStore } from 'redux';
import { persistStore, persistReducer } from 'redux-persist';
import AsyncStorage from '@react-native-community/async-storage';
import thunk from "redux-thunk";
import rootReducer from './reducers'
const persistConfig = {
key: 'root',
storage: AsyncStorage,
blacklist: [
'isLoggingIn',
'isFetchingUserData',
'isRegisteringUser',
'isChargingMembership'
]
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
export let store = createStore(
persistedReducer,
applyMiddleware(...[thunk])
);
export let persistor = persistStore(store);
+1 -8
View File
@@ -8,13 +8,6 @@ import getTheme from '../../native-base-theme/components';
export default class AboutScreen extends Component { export default class AboutScreen extends Component {
static navigationOptions = { static navigationOptions = {
title: 'Om oss', title: 'Om oss',
headerStyle: {
backgroundColor: '#f58220',
},
headerTitleStyle: {
color: 'white',
},
headerTintColor: 'white',
tabBarIcon: ({ tintColor }) => ( tabBarIcon: ({ tintColor }) => (
<Icon name="info" size={16} color={tintColor} style={{marginTop: 5}} /> <Icon name="info" size={16} color={tintColor} style={{marginTop: 5}} />
), ),
@@ -26,4 +19,4 @@ export default class AboutScreen extends Component {
<AboutContainer /> <AboutContainer />
</StyleProvider>); </StyleProvider>);
} }
} }
+1 -8
View File
@@ -7,13 +7,6 @@ import getTheme from '../../native-base-theme/components';
export default class EventsScreen extends Component { export default class EventsScreen extends Component {
static navigationOptions = { static navigationOptions = {
title: 'Program', title: 'Program',
headerStyle: {
backgroundColor: '#f58220',
},
headerTitleStyle: {
color: 'white',
},
headerTintColor: 'white',
tabBarIcon: ({ tintColor }) => ( tabBarIcon: ({ tintColor }) => (
<Icon name="event" size={16} color={tintColor} style={{marginTop: 5}}/> <Icon name="event" size={16} color={tintColor} style={{marginTop: 5}}/>
), ),
@@ -31,4 +24,4 @@ export default class EventsScreen extends Component {
</StyleProvider> </StyleProvider>
); );
} }
} }
+1 -8
View File
@@ -7,13 +7,6 @@ import getTheme from '../../native-base-theme/components';
export default class MembershipScreen extends Component { export default class MembershipScreen extends Component {
static navigationOptions = { static navigationOptions = {
title: 'Medlemskap', title: 'Medlemskap',
headerStyle: {
backgroundColor: '#f58220',
},
headerTitleStyle: {
color: 'white',
},
headerTintColor: 'white',
tabBarIcon: ({ tintColor }) => ( tabBarIcon: ({ tintColor }) => (
<Icon name="user" size={16} color={tintColor} style={{marginTop: 5}} /> <Icon name="user" size={16} color={tintColor} style={{marginTop: 5}} />
), ),
@@ -41,4 +34,4 @@ export default class MembershipScreen extends Component {
</StyleProvider> </StyleProvider>
) )
} }
} }
+11
View File
@@ -1,3 +1,14 @@
export function snakeToCamelCase(val) { export function snakeToCamelCase(val) {
return val.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); }); return val.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); });
} }
export function fetchWithTimeout(url, options, timeout=10000) {
/** Wraps fetch to allow it to time out */
// FIXME: show timeout message in UI
return Promise.race([
fetch(url, options),
new Promise((_, reject) =>
setTimeout(() => reject(new Error('Fetch request timed out')), timeout)
)
]);
}
+4899 -2717
View File
File diff suppressed because it is too large. Load diff