Skip to content

Instantly share code, notes, and snippets.

@nandorojo
Last active June 10, 2021 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nandorojo/37fea5dca5b6e175571b5e72bb69b20e to your computer and use it in GitHub Desktop.
Save nandorojo/37fea5dca5b6e175571b5e72bb69b20e to your computer and use it in GitHub Desktop.
Expo EAS monorepo patches
diff --git a/node_modules/expo-dev-launcher/plugin/build/withDevLauncher.js b/node_modules/expo-dev-launcher/plugin/build/withDevLauncher.js
index 04c1d7d..a166618 100644
--- a/node_modules/expo-dev-launcher/plugin/build/withDevLauncher.js
+++ b/node_modules/expo-dev-launcher/plugin/build/withDevLauncher.js
@@ -20,7 +20,7 @@ const DEV_LAUNCHER_ON_NEW_INTENT = `
`;
const DEV_LAUNCHER_WRAPPED_ACTIVITY_DELEGATE = `DevLauncherController.wrapReactActivityDelegate(this, () -> $1);`;
const DEV_LAUNCHER_ANDROID_INIT = 'DevLauncherController.initialize(this, getReactNativeHost());';
-const DEV_LAUNCHER_POD_IMPORT = "pod 'expo-dev-launcher', path: '../node_modules/expo-dev-launcher', :configurations => :debug";
+const DEV_LAUNCHER_POD_IMPORT = "pod 'expo-dev-launcher', path: '../../../node_modules/expo-dev-launcher', :configurations => :debug";
async function readFileAsync(path) {
return fs_1.default.promises.readFile(path, 'utf8');
}
diff --git a/node_modules/expo-dev-menu/plugin/build/withDevMenu.js b/node_modules/expo-dev-menu/plugin/build/withDevMenu.js
index caad68a..9e52317 100644
--- a/node_modules/expo-dev-menu/plugin/build/withDevMenu.js
+++ b/node_modules/expo-dev-menu/plugin/build/withDevMenu.js
@@ -10,7 +10,7 @@ const withDevMenuAppDelegate_1 = require("./withDevMenuAppDelegate");
const pkg = require('expo-dev-menu/package.json');
const DEV_MENU_ANDROID_IMPORT = 'expo.modules.devmenu.react.DevMenuAwareReactActivity';
const DEV_MENU_ACTIVITY_CLASS = 'public class MainActivity extends DevMenuAwareReactActivity {';
-const DEV_MENU_POD_IMPORT = "pod 'expo-dev-menu', path: '../node_modules/expo-dev-menu', :configurations => :debug";
+const DEV_MENU_POD_IMPORT = "pod 'expo-dev-menu', path: '../../../node_modules/expo-dev-menu', :configurations => :debug";
async function readFileAsync(path) {
return fs_1.default.promises.readFile(path, 'utf8');
}
diff --git a/node_modules/sentry-expo/plugin/build/withSentryAndroid.js b/node_modules/sentry-expo/plugin/build/withSentryAndroid.js
index a683bc3..8dc0e88 100644
--- a/node_modules/sentry-expo/plugin/build/withSentryAndroid.js
+++ b/node_modules/sentry-expo/plugin/build/withSentryAndroid.js
@@ -49,7 +49,7 @@ exports.withSentryAndroid = withSentryAndroid;
* We can be confident that the react-native/react.gradle script will be there.
*/
function modifyAppBuildGradle(buildGradle) {
- if (buildGradle.includes('apply from: "../../node_modules/@sentry/react-native/sentry.gradle"')) {
+ if (buildGradle.includes('apply from: "../../../../node_modules/@sentry/react-native/sentry.gradle"')) {
return buildGradle;
}
const pattern = /\n\s*apply from: "\.\.\/\.\.\/node_modules\/react-native\/react\.gradle"/;
@@ -57,7 +57,7 @@ function modifyAppBuildGradle(buildGradle) {
config_plugins_1.WarningAggregator.addWarningAndroid('sentry-expo', 'Could not find react.gradle script in android/app/build.gradle. Please open a bug report at https://github.com/expo/sentry-expo.');
}
return buildGradle.replace(pattern, `
-apply from: "../../node_modules/react-native/react.gradle"
-apply from: "../../node_modules/@sentry/react-native/sentry.gradle"`);
+apply from: "../../../../node_modules/react-native/react.gradle"
+apply from: "../../../../node_modules/@sentry/react-native/sentry.gradle"`);
}
exports.modifyAppBuildGradle = modifyAppBuildGradle;
diff --git a/node_modules/sentry-expo/plugin/build/withSentryIOS.js b/node_modules/sentry-expo/plugin/build/withSentryIOS.js
index 5deaccc..ce921a0 100644
--- a/node_modules/sentry-expo/plugin/build/withSentryIOS.js
+++ b/node_modules/sentry-expo/plugin/build/withSentryIOS.js
@@ -31,7 +31,7 @@ const withSentryIOS = (config, sentryProperties) => {
xcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
shellPath: '/bin/sh',
shellScript: 'export SENTRY_PROPERTIES=sentry.properties\\n' +
- '../node_modules/@sentry/cli/bin/sentry-cli upload-dsym',
+ '../../../node_modules/@sentry/cli/bin/sentry-cli upload-dsym',
});
}
let bundleReactNativePhase = xcodeProject.pbxItemByComment('Bundle React Native code and images', 'PBXShellScriptBuildPhase');
@@ -57,7 +57,7 @@ function modifyExistingXcodeBuildScript(script) {
code =
'export SENTRY_PROPERTIES=sentry.properties\n' +
'export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"\n' +
- code.replace(/^.*?\/(packager|scripts)\/react-native-xcode\.sh\s*/m, (match) => `../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ${match}`);
+ code.replace(/^.*?\/(packager|scripts)\/react-native-xcode\.sh\s*/m, (match) => `../../../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ${match}`);
script.shellScript = JSON.stringify(code);
}
exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment