Browse Source

update react native

Arnaud Vergnet 2 months ago
parent
commit
95a35038eb

+ 3
- 0
.gitattributes View File

@@ -1 +1,4 @@
1 1
 *.pbxproj -text
2
+# Windows files should use crlf line endings
3
+# https://help.github.com/articles/dealing-with-line-endings/
4
+*.bat text eol=crlf

+ 4
- 1
android/app/build.gradle View File

@@ -137,6 +137,8 @@ if (keystorePropertiesFile.exists() && !keystorePropertiesFile.isDirectory()) {
137 137
 }
138 138
 
139 139
 android {
140
+    ndkVersion rootProject.ext.ndkVersion
141
+
140 142
     compileSdkVersion rootProject.ext.compileSdkVersion
141 143
 
142 144
     compileOptions {
@@ -192,11 +194,12 @@ android {
192 194
         variant.outputs.each { output ->
193 195
             // For each separate APK per architecture, set a unique version code as described here:
194 196
             // https://developer.android.com/studio/build/configure-apk-splits.html
197
+            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
195 198
             def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
196 199
             def abi = output.getFilter(OutputFile.ABI)
197 200
             if (abi != null) {  // null for the universal-debug, universal-release variants
198 201
                 output.versionCodeOverride =
199
-                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
202
+                        defaultConfig.versionCode * 1000 + versionCodes.get(abi)
200 203
             }
201 204
 
202 205
         }

+ 6
- 1
android/app/src/debug/AndroidManifest.xml View File

@@ -4,5 +4,10 @@
4 4
 
5 5
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6 6
 
7
-    <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7
+    <application
8
+        android:usesCleartextTraffic="true"
9
+        tools:targetApi="28"
10
+        tools:ignore="GoogleAppIndexingWarning">
11
+        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12
+    </application>
8 13
 </manifest>

+ 0
- 1
android/app/src/main/AndroidManifest.xml View File

@@ -67,6 +67,5 @@
67 67
                 <data android:scheme="campus-insat"/>
68 68
             </intent-filter>
69 69
         </activity>
70
-        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
71 70
     </application>
72 71
 </manifest>

+ 1
- 1
android/app/src/main/res/values/styles.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 2
 <resources>
3
-  <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
3
+  <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
4 4
     <item name="android:textColor">#000000</item>
5 5
     <item name="android:windowBackground">@color/activityBackground</item>
6 6
     <item name="android:navigationBarColor">@color/navigationBarColor</item>

+ 4
- 3
android/build.gradle View File

@@ -2,17 +2,18 @@
2 2
 
3 3
 buildscript {
4 4
     ext {
5
-        buildToolsVersion = "29.0.2"
6
-        minSdkVersion = 21
5
+        buildToolsVersion = "29.0.3"
6
+        minSdkVersion = 23
7 7
         compileSdkVersion = 29
8 8
         targetSdkVersion = 29
9
+        ndkVersion = "20.1.5948944"
9 10
     }
10 11
     repositories {
11 12
         google()
12 13
         jcenter()
13 14
     }
14 15
     dependencies {
15
-        classpath("com.android.tools.build:gradle:3.5.3")
16
+        classpath("com.android.tools.build:gradle:4.1.0")
16 17
 
17 18
         // NOTE: Do not place your application dependencies here; they belong
18 19
         // in the individual module build.gradle files

+ 1
- 1
android/gradle.properties View File

@@ -24,4 +24,4 @@ android.useAndroidX=true
24 24
 # Automatically convert third-party libraries to use AndroidX
25 25
 android.enableJetifier=true
26 26
 # Version of flipper SDK to use with React Native
27
-FLIPPER_VERSION=0.37.0
27
+FLIPPER_VERSION=0.75.1

+ 1
- 1
android/gradle/wrapper/gradle-wrapper.properties View File

@@ -1,5 +1,5 @@
1 1
 distributionBase=GRADLE_USER_HOME
2 2
 distributionPath=wrapper/dists
3
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
3
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
4 4
 zipStoreBase=GRADLE_USER_HOME
5 5
 zipStorePath=wrapper/dists

+ 5
- 1
ios/Campus/AppDelegate.m View File

@@ -52,7 +52,11 @@ static void InitializeFlipper(UIApplication *application) {
52 52
 
53 53
   RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
54 54
   RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Campus" initialProperties:nil];
55
-  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
55
+  if (@available(iOS 13.0, *)) {
56
+    rootView.backgroundColor = [UIColor systemBackgroundColor];
57
+  } else {
58
+    rootView.backgroundColor = [UIColor whiteColor];
59
+  }
56 60
 
57 61
   self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
58 62
   UIViewController *rootViewController = [UIViewController new];

+ 12
- 6
ios/Podfile View File

@@ -6,7 +6,12 @@ platform :ios, '10.0'
6 6
 target 'Campus' do
7 7
   config = use_native_modules!
8 8
   
9
-  use_react_native!(:path => config["reactNativePath"])
9
+  use_react_native!(
10
+    :path => config[:reactNativePath],
11
+    # to enable hermes on iOS, change `false` to `true` and then install pods
12
+    :hermes_enabled => false
13
+  )
14
+
10 15
   
11 16
   # Permissions
12 17
   permissions_path = '../node_modules/react-native-permissions/ios'
@@ -17,10 +22,11 @@ target 'Campus' do
17 22
   # Enables Flipper.
18 23
   #
19 24
   # Note that if you have use_frameworks! enabled, Flipper will not work and
20
-  # you should disable these next few lines.
21
-  # use_flipper!
22
-  # post_install do |installer|
23
-  #   flipper_post_install(installer)
24
-  # end
25
+  # you should disable the next line.
26
+  # use_flipper!()
27
+
28
+  post_install do |installer|
29
+    react_native_post_install(installer)
30
+  end
25 31
 
26 32
 end

+ 3414
- 3360
package-lock.json
File diff suppressed because it is too large
View File


+ 22
- 19
package.json View File

@@ -15,6 +15,7 @@
15 15
     "full-check": "npm run typescript && npm run lint && npm run test",
16 16
     "pod": "cd ios && pod install && cd ..",
17 17
     "bundle": "npm run full-check && cd android && ./gradlew bundleRelease",
18
+    "clean": "react-native-clean-project",
18 19
     "postversion": "react-native-version"
19 20
   },
20 21
   "dependencies": {
@@ -26,9 +27,9 @@
26 27
     "@react-navigation/bottom-tabs": "5.8.0",
27 28
     "@react-navigation/native": "5.7.3",
28 29
     "@react-navigation/stack": "5.9.0",
29
-    "i18n-js": "3.7.1",
30
-    "react": "16.13.1",
31
-    "react-native": "0.63.2",
30
+    "i18n-js": "3.8.0",
31
+    "react": "17.0.1",
32
+    "react-native": "0.64.1",
32 33
     "react-native-animatable": "1.3.3",
33 34
     "react-native-app-intro-slider": "4.0.4",
34 35
     "react-native-appearance": "0.3.4",
@@ -56,27 +57,29 @@
56 57
     "react-navigation-header-buttons": "5.0.2"
57 58
   },
58 59
   "devDependencies": {
59
-    "@babel/core": "7.11.0",
60
-    "@babel/runtime": "7.11.0",
61
-    "@react-native-community/eslint-config": "1.1.0",
62
-    "@types/i18n-js": "3.0.3",
63
-    "@types/jest": "25.2.3",
64
-    "@types/react-native": "0.63.2",
60
+    "@babel/core": "7.12.9",
61
+    "@babel/runtime": "7.12.5",
62
+    "@react-native-community/eslint-config": "2.0.0",
63
+    "@types/i18n-js": "3.8.0",
64
+    "@types/jest": "26.0.23",
65
+    "@types/react": "17.0.3",
66
+    "@types/react-native": "0.64.4",
65 67
     "@types/react-native-calendars": "1.20.10",
66 68
     "@types/react-native-vector-icons": "6.4.6",
67
-    "@types/react-test-renderer": "16.9.2",
68
-    "@typescript-eslint/eslint-plugin": "2.27.0",
69
-    "@typescript-eslint/parser": "2.27.0",
70
-    "babel-jest": "25.1.0",
71
-    "eslint": "7.2.0",
72
-    "jest": "25.1.0",
69
+    "@types/react-test-renderer": "17.0.1",
70
+    "@typescript-eslint/eslint-plugin": "4.22.1",
71
+    "@typescript-eslint/parser": "4.22.1",
72
+    "babel-jest": "26.6.3",
73
+    "eslint": "7.25.0",
74
+    "jest": "26.6.3",
73 75
     "jest-extended": "0.11.5",
74 76
     "jest-fetch-mock": "3.0.3",
75
-    "metro-react-native-babel-preset": "0.59.0",
76
-    "prettier": "2.0.5",
77
+    "metro-react-native-babel-preset": "0.64.0",
78
+    "prettier": "2.2.1",
79
+    "react-native-clean-project": "^3.6.3",
77 80
     "react-native-version": "4.0.0",
78
-    "react-test-renderer": "16.13.1",
79
-    "typescript": "3.8.3"
81
+    "react-test-renderer": "17.0.1",
82
+    "typescript": "4.2.4"
80 83
   },
81 84
   "eslintConfig": {
82 85
     "root": true,

Loading…
Cancel
Save