@sentry/react-native 6.5.0 → 6.7.0-alpha.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.
Files changed (51) hide show
  1. package/RNSentry.podspec +2 -2
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/io/sentry/react/RNSentryCompositeOptionsConfiguration.java +25 -0
  4. package/android/src/main/java/io/sentry/react/RNSentryJsonConverter.java +76 -0
  5. package/android/src/main/java/io/sentry/react/RNSentryJsonUtils.java +41 -0
  6. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +2 -280
  7. package/android/src/main/java/io/sentry/react/RNSentrySDK.java +68 -0
  8. package/android/src/main/java/io/sentry/react/RNSentryStart.java +365 -0
  9. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +2 -1
  10. package/dist/js/integrations/reactnativeerrorhandlers.js +1 -0
  11. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  12. package/dist/js/sdk.d.ts.map +1 -1
  13. package/dist/js/sdk.js +27 -17
  14. package/dist/js/sdk.js.map +1 -1
  15. package/dist/js/tools/metroconfig.d.ts +9 -1
  16. package/dist/js/tools/metroconfig.d.ts.map +1 -1
  17. package/dist/js/tools/metroconfig.js +9 -2
  18. package/dist/js/tools/metroconfig.js.map +1 -1
  19. package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
  20. package/dist/js/tools/sentryMetroSerializer.js +1 -0
  21. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  22. package/dist/js/tools/sentryOptionsSerializer.d.ts +6 -0
  23. package/dist/js/tools/sentryOptionsSerializer.d.ts.map +1 -0
  24. package/dist/js/tools/sentryOptionsSerializer.js +91 -0
  25. package/dist/js/tools/sentryOptionsSerializer.js.map +1 -0
  26. package/dist/js/tools/utils.d.ts +2 -1
  27. package/dist/js/tools/utils.d.ts.map +1 -1
  28. package/dist/js/tools/utils.js.map +1 -1
  29. package/dist/js/tracing/reactnavigation.js +2 -2
  30. package/dist/js/tracing/reactnavigation.js.map +1 -1
  31. package/dist/js/utils/worldwide.d.ts +2 -0
  32. package/dist/js/utils/worldwide.d.ts.map +1 -1
  33. package/dist/js/utils/worldwide.js.map +1 -1
  34. package/dist/js/version.d.ts +1 -1
  35. package/dist/js/version.d.ts.map +1 -1
  36. package/dist/js/version.js +1 -1
  37. package/dist/js/version.js.map +1 -1
  38. package/ios/RNSentry.h +3 -5
  39. package/ios/RNSentry.mm +12 -171
  40. package/ios/RNSentryReplay.mm +3 -0
  41. package/ios/RNSentrySDK.h +31 -0
  42. package/ios/RNSentrySDK.m +71 -0
  43. package/ios/RNSentryStart.h +26 -0
  44. package/ios/RNSentryStart.m +222 -0
  45. package/ios/RNSentryVersion.h +6 -0
  46. package/ios/RNSentryVersion.m +6 -0
  47. package/package.json +11 -11
  48. package/scripts/sentry-xcode.sh +19 -0
  49. package/sentry.gradle +52 -1
  50. package/ts3.8/dist/js/utils/worldwide.d.ts +2 -0
  51. package/ts3.8/dist/js/version.d.ts +1 -1
package/sentry.gradle CHANGED
@@ -3,7 +3,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
3
3
  import java.util.regex.Matcher
4
4
  import java.util.regex.Pattern
5
5
 
6
- project.ext.shouldSentryAutoUploadNative = { ->
6
+ project.ext.shouldSentryAutoUploadNative = { ->
7
7
  return System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true'
8
8
  }
9
9
 
@@ -15,9 +15,60 @@ project.ext.shouldSentryAutoUpload = { ->
15
15
  return shouldSentryAutoUploadGeneral() && shouldSentryAutoUploadNative()
16
16
  }
17
17
 
18
+ project.ext.shouldCopySentryOptionsFile = { -> // If not set, default to true
19
+ return System.getenv('SENTRY_COPY_OPTIONS_FILE') != 'false'
20
+ }
21
+
18
22
  def config = project.hasProperty("sentryCli") ? project.sentryCli : [];
19
23
 
24
+ def configFile = "sentry.options.json" // Sentry condiguration file
25
+ def androidAssetsDir = new File("$rootDir/app/src/main/assets") // Path to Android assets folder
26
+
27
+ tasks.register("copySentryJsonConfiguration") {
28
+ onlyIf { shouldCopySentryOptionsFile() }
29
+ doLast {
30
+ def appRoot = project.rootDir.parentFile ?: project.rootDir
31
+ def sentryOptionsFile = new File(appRoot, configFile)
32
+ if (sentryOptionsFile.exists()) {
33
+ if (!androidAssetsDir.exists()) {
34
+ androidAssetsDir.mkdirs()
35
+ }
36
+
37
+ copy {
38
+ from sentryOptionsFile
39
+ into androidAssetsDir
40
+ rename { String fileName -> configFile }
41
+ }
42
+ logger.lifecycle("Copied ${configFile} to Android assets")
43
+ } else {
44
+ logger.warn("${configFile} not found in app root (${appRoot})")
45
+ }
46
+ }
47
+ }
48
+
49
+ tasks.register("cleanupTemporarySentryJsonConfiguration") {
50
+ onlyIf { shouldCopySentryOptionsFile() }
51
+ doLast {
52
+ def sentryOptionsFile = new File(androidAssetsDir, configFile)
53
+ if (sentryOptionsFile.exists()) {
54
+ logger.lifecycle("Deleting temporary file: ${sentryOptionsFile.path}")
55
+ sentryOptionsFile.delete()
56
+ }
57
+ }
58
+ }
59
+
20
60
  gradle.projectsEvaluated {
61
+ // Add a task that copies the sentry.options.json file before the build starts
62
+ tasks.named("preBuild").configure {
63
+ dependsOn("copySentryJsonConfiguration")
64
+ }
65
+ // Cleanup sentry.options.json from assets after the build
66
+ tasks.matching { task ->
67
+ task.name == "build" || task.name.startsWith("assemble") || task.name.startsWith("install")
68
+ }.configureEach {
69
+ finalizedBy("cleanupTemporarySentryJsonConfiguration")
70
+ }
71
+
21
72
  def releases = extractReleasesInfo()
22
73
 
23
74
  if (config.flavorAware && config.sentryProperties) {
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react-native" />
2
2
  import type { InternalGlobal } from '@sentry/core';
3
3
  import type { ErrorUtils } from 'react-native/types';
4
+ import type { ReactNativeOptions } from '../options';
4
5
  import type { ExpoGlobalObject } from './expoglobalobject';
5
6
  /** Internal Global object interface with common and Sentry specific properties */
6
7
  export interface ReactNativeInternalGlobal extends InternalGlobal {
@@ -23,6 +24,7 @@ export interface ReactNativeInternalGlobal extends InternalGlobal {
23
24
  __BUNDLE_START_TIME__?: number;
24
25
  nativePerformanceNow?: () => number;
25
26
  TextEncoder?: TextEncoder;
27
+ __SENTRY_OPTIONS__?: ReactNativeOptions;
26
28
  }
27
29
  type TextEncoder = {
28
30
  new (): TextEncoder;
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "6.5.0";
3
+ export declare const SDK_VERSION = "6.7.0-alpha.0";
4
4
  //# sourceMappingURL=version.d.ts.map