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
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ targets:
sdks:
npm:@sentry/react-native:
includeNames: /^sentry-react-native-\d.*\.tgz$/
npm:@sentry/expo-upload-sourcemaps:
includeNames: /^sentry-expo-upload-sourcemaps-\d.*\.tgz$/
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Features

- Add new `@sentry/expo-upload-sourcemaps` package for uploading JavaScript bundles and source maps from Expo builds to Sentry ([#6027](https://github.com/getsentry/sentry-react-native/pull/6027))
- The existing `sentry-expo-upload-sourcemaps` bin bundled with `@sentry/react-native` is superseded by the new package; it continues to work unchanged for now
- Expose scope-level attributes API (`setAttribute`, `setAttributes`, `removeAttribute`) bridging to native SDKs ([#6009](https://github.com/getsentry/sentry-react-native/pull/6009))
- Expose screenshot masking options (`screenshot.maskAllText`, `screenshot.maskAllImages`, `screenshot.maskedViewClasses`, `screenshot.unmaskedViewClasses`) for error screenshots ([#6007](https://github.com/getsentry/sentry-react-native/pull/6007))
- Warn Expo users at Metro startup when prebuilt native projects are missing Sentry configuration ([#5984](https://github.com/getsentry/sentry-react-native/pull/5984))
Expand Down
24 changes: 23 additions & 1 deletion dev-packages/e2e-tests/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const e2eTestPackageName = JSON.parse(fs.readFileSync(`${e2eDir}/package.json`,
const patchScriptsDir = path.resolve(e2eDir, 'patch-scripts');
const workspaceRootDir = path.resolve(__dirname, '../..');
const corePackageDir = path.resolve(workspaceRootDir, 'packages/core');
const expoUploadSourcemapsPackageDir = path.resolve(workspaceRootDir, 'packages/expo-upload-sourcemaps');
const corePackageJson = JSON.parse(fs.readFileSync(`${corePackageDir}/package.json`, 'utf8'));
const RNVersion = env.RN_VERSION ? env.RN_VERSION : corePackageJson.devDependencies['react-native'];
const RNEngine = env.RN_ENGINE ? env.RN_ENGINE : 'hermes';
Expand Down Expand Up @@ -109,6 +110,7 @@ function patchBoostIfNeeded(rnVersion, patchScriptsDir) {
if (actions.includes('create') || (env.CI === undefined && actions.includes('build'))) {
execSync(`yarn build`, { stdio: 'inherit', cwd: workspaceRootDir, env: env });
execSync(`yalc publish --private`, { stdio: 'inherit', cwd: e2eDir, env: env });
execSync(`yalc publish`, { stdio: 'inherit', cwd: expoUploadSourcemapsPackageDir, env: env });
execSync(`yalc publish`, { stdio: 'inherit', cwd: corePackageDir, env: env });
}

Expand All @@ -122,7 +124,14 @@ if (actions.includes('create')) {

// Install dependencies
// yalc add doesn't fail if the package is not found - it skips silently.
let yalcAddOutput = execSync(`yalc add @sentry/react-native`, { cwd: appDir, env: env, encoding: 'utf-8' });
let yalcAddOutput = execSync(`yalc add @sentry/expo-upload-sourcemaps`, { cwd: appDir, env: env, encoding: 'utf-8' });
if (!yalcAddOutput.match(/Package .* added ==>/)) {
console.error(yalcAddOutput);
process.exit(1);
} else {
console.log(yalcAddOutput.trim());
}
yalcAddOutput = execSync(`yalc add @sentry/react-native`, { cwd: appDir, env: env, encoding: 'utf-8' });
if (!yalcAddOutput.match(/Package .* added ==>/)) {
console.error(yalcAddOutput);
process.exit(1);
Expand All @@ -137,6 +146,19 @@ if (actions.includes('create')) {
console.log(yalcAddOutput.trim());
}

// Force yarn to resolve the transitive @sentry/expo-upload-sourcemaps dep
// to the local yalc copy. Without this, yarn tries to fetch it from the
// npm registry (because yalc rewrites the workspace:* spec in core's
// published package.json to a concrete version) and 404s until the package
// is released.
const appPackageJsonPath = `${appDir}/package.json`;
const appPackageJson = JSON.parse(fs.readFileSync(appPackageJsonPath, 'utf-8'));
appPackageJson.resolutions = {
...appPackageJson.resolutions,
'@sentry/expo-upload-sourcemaps': 'file:.yalc/@sentry/expo-upload-sourcemaps',
};
fs.writeFileSync(appPackageJsonPath, JSON.stringify(appPackageJson, null, 2) + '\n');

// original yarnrc contains the exact yarn version which causes corepack to fail to install yarn v3
fs.writeFileSync(`${appDir}/.yarnrc.yml`, 'nodeLinker: node-modules', { encoding: 'utf-8' });
// yarn v3 won't install dependencies in a sub project without a yarn.lock file present
Expand Down
10 changes: 8 additions & 2 deletions dev-packages/type-check/run-type-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ set -ex

__dirpath=$(dirname $(realpath "$0"))

cd "${__dirpath}/../../packages/expo-upload-sourcemaps"

yalc publish

cd "${__dirpath}/../../packages/core"

yalc publish

cd "${__dirpath}/ts3.8-test"

# Add yalc package (creates .yalc/ directory and updates package.json)
# Add yalc packages (creates .yalc/ directory and updates package.json)
yalc add @sentry/expo-upload-sourcemaps
yalc add @sentry/react-native

yarn install

# Re-add yalc package to ensure it's in node_modules (yarn might have removed it)
# Re-add yalc packages to ensure they are in node_modules (yarn might have removed them)
yalc add @sentry/expo-upload-sourcemaps
yalc add @sentry/react-native

echo "Removing duplicate React types..."
Expand Down
4 changes: 4 additions & 0 deletions dev-packages/type-check/ts3.8-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"typescript": "3.8.3"
},
"dependencies": {
"@sentry/expo-upload-sourcemaps": "file:.yalc/@sentry/expo-upload-sourcemaps",
"@sentry/react-native": "file:.yalc/@sentry/react-native",
"react": "17.0.2",
"react-native": "0.65.3"
},
"resolutions": {
"@sentry/expo-upload-sourcemaps": "file:.yalc/@sentry/expo-upload-sourcemaps"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"workspaces": [
"packages/core",
"packages/expo-upload-sourcemaps",
"dev-packages/e2e-tests",
"dev-packages/type-check",
"dev-packages/utils",
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@sentry/browser": "10.49.0",
"@sentry/cli": "3.4.0",
"@sentry/core": "10.49.0",
"@sentry/expo-upload-sourcemaps": "workspace:*",
"@sentry/react": "10.49.0",
"@sentry/types": "10.49.0"
},
Expand Down
Loading
Loading