diff --git a/__mocks__/sentry-expo.js b/__mocks__/sentry-expo.js deleted file mode 100644 index 5a0e644e8a..0000000000 --- a/__mocks__/sentry-expo.js +++ /dev/null @@ -1,3 +0,0 @@ -jest.mock('sentry-expo', () => ({ - init: () => jest.fn(), -})) diff --git a/jest/jestSetup.js b/jest/jestSetup.js index c3160df3bc..1cca276121 100644 --- a/jest/jestSetup.js +++ b/jest/jestSetup.js @@ -70,17 +70,6 @@ jest.mock('lande', () => ({ default: jest.fn().mockReturnValue([['eng']]), })) -jest.mock('sentry-expo', () => ({ - init: () => jest.fn(), - Native: { - ReactNativeTracing: jest.fn().mockImplementation(() => ({ - start: jest.fn(), - stop: jest.fn(), - })), - ReactNavigationInstrumentation: jest.fn(), - }, -})) - jest.mock('crypto', () => ({})) jest.mock('expo-application', () => ({ diff --git a/package.json b/package.json index 3d69c19753..4a0a17840c 100644 --- a/package.json +++ b/package.json @@ -294,7 +294,7 @@ "\\.[jt]sx?$": "babel-jest" }, "transformIgnorePatterns": [ - "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|@discord|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|nanoid|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|normalize-url|react-native-svg|@sentry/.*|sentry-expo|bcp-47-match)" + "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|@discord|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|nanoid|@react-navigation/.*|@unimodules/.*|unimodules|native-base|normalize-url|react-native-svg|@sentry/.*|bcp-47-match)" ], "modulePathIgnorePatterns": [ "__tests__/.*/__mocks__", diff --git a/patches/@sentry+react-native+5.24.3.patch b/patches/@sentry+react-native+5.24.3.patch deleted file mode 100644 index a5ccecc21a..0000000000 --- a/patches/@sentry+react-native+5.24.3.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/node_modules/@sentry/react-native/dist/js/utils/ignorerequirecyclelogs.js b/node_modules/@sentry/react-native/dist/js/utils/ignorerequirecyclelogs.js -index 7e0b4cd..177454c 100644 ---- a/node_modules/@sentry/react-native/dist/js/utils/ignorerequirecyclelogs.js -+++ b/node_modules/@sentry/react-native/dist/js/utils/ignorerequirecyclelogs.js -@@ -3,6 +3,8 @@ import { LogBox } from 'react-native'; - * This is a workaround for using fetch on RN, this is a known issue in react-native and only generates a warning. - */ - export function ignoreRequireCycleLogs() { -- LogBox.ignoreLogs(['Require cycle:']); -+ try { -+ LogBox.ignoreLogs(['Require cycle:']); -+ } catch (e) {} - } - //# sourceMappingURL=ignorerequirecyclelogs.js.map -\ No newline at end of file -diff --git a/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js b/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js -index 0f244f2..ae7dfb3 100755 ---- a/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js -+++ b/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js -@@ -174,6 +174,7 @@ if (!outputDir) { - process.exit(1); - } - -+const otherArgs = process.argv.slice(3); - const files = getAssetPathsSync(outputDir); - const groupedAssets = groupAssets(files); - -@@ -195,7 +196,7 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) { - - const isHermes = assets.find(asset => asset.endsWith('.hbc')); - const windowsCallback = process.platform === "win32" ? 'node ' : ''; -- execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, { -+ execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')} ${otherArgs.join(' ')}`, { - env: { - ...process.env, - [SENTRY_PROJECT]: sentryProject, diff --git a/postHooks/uploadSentrySourcemapsPostHook.js b/postHooks/uploadSentrySourcemapsPostHook.js deleted file mode 100644 index 756e64253c..0000000000 --- a/postHooks/uploadSentrySourcemapsPostHook.js +++ /dev/null @@ -1,34 +0,0 @@ -const exec = require('child_process').execSync - -const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN - -module.exports = ({config}) => { - if (!SENTRY_AUTH_TOKEN) { - console.log( - 'SENTRY_AUTH_TOKEN environment variable must be set to upload sourcemaps. Skipping.', - ) - return - } - - const org = config.organization - const project = config.project - const release = config.release - const dist = config.dist - - if (!org || !project || !release || !dist) { - console.log( - '"organization", "project", "release", and "dist" must be set in the hook config to upload sourcemaps. Skipping.', - ) - return - } - - try { - console.log('Uploading sourcemaps to Sentry...') - exec( - `node node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps dist --url https://sentry.io/ -o ${org} -p ${project} -r ${release} -d ${dist}`, - ) - console.log('Sourcemaps uploaded to Sentry.') - } catch (e) { - console.error('Error uploading sourcemaps to Sentry:', e) - } -}