@sentry/react-native 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNSentry.podspec +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java +7 -3
- package/android/src/main/java/io/sentry/react/RNSentryMapConverter.java +5 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +20 -21
- package/android/src/main/java/io/sentry/react/RNSentryReactFragmentLifecycleTracer.java +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java +10 -14
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/package.json +9 -9
- package/plugin/build/utils.js +6 -6
- package/plugin/build/withSentry.js +2 -2
- package/plugin/build/withSentryAndroid.js +2 -2
- package/plugin/build/withSentryIOS.js +3 -3
- package/ts3.8/dist/js/version.d.ts +1 -1
package/RNSentry.podspec
CHANGED
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
|
|
38
38
|
s.compiler_flags = other_cflags
|
|
39
39
|
|
|
40
|
-
s.dependency 'Sentry/HybridSDK', '8.
|
|
40
|
+
s.dependency 'Sentry/HybridSDK', '8.38.0'
|
|
41
41
|
|
|
42
42
|
if defined? install_modules_dependencies
|
|
43
43
|
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
|
|
@@ -7,13 +7,17 @@ import java.util.Map;
|
|
|
7
7
|
import org.jetbrains.annotations.NotNull;
|
|
8
8
|
import org.jetbrains.annotations.Nullable;
|
|
9
9
|
|
|
10
|
-
public class RNSentryBreadcrumb {
|
|
10
|
+
public final class RNSentryBreadcrumb {
|
|
11
|
+
|
|
12
|
+
private RNSentryBreadcrumb() {
|
|
13
|
+
throw new AssertionError("Utility class should not be instantiated");
|
|
14
|
+
}
|
|
11
15
|
|
|
12
16
|
@Nullable
|
|
13
17
|
public static String getCurrentScreenFrom(ReadableMap from) {
|
|
14
18
|
final @Nullable String maybeCategory =
|
|
15
19
|
from.hasKey("category") ? from.getString("category") : null;
|
|
16
|
-
if (maybeCategory == null || !
|
|
20
|
+
if (maybeCategory == null || !"navigation".equals(maybeCategory)) {
|
|
17
21
|
return null;
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -26,7 +30,7 @@ public class RNSentryBreadcrumb {
|
|
|
26
30
|
// getString might throw if cast to string fails (data.to is not enforced by TS to be a
|
|
27
31
|
// string)
|
|
28
32
|
return maybeData.hasKey("to") ? maybeData.getString("to") : null;
|
|
29
|
-
} catch (Throwable exception) {
|
|
33
|
+
} catch (Throwable exception) { // NOPMD - We don't want to crash in any case
|
|
30
34
|
return null;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
@@ -14,11 +14,15 @@ import java.util.List;
|
|
|
14
14
|
import java.util.Map;
|
|
15
15
|
import org.jetbrains.annotations.Nullable;
|
|
16
16
|
|
|
17
|
-
public class RNSentryMapConverter {
|
|
17
|
+
public final class RNSentryMapConverter {
|
|
18
18
|
public static final String NAME = "RNSentry.MapConverter";
|
|
19
19
|
|
|
20
20
|
private static final ILogger logger = new AndroidLogger(NAME);
|
|
21
21
|
|
|
22
|
+
private RNSentryMapConverter() {
|
|
23
|
+
throw new AssertionError("Utility class should not be instantiated");
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
public static Object convertToWritable(@Nullable Object serialized) {
|
|
23
27
|
if (serialized instanceof List) {
|
|
24
28
|
WritableArray writable = Arguments.createArray();
|
|
@@ -91,7 +91,7 @@ public class RNSentryModuleImpl {
|
|
|
91
91
|
private static final ILogger logger = new AndroidLogger(NAME);
|
|
92
92
|
private static final BuildInfoProvider buildInfo = new BuildInfoProvider(logger);
|
|
93
93
|
private static final String modulesPath = "modules.json";
|
|
94
|
-
private static final Charset UTF_8 = Charset.forName("UTF-8");
|
|
94
|
+
private static final Charset UTF_8 = Charset.forName("UTF-8"); // NOPMD - Allow using UTF-8
|
|
95
95
|
|
|
96
96
|
private final ReactApplicationContext reactApplicationContext;
|
|
97
97
|
private final PackageInfo packageInfo;
|
|
@@ -270,7 +270,7 @@ public class RNSentryModuleImpl {
|
|
|
270
270
|
if (null != ex && ex.getType().contains("JavascriptException")) {
|
|
271
271
|
return null;
|
|
272
272
|
}
|
|
273
|
-
} catch (Throwable ignored) {
|
|
273
|
+
} catch (Throwable ignored) { // NOPMD - We don't want to crash in any case
|
|
274
274
|
// We do nothing
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -356,12 +356,12 @@ public class RNSentryModuleImpl {
|
|
|
356
356
|
throw new RuntimeException("TEST - Sentry Client Crash (only works in release mode)");
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
public void addListener(String
|
|
359
|
+
public void addListener(String eventType) {
|
|
360
360
|
// Is must be defined otherwise the generated interface from TS won't be fulfilled
|
|
361
361
|
logger.log(SentryLevel.ERROR, "addListener of NativeEventEmitter can't be used on Android!");
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
public void removeListeners(double
|
|
364
|
+
public void removeListeners(double id) {
|
|
365
365
|
// Is must be defined otherwise the generated interface from TS won't be fulfilled
|
|
366
366
|
logger.log(
|
|
367
367
|
SentryLevel.ERROR, "removeListeners of NativeEventEmitter can't be used on Android!");
|
|
@@ -369,17 +369,16 @@ public class RNSentryModuleImpl {
|
|
|
369
369
|
|
|
370
370
|
public void fetchModules(Promise promise) {
|
|
371
371
|
final AssetManager assets = this.getReactApplicationContext().getResources().getAssets();
|
|
372
|
-
try (
|
|
373
|
-
new BufferedInputStream(assets.open(RNSentryModuleImpl.modulesPath))) {
|
|
372
|
+
try (InputStream stream = new BufferedInputStream(assets.open(modulesPath))) {
|
|
374
373
|
int size = stream.available();
|
|
375
374
|
byte[] buffer = new byte[size];
|
|
376
375
|
stream.read(buffer);
|
|
377
376
|
stream.close();
|
|
378
|
-
String modulesJson = new String(buffer,
|
|
377
|
+
String modulesJson = new String(buffer, UTF_8);
|
|
379
378
|
promise.resolve(modulesJson);
|
|
380
379
|
} catch (FileNotFoundException e) {
|
|
381
380
|
promise.resolve(null);
|
|
382
|
-
} catch (Throwable e) {
|
|
381
|
+
} catch (Throwable e) { // NOPMD - We don't want to crash in any case
|
|
383
382
|
logger.log(SentryLevel.WARNING, "Fetching JS Modules failed.");
|
|
384
383
|
promise.resolve(null);
|
|
385
384
|
}
|
|
@@ -462,7 +461,7 @@ public class RNSentryModuleImpl {
|
|
|
462
461
|
map.putInt("frozenFrames", frozenFrames);
|
|
463
462
|
|
|
464
463
|
promise.resolve(map);
|
|
465
|
-
} catch (Throwable ignored) {
|
|
464
|
+
} catch (Throwable ignored) { // NOPMD - We don't want to crash in any case
|
|
466
465
|
logger.log(SentryLevel.WARNING, "Error fetching native frames.");
|
|
467
466
|
promise.resolve(null);
|
|
468
467
|
}
|
|
@@ -493,7 +492,7 @@ public class RNSentryModuleImpl {
|
|
|
493
492
|
try {
|
|
494
493
|
InternalSentrySdk.captureEnvelope(
|
|
495
494
|
bytes, !options.hasKey("hardCrashed") || !options.getBoolean("hardCrashed"));
|
|
496
|
-
} catch (Throwable e) {
|
|
495
|
+
} catch (Throwable e) { // NOPMD - We don't want to crash in any case
|
|
497
496
|
logger.log(SentryLevel.ERROR, "Error while capturing envelope");
|
|
498
497
|
promise.resolve(false);
|
|
499
498
|
}
|
|
@@ -511,7 +510,7 @@ public class RNSentryModuleImpl {
|
|
|
511
510
|
|
|
512
511
|
final byte[] raw = takeScreenshotOnUiThread(activity);
|
|
513
512
|
|
|
514
|
-
if (raw == null) {
|
|
513
|
+
if (raw == null || raw.length == 0) {
|
|
515
514
|
logger.log(SentryLevel.WARNING, "Screenshot is null, screen was not captured.");
|
|
516
515
|
promise.resolve(null);
|
|
517
516
|
return;
|
|
@@ -550,7 +549,7 @@ public class RNSentryModuleImpl {
|
|
|
550
549
|
doneSignal.await(SCREENSHOT_TIMEOUT_SECONDS, SECONDS);
|
|
551
550
|
} catch (InterruptedException e) {
|
|
552
551
|
logger.log(SentryLevel.ERROR, "Screenshot process was interrupted.");
|
|
553
|
-
return
|
|
552
|
+
return new byte[0];
|
|
554
553
|
}
|
|
555
554
|
|
|
556
555
|
return bytesWrapper[0];
|
|
@@ -627,7 +626,7 @@ public class RNSentryModuleImpl {
|
|
|
627
626
|
}
|
|
628
627
|
|
|
629
628
|
if (userDataKeys != null) {
|
|
630
|
-
|
|
629
|
+
Map<String, String> userDataMap = new HashMap<>();
|
|
631
630
|
ReadableMapKeySetIterator it = userDataKeys.keySetIterator();
|
|
632
631
|
while (it.hasNextKey()) {
|
|
633
632
|
String key = it.nextKey();
|
|
@@ -694,7 +693,7 @@ public class RNSentryModuleImpl {
|
|
|
694
693
|
return;
|
|
695
694
|
}
|
|
696
695
|
|
|
697
|
-
final
|
|
696
|
+
final Map<String, Object> contextHashMap = context.toHashMap();
|
|
698
697
|
scope.setContexts(key, contextHashMap);
|
|
699
698
|
});
|
|
700
699
|
}
|
|
@@ -726,7 +725,7 @@ public class RNSentryModuleImpl {
|
|
|
726
725
|
frameMetricsAggregator.add(currentActivity);
|
|
727
726
|
|
|
728
727
|
logger.log(SentryLevel.INFO, "FrameMetricsAggregator installed.");
|
|
729
|
-
} catch (Throwable ignored) {
|
|
728
|
+
} catch (Throwable ignored) { // NOPMD - We don't want to crash in any case
|
|
730
729
|
// throws ConcurrentModification when calling addOnFrameMetricsAvailableListener
|
|
731
730
|
// this is a best effort since we can't reproduce it
|
|
732
731
|
logger.log(SentryLevel.ERROR, "Error adding Activity to frameMetricsAggregator.");
|
|
@@ -785,7 +784,7 @@ public class RNSentryModuleImpl {
|
|
|
785
784
|
}
|
|
786
785
|
|
|
787
786
|
result.putBoolean("started", true);
|
|
788
|
-
} catch (Throwable e) {
|
|
787
|
+
} catch (Throwable e) { // NOPMD - We don't want to crash in any case
|
|
789
788
|
result.putBoolean("started", false);
|
|
790
789
|
result.putString("error", e.toString());
|
|
791
790
|
}
|
|
@@ -825,7 +824,7 @@ public class RNSentryModuleImpl {
|
|
|
825
824
|
androidProfile.putString("build_id", getProguardUuid());
|
|
826
825
|
result.putMap("androidProfile", androidProfile);
|
|
827
826
|
}
|
|
828
|
-
} catch (Throwable e) {
|
|
827
|
+
} catch (Throwable e) { // NOPMD - We don't want to crash in any case
|
|
829
828
|
result.putString("error", e.toString());
|
|
830
829
|
} finally {
|
|
831
830
|
if (output != null) {
|
|
@@ -834,7 +833,7 @@ public class RNSentryModuleImpl {
|
|
|
834
833
|
if (!wasProfileSuccessfullyDeleted) {
|
|
835
834
|
logger.log(SentryLevel.WARNING, "Profile not deleted from:" + output.getAbsolutePath());
|
|
836
835
|
}
|
|
837
|
-
} catch (Throwable e) {
|
|
836
|
+
} catch (Throwable e) { // NOPMD - We don't want to crash in any case
|
|
838
837
|
logger.log(SentryLevel.WARNING, "Profile not deleted from:" + output.getAbsolutePath());
|
|
839
838
|
}
|
|
840
839
|
}
|
|
@@ -848,7 +847,7 @@ public class RNSentryModuleImpl {
|
|
|
848
847
|
}
|
|
849
848
|
isProguardDebugMetaLoaded = true;
|
|
850
849
|
final @Nullable List<Properties> debugMetaList =
|
|
851
|
-
|
|
850
|
+
new AssetsDebugMetaLoader(this.getReactApplicationContext(), logger).loadDebugMeta();
|
|
852
851
|
if (debugMetaList == null) {
|
|
853
852
|
return null;
|
|
854
853
|
}
|
|
@@ -866,7 +865,7 @@ public class RNSentryModuleImpl {
|
|
|
866
865
|
}
|
|
867
866
|
|
|
868
867
|
private String readStringFromFile(File path) throws IOException {
|
|
869
|
-
try (
|
|
868
|
+
try (BufferedReader br = new BufferedReader(new FileReader(path)); ) {
|
|
870
869
|
|
|
871
870
|
final StringBuilder text = new StringBuilder();
|
|
872
871
|
String line;
|
|
@@ -943,7 +942,7 @@ public class RNSentryModuleImpl {
|
|
|
943
942
|
private void addPackages(SentryEvent event, SdkVersion sdk) {
|
|
944
943
|
SdkVersion eventSdk = event.getSdk();
|
|
945
944
|
if (eventSdk != null
|
|
946
|
-
&&
|
|
945
|
+
&& "sentry.javascript.react-native".equals(eventSdk.getName())
|
|
947
946
|
&& sdk != null) {
|
|
948
947
|
List<SentryPackage> sentryPackages = sdk.getPackages();
|
|
949
948
|
if (sentryPackages != null) {
|
|
@@ -40,7 +40,7 @@ public class RNSentryReactFragmentLifecycleTracer extends FragmentLifecycleCallb
|
|
|
40
40
|
@NotNull Fragment f,
|
|
41
41
|
@NotNull View v,
|
|
42
42
|
@Nullable Bundle savedInstanceState) {
|
|
43
|
-
if (!
|
|
43
|
+
if (!"com.swmansion.rnscreens.ScreenStackFragment".equals(f.getClass().getCanonicalName())) {
|
|
44
44
|
logger.log(
|
|
45
45
|
SentryLevel.DEBUG,
|
|
46
46
|
"Fragment is not a ScreenStackFragment, won't listen for the first draw.");
|
|
@@ -13,8 +13,6 @@ import org.jetbrains.annotations.Nullable;
|
|
|
13
13
|
import org.jetbrains.annotations.TestOnly;
|
|
14
14
|
|
|
15
15
|
public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadcrumbConverter {
|
|
16
|
-
public RNSentryReplayBreadcrumbConverter() {}
|
|
17
|
-
|
|
18
16
|
@Override
|
|
19
17
|
public @Nullable RRWebEvent convert(final @NotNull Breadcrumb breadcrumb) {
|
|
20
18
|
if (breadcrumb.getCategory() == null) {
|
|
@@ -22,22 +20,22 @@ public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadc
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
// Do not add Sentry Event breadcrumbs to replay
|
|
25
|
-
if (
|
|
26
|
-
||
|
|
23
|
+
if ("sentry.event".equals(breadcrumb.getCategory())
|
|
24
|
+
|| "sentry.transaction".equals(breadcrumb.getCategory())) {
|
|
27
25
|
return null;
|
|
28
26
|
}
|
|
29
|
-
if (breadcrumb.getCategory()
|
|
27
|
+
if ("http".equals(breadcrumb.getCategory())) {
|
|
30
28
|
// Drop native http breadcrumbs to avoid duplicates
|
|
31
29
|
return null;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
if (breadcrumb.getCategory()
|
|
32
|
+
if ("touch".equals(breadcrumb.getCategory())) {
|
|
35
33
|
return convertTouchBreadcrumb(breadcrumb);
|
|
36
34
|
}
|
|
37
|
-
if (breadcrumb.getCategory()
|
|
35
|
+
if ("navigation".equals(breadcrumb.getCategory())) {
|
|
38
36
|
return convertNavigationBreadcrumb(breadcrumb);
|
|
39
37
|
}
|
|
40
|
-
if (breadcrumb.getCategory()
|
|
38
|
+
if ("xhr".equals(breadcrumb.getCategory())) {
|
|
41
39
|
return convertNetworkBreadcrumb(breadcrumb);
|
|
42
40
|
}
|
|
43
41
|
|
|
@@ -46,8 +44,7 @@ public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadc
|
|
|
46
44
|
// ignore native navigation breadcrumbs
|
|
47
45
|
if (nativeBreadcrumb instanceof RRWebBreadcrumbEvent) {
|
|
48
46
|
final RRWebBreadcrumbEvent rrWebBreadcrumb = (RRWebBreadcrumbEvent) nativeBreadcrumb;
|
|
49
|
-
if (rrWebBreadcrumb.getCategory()
|
|
50
|
-
&& rrWebBreadcrumb.getCategory().equals("navigation")) {
|
|
47
|
+
if ("navigation".equals(rrWebBreadcrumb.getCategory())) {
|
|
51
48
|
return null;
|
|
52
49
|
}
|
|
53
50
|
}
|
|
@@ -69,8 +66,7 @@ public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadc
|
|
|
69
66
|
|
|
70
67
|
rrWebBreadcrumb.setCategory("ui.tap");
|
|
71
68
|
|
|
72
|
-
rrWebBreadcrumb.setMessage(
|
|
73
|
-
RNSentryReplayBreadcrumbConverter.getTouchPathMessage(breadcrumb.getData("path")));
|
|
69
|
+
rrWebBreadcrumb.setMessage(getTouchPathMessage(breadcrumb.getData("path")));
|
|
74
70
|
|
|
75
71
|
setRRWebEventDefaultsFrom(rrWebBreadcrumb, breadcrumb);
|
|
76
72
|
return rrWebBreadcrumb;
|
|
@@ -83,7 +79,7 @@ public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadc
|
|
|
83
79
|
}
|
|
84
80
|
|
|
85
81
|
final @NotNull List path = (List) maybePath;
|
|
86
|
-
if (path.
|
|
82
|
+
if (path.isEmpty()) {
|
|
87
83
|
return null;
|
|
88
84
|
}
|
|
89
85
|
|
|
@@ -145,7 +141,7 @@ public final class RNSentryReplayBreadcrumbConverter extends DefaultReplayBreadc
|
|
|
145
141
|
return null;
|
|
146
142
|
}
|
|
147
143
|
|
|
148
|
-
final
|
|
144
|
+
final Map<String, Object> data = new HashMap<>();
|
|
149
145
|
if (breadcrumb.getData("method") instanceof String) {
|
|
150
146
|
data.put("method", breadcrumb.getData("method"));
|
|
151
147
|
}
|
package/dist/js/version.d.ts
CHANGED
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.1.0';\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sentry/react-native",
|
|
3
3
|
"homepage": "https://github.com/getsentry/sentry-react-native",
|
|
4
4
|
"repository": "https://github.com/getsentry/sentry-react-native",
|
|
5
|
-
"version": "6.
|
|
5
|
+
"version": "6.1.0",
|
|
6
6
|
"description": "Official Sentry SDK for react-native",
|
|
7
7
|
"typings": "dist/js/index.d.ts",
|
|
8
8
|
"types": "dist/js/index.d.ts",
|
|
@@ -66,20 +66,20 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@sentry/babel-plugin-component-annotate": "2.20.1",
|
|
69
|
-
"@sentry/browser": "8.
|
|
69
|
+
"@sentry/browser": "8.34.0",
|
|
70
70
|
"@sentry/cli": "2.37.0",
|
|
71
|
-
"@sentry/core": "8.
|
|
72
|
-
"@sentry/react": "8.
|
|
73
|
-
"@sentry/types": "8.
|
|
74
|
-
"@sentry/utils": "8.
|
|
71
|
+
"@sentry/core": "8.34.0",
|
|
72
|
+
"@sentry/react": "8.34.0",
|
|
73
|
+
"@sentry/types": "8.34.0",
|
|
74
|
+
"@sentry/utils": "8.34.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@babel/core": "^7.23.5",
|
|
78
78
|
"@expo/metro-config": "0.17.5",
|
|
79
79
|
"@mswjs/interceptors": "^0.25.15",
|
|
80
|
-
"@sentry-internal/eslint-config-sdk": "8.
|
|
81
|
-
"@sentry-internal/eslint-plugin-sdk": "8.
|
|
82
|
-
"@sentry-internal/typescript": "8.
|
|
80
|
+
"@sentry-internal/eslint-config-sdk": "8.34.0",
|
|
81
|
+
"@sentry-internal/eslint-plugin-sdk": "8.34.0",
|
|
82
|
+
"@sentry-internal/typescript": "8.34.0",
|
|
83
83
|
"@sentry/wizard": "3.16.3",
|
|
84
84
|
"@testing-library/react-native": "^12.6.1",
|
|
85
85
|
"@types/jest": "^29.5.3",
|
package/plugin/build/utils.js
CHANGED
|
@@ -23,12 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.SDK_PACKAGE_NAME = exports.sdkPackage = void 0;
|
|
27
|
-
exports.writeSentryPropertiesTo = writeSentryPropertiesTo;
|
|
28
|
-
exports.warnOnce = warnOnce;
|
|
29
|
-
exports.logPrefix = logPrefix;
|
|
30
|
-
exports.yellow = yellow;
|
|
31
|
-
exports.bold = bold;
|
|
26
|
+
exports.SDK_PACKAGE_NAME = exports.sdkPackage = exports.bold = exports.yellow = exports.logPrefix = exports.warnOnce = exports.writeSentryPropertiesTo = void 0;
|
|
32
27
|
const fs = __importStar(require("fs"));
|
|
33
28
|
const path = __importStar(require("path"));
|
|
34
29
|
function writeSentryPropertiesTo(filepath, sentryProperties) {
|
|
@@ -37,6 +32,7 @@ function writeSentryPropertiesTo(filepath, sentryProperties) {
|
|
|
37
32
|
}
|
|
38
33
|
fs.writeFileSync(path.resolve(filepath, 'sentry.properties'), sentryProperties);
|
|
39
34
|
}
|
|
35
|
+
exports.writeSentryPropertiesTo = writeSentryPropertiesTo;
|
|
40
36
|
const sdkPackage = require('../../package.json');
|
|
41
37
|
exports.sdkPackage = sdkPackage;
|
|
42
38
|
const SDK_PACKAGE_NAME = `${sdkPackage.name}/expo`;
|
|
@@ -49,9 +45,11 @@ function warnOnce(message) {
|
|
|
49
45
|
console.warn(yellow(`${logPrefix()} ${message}`));
|
|
50
46
|
}
|
|
51
47
|
}
|
|
48
|
+
exports.warnOnce = warnOnce;
|
|
52
49
|
function logPrefix() {
|
|
53
50
|
return `› ${bold('[@sentry/react-native/expo]')}`;
|
|
54
51
|
}
|
|
52
|
+
exports.logPrefix = logPrefix;
|
|
55
53
|
/**
|
|
56
54
|
* The same as `chalk.yellow`
|
|
57
55
|
* This code is part of the SDK, we don't want to introduce a dependency on `chalk` just for this.
|
|
@@ -59,6 +57,7 @@ function logPrefix() {
|
|
|
59
57
|
function yellow(message) {
|
|
60
58
|
return `\x1b[33m${message}\x1b[0m`;
|
|
61
59
|
}
|
|
60
|
+
exports.yellow = yellow;
|
|
62
61
|
/**
|
|
63
62
|
* The same as `chalk.bold`
|
|
64
63
|
* This code is part of the SDK, we don't want to introduce a dependency on `chalk` just for this.
|
|
@@ -66,3 +65,4 @@ function yellow(message) {
|
|
|
66
65
|
function bold(message) {
|
|
67
66
|
return `\x1b[1m${message}\x1b[22m`;
|
|
68
67
|
}
|
|
68
|
+
exports.bold = bold;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withSentry = void 0;
|
|
4
|
-
exports.getSentryProperties = getSentryProperties;
|
|
3
|
+
exports.withSentry = exports.getSentryProperties = void 0;
|
|
5
4
|
const config_plugins_1 = require("expo/config-plugins");
|
|
6
5
|
const utils_1 = require("./utils");
|
|
7
6
|
const withSentryAndroid_1 = require("./withSentryAndroid");
|
|
@@ -50,6 +49,7 @@ ${organization ? `defaults.org=${organization}` : missingOrgMessage}
|
|
|
50
49
|
${project ? `defaults.project=${project}` : missingProjectMessage}
|
|
51
50
|
${authToken ? `${existingAuthTokenMessage}\nauth.token=${authToken}` : missingAuthTokenMessage}`;
|
|
52
51
|
}
|
|
52
|
+
exports.getSentryProperties = getSentryProperties;
|
|
53
53
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
54
54
|
const withSentry = (0, config_plugins_1.createRunOncePlugin)(withSentryPlugin, utils_1.sdkPackage.name, utils_1.sdkPackage.version);
|
|
55
55
|
exports.withSentry = withSentry;
|
|
@@ -23,8 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.withSentryAndroid = void 0;
|
|
27
|
-
exports.modifyAppBuildGradle = modifyAppBuildGradle;
|
|
26
|
+
exports.modifyAppBuildGradle = exports.withSentryAndroid = void 0;
|
|
28
27
|
const config_plugins_1 = require("expo/config-plugins");
|
|
29
28
|
const path = __importStar(require("path"));
|
|
30
29
|
const utils_1 = require("./utils");
|
|
@@ -66,3 +65,4 @@ function modifyAppBuildGradle(buildGradle) {
|
|
|
66
65
|
const applyFrom = `apply from: new File(${resolveSentryReactNativePackageJsonPath}, "sentry.gradle")`;
|
|
67
66
|
return buildGradle.replace(pattern, match => `${applyFrom}\n\n${match}`);
|
|
68
67
|
}
|
|
68
|
+
exports.modifyAppBuildGradle = modifyAppBuildGradle;
|
|
@@ -23,9 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.withSentryIOS = void 0;
|
|
27
|
-
exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
|
|
28
|
-
exports.addSentryWithBundledScriptsToBundleShellScript = addSentryWithBundledScriptsToBundleShellScript;
|
|
26
|
+
exports.addSentryWithBundledScriptsToBundleShellScript = exports.modifyExistingXcodeBuildScript = exports.withSentryIOS = void 0;
|
|
29
27
|
const config_plugins_1 = require("expo/config-plugins");
|
|
30
28
|
const path = __importStar(require("path"));
|
|
31
29
|
const utils_1 = require("./utils");
|
|
@@ -73,8 +71,10 @@ Run npx expo prebuild --clean`);
|
|
|
73
71
|
const code = JSON.parse(script.shellScript);
|
|
74
72
|
script.shellScript = JSON.stringify(addSentryWithBundledScriptsToBundleShellScript(code));
|
|
75
73
|
}
|
|
74
|
+
exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
|
|
76
75
|
function addSentryWithBundledScriptsToBundleShellScript(script) {
|
|
77
76
|
return script.replace(/^.*?(packager|scripts)\/react-native-xcode\.sh\s*(\\'\\\\")?/m,
|
|
78
77
|
// eslint-disable-next-line no-useless-escape
|
|
79
78
|
(match) => `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_PATH} ${match}`);
|
|
80
79
|
}
|
|
80
|
+
exports.addSentryWithBundledScriptsToBundleShellScript = addSentryWithBundledScriptsToBundleShellScript;
|