Browse Source

Completely removed expo from android project

Arnaud Vergnet 3 years ago
parent
commit
a4bbd84136

+ 0
- 15
android/app/build.gradle View File

@@ -80,10 +80,7 @@ project.ext.react = [
80 80
     enableHermes: true,
81 81
 ]
82 82
 
83
-apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
84 83
 apply from: "../../node_modules/react-native/react.gradle"
85
-
86
-
87 84
 apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
88 85
 
89 86
 /**
@@ -194,18 +191,6 @@ android {
194 191
 dependencies {
195 192
     implementation fileTree(dir: "libs", include: ["*.jar"])
196 193
     implementation "com.facebook.react:react-native:+"  // From node_modules
197
-    addUnimodulesDependencies([exclude: [
198
-    'expo-camera',
199
-    'expo-barcode-scanner',
200
-    'expo-error-recovery',
201
-    'expo-image-loader',
202
-    'expo-keep-awake',
203
-    'expo-linear-gradient',
204
-    'expo-location',
205
-    'expo-web-browser',
206
-    'expo-sqlite',
207
-    'expo-image-loader',
208
-     ]])
209 194
 
210 195
     if (enableHermes) {
211 196
         def hermesPath = "../../node_modules/hermes-engine/android/";

+ 0
- 15
android/app/src/main/java/fr/amicaleinsat/application/MainApplication.java View File

@@ -9,16 +9,6 @@ import com.facebook.react.ReactNativeHost;
9 9
 import com.facebook.react.ReactPackage;
10 10
 import com.facebook.react.shell.MainReactPackage;
11 11
 import com.facebook.soloader.SoLoader;
12
-import fr.amicaleinsat.application.generated.BasePackageList;
13
-
14
-import org.unimodules.adapters.react.ReactAdapterPackage;
15
-import org.unimodules.adapters.react.ModuleRegistryAdapter;
16
-import org.unimodules.adapters.react.ReactModuleRegistryProvider;
17
-import org.unimodules.core.interfaces.Package;
18
-import org.unimodules.core.interfaces.SingletonModule;
19
-import expo.modules.constants.ConstantsPackage;
20
-import expo.modules.permissions.PermissionsPackage;
21
-import expo.modules.filesystem.FileSystemPackage;
22 12
 
23 13
 import java.lang.reflect.InvocationTargetException;
24 14
 import java.util.Arrays;
@@ -26,10 +16,6 @@ import java.util.List;
26 16
 import javax.annotation.Nullable;
27 17
 
28 18
 public class MainApplication extends Application implements ReactApplication {
29
-  private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
30
-    new BasePackageList().getPackageList(),
31
-    null
32
-  );
33 19
 
34 20
   private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
35 21
     @Override
@@ -40,7 +26,6 @@ public class MainApplication extends Application implements ReactApplication {
40 26
     @Override
41 27
     protected List<ReactPackage> getPackages() {
42 28
       List<ReactPackage> packages = new PackageList(this).getPackages();
43
-      packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
44 29
       return packages;
45 30
     }
46 31
 

+ 0
- 16
android/app/src/main/java/fr/amicaleinsat/application/generated/BasePackageList.java View File

@@ -1,16 +0,0 @@
1
-package fr.amicaleinsat.application.generated;
2
-
3
-import java.util.Arrays;
4
-import java.util.List;
5
-import org.unimodules.core.interfaces.Package;
6
-
7
-public class BasePackageList {
8
-  public List<Package> getPackageList() {
9
-    return Arrays.<Package>asList(
10
-        new expo.modules.constants.ConstantsPackage(),
11
-        new expo.modules.filesystem.FileSystemPackage(),
12
-        new expo.modules.font.FontLoaderPackage(),
13
-        new expo.modules.permissions.PermissionsPackage()
14
-    );
15
-  }
16
-}

+ 0
- 3
android/settings.gradle View File

@@ -1,8 +1,5 @@
1 1
 rootProject.name = 'Campus'
2 2
 
3
-apply from: '../node_modules/react-native-unimodules/gradle.groovy'
4
-includeUnimodulesProjects()
5
-
6 3
 apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
7 4
 applyNativeModulesSettingsGradle(settings)
8 5
 

+ 2
- 10
babel.config.js View File

@@ -1,11 +1,3 @@
1
-module.exports = function(api) {
2
-  api.cache(true);
3
-  return {
4
-    presets: ['babel-preset-expo', '@babel/preset-flow'],
5
-    env: {
6
-      production: {
7
-        plugins: ['react-native-paper/babel'],
8
-      },
9
-    },
10
-  };
1
+module.exports = {
2
+  presets: ['module:metro-react-native-babel-preset'],
11 3
 };

+ 2
- 6
index.js View File

@@ -1,8 +1,4 @@
1
-import {registerRootComponent} from 'expo';
2
-
1
+import {AppRegistry} from 'react-native';
3 2
 import App from './App';
4 3
 
5
-// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6
-// It also ensures that whether you load the app in the Expo client or in a native build,
7
-// the environment is set up appropriately
8
-registerRootComponent(App);
4
+AppRegistry.registerComponent('main', () => App);

+ 17
- 0
metro.config.js View File

@@ -0,0 +1,17 @@
1
+/**
2
+ * Metro configuration for React Native
3
+ * https://github.com/facebook/react-native
4
+ *
5
+ * @format
6
+ */
7
+
8
+module.exports = {
9
+    transformer: {
10
+        getTransformOptions: async () => ({
11
+            transform: {
12
+                experimentalImportSupport: false,
13
+                inlineRequires: false,
14
+            },
15
+        }),
16
+    },
17
+};

