@sentry/react-native 5.14.1 → 5.16.0-alpha.1

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 (99) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/RNSentry.podspec +1 -1
  3. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +3 -5
  4. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +1 -1
  5. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +1 -1
  6. package/app.plugin.js +1 -0
  7. package/dist/js/NativeRNSentry.d.ts +1 -1
  8. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  9. package/dist/js/NativeRNSentry.js.map +1 -1
  10. package/dist/js/index.d.ts +4 -3
  11. package/dist/js/index.d.ts.map +1 -1
  12. package/dist/js/index.js.map +1 -1
  13. package/dist/js/integrations/debugsymbolicator.d.ts +25 -3
  14. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  15. package/dist/js/integrations/debugsymbolicator.js +109 -70
  16. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  17. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +4 -0
  18. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  19. package/dist/js/integrations/reactnativeerrorhandlers.js +10 -1
  20. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  21. package/dist/js/profiling/constants.d.ts +2 -0
  22. package/dist/js/profiling/constants.d.ts.map +1 -0
  23. package/dist/js/profiling/constants.js +2 -0
  24. package/dist/js/profiling/constants.js.map +1 -0
  25. package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
  26. package/dist/js/profiling/convertHermesProfile.js +1 -1
  27. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  28. package/dist/js/profiling/integration.d.ts +0 -1
  29. package/dist/js/profiling/integration.d.ts.map +1 -1
  30. package/dist/js/profiling/integration.js +1 -1
  31. package/dist/js/profiling/integration.js.map +1 -1
  32. package/dist/js/sdk.d.ts.map +1 -1
  33. package/dist/js/sdk.js +9 -8
  34. package/dist/js/sdk.js.map +1 -1
  35. package/dist/js/touchevents.js +5 -8
  36. package/dist/js/touchevents.js.map +1 -1
  37. package/dist/js/tracing/index.d.ts +3 -2
  38. package/dist/js/tracing/index.d.ts.map +1 -1
  39. package/dist/js/tracing/index.js.map +1 -1
  40. package/dist/js/utils/error.d.ts +19 -0
  41. package/dist/js/utils/error.d.ts.map +1 -0
  42. package/dist/js/utils/error.js +30 -0
  43. package/dist/js/utils/error.js.map +1 -0
  44. package/dist/js/vendor/base64-js/fromByteArray.d.ts +5 -0
  45. package/dist/js/vendor/base64-js/fromByteArray.d.ts.map +1 -0
  46. package/dist/js/vendor/base64-js/fromByteArray.js +61 -0
  47. package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -0
  48. package/dist/js/vendor/base64-js/index.d.ts +2 -0
  49. package/dist/js/vendor/base64-js/index.d.ts.map +1 -0
  50. package/dist/js/vendor/base64-js/index.js +2 -0
  51. package/dist/js/vendor/base64-js/index.js.map +1 -0
  52. package/dist/js/vendor/index.d.ts +2 -0
  53. package/dist/js/vendor/index.d.ts.map +1 -1
  54. package/dist/js/vendor/index.js +2 -0
  55. package/dist/js/vendor/index.js.map +1 -1
  56. package/dist/js/vendor/react-native/index.d.ts +27 -0
  57. package/dist/js/vendor/react-native/index.d.ts.map +1 -0
  58. package/dist/js/vendor/react-native/index.js +3 -0
  59. package/dist/js/vendor/react-native/index.js.map +1 -0
  60. package/dist/js/version.d.ts +1 -1
  61. package/dist/js/version.d.ts.map +1 -1
  62. package/dist/js/version.js +1 -1
  63. package/dist/js/version.js.map +1 -1
  64. package/dist/js/wrapper.d.ts.map +1 -1
  65. package/dist/js/wrapper.js +18 -12
  66. package/dist/js/wrapper.js.map +1 -1
  67. package/expo.d.ts +1 -0
  68. package/expo.js +1 -0
  69. package/ios/RNSentry.mm +2 -6
  70. package/metro.d.ts +1 -0
  71. package/metro.js +1 -0
  72. package/package.json +19 -9
  73. package/plugin/build/index.d.ts +3 -0
  74. package/plugin/build/index.js +6 -0
  75. package/plugin/build/utils.d.ts +7 -0
  76. package/plugin/build/utils.js +39 -0
  77. package/plugin/build/withSentry.d.ts +10 -0
  78. package/plugin/build/withSentry.js +50 -0
  79. package/plugin/build/withSentryAndroid.d.ts +7 -0
  80. package/plugin/build/withSentryAndroid.js +68 -0
  81. package/plugin/build/withSentryIOS.d.ts +8 -0
  82. package/plugin/build/withSentryIOS.js +71 -0
  83. package/{sample-new-architecture → samples/react-native}/react-native.config.js +1 -1
  84. package/scripts/sentry-xcode-debug-files.sh +5 -1
  85. package/scripts/sentry-xcode.sh +7 -2
  86. package/src/js/NativeRNSentry.ts +1 -1
  87. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
  88. package/ts3.8/dist/js/index.d.ts +4 -3
  89. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +25 -3
  90. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +4 -0
  91. package/ts3.8/dist/js/profiling/constants.d.ts +2 -0
  92. package/ts3.8/dist/js/profiling/integration.d.ts +0 -1
  93. package/ts3.8/dist/js/tracing/index.d.ts +3 -2
  94. package/ts3.8/dist/js/utils/error.d.ts +19 -0
  95. package/ts3.8/dist/js/vendor/base64-js/fromByteArray.d.ts +5 -0
  96. package/ts3.8/dist/js/vendor/base64-js/index.d.ts +2 -0
  97. package/ts3.8/dist/js/vendor/index.d.ts +2 -0
  98. package/ts3.8/dist/js/vendor/react-native/index.d.ts +27 -0
  99. package/ts3.8/dist/js/version.d.ts +1 -1
