Skip to content
Merged
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
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Changelog

## 1.3.1
## 2.0.0

- revert(react-native) Xcode linking for RN 0.69 and higher (#177)
- fix(react-native) Xcode linking for RN 0.69 and higher (#178)

## 1.3.0

- chore(deps): Bump sentry-cli to 1.72.0 (#154)
- feat(nextjs): Use helper function in `_error.js` (#170)
- fix(electron): Fix version detection to use electron/package.json (#161)
- fix(react-native) Xcode linking for RN 0.69 and higher (#173)

## 1.2.17

Expand Down
38 changes: 9 additions & 29 deletions lib/Steps/Integrations/ReactNative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ export class ReactNative extends MobileProject {
for (const script of buildScripts) {
if (
!script.shellScript.match(
/(packager|scripts)\/react-native-xcode\.sh\b/,
/\/scripts\/react-native-xcode\.sh/i,
) ||
script.shellScript.match(/sentry-cli\s+react-native[\s-]xcode/)
script.shellScript.match(/sentry-cli\s+react-native\s+xcode/i)
) {
continue;
}
Expand All @@ -243,9 +243,10 @@ export class ReactNative extends MobileProject {
'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: any) =>
`../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ${match}`,
'$REACT_NATIVE_XCODE',
() =>
// eslint-disable-next-line no-useless-escape
'\\\"../node_modules/@sentry/cli/bin/sentry-cli react-native xcode $REACT_NATIVE_XCODE\\\"',
);
script.shellScript = JSON.stringify(code);
}
Expand Down Expand Up @@ -339,38 +340,20 @@ export class ReactNative extends MobileProject {
}

// ignore scripts that do not invoke the react-native-xcode command.
if (!script.shellScript.match(/sentry-cli\s+react-native[\s-]xcode\b/)) {
if (!script.shellScript.match(/sentry-cli\s+react-native\s+xcode/i)) {
continue;
}

script.shellScript = JSON.stringify(
JSON.parse(script.shellScript)
// "legacy" location for this. This is what happens if users followed
// the old documentation for where to add the bundle command
.replace(
/^..\/node_modules\/@sentry\/react-native\/bin\/bundle-frameworks\s*?\r\n?/m,
'',
)
// legacy location for dsym upload
.replace(
/^..\/node_modules\/@sentry\/cli\/bin\/sentry-cli upload-dsym\s*?\r?\n/m,
'',
)
// remove sentry properties export
.replace(/^export SENTRY_PROPERTIES=sentry.properties\r?\n/m, '')
// unwrap react-native-xcode.sh command. In case someone replaced it
// entirely with the sentry-cli command we need to put the original
// version back in.
.replace(
/^(?:..\/node_modules\/@sentry\/cli\/bin\/)?sentry-cli\s+react-native[\s-]xcode(\s+.*?)$/m,
(match: any, m1: string) => {
const rv = m1.trim();
if (rv === '') {
return '../node_modules/react-native/scripts/react-native-xcode.sh';
} else {
return rv;
}
},
/\.\.\/node_modules\/@sentry\/cli\/bin\/sentry-cli\s+react-native\s+xcode\s+\$REACT_NATIVE_XCODE/i,
'$REACT_NATIVE_XCODE',
),
);
}
Expand All @@ -385,9 +368,6 @@ export class ReactNative extends MobileProject {
}

if (
script.shellScript.match(
/@sentry\/react-native\/bin\/bundle-frameworks\b/,
) ||
script.shellScript.match(
/@sentry\/cli\/bin\/sentry-cli\s+upload-dsym\b/,
)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"test": "yarn build && jest",
"try": "ts-node bin.ts",
"try:uninstall": "ts-node bin.ts --uninstall",
"test:watch": "jest --watch --notify"
},
"jest": {
Expand Down