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
     enableHermes: true,
80
     enableHermes: true,
81
 ]
81
 ]
82
 
82
 
83
-apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
84
 apply from: "../../node_modules/react-native/react.gradle"
83
 apply from: "../../node_modules/react-native/react.gradle"
85
-
86
-
87
 apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
84
 apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
88
 
85
 
89
 /**
86
 /**
194
 dependencies {
191
 dependencies {
195
     implementation fileTree(dir: "libs", include: ["*.jar"])
192
     implementation fileTree(dir: "libs", include: ["*.jar"])
196
     implementation "com.facebook.react:react-native:+"  // From node_modules
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
     if (enableHermes) {
195
     if (enableHermes) {
211
         def hermesPath = "../../node_modules/hermes-engine/android/";
196
         def hermesPath = "../../node_modules/hermes-engine/android/";

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

9
 import com.facebook.react.ReactPackage;
9
 import com.facebook.react.ReactPackage;
10
 import com.facebook.react.shell.MainReactPackage;
10
 import com.facebook.react.shell.MainReactPackage;
11
 import com.facebook.soloader.SoLoader;
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
 import java.lang.reflect.InvocationTargetException;
13
 import java.lang.reflect.InvocationTargetException;
24
 import java.util.Arrays;
14
 import java.util.Arrays;
26
 import javax.annotation.Nullable;
16
 import javax.annotation.Nullable;
27
 
17
 
28
 public class MainApplication extends Application implements ReactApplication {
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
   private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
20
   private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
35
     @Override
21
     @Override
40
     @Override
26
     @Override
41
     protected List<ReactPackage> getPackages() {
27
     protected List<ReactPackage> getPackages() {
42
       List<ReactPackage> packages = new PackageList(this).getPackages();
28
       List<ReactPackage> packages = new PackageList(this).getPackages();
43
-      packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
44
       return packages;
29
       return packages;
45
     }
30
     }
46
 
31
 

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

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

+ 2
- 10
babel.config.js View File

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
-import {registerRootComponent} from 'expo';
2
-
1
+import {AppRegistry} from 'react-native';
3
 import App from './App';
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

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
 {
1
 {
2
+  "name": "campus",
3
+  "version": "2.0.0",
4
+  "private": true,
2
   "scripts": {
5
   "scripts": {
3
     "start": "react-native start",
6
     "start": "react-native start",
4
     "android": "react-native run-android",
7
     "android": "react-native run-android",
5
     "ios": "react-native run-ios",
8
     "ios": "react-native run-ios",
6
-    "web": "expo start --web",
7
     "test": "jest",
9
     "test": "jest",
8
-    "testw": "jest --watch",
9
-    "testc": "jest --coverage"
10
+    "lint": "eslint ."
10
   },
11
   },
11
   "jest": {
12
   "jest": {
12
     "preset": "react-native",
13
     "preset": "react-native",
24
     "@react-navigation/drawer": "^5.1.1",
25
     "@react-navigation/drawer": "^5.1.1",
25
     "@react-navigation/native": "^5.0.9",
26
     "@react-navigation/native": "^5.0.9",
26
     "@react-navigation/stack": "^5.1.1",
27
     "@react-navigation/stack": "^5.1.1",
27
-    "expo": "^37.0.0",
28
     "i18n-js": "^3.3.0",
28
     "i18n-js": "^3.3.0",
29
     "react": "~16.9.0",
29
     "react": "~16.9.0",
30
     "react-dom": "16.9.0",
30
     "react-dom": "16.9.0",
49
     "react-native-safe-area-context": "0.7.3",
49
     "react-native-safe-area-context": "0.7.3",
50
     "react-native-screens": "~2.2.0",
50
     "react-native-screens": "~2.2.0",
51
     "react-native-splash-screen": "^3.2.0",
51
     "react-native-splash-screen": "^3.2.0",
52
-    "react-native-unimodules": "~0.9.0",
53
     "react-native-vector-icons": "^6.6.0",
52
     "react-native-vector-icons": "^6.6.0",
54
     "react-native-web": "~0.11.7",
53
     "react-native-web": "~0.11.7",
55
     "react-native-webview": "8.1.1",
54
     "react-native-webview": "8.1.1",
57
     "react-navigation-header-buttons": "^3.0.5"
56
     "react-navigation-header-buttons": "^3.0.5"
58
   },
57
   },
59
   "devDependencies": {
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