diff --git a/CHANGELOG.md b/CHANGELOG.md index 5538c9ee82..d3bfca55b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This release is compatible with `expo@50.0.0-preview.6` and newer. +### Features + - `withSentryExpoSerializers` changes to `getSentryExpoConfig` ([#3501](https://github.com/getsentry/sentry-react-native/pull/3501)) - `getSentryExpoConfig` accepts the same parameters as `getDefaultConfig` from `expo/metro-config` and returns Metro configuration - This also works for EAS Updates (and expo export). Debug ID is generated by `expo/metro-config` and used by Sentry. @@ -13,10 +15,24 @@ This release is compatible with `expo@50.0.0-preview.6` and newer. const config = getSentryExpoConfig(config); ``` +- Add `scripts/expo-upload-sourcemaps.js` for simple EAS Update (expo export) source maps upload to Sentry ([#3491](https://github.com/getsentry/sentry-react-native/pull/3491)) + + ```bash + SENTRY_PROJECT=project-slug \ + SENTRY_ORG=org-slug \ + SENTRY_AUTH_TOKEN=super-secret-token \ + node node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js dist + ``` + +- Sentry CLI binary path in `scripts/expo-upload-sourcemaps.js` is resolved dynamically ([#3507](https://github.com/getsentry/sentry-react-native/pull/3507)) + - Or can be overwritten by `SENTRY_CLI_EXECUTABLE` env + - Resolve Default Integrations based on current platform ([#3465](https://github.com/getsentry/sentry-react-native/pull/3465)) - Native Integrations are only added if Native Module is available - Web Integrations only for React Native Web builds +### Fixes + - Includes fixes from version 5.15.2 ## 5.15.2 diff --git a/scripts/expo-upload-sourcemaps.js b/scripts/expo-upload-sourcemaps.js index ecbaa4f709..b57d50175a 100755 --- a/scripts/expo-upload-sourcemaps.js +++ b/scripts/expo-upload-sourcemaps.js @@ -6,8 +6,7 @@ const process = require('process'); const SENTRY_PROJECT = 'SENTRY_PROJECT'; // The sentry org is inferred from the auth token const SENTRY_AUTH_TOKEN = 'SENTRY_AUTH_TOKEN'; - -const SENTRY_CLI = 'node_modules/@sentry/cli/bin/sentry-cli'; +const SENTRY_CLI_EXECUTABLE = 'SENTRY_CLI_EXECUTABLE'; function getEnvVar(varname) { return process.env[varname]; @@ -103,6 +102,7 @@ function groupAssets(assetPaths) { let sentryProject = getEnvVar(SENTRY_PROJECT); let authToken = getEnvVar(SENTRY_AUTH_TOKEN); +const sentryCliBin = getEnvVar(SENTRY_CLI_EXECUTABLE) || require.resolve('@sentry/cli/bin/sentry-cli'); if (!sentryProject) { console.log(`🐕 Fetching ${SENTRY_PROJECT} from expo config...`); @@ -147,7 +147,7 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) { } console.log(`⬆️ Uploading ${assetGroupName} bundle and sourcemap...`); const isHermes = assets.find(asset => asset.endsWith('.hbc')); - execSync(`${SENTRY_CLI} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, { + execSync(`${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, { env: { ...process.env, [SENTRY_PROJECT]: sentryProject,