@sentry/react-native 5.16.0-alpha.1 → 5.16.0-alpha.3
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/CHANGELOG.md +82 -0
- package/dist/js/NativeRNSentry.d.ts +1 -1
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +12 -10
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/default.d.ts +11 -0
- package/dist/js/integrations/default.d.ts.map +1 -0
- package/dist/js/integrations/default.js +79 -0
- package/dist/js/integrations/default.js.map +1 -0
- package/dist/js/integrations/expocontext.d.ts +17 -0
- package/dist/js/integrations/expocontext.d.ts.map +1 -0
- package/dist/js/integrations/expocontext.js +68 -0
- package/dist/js/integrations/expocontext.js.map +1 -0
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +9 -6
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts +3 -1
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js +9 -1
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +5 -2
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/measurements.d.ts +0 -7
- package/dist/js/measurements.d.ts.map +1 -1
- package/dist/js/measurements.js +0 -56
- package/dist/js/measurements.js.map +1 -1
- package/dist/js/options.d.ts +6 -0
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js +23 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +13 -55
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.d.ts +6 -0
- package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +34 -1
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/vendor/expo/expoconfig.d.ts +24 -0
- package/dist/js/tools/vendor/expo/expoconfig.d.ts.map +1 -0
- package/dist/js/tools/vendor/expo/expoconfig.js +3 -0
- package/dist/js/tools/vendor/expo/expoconfig.js.map +1 -0
- package/dist/js/tracing/addTracingExtensions.d.ts +8 -0
- package/dist/js/tracing/addTracingExtensions.d.ts.map +1 -0
- package/dist/js/tracing/addTracingExtensions.js +58 -0
- package/dist/js/tracing/addTracingExtensions.js.map +1 -0
- package/dist/js/tracing/reactnativenavigation.d.ts +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +6 -4
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigationv4.js +4 -3
- package/dist/js/tracing/reactnavigationv4.js.map +1 -1
- package/dist/js/utils/environment.d.ts +9 -1
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +28 -1
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/expoglobalobject.d.ts +51 -0
- package/dist/js/utils/expoglobalobject.d.ts.map +1 -0
- package/dist/js/utils/expoglobalobject.js +2 -0
- package/dist/js/utils/expoglobalobject.js.map +1 -0
- package/dist/js/utils/expomodules.d.ts +10 -0
- package/dist/js/utils/expomodules.d.ts.map +1 -0
- package/dist/js/utils/expomodules.js +14 -0
- package/dist/js/utils/expomodules.js.map +1 -0
- package/dist/js/utils/rnlibraries.d.ts +3 -0
- package/dist/js/utils/rnlibraries.d.ts.map +1 -0
- package/dist/js/utils/rnlibraries.js +29 -0
- package/dist/js/utils/rnlibraries.js.map +1 -0
- package/dist/js/utils/rnlibraries.web.d.ts +3 -0
- package/dist/js/utils/rnlibraries.web.d.ts.map +1 -0
- package/dist/js/utils/rnlibraries.web.js +2 -0
- package/dist/js/utils/rnlibraries.web.js.map +1 -0
- package/dist/js/utils/rnlibrariesinterface.d.ts +19 -0
- package/dist/js/utils/rnlibrariesinterface.d.ts.map +1 -0
- package/dist/js/utils/rnlibrariesinterface.js +8 -0
- package/dist/js/utils/rnlibrariesinterface.js.map +1 -0
- package/dist/js/utils/worldwide.d.ts +2 -1
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- 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 +14 -6
- package/samples/react-native/react-native.config.js +5 -0
- package/scripts/expo-upload-sourcemaps.js +160 -0
- package/src/js/NativeRNSentry.ts +2 -1
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
- package/ts3.8/dist/js/integrations/default.d.ts +11 -0
- package/ts3.8/dist/js/integrations/expocontext.d.ts +17 -0
- package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +3 -1
- package/ts3.8/dist/js/measurements.d.ts +0 -7
- package/ts3.8/dist/js/options.d.ts +6 -0
- package/ts3.8/dist/js/tracing/addTracingExtensions.d.ts +8 -0
- package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +1 -1
- package/ts3.8/dist/js/utils/environment.d.ts +9 -1
- package/ts3.8/dist/js/utils/expoglobalobject.d.ts +51 -0
- package/ts3.8/dist/js/utils/expomodules.d.ts +10 -0
- package/ts3.8/dist/js/utils/rnlibraries.d.ts +3 -0
- package/ts3.8/dist/js/utils/rnlibraries.web.d.ts +3 -0
- package/ts3.8/dist/js/utils/rnlibrariesinterface.d.ts +19 -0
- package/ts3.8/dist/js/utils/worldwide.d.ts +2 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
2
|
import { RN_GLOBAL_OBJ } from '../utils/worldwide';
|
|
3
|
+
import { getExpoConstants } from './expomodules';
|
|
4
|
+
import { ReactNativeLibraries } from './rnlibraries';
|
|
3
5
|
/** Checks if the React Native Hermes engine is running */
|
|
4
6
|
export function isHermesEnabled() {
|
|
5
7
|
return !!RN_GLOBAL_OBJ.HermesInternal;
|
|
@@ -14,12 +16,37 @@ export function isFabricEnabled() {
|
|
|
14
16
|
}
|
|
15
17
|
/** Returns React Native Version as semver string */
|
|
16
18
|
export function getReactNativeVersion() {
|
|
19
|
+
if (!ReactNativeLibraries.ReactNativeVersion) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const RNV = ReactNativeLibraries.ReactNativeVersion.version;
|
|
17
23
|
return `${RNV.major}.${RNV.minor}.${RNV.patch}${RNV.prerelease != null ? `-${RNV.prerelease}` : ''}`;
|
|
18
24
|
}
|
|
19
25
|
/** Checks if Expo is present in the runtime */
|
|
20
26
|
export function isExpo() {
|
|
21
27
|
return RN_GLOBAL_OBJ.expo != null;
|
|
22
28
|
}
|
|
29
|
+
/** Check if JS runs in Expo Go */
|
|
30
|
+
export function isExpoGo() {
|
|
31
|
+
const expoConstants = getExpoConstants();
|
|
32
|
+
return (expoConstants && expoConstants.appOwnership) === 'expo';
|
|
33
|
+
}
|
|
34
|
+
/** Check Expo Go version if available */
|
|
35
|
+
export function getExpoGoVersion() {
|
|
36
|
+
const expoConstants = getExpoConstants();
|
|
37
|
+
return typeof (expoConstants === null || expoConstants === void 0 ? void 0 : expoConstants.expoVersion) === 'string' ? expoConstants.expoVersion : undefined;
|
|
38
|
+
}
|
|
39
|
+
/** Returns Expo SDK version if available */
|
|
40
|
+
export function getExpoSdkVersion() {
|
|
41
|
+
var _a;
|
|
42
|
+
const expoConstants = getExpoConstants();
|
|
43
|
+
const [, expoSdkVersion] = typeof ((_a = expoConstants === null || expoConstants === void 0 ? void 0 : expoConstants.manifest) === null || _a === void 0 ? void 0 : _a.runtimeVersion) === 'string' ? expoConstants.manifest.runtimeVersion.split(':') : [];
|
|
44
|
+
return expoSdkVersion;
|
|
45
|
+
}
|
|
46
|
+
/** Checks if the current platform is not web */
|
|
47
|
+
export function notWeb() {
|
|
48
|
+
return Platform.OS !== 'web';
|
|
49
|
+
}
|
|
23
50
|
/** Returns Hermes Version if hermes is present in the runtime */
|
|
24
51
|
export function getHermesVersion() {
|
|
25
52
|
return (RN_GLOBAL_OBJ.HermesInternal &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,0DAA0D;AAC1D,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC;AACxC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB;IAClC,OAAO,aAAa,CAAC,kBAAkB,IAAI,IAAI,CAAC;AAClD,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC,qBAAqB,IAAI,IAAI,CAAC;AACrD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,EAAE;QAC5C,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,GAAG,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,OAAO,CAAC;IAC5D,OAAO,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACvG,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,MAAM;IACpB,OAAO,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC;AACpC,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,QAAQ;IACtB,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CAAC,aAAa,IAAI,aAAa,CAAC,YAAY,CAAC,KAAK,MAAM,CAAC;AAClE,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,gBAAgB;IAC9B,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,OAAO,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,CAAA,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AAChG,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,iBAAiB;;IAC/B,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,CAAC,EAAE,cAAc,CAAC,GACtB,OAAO,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,cAAc,CAAA,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACtH,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,MAAM;IACpB,OAAO,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC;AAC/B,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CACL,aAAa,CAAC,cAAc;QAC5B,aAAa,CAAC,cAAc,CAAC,oBAAoB;QACjD,aAAa,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC,qBAAqB,CAAC,CAC3E,CAAC;AACJ,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;AAClF,CAAC","sourcesContent":["import { Platform } from 'react-native';\n\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { getExpoConstants } from './expomodules';\nimport { ReactNativeLibraries } from './rnlibraries';\n\n/** Checks if the React Native Hermes engine is running */\nexport function isHermesEnabled(): boolean {\n return !!RN_GLOBAL_OBJ.HermesInternal;\n}\n\n/** Checks if the React Native TurboModules are enabled */\nexport function isTurboModuleEnabled(): boolean {\n return RN_GLOBAL_OBJ.__turboModuleProxy != null;\n}\n\n/** Checks if the React Native Fabric renderer is running */\nexport function isFabricEnabled(): boolean {\n return RN_GLOBAL_OBJ.nativeFabricUIManager != null;\n}\n\n/** Returns React Native Version as semver string */\nexport function getReactNativeVersion(): string | undefined {\n if (!ReactNativeLibraries.ReactNativeVersion) {\n return undefined;\n }\n const RNV = ReactNativeLibraries.ReactNativeVersion.version;\n return `${RNV.major}.${RNV.minor}.${RNV.patch}${RNV.prerelease != null ? `-${RNV.prerelease}` : ''}`;\n}\n\n/** Checks if Expo is present in the runtime */\nexport function isExpo(): boolean {\n return RN_GLOBAL_OBJ.expo != null;\n}\n\n/** Check if JS runs in Expo Go */\nexport function isExpoGo(): boolean {\n const expoConstants = getExpoConstants();\n return (expoConstants && expoConstants.appOwnership) === 'expo';\n}\n\n/** Check Expo Go version if available */\nexport function getExpoGoVersion(): string | undefined {\n const expoConstants = getExpoConstants();\n return typeof expoConstants?.expoVersion === 'string' ? expoConstants.expoVersion : undefined;\n}\n\n/** Returns Expo SDK version if available */\nexport function getExpoSdkVersion(): string | undefined {\n const expoConstants = getExpoConstants();\n const [, expoSdkVersion] =\n typeof expoConstants?.manifest?.runtimeVersion === 'string' ? expoConstants.manifest.runtimeVersion.split(':') : [];\n return expoSdkVersion;\n}\n\n/** Checks if the current platform is not web */\nexport function notWeb(): boolean {\n return Platform.OS !== 'web';\n}\n\n/** Returns Hermes Version if hermes is present in the runtime */\nexport function getHermesVersion(): string | undefined {\n return (\n RN_GLOBAL_OBJ.HermesInternal &&\n RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties &&\n RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties()['OSS Release Version']\n );\n}\n\n/** Returns default environment based on __DEV__ */\nexport function getDefaultEnvironment(): 'development' | 'production' {\n return typeof __DEV__ !== 'undefined' && __DEV__ ? 'development' : 'production';\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface from the Expo SDK defined here
|
|
3
|
+
* (we are describing the native Module
|
|
4
|
+
* the TS typing is only guideline):
|
|
5
|
+
*
|
|
6
|
+
* https://github.com/expo/expo/blob/b51b5139f2caa2a9495e4132437d7ca612276158/packages/expo-constants/src/Constants.ts
|
|
7
|
+
* https://github.com/expo/expo/blob/b51b5139f2caa2a9495e4132437d7ca612276158/packages/expo-manifests/src/Manifests.ts
|
|
8
|
+
*/
|
|
9
|
+
export interface ExpoConstants {
|
|
10
|
+
appOwnership?: 'standalone' | 'expo' | 'guest';
|
|
11
|
+
/**
|
|
12
|
+
* Deprecated. But until removed we can use it as user ID to match the native SDKs.
|
|
13
|
+
*/
|
|
14
|
+
installationId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Version of the Expo Go app
|
|
17
|
+
*/
|
|
18
|
+
expoVersion?: string | null;
|
|
19
|
+
manifest?: null | {
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Expo SDK version should match `expo` version from the app `package.json`.
|
|
23
|
+
* Example "exposdk:50.0.0"
|
|
24
|
+
*/
|
|
25
|
+
runtimeVersion?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Interface from the Expo SDK defined here
|
|
30
|
+
* (we are describing the native module
|
|
31
|
+
* the TS typing is only guideline)
|
|
32
|
+
*
|
|
33
|
+
* https://github.com/expo/expo/blob/5d1153e6ae7c497fa1281ffee85fabe90d2321c2/packages/expo-device/src/Device.ts
|
|
34
|
+
*/
|
|
35
|
+
export interface ExpoDevice {
|
|
36
|
+
deviceName?: string;
|
|
37
|
+
isDevice?: boolean;
|
|
38
|
+
manufacturer?: string;
|
|
39
|
+
modelName?: string;
|
|
40
|
+
osName?: string;
|
|
41
|
+
osBuildId?: string;
|
|
42
|
+
osVersion?: string;
|
|
43
|
+
totalMemory?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface ExpoGlobalObject {
|
|
46
|
+
modules?: {
|
|
47
|
+
ExponentConstants?: ExpoConstants;
|
|
48
|
+
ExpoDevice?: ExpoDevice;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=expoglobalobject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expoglobalobject.d.ts","sourceRoot":"","sources":["../../../src/js/utils/expoglobalobject.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,IAAI,GAAG;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE;QACR,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,UAAU,CAAC;KACzB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expoglobalobject.js","sourceRoot":"","sources":["../../../src/js/utils/expoglobalobject.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface from the Expo SDK defined here\n * (we are describing the native Module\n * the TS typing is only guideline):\n *\n * https://github.com/expo/expo/blob/b51b5139f2caa2a9495e4132437d7ca612276158/packages/expo-constants/src/Constants.ts\n * https://github.com/expo/expo/blob/b51b5139f2caa2a9495e4132437d7ca612276158/packages/expo-manifests/src/Manifests.ts\n */\nexport interface ExpoConstants {\n appOwnership?: 'standalone' | 'expo' | 'guest';\n /**\n * Deprecated. But until removed we can use it as user ID to match the native SDKs.\n */\n installationId?: string;\n /**\n * Version of the Expo Go app\n */\n expoVersion?: string | null;\n manifest?: null | {\n [key: string]: unknown;\n /**\n * Expo SDK version should match `expo` version from the app `package.json`.\n * Example \"exposdk:50.0.0\"\n */\n runtimeVersion?: string;\n };\n}\n\n/**\n * Interface from the Expo SDK defined here\n * (we are describing the native module\n * the TS typing is only guideline)\n *\n * https://github.com/expo/expo/blob/5d1153e6ae7c497fa1281ffee85fabe90d2321c2/packages/expo-device/src/Device.ts\n */\nexport interface ExpoDevice {\n deviceName?: string;\n isDevice?: boolean;\n manufacturer?: string;\n modelName?: string;\n osName?: string;\n osBuildId?: string;\n osVersion?: string;\n totalMemory?: number;\n}\n\nexport interface ExpoGlobalObject {\n modules?: {\n ExponentConstants?: ExpoConstants;\n ExpoDevice?: ExpoDevice;\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExpoConstants, ExpoDevice } from './expoglobalobject';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the Expo Constants module if present
|
|
4
|
+
*/
|
|
5
|
+
export declare function getExpoConstants(): ExpoConstants | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the Expo Device module if present
|
|
8
|
+
*/
|
|
9
|
+
export declare function getExpoDevice(): ExpoDevice | undefined;
|
|
10
|
+
//# sourceMappingURL=expomodules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expomodules.d.ts","sourceRoot":"","sources":["../../../src/js/utils/expomodules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGpE;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAI5D;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,GAAG,SAAS,CAEtD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RN_GLOBAL_OBJ } from './worldwide';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the Expo Constants module if present
|
|
4
|
+
*/
|
|
5
|
+
export function getExpoConstants() {
|
|
6
|
+
return ((RN_GLOBAL_OBJ.expo && RN_GLOBAL_OBJ.expo.modules && RN_GLOBAL_OBJ.expo.modules.ExponentConstants) || undefined);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns the Expo Device module if present
|
|
10
|
+
*/
|
|
11
|
+
export function getExpoDevice() {
|
|
12
|
+
return (RN_GLOBAL_OBJ.expo && RN_GLOBAL_OBJ.expo.modules && RN_GLOBAL_OBJ.expo.modules.ExpoDevice) || undefined;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=expomodules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expomodules.js","sourceRoot":"","sources":["../../../src/js/utils/expomodules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CACL,CAAC,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,SAAS,CAChH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC;AAClH,CAAC","sourcesContent":["import type { ExpoConstants, ExpoDevice } from './expoglobalobject';\nimport { RN_GLOBAL_OBJ } from './worldwide';\n\n/**\n * Returns the Expo Constants module if present\n */\nexport function getExpoConstants(): ExpoConstants | undefined {\n return (\n (RN_GLOBAL_OBJ.expo && RN_GLOBAL_OBJ.expo.modules && RN_GLOBAL_OBJ.expo.modules.ExponentConstants) || undefined\n );\n}\n\n/**\n * Returns the Expo Device module if present\n */\nexport function getExpoDevice(): ExpoDevice | undefined {\n return (RN_GLOBAL_OBJ.expo && RN_GLOBAL_OBJ.expo.modules && RN_GLOBAL_OBJ.expo.modules.ExpoDevice) || undefined;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rnlibraries.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAE5E,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,6BAA6B,CA4BxE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
|
|
3
|
+
export const ReactNativeLibraries = {
|
|
4
|
+
Devtools: {
|
|
5
|
+
parseErrorStack: (errorStack) => {
|
|
6
|
+
const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
|
|
7
|
+
return parseErrorStack(errorStack);
|
|
8
|
+
},
|
|
9
|
+
symbolicateStackTrace: (stack, extraData) => {
|
|
10
|
+
const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');
|
|
11
|
+
return symbolicateStackTrace(stack, extraData);
|
|
12
|
+
},
|
|
13
|
+
getDevServer: () => {
|
|
14
|
+
const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');
|
|
15
|
+
return getDevServer();
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
Promise: require('react-native/Libraries/Promise'),
|
|
19
|
+
Utilities: {
|
|
20
|
+
polyfillGlobal: (name, getValue) => {
|
|
21
|
+
const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');
|
|
22
|
+
polyfillGlobal(name, getValue);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
ReactNativeVersion: {
|
|
26
|
+
version: RNV,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=rnlibraries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rnlibraries.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAKhF,MAAM,CAAC,MAAM,oBAAoB,GAA4C;IAC3E,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,UAAkB,EAAiC,EAAE;YACrE,MAAM,eAAe,GAAG,OAAO,CAAC,sDAAsD,CAAC,CAAC;YACxF,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,qBAAqB,EAAE,CACrB,KAAoC,EACpC,SAAmC,EACU,EAAE;YAC/C,MAAM,qBAAqB,GAAG,OAAO,CAAC,4DAA4D,CAAC,CAAC;YACpG,OAAO,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACjD,CAAC;QACD,YAAY,EAAE,GAA8B,EAAE;YAC5C,MAAM,YAAY,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;YAClF,OAAO,YAAY,EAAE,CAAC;QACxB,CAAC;KACF;IACD,OAAO,EAAE,OAAO,CAAC,gCAAgC,CAAC;IAClD,SAAS,EAAE;QACT,cAAc,EAAE,CAAI,IAAY,EAAE,QAAiB,EAAQ,EAAE;YAC3D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;YACzF,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,CAAC;KACF;IACD,kBAAkB,EAAE;QAClB,OAAO,EAAE,GAAG;KACb;CACF,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\n\nimport { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';\n\nimport type * as ReactNative from '../vendor/react-native';\nimport type { ReactNativeLibrariesInterface } from './rnlibrariesinterface';\n\nexport const ReactNativeLibraries: Required<ReactNativeLibrariesInterface> = {\n Devtools: {\n parseErrorStack: (errorStack: string): Array<ReactNative.StackFrame> => {\n const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');\n return parseErrorStack(errorStack);\n },\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ): Promise<ReactNative.SymbolicatedStackTrace> => {\n const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');\n return symbolicateStackTrace(stack, extraData);\n },\n getDevServer: (): ReactNative.DevServerInfo => {\n const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');\n return getDevServer();\n },\n },\n Promise: require('react-native/Libraries/Promise'),\n Utilities: {\n polyfillGlobal: <T>(name: string, getValue: () => T): void => {\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n polyfillGlobal(name, getValue);\n },\n },\n ReactNativeVersion: {\n version: RNV,\n },\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rnlibraries.web.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAE5E,eAAO,MAAM,oBAAoB,EAAE,6BAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rnlibraries.web.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.web.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAkC,EAAE,CAAC","sourcesContent":["import type { ReactNativeLibrariesInterface } from './rnlibrariesinterface';\n\nexport const ReactNativeLibraries: ReactNativeLibrariesInterface = {};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
|
|
2
|
+
import type * as ReactNative from '../vendor/react-native';
|
|
3
|
+
export type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
export type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';
|
|
5
|
+
export interface ReactNativeLibrariesInterface {
|
|
6
|
+
Devtools?: {
|
|
7
|
+
parseErrorStack: (errorStack: string) => Array<ReactNative.StackFrame>;
|
|
8
|
+
symbolicateStackTrace: (stack: Array<ReactNative.StackFrame>, extraData?: Record<string, unknown>) => Promise<ReactNative.SymbolicatedStackTrace>;
|
|
9
|
+
getDevServer: () => ReactNative.DevServerInfo;
|
|
10
|
+
};
|
|
11
|
+
Utilities?: {
|
|
12
|
+
polyfillGlobal: <T>(name: string, getValue: () => T) => void;
|
|
13
|
+
};
|
|
14
|
+
Promise?: typeof Promise;
|
|
15
|
+
ReactNativeVersion?: {
|
|
16
|
+
version: typeof RNV;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=rnlibrariesinterface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rnlibrariesinterface.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibrariesinterface.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAErF,OAAO,KAAK,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAE3D,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAE9F,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE;QACT,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACvE,qBAAqB,EAAE,CACrB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;QACjD,YAAY,EAAE,MAAM,WAAW,CAAC,aAAa,CAAC;KAC/C,CAAC;IACF,SAAS,CAAC,EAAE;QACV,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;KAC9D,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE;QACnB,OAAO,EAAE,OAAO,GAAG,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// This interface contains all of react-native internals Libraries used in Sentry RN SDK.
|
|
3
|
+
//
|
|
4
|
+
// Containing the internals in one place enables us to handle platforms
|
|
5
|
+
// that don't have all the internals available. For example react-native-web.
|
|
6
|
+
//
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=rnlibrariesinterface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rnlibrariesinterface.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibrariesinterface.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,yFAAyF;AACzF,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,EAAE","sourcesContent":["//\n// This interface contains all of react-native internals Libraries used in Sentry RN SDK.\n//\n// Containing the internals in one place enables us to handle platforms\n// that don't have all the internals available. For example react-native-web.\n//\n\nimport type { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';\n\nimport type * as ReactNative from '../vendor/react-native';\n\nexport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\nexport type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';\n\nexport interface ReactNativeLibrariesInterface {\n Devtools?: {\n parseErrorStack: (errorStack: string) => Array<ReactNative.StackFrame>;\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ) => Promise<ReactNative.SymbolicatedStackTrace>;\n getDevServer: () => ReactNative.DevServerInfo;\n };\n Utilities?: {\n polyfillGlobal: <T>(name: string, getValue: () => T) => void;\n };\n Promise?: typeof Promise;\n ReactNativeVersion?: {\n version: typeof RNV;\n };\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { InternalGlobal } from '@sentry/utils';
|
|
2
2
|
import type { ErrorUtils } from 'react-native/types';
|
|
3
|
+
import type { ExpoGlobalObject } from './expoglobalobject';
|
|
3
4
|
/** Internal Global object interface with common and Sentry specific properties */
|
|
4
5
|
export interface ReactNativeInternalGlobal extends InternalGlobal {
|
|
5
6
|
__sentry_rn_v4_registered?: boolean;
|
|
@@ -11,7 +12,7 @@ export interface ReactNativeInternalGlobal extends InternalGlobal {
|
|
|
11
12
|
__turboModuleProxy: unknown;
|
|
12
13
|
nativeFabricUIManager: unknown;
|
|
13
14
|
ErrorUtils?: ErrorUtils;
|
|
14
|
-
expo
|
|
15
|
+
expo?: ExpoGlobalObject;
|
|
15
16
|
}
|
|
16
17
|
/** Get's the global object for the current JavaScript runtime */
|
|
17
18
|
export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KACjE,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KACjE,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,2BAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAmB3C,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,UAAuC,CAAC","sourcesContent":["import type { InternalGlobal } from '@sentry/utils';\nimport { GLOBAL_OBJ } from '@sentry/utils';\nimport type { ErrorUtils } from 'react-native/types';\n\nimport type { ExpoGlobalObject } from './expoglobalobject';\n\n/** Internal Global object interface with common and Sentry specific properties */\nexport interface ReactNativeInternalGlobal extends InternalGlobal {\n __sentry_rn_v4_registered?: boolean;\n __sentry_rn_v5_registered?: boolean;\n HermesInternal?: {\n getRuntimeProperties?: () => Record<string, string | undefined>;\n };\n Promise: unknown;\n __turboModuleProxy: unknown;\n nativeFabricUIManager: unknown;\n ErrorUtils?: ErrorUtils;\n expo?: ExpoGlobalObject;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const RN_GLOBAL_OBJ = GLOBAL_OBJ as ReactNativeInternalGlobal;\n"]}
|
package/dist/js/version.d.ts
CHANGED
|
@@ -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.16.0-alpha.
|
|
3
|
+
export declare const SDK_VERSION = "5.16.0-alpha.3";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|
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,gBAAgB,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.16.0-alpha.
|
|
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,gBAAgB,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.16.0-alpha.3';\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": "5.16.0-alpha.
|
|
5
|
+
"version": "5.16.0-alpha.3",
|
|
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",
|
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
"build:sdk": "tsc -p tsconfig.build.json",
|
|
23
23
|
"build:sdk:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
|
|
24
24
|
"build:tools": "tsc -p tsconfig.build.tools.json",
|
|
25
|
+
"build:tools:watch": "tsc -p tsconfig.build.tools.json -w --preserveWatchOutput",
|
|
25
26
|
"build:plugin": "EXPO_NONINTERACTIVE=true expo-module build plugin",
|
|
26
27
|
"downlevel": "downlevel-dts dist ts3.8/dist --to=3.8",
|
|
27
28
|
"clean": "rimraf dist coverage && yarn clean:plugin",
|
|
28
29
|
"clean:plugin": "expo-module clean plugin",
|
|
30
|
+
"circularDepCheck": "madge --circular dist/js/index.js && madge --circular metro.js && madge --circular expo.js",
|
|
29
31
|
"test": "yarn test:sdk && yarn test:tools",
|
|
30
32
|
"test:sdk": "jest",
|
|
31
33
|
"test:tools": "jest --config jest.config.tools.js",
|
|
@@ -40,6 +42,9 @@
|
|
|
40
42
|
"run-android": "cd samples/react-native && yarn react-native run-android",
|
|
41
43
|
"yalc:add:sentry-javascript": "yalc add @sentry/browser @sentry/core @sentry/hub @sentry/integrations @sentry/react @sentry/types @sentry/utils"
|
|
42
44
|
},
|
|
45
|
+
"bin": {
|
|
46
|
+
"sentry-expo-upload-sourcemaps": "scripts/expo-upload-sourcemaps.js"
|
|
47
|
+
},
|
|
43
48
|
"keywords": [
|
|
44
49
|
"react-native",
|
|
45
50
|
"sentry",
|
|
@@ -56,13 +61,13 @@
|
|
|
56
61
|
"When bumping make sure to update the version of react, i.e: https://github.com/facebook/react-native/blob/v0.56.0/package.json"
|
|
57
62
|
],
|
|
58
63
|
"peerDependencies": {
|
|
64
|
+
"expo": ">=49.0.0",
|
|
59
65
|
"react": ">=17.0.0",
|
|
60
|
-
"react-native": ">=0.65.0"
|
|
61
|
-
"expo": ">=47.0.0"
|
|
66
|
+
"react-native": ">=0.65.0"
|
|
62
67
|
},
|
|
63
68
|
"dependencies": {
|
|
64
69
|
"@sentry/browser": "7.81.1",
|
|
65
|
-
"@sentry/cli": "2.
|
|
70
|
+
"@sentry/cli": "2.23.0",
|
|
66
71
|
"@sentry/core": "7.81.1",
|
|
67
72
|
"@sentry/hub": "7.81.1",
|
|
68
73
|
"@sentry/integrations": "7.81.1",
|
|
@@ -71,6 +76,8 @@
|
|
|
71
76
|
"@sentry/utils": "7.81.1"
|
|
72
77
|
},
|
|
73
78
|
"devDependencies": {
|
|
79
|
+
"@babel/core": "^7.23.5",
|
|
80
|
+
"@expo/metro-config": "0.16.0",
|
|
74
81
|
"@sentry-internal/eslint-config-sdk": "7.81.1",
|
|
75
82
|
"@sentry-internal/eslint-plugin-sdk": "7.81.1",
|
|
76
83
|
"@sentry-internal/typescript": "7.80.0",
|
|
@@ -85,14 +92,15 @@
|
|
|
85
92
|
"eslint": "^7.6.0",
|
|
86
93
|
"eslint-plugin-react": "^7.20.6",
|
|
87
94
|
"eslint-plugin-react-native": "^3.8.1",
|
|
88
|
-
"expo": "
|
|
95
|
+
"expo": "50.0.0-preview.8",
|
|
89
96
|
"expo-module-scripts": "^3.1.0",
|
|
90
97
|
"jest": "^29.6.2",
|
|
91
98
|
"jest-environment-jsdom": "^29.6.2",
|
|
99
|
+
"madge": "^6.1.0",
|
|
92
100
|
"metro": "0.76",
|
|
93
101
|
"prettier": "^2.0.5",
|
|
94
102
|
"react": "18.2.0",
|
|
95
|
-
"react-native": "0.
|
|
103
|
+
"react-native": "0.73.2",
|
|
96
104
|
"replace-in-file": "^7.0.1",
|
|
97
105
|
"rimraf": "^4.1.1",
|
|
98
106
|
"ts-jest": "^29.1.1",
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const process = require('process');
|
|
6
|
+
|
|
7
|
+
const SENTRY_PROJECT = 'SENTRY_PROJECT';
|
|
8
|
+
// The sentry org is inferred from the auth token
|
|
9
|
+
const SENTRY_AUTH_TOKEN = 'SENTRY_AUTH_TOKEN';
|
|
10
|
+
const SENTRY_CLI_EXECUTABLE = 'SENTRY_CLI_EXECUTABLE';
|
|
11
|
+
|
|
12
|
+
function getEnvVar(varname) {
|
|
13
|
+
return process.env[varname];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getSentryPluginPropertiesFromExpoConfig() {
|
|
17
|
+
try {
|
|
18
|
+
const stdOutBuffer = execSync('npx expo config --json');
|
|
19
|
+
const config = JSON.parse(stdOutBuffer.toString());
|
|
20
|
+
const plugins = config.plugins;
|
|
21
|
+
if (!plugins) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const sentryPlugin = plugins.find(plugin => {
|
|
26
|
+
if (!Array.isArray(plugin) || plugin.length < 2) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const [pluginName] = plugin;
|
|
30
|
+
return pluginName === '@sentry/react-native';
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (!sentryPlugin) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const [, pluginConfig] = sentryPlugin;
|
|
37
|
+
return pluginConfig;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error('Error fetching expo config:', error);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readAndPrintJSONFile(filePath) {
|
|
45
|
+
if (!fs.existsSync(filePath)) {
|
|
46
|
+
throw new Error(`The file "${filePath}" does not exist.`);
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const data = fs.readFileSync(filePath, 'utf8');
|
|
50
|
+
return JSON.parse(data);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
console.error('Error reading or parsing JSON file:', err);
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function writeJSONFile(filePath, object) {
|
|
58
|
+
// Convert the updated JavaScript object back to a JSON string
|
|
59
|
+
const updatedJsonString = JSON.stringify(object, null, 2);
|
|
60
|
+
fs.writeFileSync(filePath, updatedJsonString, 'utf8', writeErr => {
|
|
61
|
+
if (writeErr) {
|
|
62
|
+
console.error('Error writing to the file:', writeErr);
|
|
63
|
+
} else {
|
|
64
|
+
console.log('File updated successfully.');
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function isAsset(filename) {
|
|
70
|
+
return filename.endsWith('.map') || filename.endsWith('.js') || filename.endsWith('.hbc');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getAssetPathsSync(directory) {
|
|
74
|
+
const files = [];
|
|
75
|
+
const items = fs.readdirSync(directory, { withFileTypes: true });
|
|
76
|
+
|
|
77
|
+
for (const item of items) {
|
|
78
|
+
const fullPath = path.join(directory, item.name);
|
|
79
|
+
if (item.isDirectory()) {
|
|
80
|
+
// eslint-disable-next-line no-unused-vars
|
|
81
|
+
files.push(...getAssetPathsSync(fullPath));
|
|
82
|
+
} else if (item.isFile() && isAsset(item.name)) {
|
|
83
|
+
files.push(fullPath);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return files;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function groupAssets(assetPaths) {
|
|
90
|
+
const groups = {};
|
|
91
|
+
for (const assetPath of assetPaths) {
|
|
92
|
+
const parsedPath = path.parse(assetPath);
|
|
93
|
+
const extname = parsedPath.ext;
|
|
94
|
+
const assetGroupName = extname === '.map' ? path.join(parsedPath.dir, parsedPath.name) : path.format(parsedPath);
|
|
95
|
+
if (!groups[assetGroupName]) {
|
|
96
|
+
groups[assetGroupName] = [assetPath];
|
|
97
|
+
} else {
|
|
98
|
+
groups[assetGroupName].push(assetPath);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return groups;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let sentryProject = getEnvVar(SENTRY_PROJECT);
|
|
105
|
+
let authToken = getEnvVar(SENTRY_AUTH_TOKEN);
|
|
106
|
+
const sentryCliBin = getEnvVar(SENTRY_CLI_EXECUTABLE) || require.resolve('@sentry/cli/bin/sentry-cli');
|
|
107
|
+
|
|
108
|
+
if (!sentryProject) {
|
|
109
|
+
console.log(`🐕 Fetching ${SENTRY_PROJECT} from expo config...`);
|
|
110
|
+
const pluginConfig = getSentryPluginPropertiesFromExpoConfig();
|
|
111
|
+
if (!pluginConfig) {
|
|
112
|
+
console.error("Could not fetch '@sentry/react-native' plugin properties from expo config.");
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
if (!pluginConfig.project) {
|
|
116
|
+
console.error(
|
|
117
|
+
`Could not resolve sentry project, set it in the environment variable ${SENTRY_PROJECT} or in the '@sentry/react-native' plugin properties in your expo config.`,
|
|
118
|
+
);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
sentryProject = pluginConfig.project;
|
|
122
|
+
console.log(`${SENTRY_PROJECT} resolved to ${sentryProject} from expo config.`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!authToken) {
|
|
126
|
+
console.error(`${SENTRY_AUTH_TOKEN} environment variable must be set.`);
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const outputDir = process.argv[2];
|
|
131
|
+
if (!outputDir) {
|
|
132
|
+
console.error('Provide the directory with your bundles and sourcemaps as the first argument.');
|
|
133
|
+
console.error('Example: node node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps dist');
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const files = getAssetPathsSync(outputDir);
|
|
138
|
+
const groupedAssets = groupAssets(files);
|
|
139
|
+
|
|
140
|
+
for (const [assetGroupName, assets] of Object.entries(groupedAssets)) {
|
|
141
|
+
const sourceMapPath = assets.find(asset => asset.endsWith('.map'));
|
|
142
|
+
if (sourceMapPath) {
|
|
143
|
+
const sourceMap = readAndPrintJSONFile(sourceMapPath);
|
|
144
|
+
if (sourceMap.debugId) {
|
|
145
|
+
sourceMap.debug_id = sourceMap.debugId;
|
|
146
|
+
}
|
|
147
|
+
writeJSONFile(sourceMapPath, sourceMap);
|
|
148
|
+
}
|
|
149
|
+
console.log(`⬆️ Uploading ${assetGroupName} bundle and sourcemap...`);
|
|
150
|
+
const isHermes = assets.find(asset => asset.endsWith('.hbc'));
|
|
151
|
+
execSync(`${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, {
|
|
152
|
+
env: {
|
|
153
|
+
...process.env,
|
|
154
|
+
[SENTRY_PROJECT]: sentryProject,
|
|
155
|
+
},
|
|
156
|
+
stdio: 'inherit',
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
console.log('✅ Uploaded bundles and sourcemaps to Sentry successfully.');
|
package/src/js/NativeRNSentry.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Package } from '@sentry/types';
|
|
2
2
|
import type { TurboModule } from 'react-native';
|
|
3
3
|
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import type { UnsafeObject } from './utils/rnlibrariesinterface';
|
|
5
6
|
|
|
6
7
|
// There has to be only one interface and it has to be named `Spec`
|
|
7
8
|
// Only extra allowed definitions are types (probably codegen bug)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Package } from '@sentry/types';
|
|
2
2
|
import type { TurboModule } from 'react-native';
|
|
3
|
-
import type { UnsafeObject } from '
|
|
3
|
+
import type { UnsafeObject } from './utils/rnlibrariesinterface';
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
5
|
addBreadcrumb(breadcrumb: UnsafeObject): void;
|
|
6
6
|
captureEnvelope(bytes: string, options: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Integration } from '@sentry/types';
|
|
2
|
+
import type { ReactNativeClientOptions } from '../options';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the default ReactNative integrations based on the current environment.
|
|
5
|
+
*
|
|
6
|
+
* Native integrations are only returned when native is enabled.
|
|
7
|
+
*
|
|
8
|
+
* Web integrations are only returned when running on web.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[];
|
|
11
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EventProcessor, Hub, Integration } from '@sentry/types';
|
|
2
|
+
/** Load device context from expo modules. */
|
|
3
|
+
export declare class ExpoContext implements Integration {
|
|
4
|
+
/**
|
|
5
|
+
* @inheritDoc
|
|
6
|
+
*/
|
|
7
|
+
static id: string;
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=expocontext.d.ts.map
|