Skip to content

Commit d259d0d

Browse files
authored
Merge pull request #19 from pmusaraj/sep2019-update
September 2019 updates and upgrades
2 parents fe32e55 + c059701 commit d259d0d

31 files changed

+8024
-6464
lines changed

.babelrc

-3
This file was deleted.

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: "@react-native-community"
4+
};

.flowconfig

+58-15
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,89 @@
1111
; Ignore duplicate module providers
1212
; For RN Apps installed via npm, "Libraries" folder is inside
1313
; "node_modules/react-native" but in the source repo it is in the root
14-
.*/Libraries/react-native/React.js
14+
node_modules/react-native/Libraries/react-native/React.js
1515

1616
; Ignore polyfills
17-
.*/Libraries/polyfills/.*
17+
node_modules/react-native/Libraries/polyfills/.*
1818

19-
; Ignore metro
20-
.*/node_modules/metro/.*
19+
; These should not be required directly
20+
; require from fbjs/lib instead: require('fbjs/lib/warning')
21+
node_modules/warning/.*
22+
23+
; Flow doesn't support platforms
24+
.*/Libraries/Utilities/HMRLoadingView.js
25+
26+
[untyped]
27+
.*/node_modules/@react-native-community/cli/.*/.*
2128

2229
[include]
2330

2431
[libs]
2532
node_modules/react-native/Libraries/react-native/react-native-interface.js
2633
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2834

2935
[options]
3036
emoji=true
3137

38+
esproposal.optional_chaining=enable
39+
esproposal.nullish_coalescing=enable
40+
41+
module.file_ext=.js
42+
module.file_ext=.json
43+
module.file_ext=.ios.js
44+
3245
module.system=haste
46+
module.system.haste.use_name_reducers=true
47+
# get basename
48+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
49+
# strip .js or .js.flow suffix
50+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
51+
# strip .ios suffix
52+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
53+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
54+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
55+
module.system.haste.paths.blacklist=.*/__tests__/.*
56+
module.system.haste.paths.blacklist=.*/__mocks__/.*
57+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
58+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
59+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
60+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
3362

3463
munge_underscores=true
3564

3665
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'
3766

38-
module.file_ext=.js
39-
module.file_ext=.jsx
40-
module.file_ext=.json
41-
module.file_ext=.native.js
42-
4367
suppress_type=$FlowIssue
4468
suppress_type=$FlowFixMe
4569
suppress_type=$FlowFixMeProps
4670
suppress_type=$FlowFixMeState
4771

48-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
49-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
50-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
72+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
73+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
5174
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5275

53-
unsafe.enable_getters_and_setters=true
76+
[lints]
77+
sketchy-null-number=warn
78+
sketchy-null-mixed=warn
79+
sketchy-number=warn
80+
untyped-type-import=warn
81+
nonstrict-import=warn
82+
deprecated-type=warn
83+
unsafe-getters-setters=warn
84+
inexact-spread=warn
85+
unnecessary-invariant=warn
86+
signature-verification-failure=warn
87+
deprecated-utility=error
88+
89+
[strict]
90+
deprecated-type
91+
nonstrict-import
92+
sketchy-null
93+
unclear-type
94+
unsafe-getters-setters
95+
untyped-import
96+
untyped-type-import
5497

5598
[version]
56-
^0.61.0
99+
^0.98.0

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,9 @@ buck-out/
5353
*/fastlane/report.xml
5454
*/fastlane/Preview.html
5555
*/fastlane/screenshots
56+
57+
# Bundle artifact
58+
*.jsbundle
59+
60+
# CocoaPods
61+
/ios/Pods/

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: "all"
6+
};

android/app/build.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ android {
139139
}
140140