+ 14
- 16
package.json View File

@@ -1,12 +1,13 @@
1 1
 {
2
+  "name": "campus",
3
+  "version": "2.0.0",
4
+  "private": true,
2 5
   "scripts": {
3 6
     "start": "react-native start",
4 7
     "android": "react-native run-android",
5 8
     "ios": "react-native run-ios",
6
-    "web": "expo start --web",
7 9
     "test": "jest",
8
-    "testw": "jest --watch",
9
-    "testc": "jest --coverage"
10
+    "lint": "eslint ."
10 11
   },
11 12
   "jest": {
12 13
     "preset": "react-native",
@@ -24,7 +25,6 @@
24 25
     "@react-navigation/drawer": "^5.1.1",
25 26
     "@react-navigation/native": "^5.0.9",
26 27
     "@react-navigation/stack": "^5.1.1",
27
-    "expo": "^37.0.0",
28 28
     "i18n-js": "^3.3.0",
29 29
     "react": "~16.9.0",
30 30
     "react-dom": "16.9.0",
@@ -49,7 +49,6 @@
49 49
     "react-native-safe-area-context": "0.7.3",
50 50
     "react-native-screens": "~2.2.0",
51 51
     "react-native-splash-screen": "^3.2.0",
52
-    "react-native-unimodules": "~0.9.0",
53 52
     "react-native-vector-icons": "^6.6.0",
54 53
     "react-native-web": "~0.11.7",
55 54
     "react-native-webview": "8.1.1",
@@ -57,15 +56,14 @@
57 56
     "react-navigation-header-buttons": "^3.0.5"
58 57
   },
59 58
   "devDependencies": {
60
-    "@babel/core": "^7.9.0",
61
-    "babel-jest": "~25.2.6",
62
-    "jest": "^25.1.0",
63
-    "react-test-renderer": "^16.13.1",
64
-    "@babel/cli": "^7.8.4",
65
-    "@babel/preset-flow": "^7.9.0",
66
-    "babel-preset-expo": "^8.1.0",
67
-    "flow-bin": "^0.122.0",
68
-    "jest-extended": "^0.11.5"
69
-  },
70
-  "private": true
59
+    "@babel/core": "^7.6.2",
60
+    "@babel/runtime": "^7.6.2",
61
+    "@react-native-community/eslint-config": "^0.0.5",
62
+    "babel-jest": "^24.9.0",
63
+    "eslint": "^6.5.1",
64
+    "jest": "^24.9.0",
65
+    "metro-react-native-babel-preset": "^0.58.0",
66
+    "react-test-renderer": "16.9.0",
67
+    "flow-bin": "^0.122.0"
68
+  }
71 69
 }

Loading…
Cancel
Save