Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from 'react';

// Imported first for its side effect: Sentry.init must run before other modules
// (store creation, firebase) so their errors are captured.
// eslint-disable-next-line import/order
import Sentry from './src/sentry';

import analytics from '@react-native-firebase/analytics';
import { StatusBar } from 'expo-status-bar';
import { View } from 'react-native';
Expand All @@ -24,7 +29,7 @@ if (process.env.EXPO_PUBLIC_FIREBASE_ANALYTICS == 'false') {
analytics().setAnalyticsCollectionEnabled(false);
}

export default function App() {
function App() {
return (
<View style={{ flex: 1, backgroundColor: '#000' }}>
<SafeAreaProvider>
Expand All @@ -47,4 +52,6 @@ export default function App() {
</SafeAreaProvider>
</View>
);
};
}

export default Sentry.wrap(App);
9 changes: 9 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,14 @@ export default {
skipOnboarding: true,
},
],
[
'@sentry/react-native/expo',
{
// Source map upload during EAS builds; skipped with a warning unless
// SENTRY_AUTH_TOKEN is set in the build environment.
organization: process.env.SENTRY_ORG || 'justin-wyne',
project: process.env.SENTRY_PROJECT || 'scorepad-react-native',
},
],
],
};
6 changes: 4 additions & 2 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
"distribution": "internal",
"env": {
"APP_VARIANT": "development",
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false"
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false",
"EXPO_PUBLIC_SENTRY_DSN": "https://88dd6d7c83b64ed8870ff21a2a9f1ba7@o1326242.ingest.us.sentry.io/4504710808076288"
}
},
"preview": {
"distribution": "internal",
"channel": "preview",
"env": {
"APP_VARIANT": "preview",
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false"
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false",
"EXPO_PUBLIC_SENTRY_DSN": "https://88dd6d7c83b64ed8870ff21a2a9f1ba7@o1326242.ingest.us.sentry.io/4504710808076288"
}
},
"production": {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config: Config = {
'^.+\\.tsx?$': 'babel-jest',
},
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|immer|react-redux|@reduxjs/toolkit)'
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|@sentry/.*|native-base|react-native-svg|immer|react-redux|@reduxjs/toolkit)'
],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
testPathIgnorePatterns: ['<rootDir>/e2e/', '<rootDir>/.claude/'],
Expand Down
6 changes: 4 additions & 2 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-disable @typescript-eslint/no-require-imports */
const { getDefaultConfig } = require('@expo/metro-config');
const { getSentryExpoConfig } = require('@sentry/react-native/metro');

const defaultConfig = getDefaultConfig(__dirname);
// Sentry's wrapper of Expo's default config: adds debug ID injection and
// source map options so stack traces symbolicate in Sentry.
const defaultConfig = getSentryExpoConfig(__dirname);
// NOTE: do NOT add 'cjs' to assetExts — it prevents Metro from executing
// .cjs files as JavaScript (e.g. superstruct/dist/index.cjs gets treated as
// a binary asset instead of a module).
Expand Down
Loading
Loading