@@ -0,0 +1,3 @@
1
+ import { withSentry } from './withSentry';
2
+ export { withSentry };
3
+ export default withSentry;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withSentry = void 0;
4
+ const withSentry_1 = require("./withSentry");
5
+ Object.defineProperty(exports, "withSentry", { enumerable: true, get: function () { return withSentry_1.withSentry; } });
6
+ exports.default = withSentry_1.withSentry;
@@ -0,0 +1,7 @@
1
+ export declare function writeSentryPropertiesTo(filepath: string, sentryProperties: string): void;
2
+ declare const sdkPackage: {
3
+ name: string;
4
+ version: string;
5
+ };
6
+ declare const SDK_PACKAGE_NAME: string;
7
+ export { sdkPackage, SDK_PACKAGE_NAME };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SDK_PACKAGE_NAME = exports.sdkPackage = exports.writeSentryPropertiesTo = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ function writeSentryPropertiesTo(filepath, sentryProperties) {
30
+ if (!fs.existsSync(filepath)) {
31
+ throw new Error(`Directory '${filepath}' does not exist.`);
32
+ }
33
+ fs.writeFileSync(path.resolve(filepath, 'sentry.properties'), sentryProperties);
34
+ }
35
+ exports.writeSentryPropertiesTo = writeSentryPropertiesTo;
36
+ const sdkPackage = require('../../package.json');
37
+ exports.sdkPackage = sdkPackage;
38
+ const SDK_PACKAGE_NAME = sdkPackage.name;
39
+ exports.SDK_PACKAGE_NAME = SDK_PACKAGE_NAME;
@@ -0,0 +1,10 @@
1
+ import type { ConfigPlugin } from 'expo/config-plugins';
2
+ interface PluginProps {
3
+ organization?: string;
4
+ project?: string;
5
+ authToken?: string;
6
+ url?: string;
7
+ }
8
+ export declare function getSentryProperties(props: PluginProps | void): string | null;
9
+ declare const withSentry: ConfigPlugin<void | PluginProps>;
10
+ export { withSentry };
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withSentry = exports.getSentryProperties = void 0;
4
+ const config_plugins_1 = require("expo/config-plugins");
5
+ const utils_1 = require("./utils");
6
+ const withSentryAndroid_1 = require("./withSentryAndroid");
7
+ const withSentryIOS_1 = require("./withSentryIOS");
8
+ const withSentryPlugin = (config, props) => {
9
+ const sentryProperties = getSentryProperties(props);
10
+ let cfg = config;
11
+ if (sentryProperties !== null) {
12
+ try {
13
+ cfg = (0, withSentryAndroid_1.withSentryAndroid)(cfg, sentryProperties);
14
+ }
15
+ catch (e) {
16
+ config_plugins_1.WarningAggregator.addWarningAndroid(utils_1.SDK_PACKAGE_NAME, `There was a problem configuring sentry-expo in your native Android project: ${e}`);
17
+ }
18
+ try {
19
+ cfg = (0, withSentryIOS_1.withSentryIOS)(cfg, sentryProperties);
20
+ }
21
+ catch (e) {
22
+ config_plugins_1.WarningAggregator.addWarningIOS(utils_1.SDK_PACKAGE_NAME, `There was a problem configuring sentry-expo in your native iOS project: ${e}`);
23
+ }
24
+ }
25
+ return cfg;
26
+ };
27
+ const missingAuthTokenMessage = '# auth.token is configured through SENTRY_AUTH_TOKEN environment variable';
28
+ const missingProjectMessage = '# no project found, falling back to SENTRY_PROJECT environment variable';
29
+ const missingOrgMessage = '# no org found, falling back to SENTRY_ORG environment variable';
30
+ function getSentryProperties(props) {
31
+ const { organization, project, authToken, url = 'https://sentry.io/' } = props ?? {};
32
+ // eslint-disable-next-line no-prototype-builtins
33
+ const missingProperties = ['organization', 'project'].filter(each => !props?.hasOwnProperty(each));
34
+ if (missingProperties.length) {
35
+ const warningMessage = `Missing Sentry configuration properties: ${missingProperties.join(', ')} in config plugin. Builds will fall back to environment variables. See: https://docs.sentry.io/platforms/react-native/manual-setup/.`;
36
+ config_plugins_1.WarningAggregator.addWarningAndroid(utils_1.SDK_PACKAGE_NAME, warningMessage);
37
+ config_plugins_1.WarningAggregator.addWarningIOS(utils_1.SDK_PACKAGE_NAME, warningMessage);
38
+ }
39
+ return `defaults.url=${url}
40
+ ${organization ? `defaults.org=${organization}` : missingOrgMessage}
41
+ ${project ? `defaults.project=${project}` : missingProjectMessage}
42
+ ${authToken
43
+ ? `# Configure this value through \`SENTRY_AUTH_TOKEN\` environment variable instead. See: https://docs.sentry.io/platforms/react-native/manual-setup/\nauth.token=${authToken}`
44
+ : missingAuthTokenMessage}
45
+ `;
46
+ }
47
+ exports.getSentryProperties = getSentryProperties;
48
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
49
+ const withSentry = (0, config_plugins_1.createRunOncePlugin)(withSentryPlugin, utils_1.sdkPackage.name, utils_1.sdkPackage.version);
50
+ exports.withSentry = withSentry;
@@ -0,0 +1,7 @@
1
+ import type { ConfigPlugin } from 'expo/config-plugins';
2
+ export declare const withSentryAndroid: ConfigPlugin<string>;
3
+ /**
4
+ * Writes to projectDirectory/android/app/build.gradle,
5
+ * adding the relevant @sentry/react-native script.
6
+ */
7
+ export declare function modifyAppBuildGradle(buildGradle: string): string;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.modifyAppBuildGradle = exports.withSentryAndroid = void 0;
27
+ const config_plugins_1 = require("expo/config-plugins");
28
+ const path = __importStar(require("path"));
29
+ const utils_1 = require("./utils");
30
+ const withSentryAndroid = (config, sentryProperties) => {
31
+ const cfg = (0, config_plugins_1.withAppBuildGradle)(config, config => {
32
+ if (config.modResults.language === 'groovy') {
33
+ config.modResults.contents = modifyAppBuildGradle(config.modResults.contents);
34
+ }
35
+ else {
36
+ throw new Error('Cannot configure Sentry in the app gradle because the build.gradle is not groovy');
37
+ }
38
+ return config;
39
+ });
40
+ return (0, config_plugins_1.withDangerousMod)(cfg, [
41
+ 'android',
42
+ config => {
43
+ (0, utils_1.writeSentryPropertiesTo)(path.resolve(config.modRequest.projectRoot, 'android'), sentryProperties);
44
+ return config;
45
+ },
46
+ ]);
47
+ };
48
+ exports.withSentryAndroid = withSentryAndroid;
49
+ const resolveSentryReactNativePackageJsonPath = '["node", "--print", "require(\'path\').dirname(require.resolve(\'@sentry/react-native/package.json\'))"].execute().text.trim()';
50
+ /**
51
+ * Writes to projectDirectory/android/app/build.gradle,
52
+ * adding the relevant @sentry/react-native script.
53
+ */
54
+ function modifyAppBuildGradle(buildGradle) {
55
+ if (buildGradle.includes('sentry.gradle')) {
56
+ return buildGradle;
57
+ }
58
+ // Use the same location that sentry-wizard uses
59
+ // See: https://github.com/getsentry/sentry-wizard/blob/e9b4522f27a852069c862bd458bdf9b07cab6e33/lib/Steps/Integrations/ReactNative.ts#L232
60
+ const pattern = /^android {/m;
61
+ if (!buildGradle.match(pattern)) {
62
+ config_plugins_1.WarningAggregator.addWarningAndroid(utils_1.SDK_PACKAGE_NAME, 'Could not find `^android {` in `android/app/build.gradle`. Please open a bug report at https://github.com/getsentry/sentry-react-native.');
63
+ return buildGradle;
64
+ }
65
+ const applyFrom = `apply from: new File(${resolveSentryReactNativePackageJsonPath}, "sentry.gradle")`;
66
+ return buildGradle.replace(pattern, match => `${applyFrom}\n\n${match}`);
67
+ }
68
+ exports.modifyAppBuildGradle = modifyAppBuildGradle;
@@ -0,0 +1,8 @@
1
+ import type { ConfigPlugin } from 'expo/config-plugins';
2
+ type BuildPhase = {
3
+ shellScript: string;
4
+ };
5
+ export declare const withSentryIOS: ConfigPlugin<string>;
6
+ export declare function modifyExistingXcodeBuildScript(script: BuildPhase): void;
7
+ export declare function addSentryWithBundledScriptsToBundleShellScript(script: string): string;
8
+ export {};
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.addSentryWithBundledScriptsToBundleShellScript = exports.modifyExistingXcodeBuildScript = exports.withSentryIOS = void 0;
27
+ const config_plugins_1 = require("expo/config-plugins");
28
+ const path = __importStar(require("path"));
29
+ const utils_1 = require("./utils");
30
+ const SENTRY_REACT_NATIVE_XCODE_PATH = "`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode.sh'\"`";
31
+ const SENTRY_REACT_NATIVE_XCODE_DEBUG_FILES_PATH = "`${NODE_BINARY:-node} --print \"require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode-debug-files.sh'\"`";
32
+ const withSentryIOS = (config, sentryProperties) => {
33
+ const cfg = (0, config_plugins_1.withXcodeProject)(config, config => {
34
+ const xcodeProject = config.modResults;
35
+ const sentryBuildPhase = xcodeProject.pbxItemByComment('Upload Debug Symbols to Sentry', 'PBXShellScriptBuildPhase');
36
+ if (!sentryBuildPhase) {
37
+ xcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Upload Debug Symbols to Sentry', null, {
38
+ shellPath: '/bin/sh',
39
+ shellScript: `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_DEBUG_FILES_PATH}`,
40
+ });
41
+ }
42
+ const bundleReactNativePhase = xcodeProject.pbxItemByComment('Bundle React Native code and images', 'PBXShellScriptBuildPhase');
43
+ modifyExistingXcodeBuildScript(bundleReactNativePhase);
44
+ return config;
45
+ });
46
+ return (0, config_plugins_1.withDangerousMod)(cfg, [
47
+ 'ios',
48
+ config => {
49
+ (0, utils_1.writeSentryPropertiesTo)(path.resolve(config.modRequest.projectRoot, 'ios'), sentryProperties);
50
+ return config;
51
+ },
52
+ ]);
53
+ };
54
+ exports.withSentryIOS = withSentryIOS;
55
+ function modifyExistingXcodeBuildScript(script) {
56
+ if (!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/) ||
57
+ script.shellScript.includes('sentry-xcode.sh') ||
58
+ script.shellScript.includes('@sentry')) {
59
+ config_plugins_1.WarningAggregator.addWarningIOS(utils_1.SDK_PACKAGE_NAME, "Unable to modify build script 'Bundle React Native code and images'. Please open a bug report at https://github.com/expo/sentry-expo.");
60
+ return;
61
+ }
62
+ const code = JSON.parse(script.shellScript);
63
+ script.shellScript = JSON.stringify(addSentryWithBundledScriptsToBundleShellScript(code));
64
+ }
65
+ exports.modifyExistingXcodeBuildScript = modifyExistingXcodeBuildScript;
66
+ function addSentryWithBundledScriptsToBundleShellScript(script) {
67
+ return script.replace(/^.*?(packager|scripts)\/react-native-xcode\.sh\s*(\\'\\\\")?/m,
68
+ // eslint-disable-next-line no-useless-escape
69
+ (match) => `/bin/sh ${SENTRY_REACT_NATIVE_XCODE_PATH} ${match}`);
70
+ }
71
+ exports.addSentryWithBundledScriptsToBundleShellScript = addSentryWithBundledScriptsToBundleShellScript;
@@ -6,7 +6,7 @@ const path = require('path');
6
6
  module.exports = {
7
7
  dependencies: {
8
8
  RNSentry: {
9
- root: path.resolve(__dirname, '..'),
9
+ root: path.resolve(__dirname, '../../'),
10
10
  },
11
11
  },
12
12
  };
@@ -5,6 +5,8 @@
5
5
  # print commands before executing them and stop on first error
6
6
  set -x -e
7
7
 
8
+ LOCAL_NODE_BINARY=${NODE_BINARY:-node}
9
+
8
10
  # load envs if loader file exists (since rn 0.68)
9
11
  WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
10
12
  if [ -f "$WITH_ENVIRONMENT" ]; then
@@ -12,7 +14,9 @@ if [ -f "$WITH_ENVIRONMENT" ]; then
12
14
  fi
13
15
 
14
16
  [ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
15
- [ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="../node_modules/@sentry/cli/bin/sentry-cli"
17
+
18
+ [ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
19
+ [ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="${SENTRY_CLI_PACKAGE_PATH}/bin/sentry-cli"
16
20
 
17
21
  [[ $SENTRY_INCLUDE_NATIVE_SOURCES == "true" ]] && INCLUDE_SOURCES_FLAG="--include-sources" || INCLUDE_SOURCES_FLAG=""
18
22
 
@@ -7,9 +7,13 @@ set -x -e
7
7
 
8
8
  # WITH_ENVIRONMENT is executed by React Native
9
9
 
10
+ LOCAL_NODE_BINARY=${NODE_BINARY:-node}
11
+
10
12
  [ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
11
13
  [ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
12
- [ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="../node_modules/@sentry/cli/bin/sentry-cli"
14
+
15
+ [ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
16
+ [ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="${SENTRY_CLI_PACKAGE_PATH}/bin/sentry-cli"
13
17
 
14
18
  REACT_NATIVE_XCODE=$1
15
19
 
@@ -25,7 +29,8 @@ else
25
29
  /bin/sh -c "$REACT_NATIVE_XCODE"
26
30
  fi
27
31
 
28
- [ -z "$SENTRY_COLLECT_MODULES" ] && SENTRY_COLLECT_MODULES="../../scripts/collect-modules.sh"
32
+ [ -z "$SENTRY_COLLECT_MODULES" ] && SENTRY_RN_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/react-native/package.json'))")
33
+ [ -z "$SENTRY_COLLECT_MODULES" ] && SENTRY_COLLECT_MODULES="${SENTRY_RN_PACKAGE_PATH}/scripts/collect-modules.sh"
29
34
 
30
35
  if [ -f "$SENTRY_COLLECT_MODULES" ]; then
31
36
  /bin/sh "$SENTRY_COLLECT_MODULES"
@@ -8,7 +8,7 @@ import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
8
8
  export interface Spec extends TurboModule {
9
9
  addBreadcrumb(breadcrumb: UnsafeObject): void;
10
10
  captureEnvelope(
11
- bytes: number[],
11
+ bytes: string,
12
12
  options: {
13
13
  store: boolean;
14
14
  },
@@ -3,7 +3,7 @@ import type { TurboModule } from 'react-native';
3
3
  import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
4
4
  export interface Spec extends TurboModule {
5
5
  addBreadcrumb(breadcrumb: UnsafeObject): void;
6
- captureEnvelope(bytes: number[], options: {
6
+ captureEnvelope(bytes: string, options: {
7
7
  store: boolean;
8
8
  }): Promise<boolean>;
9
9
  captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;
@@ -1,13 +1,14 @@
1
- export { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
1
+ export type { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
2
2
  export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, } from '@sentry/core';
3
3
  export { Integrations as BrowserIntegrations, ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
4
4
  export { lastEventId } from '@sentry/browser';
5
5
  import * as Integrations from './integrations';
6
6
  import { SDK_NAME, SDK_VERSION } from './version';
7
- export { ReactNativeOptions } from './options';
7
+ export type { ReactNativeOptions } from './options';
8
8
  export { ReactNativeClient } from './client';
9
9
  export { init, wrap, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback, withScope, configureScope, } from './sdk';
10
10
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
11
- export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, ReactNavigationTransactionContext, sentryTraceGesture, } from './tracing';
11
+ export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, } from './tracing';
12
+ export type { ReactNavigationTransactionContext } from './tracing';
12
13
  export { Integrations, SDK_NAME, SDK_VERSION };
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Integration } from '@sentry/types';
1
+ import type { EventProcessor, Hub, Integration } from '@sentry/types';
2
2
  /**
3
3
  * React Native Error
4
4
  */
@@ -21,7 +21,7 @@ export declare class DebugSymbolicator implements Integration {
21
21
  /**
22
22
  * @inheritDoc
23
23
  */
24
- setupOnce(): void;
24
+ setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
25
25
  /**
26
26
  * Symbolicates the stack on the device talking to local dev server.
27
27
  * Mutates the passed event.
@@ -37,7 +37,13 @@ export declare class DebugSymbolicator implements Integration {
37
37
  * @param event Event
38
38
  * @param frames StackFrame[]
39
39
  */
40
- private _replaceFramesInEvent;
40
+ private _replaceExceptionFramesInEvent;
41
+ /**
42
+ * Replaces the frames in the thread of a message.
43
+ * @param event Event
44
+ * @param frames StackFrame[]
45
+ */
46
+ private _replaceThreadFramesInEvent;
41
47
  /**
42
48
  * This tries to add source context for in_app Frames
43
49
  *
@@ -45,5 +51,21 @@ export declare class DebugSymbolicator implements Integration {
45
51
  * @param getDevServer function from RN to get DevServer URL
46
52
  */
47
53
  private _addSourceContext;
54
+ /**
55
+ * Get source context for segment
56
+ */
57
+ private _fetchSourceContext;
58
+ /**
59
+ * Loads and calls RN Core Devtools parseErrorStack function.
60
+ */
61
+ private _parseErrorStack;
62
+ /**
63
+ * Loads and calls RN Core Devtools symbolicateStackTrace function.
64
+ */
65
+ private _symbolicateStackTrace;
66
+ /**
67
+ * Loads and returns the RN DevServer URL.
68
+ */
69
+ private _getDevServer;
48
70
  }
49
71
  //# sourceMappingURL=debugsymbolicator.d.ts.map
@@ -54,6 +54,10 @@ export declare class ReactNativeErrorHandlers implements Integration {
54
54
  * Handle errors
55
55
  */
56
56
  private _handleOnError;
57
+ /**
58
+ * Loads and returns rejection tracking module
59
+ */
60
+ private _loadRejectionTracking;
57
61
  }
58
62
  export {};
59
63
  //# sourceMappingURL=reactnativeerrorhandlers.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const MAX_PROFILE_DURATION_MS: number;
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -2,7 +2,6 @@ import type { Hub } from '@sentry/core';
2
2
  import type { EventProcessor, Integration, ThreadCpuProfile } from '@sentry/types';
3
3
  import type { NativeProfileEvent } from './nativeTypes';
4
4
  import type { CombinedProfileEvent, HermesProfileEvent } from './types';
5
- export declare const MAX_PROFILE_DURATION_MS: number;
6
5
  /**
7
6
  * Profiling integration creates a profile for each transaction and adds it to the event envelope.
8
7
  *
@@ -1,9 +1,10 @@
1
1
  export { ReactNativeTracing } from './reactnativetracing';
2
- export { RoutingInstrumentation, RoutingInstrumentationInstance } from './routingInstrumentation';
2
+ export type { RoutingInstrumentationInstance } from './routingInstrumentation';
3
+ export { RoutingInstrumentation } from './routingInstrumentation';
3
4
  export { ReactNavigationInstrumentation, ReactNavigationV5Instrumentation, } from './reactnavigation';
4
5
  export { ReactNavigationV4Instrumentation } from './reactnavigationv4';
5
6
  export { ReactNativeNavigationInstrumentation } from './reactnativenavigation';
6
- export { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
7
+ export type { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
7
8
  export { ReactNativeProfiler } from './reactnativeprofiler';
8
9
  export { sentryTraceGesture } from './gesturetracing';
9
10
  export * from './ops';
@@ -0,0 +1,19 @@
1
+ export interface ExtendedError extends Error {
2
+ framesToPop?: number | undefined;
3
+ }
4
+ /**
5
+ * Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller
6
+ */
7
+ export declare function createSyntheticError(framesToPop?: number): ExtendedError;
8
+ /**
9
+ * Returns the number of frames to pop from the stack trace.
10
+ * @param error ExtendedError
11
+ */
12
+ export declare function getFramesToPop(error: ExtendedError): number;
13
+ /**
14
+ * Check if `potentialError` is an object with string stack property.
15
+ */
16
+ export declare function isErrorLike(potentialError: unknown): potentialError is {
17
+ stack: string;
18
+ };
19
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Converts a Uint8Array or Array of bytes into a string representation of base64.
3
+ */
4
+ export declare function base64StringFromByteArray(uint8: Uint8Array | number[]): string;
5
+ //# sourceMappingURL=fromByteArray.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { base64StringFromByteArray } from './fromByteArray';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,4 @@
1
1
  export { utf8ToBytes } from './buffer';
2
+ export * from './react-native';
3
+ export { base64StringFromByteArray } from './base64-js';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ export type StackFrame = {
2
+ column?: number;
3
+ file?: string;
4
+ lineNumber?: number;
5
+ methodName: string;
6
+ collapse?: boolean;
7
+ };
8
+ export type CodeFrame = Readonly<{
9
+ content: string;
10
+ location?: {
11
+ [key: string]: unknown;
12
+ row: number;
13
+ column: number;
14
+ };
15
+ fileName: string;
16
+ }>;
17
+ export type SymbolicatedStackTrace = Readonly<{
18
+ stack: Array<StackFrame>;
19
+ codeFrame?: CodeFrame;
20
+ }>;
21
+ export type DevServerInfo = {
22
+ [key: string]: unknown;
23
+ url: string;
24
+ fullBundleUrl?: string;
25
+ bundleLoadedFromServer: boolean;
26
+ };
27
+ //# sourceMappingURL=index.d.ts.map
@@ -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 = "5.14.1";
3
+ export declare const SDK_VERSION = "5.16.0-alpha.1";
4
4
  //# sourceMappingURL=version.d.ts.map