From e69ac945ca2d9038f87e98a307e2861a7798c582 Mon Sep 17 00:00:00 2001 From: d0422 Date: Thu, 26 Sep 2024 15:48:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?config:=20sentry=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react-native/android/app/build.gradle | 1 + packages/react-native/ios/Podfile.lock | 52 +++ .../ios/SPOTClient.xcodeproj/project.pbxproj | 17 +- packages/react-native/metro.config.js | 7 +- packages/react-native/package.json | 1 + yarn.lock | 303 +++++++++++++++++- 6 files changed, 376 insertions(+), 5 deletions(-) diff --git a/packages/react-native/android/app/build.gradle b/packages/react-native/android/app/build.gradle index 2e318de9..e99d0f24 100644 --- a/packages/react-native/android/app/build.gradle +++ b/packages/react-native/android/app/build.gradle @@ -73,6 +73,7 @@ def enableProguardInReleaseBuilds = false */ def jscFlavor = 'org.webkit:android-jsc:+' +apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle") android { ndkVersion rootProject.ext.ndkVersion buildToolsVersion rootProject.ext.buildToolsVersion diff --git a/packages/react-native/ios/Podfile.lock b/packages/react-native/ios/Podfile.lock index aba1ad45..5b31a23b 100644 --- a/packages/react-native/ios/Podfile.lock +++ b/packages/react-native/ios/Podfile.lock @@ -1019,6 +1019,8 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga + - react-native-mail (6.1.1): + - React-Core - react-native-pager-view (6.3.3): - DoubleConversion - glog @@ -1317,6 +1319,15 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga + - RNImageCropPicker (0.41.2): + - React-Core + - React-RCTImage + - RNImageCropPicker/QBImagePickerController (= 0.41.2) + - TOCropViewController (~> 2.7.4) + - RNImageCropPicker/QBImagePickerController (0.41.2): + - React-Core + - React-RCTImage + - TOCropViewController (~> 2.7.4) - RNPermissions (4.1.5): - React-Core - RNReanimated (3.14.0): @@ -1362,9 +1373,34 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga + - RNSentry (5.33.1): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Sentry/HybridSDK (= 8.36.0) + - Yoga - RNSVG (15.4.0): - React-Core + - Sentry/HybridSDK (8.36.0) - SocketRocket (0.7.0) + - TOCropViewController (2.7.4) - VisionCamera (4.5.0): - VisionCamera/Core (= 4.5.0) - VisionCamera/React (= 4.5.0) @@ -1412,6 +1448,7 @@ DEPENDENCIES: - react-native-date-picker (from `../../../node_modules/react-native-date-picker`) - "react-native-geolocation (from `../../../node_modules/@react-native-community/geolocation`)" - react-native-image-picker (from `../../../node_modules/react-native-image-picker`) + - react-native-mail (from `../../../node_modules/react-native-mail`) - react-native-pager-view (from `../../../node_modules/react-native-pager-view`) - react-native-safe-area-context (from `../../../node_modules/react-native-safe-area-context`) - react-native-view-shot (from `../../../node_modules/react-native-view-shot`) @@ -1441,9 +1478,11 @@ DEPENDENCIES: - ReactCommon/turbomodule/core (from `../../../node_modules/react-native/ReactCommon`) - "RNCAsyncStorage (from `../../../node_modules/@react-native-async-storage/async-storage`)" - RNGestureHandler (from `../../../node_modules/react-native-gesture-handler`) + - RNImageCropPicker (from `../../../node_modules/react-native-image-crop-picker`) - RNPermissions (from `../../../node_modules/react-native-permissions`) - RNReanimated (from `../../../node_modules/react-native-reanimated`) - RNScreens (from `../../../node_modules/react-native-screens`) + - "RNSentry (from `../../../node_modules/@sentry/react-native`)" - RNSVG (from `../../../node_modules/react-native-svg`) - VisionCamera (from `../../../node_modules/react-native-vision-camera`) - Yoga (from `../../../node_modules/react-native/ReactCommon/yoga`) @@ -1454,7 +1493,9 @@ SPEC REPOS: - KakaoSDKAuth - KakaoSDKCommon - KakaoSDKUser + - Sentry - SocketRocket + - TOCropViewController EXTERNAL SOURCES: boost: @@ -1530,6 +1571,8 @@ EXTERNAL SOURCES: :path: "../../../node_modules/@react-native-community/geolocation" react-native-image-picker: :path: "../../../node_modules/react-native-image-picker" + react-native-mail: + :path: "../../../node_modules/react-native-mail" react-native-pager-view: :path: "../../../node_modules/react-native-pager-view" react-native-safe-area-context: @@ -1588,12 +1631,16 @@ EXTERNAL SOURCES: :path: "../../../node_modules/@react-native-async-storage/async-storage" RNGestureHandler: :path: "../../../node_modules/react-native-gesture-handler" + RNImageCropPicker: + :path: "../../../node_modules/react-native-image-crop-picker" RNPermissions: :path: "../../../node_modules/react-native-permissions" RNReanimated: :path: "../../../node_modules/react-native-reanimated" RNScreens: :path: "../../../node_modules/react-native-screens" + RNSentry: + :path: "../../../node_modules/@sentry/react-native" RNSVG: :path: "../../../node_modules/react-native-svg" VisionCamera: @@ -1642,6 +1689,7 @@ SPEC CHECKSUMS: react-native-date-picker: 6891317e850deae5b53d51355226e07a495aba61 react-native-geolocation: 67d909c955daedea3f8c30d912f004f806edff64 react-native-image-picker: c3afe5472ef870d98a4b28415fc0b928161ee5f7 + react-native-mail: 8fdcd3aef007c33a6877a18eb4cf7447a1d4ce4a react-native-pager-view: f848f89049a8e888d38f10ff31588eb63292a95f react-native-safe-area-context: b7daa1a8df36095a032dff095a1ea8963cb48371 react-native-view-shot: 6b7ed61d77d88580fed10954d45fad0eb2d47688 @@ -1671,11 +1719,15 @@ SPEC CHECKSUMS: ReactCommon: f00e436b3925a7ae44dfa294b43ef360fbd8ccc4 RNCAsyncStorage: ec53e44dc3e75b44aa2a9f37618a49c3bc080a7a RNGestureHandler: 8dbcccada4a7e702e7dec9338c251b1cf393c960 + RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f RNPermissions: 4eb47e412214ddbc0fc5cc76fd441f456da95df7 RNReanimated: 7e6fc1e80f412285a16ac3879b9e4672ffa91cef RNScreens: 5aeecbb09aa7285379b6e9f3c8a3c859bb16401c + RNSentry: c74f756c88aa2a90070f555609d2a31ab2a7f461 RNSVG: cb24fb322de8c1ebf59904e7aca0447bb8dbed5a + Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d + TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 VisionCamera: 412fec057156eb5fe84a44351e8ed71a072c1228 Yoga: 04f1db30bb810187397fa4c37dd1868a27af229c diff --git a/packages/react-native/ios/SPOTClient.xcodeproj/project.pbxproj b/packages/react-native/ios/SPOTClient.xcodeproj/project.pbxproj index 68a26ce6..516a90bd 100644 --- a/packages/react-native/ios/SPOTClient.xcodeproj/project.pbxproj +++ b/packages/react-native/ios/SPOTClient.xcodeproj/project.pbxproj @@ -208,6 +208,7 @@ 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + 9B09695C53C748268689B9F8 /* Upload Debug Symbols to Sentry */, ); buildRules = ( ); @@ -293,7 +294,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; + shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT \\\"/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\\\"\"\n"; }; 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; @@ -407,6 +408,20 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SPOTClient-SPOTClientTests/Pods-SPOTClient-SPOTClientTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 9B09695C53C748268689B9F8 /* Upload Debug Symbols to Sentry */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + name = "Upload Debug Symbols to Sentry"; + inputPaths = ( + ); + outputPaths = ( + ); + shellPath = /bin/sh; + shellScript = "/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/packages/react-native/metro.config.js b/packages/react-native/metro.config.js index 4372df78..1b592a0c 100644 --- a/packages/react-native/metro.config.js +++ b/packages/react-native/metro.config.js @@ -1,6 +1,11 @@ const path = require('path'); const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); + +const { withSentryConfig } = require('@sentry/react-native/metro'); + const config = { watchFolders: [path.resolve(__dirname, '../../')], }; -module.exports = mergeConfig(getDefaultConfig(__dirname), config); +module.exports = withSentryConfig( + mergeConfig(getDefaultConfig(__dirname), config), +); diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 37c70263..460d7282 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -25,6 +25,7 @@ "@react-navigation/material-top-tabs": "^6.6.14", "@react-navigation/native": "^6.1.17", "@react-navigation/stack": "^6.4.0", + "@sentry/react-native": "^5.33.1", "@tanstack/react-query": "^5.51.9", "axios": "^1.7.2", "babel-plugin-module-resolver": "^5.0.2", diff --git a/yarn.lock b/yarn.lock index f296b182..9044a13d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3713,6 +3713,251 @@ __metadata: languageName: node linkType: hard +"@sentry-internal/feedback@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry-internal/feedback@npm:7.119.0" + dependencies: + "@sentry/core": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: 87eed91cd77cbe914a0150e7d02097be39c6e8b08bf809ddaa0be16b9c8921fd5afbf7b5c90a93f6c79502b2770f10d9bab6b34bb14a46697f0b10efc06285ea + languageName: node + linkType: hard + +"@sentry-internal/replay-canvas@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry-internal/replay-canvas@npm:7.119.0" + dependencies: + "@sentry/core": 7.119.0 + "@sentry/replay": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: aee5c862f6ee2b257da8a22e448c5939baec8fc3408d0bba4589b42d67197827e9f7f3dfd2fc529fab9ae4a652c1172a0b6986b3041e5c28111b4e224934fde2 + languageName: node + linkType: hard + +"@sentry-internal/tracing@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry-internal/tracing@npm:7.119.0" + dependencies: + "@sentry/core": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: 23493c08463ea9a296bfb7fbaf315246347e2a1212ff561076d76fefdf33e64d2ee6925912a1be2ec4aff22c7ad36686d0d15609acca26be8d7ed58b658ab773 + languageName: node + linkType: hard + +"@sentry/babel-plugin-component-annotate@npm:2.20.1": + version: 2.20.1 + resolution: "@sentry/babel-plugin-component-annotate@npm:2.20.1" + checksum: 5fecba8c7915693fec811bb06ff0441f28496f6b12e811337a08996a7aa13a13a069c9f9ed28bac95be89d03b422a68d7236ab3376c161edbe051cb0ad2a0193 + languageName: node + linkType: hard + +"@sentry/browser@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/browser@npm:7.119.0" + dependencies: + "@sentry-internal/feedback": 7.119.0 + "@sentry-internal/replay-canvas": 7.119.0 + "@sentry-internal/tracing": 7.119.0 + "@sentry/core": 7.119.0 + "@sentry/integrations": 7.119.0 + "@sentry/replay": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: 50df92a595cdd6451ff75af294b3b148cf0ed675787d99a0dbf65e186221e287e696a1222e40c8d9f32da7576bfa5913f29aea0929df3af7bed3d867d25a64af + languageName: node + linkType: hard + +"@sentry/cli-darwin@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-darwin@npm:2.36.1" + conditions: os=darwin + languageName: node + linkType: hard + +"@sentry/cli-linux-arm64@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-linux-arm64@npm:2.36.1" + conditions: (os=linux | os=freebsd) & cpu=arm64 + languageName: node + linkType: hard + +"@sentry/cli-linux-arm@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-linux-arm@npm:2.36.1" + conditions: (os=linux | os=freebsd) & cpu=arm + languageName: node + linkType: hard + +"@sentry/cli-linux-i686@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-linux-i686@npm:2.36.1" + conditions: (os=linux | os=freebsd) & (cpu=x86 | cpu=ia32) + languageName: node + linkType: hard + +"@sentry/cli-linux-x64@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-linux-x64@npm:2.36.1" + conditions: (os=linux | os=freebsd) & cpu=x64 + languageName: node + linkType: hard + +"@sentry/cli-win32-i686@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-win32-i686@npm:2.36.1" + conditions: os=win32 & (cpu=x86 | cpu=ia32) + languageName: node + linkType: hard + +"@sentry/cli-win32-x64@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli-win32-x64@npm:2.36.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@sentry/cli@npm:2.36.1": + version: 2.36.1 + resolution: "@sentry/cli@npm:2.36.1" + dependencies: + "@sentry/cli-darwin": 2.36.1 + "@sentry/cli-linux-arm": 2.36.1 + "@sentry/cli-linux-arm64": 2.36.1 + "@sentry/cli-linux-i686": 2.36.1 + "@sentry/cli-linux-x64": 2.36.1 + "@sentry/cli-win32-i686": 2.36.1 + "@sentry/cli-win32-x64": 2.36.1 + https-proxy-agent: ^5.0.0 + node-fetch: ^2.6.7 + progress: ^2.0.3 + proxy-from-env: ^1.1.0 + which: ^2.0.2 + dependenciesMeta: + "@sentry/cli-darwin": + optional: true + "@sentry/cli-linux-arm": + optional: true + "@sentry/cli-linux-arm64": + optional: true + "@sentry/cli-linux-i686": + optional: true + "@sentry/cli-linux-x64": + optional: true + "@sentry/cli-win32-i686": + optional: true + "@sentry/cli-win32-x64": + optional: true + bin: + sentry-cli: bin/sentry-cli + checksum: 036ebfa2a7847a40bebc71f15767cdac644ac0c4bd2737bdc16e687661a2c6a0e528b481cee0b1deeddc154e138cb21ca5b292970113998b061495f3d710ec1a + languageName: node + linkType: hard + +"@sentry/core@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/core@npm:7.119.0" + dependencies: + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: 29d9282c9555c64e60d587260ebf1957e4939cc43617a38da4f5fd67723dcf68dad6d5c1d221e75576cf77c0bc0f3362c47ee856193aac120001583186f17e04 + languageName: node + linkType: hard + +"@sentry/hub@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/hub@npm:7.119.0" + dependencies: + "@sentry/core": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: f4c4fc77a7c3f8e161b86e807c999d078127cafa93407b6f7eac68fbd469902097241b5620aed1b08544767fa5f444ca2f7c70891df682fb265ac0efb50842e5 + languageName: node + linkType: hard + +"@sentry/integrations@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/integrations@npm:7.119.0" + dependencies: + "@sentry/core": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + localforage: ^1.8.1 + checksum: c256f81e7c6983c5bbf6cd9bcf867e96798b285c53aad053a6d1bc4cc0491588042c7c6eca9d5a79d2661d53bc725ad26d56ee2b6631b6249f2332bd1e4a28d9 + languageName: node + linkType: hard + +"@sentry/react-native@npm:^5.33.1": + version: 5.33.1 + resolution: "@sentry/react-native@npm:5.33.1" + dependencies: + "@sentry/babel-plugin-component-annotate": 2.20.1 + "@sentry/browser": 7.119.0 + "@sentry/cli": 2.36.1 + "@sentry/core": 7.119.0 + "@sentry/hub": 7.119.0 + "@sentry/integrations": 7.119.0 + "@sentry/react": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + peerDependencies: + expo: ">=49.0.0" + react: ">=17.0.0" + react-native: ">=0.65.0" + peerDependenciesMeta: + expo: + optional: true + bin: + sentry-expo-upload-sourcemaps: scripts/expo-upload-sourcemaps.js + checksum: b366f7c78003e2463e390aa7684dff93d2debc322daad0f34c39563936aa3698f16d71387c5d8fe1c456a7ac2ed50167aef7d2cbdc6a8f13fe21b2a0fe333043 + languageName: node + linkType: hard + +"@sentry/react@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/react@npm:7.119.0" + dependencies: + "@sentry/browser": 7.119.0 + "@sentry/core": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + hoist-non-react-statics: ^3.3.2 + peerDependencies: + react: 15.x || 16.x || 17.x || 18.x + checksum: 5c5ccb19567b3cb660437120e9e1c649d6b4eb7966a71ad86a52892dd6312fd0b1d3be54945f133e03ce2321d95aaed9eeb3deafd138c250ee062e31fd2df17d + languageName: node + linkType: hard + +"@sentry/replay@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/replay@npm:7.119.0" + dependencies: + "@sentry-internal/tracing": 7.119.0 + "@sentry/core": 7.119.0 + "@sentry/types": 7.119.0 + "@sentry/utils": 7.119.0 + checksum: c10c08c43b1bb873bf142455e7fa568be66bbf11061d5d922b7231c6ac4e778c1fbf68a90b18629df3c87678c2ce9f3ba98d59fb4045fc4954e2aca01362c3b9 + languageName: node + linkType: hard + +"@sentry/types@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/types@npm:7.119.0" + checksum: ffb8dcaf1d5c96defe860e663553511e602cd6bfbe63b0c3fd8cba5ec1c3ea9ad47597527f4d9ef314ba1b11bccf89c4d6f50435df7cbfb92f5a398c6c261f0b + languageName: node + linkType: hard + +"@sentry/utils@npm:7.119.0": + version: 7.119.0 + resolution: "@sentry/utils@npm:7.119.0" + dependencies: + "@sentry/types": 7.119.0 + checksum: 900d5062cc92d9dbbeadd3ac2202da99ba648a78707fdbf878ff0d5eec52fc9d5484d63c281d3a1e7a6151999a5a45a1709ffc5d602e545ddb547182483831d0 + languageName: node + linkType: hard + "@sideway/address@npm:^4.1.5": version: 4.1.5 resolution: "@sideway/address@npm:4.1.5" @@ -6064,6 +6309,15 @@ __metadata: languageName: node linkType: hard +"agent-base@npm:6": + version: 6.0.2 + resolution: "agent-base@npm:6.0.2" + dependencies: + debug: 4 + checksum: f52b6872cc96fd5f622071b71ef200e01c7c4c454ee68bc9accca90c98cfb39f2810e3e9aa330435835eedc8c23f4f8a15267f67c6e245d2b33757575bdac49d + languageName: node + linkType: hard + "agent-base@npm:^7.0.2, agent-base@npm:^7.1.0, agent-base@npm:^7.1.1": version: 7.1.1 resolution: "agent-base@npm:7.1.1" @@ -10489,7 +10743,7 @@ __metadata: languageName: node linkType: hard -"hoist-non-react-statics@npm:^3.3.0, hoist-non-react-statics@npm:^3.3.1": +"hoist-non-react-statics@npm:^3.3.0, hoist-non-react-statics@npm:^3.3.1, hoist-non-react-statics@npm:^3.3.2": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" dependencies: @@ -10616,6 +10870,16 @@ __metadata: languageName: node linkType: hard +"https-proxy-agent@npm:^5.0.0": + version: 5.0.1 + resolution: "https-proxy-agent@npm:5.0.1" + dependencies: + agent-base: 6 + debug: 4 + checksum: 571fccdf38184f05943e12d37d6ce38197becdd69e58d03f43637f7fa1269cf303a7d228aa27e5b27bbd3af8f09fd938e1c91dcfefff2df7ba77c20ed8dfc765 + languageName: node + linkType: hard + "https-proxy-agent@npm:^7.0.1": version: 7.0.5 resolution: "https-proxy-agent@npm:7.0.5" @@ -10708,6 +10972,13 @@ __metadata: languageName: node linkType: hard +"immediate@npm:~3.0.5": + version: 3.0.6 + resolution: "immediate@npm:3.0.6" + checksum: f9b3486477555997657f70318cc8d3416159f208bec4cca3ff3442fd266bc23f50f0c9bd8547e1371a6b5e82b821ec9a7044a4f7b944798b25aa3cc6d5e63e62 + languageName: node + linkType: hard + "import-fresh@npm:^2.0.0": version: 2.0.0 resolution: "import-fresh@npm:2.0.0" @@ -12151,6 +12422,15 @@ __metadata: languageName: node linkType: hard +"lie@npm:3.1.1": + version: 3.1.1 + resolution: "lie@npm:3.1.1" + dependencies: + immediate: ~3.0.5 + checksum: 6da9f2121d2dbd15f1eca44c0c7e211e66a99c7b326ec8312645f3648935bc3a658cf0e9fa7b5f10144d9e2641500b4f55bd32754607c3de945b5f443e50ddd1 + languageName: node + linkType: hard + "lighthouse-logger@npm:^1.0.0": version: 1.4.2 resolution: "lighthouse-logger@npm:1.4.2" @@ -12223,6 +12503,15 @@ __metadata: languageName: node linkType: hard +"localforage@npm:^1.8.1": + version: 1.10.0 + resolution: "localforage@npm:1.10.0" + dependencies: + lie: 3.1.1 + checksum: f2978b434dafff9bcb0d9498de57d97eba165402419939c944412e179cab1854782830b5ec196212560b22712d1dd03918939f59cf1d4fc1d756fca7950086cf + languageName: node + linkType: hard + "locate-path@npm:^3.0.0": version: 3.0.0 resolution: "locate-path@npm:3.0.0" @@ -13194,7 +13483,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.0.0, node-fetch@npm:^2.2.0, node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.12": +"node-fetch@npm:^2.0.0, node-fetch@npm:^2.2.0, node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -14328,6 +14617,13 @@ __metadata: languageName: node linkType: hard +"progress@npm:^2.0.3": + version: 2.0.3 + resolution: "progress@npm:2.0.3" + checksum: f67403fe7b34912148d9252cb7481266a354bd99ce82c835f79070643bb3c6583d10dbcfda4d41e04bbc1d8437e9af0fb1e1f2135727878f5308682a579429b7 + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -14975,6 +15271,7 @@ __metadata: "@react-navigation/material-top-tabs": ^6.6.14 "@react-navigation/native": ^6.1.17 "@react-navigation/stack": ^6.4.0 + "@sentry/react-native": ^5.33.1 "@tanstack/react-query": ^5.51.9 "@types/d3-geo": ^3.1.0 "@types/react": ^18.2.6 @@ -17703,7 +18000,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^2.0.1": +"which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" dependencies: From af97ffe77d35a658c977e8920f6221b9c29b3f3f Mon Sep 17 00:00:00 2001 From: d0422 Date: Thu, 26 Sep 2024 15:52:42 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EC=98=A4=EB=A5=98=20=EB=B0=9C?= =?UTF-8?q?=EC=83=9D=EC=8B=9C=20sentry=EB=A1=9C=20=EB=B3=B4=EB=82=B4?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-native/env.d.ts | 1 + packages/react-native/src/App.tsx | 13 +++++++++++-- .../src/components/HOC/withSpotErrorBoundary.tsx | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/react-native/env.d.ts b/packages/react-native/env.d.ts index c2307f38..19899bcc 100644 --- a/packages/react-native/env.d.ts +++ b/packages/react-native/env.d.ts @@ -3,4 +3,5 @@ declare module '@env' { export const BASE_URL: string; export const DEV_ACCESS_TOKEN: string; export const DEV_REFRESH_TOKEN: string; + export const SENTRY_DSN: string; } diff --git a/packages/react-native/src/App.tsx b/packages/react-native/src/App.tsx index b1ce33cf..e1a09cce 100644 --- a/packages/react-native/src/App.tsx +++ b/packages/react-native/src/App.tsx @@ -4,6 +4,12 @@ import StackNavigator from '@routes/StackNavigator'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Alert } from 'react-native'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; +import * as Sentry from '@sentry/react-native'; +import { SENTRY_DSN } from '@env'; + +Sentry.init({ + dsn: SENTRY_DSN, +}); const queryClient = new QueryClient({ defaultOptions: { @@ -12,13 +18,14 @@ const queryClient = new QueryClient({ throwOnError: true, }, mutations: { - onError: () => { + onError: (err) => { + Sentry.captureException(err); Alert.alert('오류가 발생했어요', '잠시뒤에 시도해보세요.'); }, }, }, }); -export default function App() { +function App() { return ( @@ -31,3 +38,5 @@ export default function App() { ); } + +export default Sentry.wrap(App); diff --git a/packages/react-native/src/components/HOC/withSpotErrorBoundary.tsx b/packages/react-native/src/components/HOC/withSpotErrorBoundary.tsx index 0a3ba17a..857f6cc1 100644 --- a/packages/react-native/src/components/HOC/withSpotErrorBoundary.tsx +++ b/packages/react-native/src/components/HOC/withSpotErrorBoundary.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { ErrorBoundary } from 'react-error-boundary'; +import * as Sentry from '@sentry/react-native'; import Error from '../common/Error'; export default function withSpotErrorBoundary( @@ -7,7 +8,10 @@ export default function withSpotErrorBoundary( ) { return function ErrorBoundaryComponent({ ...props }: T) { return ( - }> + } + onError={(err) => Sentry.captureException(err)} + > {/* eslint-disable-next-line react/jsx-props-no-spreading */}