141141
dependencies {
142-
compile project(':react-native-onesignal')
143-
compile project(':react-native-key-pair')
142+
implementation project(':react-native-onesignal')
144143
compile project(':react-native-device-info')
145-
compile project(':react-native-cookies')
146144
compile fileTree(dir: "libs", include: ["*.jar"])
147145
compile "com.android.support:appcompat-v7:23.0.1"
148146
compile "com.facebook.react:react-native:+" // From node_modules

android/app/src/main/java/com/discosingle/MainApplication.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
import com.facebook.react.ReactApplication;
66
import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage;
7-
import com.RNKeyPair.RNKeyPairPackage;
87
import com.learnium.RNDeviceInfo.RNDeviceInfo;
9-
import com.psykar.cookiemanager.CookieManagerPackage;
108
import com.facebook.react.ReactNativeHost;
119
import com.facebook.react.ReactPackage;
1210
import com.facebook.react.shell.MainReactPackage;
@@ -27,11 +25,9 @@ public boolean getUseDeveloperSupport() {
2725
protected List<ReactPackage> getPackages() {
2826
return Arrays.<ReactPackage>asList(
2927
new MainReactPackage(),
30-
new CustomWebViewPackage(),
3128
new ReactNativeOneSignalPackage(),
32-
new RNKeyPairPackage(),
33-
new RNDeviceInfo(),
34-
new CookieManagerPackage()
29+
new CustomWebViewPackage(),
30+
new RNDeviceInfo()
3531
);
3632
}
3733

android/settings.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
rootProject.name = 'DiscoSingle'
22
include ':react-native-onesignal'
33
project(':react-native-onesignal').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-onesignal/android')
4-
include ':react-native-key-pair'
5-
project(':react-native-key-pair').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-key-pair/android')
64
include ':react-native-device-info'
75
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
8-
include ':react-native-cookies'
9-
project(':react-native-cookies').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cookies/android')
106

117
include ':app'

app.variables.js

-2
This file was deleted.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["module:metro-react-native-babel-preset"]
3+
};

default.variables.js

+30-28
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//// Application variables ////
2+
// Copy these to app.variables.js in the root of the project
23

34
// domain name of the site
4-
global.siteDomain = 'example.com'
5+
global.siteDomain = "example.com";
56

67
// the app's name
7-
global.appName = 'DiscoSingle'
8+
global.appName = "DiscoSingle";
89

910
// App ID from OneSignal (see readme, needs manual update)
1011
// global.oneSignalAppId = 'ONESIGNAL_APP_ID'
@@ -13,38 +14,39 @@ global.appName = 'DiscoSingle'
1314
// global.googleProjectNumber = 'ONESIGNAL_GOOGLE_PROJECT_NUMBER'
1415

1516
// Show login form on splash screen
16-
global.showLoginForm = true
17+
global.showLoginForm = true;
1718

1819
// OneSignal in-app focus behaviour
1920
// 0 = no notification, 1 = alert dialog with a message, 2 = regular notification (same as when app is not in focus)
20-
global.inAppNotification = 2
21+
global.inAppNotification = 2;
2122

2223
// URLs to load directly in app
23-
global.internalURLs = ['oauth']
24+
global.internalURLs = ["oauth"];
2425

2526
// Styling variables
26-
global.bgColor = '#FFFFFF'
27-
global.textColor = '#333333'
28-
global.buttonColor = '#bb3c2b'
29-
global.introText = 'Welcome! Please log in or signup to get started. Make sure to authenticate the application in order to enable notifications.';
30-
global.loginText = 'Login'
31-
global.skipText = 'Skip'
27+
global.bgColor = "#FFFFFF";
28+
global.textColor = "#333333";
29+
global.buttonColor = "#bb3c2b";
30+
global.introText =
31+
"Welcome! Please log in or signup to get started. Make sure to authenticate the application in order to enable notifications.";
32+
global.loginText = "Login";
33+
global.skipText = "Skip";
3234

3335
// if showLoginForm is disabled, the following variables are used
34-
global.primaryStartButtonText = 'Launch'
35-
global.primaryStartButtonTextColor = '#FFFFFF'
36-
global.primaryStartUrl = ''
37-
global.secondaryStartButtonText = ''
38-
39-
global.connectText = 'Connect'
40-
global.connectButtonBgColor = '#bb3c2b'
41-
global.connectButtonTextColor = '#FFFFFF'
42-
global.acctText = 'No account? Click here'
43-
global.acctUrl = '/signup'
44-
global.TOSText = 'By continuing, you agree to our '
45-
global.TOSLinkText = 'Terms of Service'
46-
global.TOSUrl = '/tos'
47-
global.TOSTextColor = '#555555'
48-
49-
global.usernamePlaceholder = 'Username'
50-
global.passwordPlaceholder = 'Password'
36+
global.primaryStartButtonText = "Launch";
37+
global.primaryStartButtonTextColor = "#FFFFFF";
38+
global.primaryStartUrl = "";
39+
global.secondaryStartButtonText = "";
40+
41+
global.connectText = "Connect";
42+
global.connectButtonBgColor = "#bb3c2b";
43+
global.connectButtonTextColor = "#FFFFFF";
44+
global.acctText = "No account? Click here";
45+
global.acctUrl = "/signup";
46+
global.TOSText = "By continuing, you agree to our ";
47+
global.TOSLinkText = "Terms of Service";
48+
global.TOSUrl = "/tos";
49+
global.TOSTextColor = "#555555";
50+
51+
global.usernamePlaceholder = "Username";
52+
global.passwordPlaceholder = "Password";

index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/**
2-
* @flow
2+
* @format
33
*/
44

5-
import {
6-
AppRegistry
7-
} from 'react-native';
5+
import { AppRegistry } from "react-native";
86

9-
import './default.variables.js';
10-
import './app.variables.js';
7+
import "./default.variables.js";
8+
import "./app.variables.js";
119

12-
import App from './js/App';
10+
import App from "./js/App";
1311

14-
AppRegistry.registerComponent('DiscoSingle', () => App);
12+
AppRegistry.registerComponent("DiscoSingle", () => App);

ios/DiscoSingle-tvOS/Info.plist

+15-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>
@@ -22,6 +22,19 @@
2222
<string>1</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
25+
<key>NSAppTransportSecurity</key>
26+
<dict>
27+
<key>NSExceptionDomains</key>
28+
<dict>
29+
<key>localhost</key>
30+
<dict>
31+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
32+
<true/>
33+
</dict>
34+
</dict>
35+
</dict>
36+
<key>NSLocationWhenInUseUsageDescription</key>
37+
<string></string>
2538
<key>UILaunchStoryboardName</key>
2639
<string>LaunchScreen</string>
2740
<key>UIRequiredDeviceCapabilities</key>
@@ -36,19 +49,5 @@
3649
</array>
3750
<key>UIViewControllerBasedStatusBarAppearance</key>
3851
<false/>
39-
<key>NSLocationWhenInUseUsageDescription</key>
40-
<string></string>
41-
<key>NSAppTransportSecurity</key>
42-
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
43-
<dict>
44-
<key>NSExceptionDomains</key>
45-
<dict>
46-
<key>localhost</key>
47-
<dict>
48-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
49-
<true/>
50-
</dict>
51-
</dict>
52-
</dict>
5352
</dict>
54-
</plist>
53+
</plist>

0 commit comments

Comments
 (0)