@sentry/react-native 8.5.0 → 8.7.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/build.gradle +2 -2
- package/android/expo-handler/build.gradle +20 -0
- package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryExpoPackage.java +22 -0
- package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryReactNativeHostHandler.java +48 -0
- package/android/expo-stubs/README.md +7 -0
- package/android/expo-stubs/build.gradle +23 -0
- package/android/expo-stubs/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/expo-stubs/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/expo-stubs/gradlew +251 -0
- package/android/expo-stubs/gradlew.bat +94 -0
- package/android/expo-stubs/settings.gradle +1 -0
- package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/Package.java +11 -0
- package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +7 -0
- package/android/libs/expo-stubs.jar +0 -0
- package/android/libs/replay-stubs.jar +0 -0
- package/android/replay-stubs/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryFrameDelayCollector.java +128 -0
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +63 -11
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +6 -0
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +6 -0
- package/dist/js/NativeLogListener.d.ts.map +1 -1
- package/dist/js/NativeLogListener.js.map +1 -1
- package/dist/js/NativeRNSentry.d.ts +1 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/RNSentryReplayMaskNativeComponent.d.ts.map +1 -1
- package/dist/js/RNSentryReplayMaskNativeComponent.js +1 -2
- package/dist/js/RNSentryReplayMaskNativeComponent.js.map +1 -1
- package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts.map +1 -1
- package/dist/js/RNSentryReplayUnmaskNativeComponent.js +1 -2
- package/dist/js/RNSentryReplayUnmaskNativeComponent.js.map +1 -1
- package/dist/js/breadcrumb.d.ts.map +1 -1
- package/dist/js/breadcrumb.js.map +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +1 -1
- package/dist/js/client.js.map +1 -1
- package/dist/js/feedback/FeedbackButton.d.ts +2 -1
- package/dist/js/feedback/FeedbackButton.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackButton.js +5 -4
- package/dist/js/feedback/FeedbackButton.js.map +1 -1
- package/dist/js/feedback/{FeedbackWidget.d.ts → FeedbackForm.d.ts} +5 -5
- package/dist/js/feedback/FeedbackForm.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.js → FeedbackForm.js} +32 -30
- package/dist/js/feedback/FeedbackForm.js.map +1 -0
- package/dist/js/feedback/FeedbackForm.styles.d.ts +11 -0
- package/dist/js/feedback/FeedbackForm.styles.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.styles.js → FeedbackForm.styles.js} +1 -1
- package/dist/js/feedback/FeedbackForm.styles.js.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.theme.d.ts → FeedbackForm.theme.d.ts} +7 -5
- package/dist/js/feedback/FeedbackForm.theme.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.theme.js → FeedbackForm.theme.js} +1 -1
- package/dist/js/feedback/FeedbackForm.theme.js.map +1 -0
- package/{ts3.8/dist/js/feedback/FeedbackWidget.types.d.ts → dist/js/feedback/FeedbackForm.types.d.ts} +305 -299
- package/dist/js/feedback/FeedbackForm.types.d.ts.map +1 -0
- package/dist/js/feedback/FeedbackForm.types.js +2 -0
- package/dist/js/feedback/FeedbackForm.types.js.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetManager.d.ts → FeedbackFormManager.d.ts} +12 -4
- package/dist/js/feedback/FeedbackFormManager.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetManager.js → FeedbackFormManager.js} +22 -13
- package/dist/js/feedback/FeedbackFormManager.js.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetProvider.d.ts → FeedbackFormProvider.d.ts} +10 -10
- package/dist/js/feedback/FeedbackFormProvider.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetProvider.js → FeedbackFormProvider.js} +18 -15
- package/dist/js/feedback/FeedbackFormProvider.js.map +1 -0
- package/dist/js/feedback/ScreenshotButton.d.ts +2 -2
- package/dist/js/feedback/ScreenshotButton.d.ts.map +1 -1
- package/dist/js/feedback/ScreenshotButton.js +6 -5
- package/dist/js/feedback/ScreenshotButton.js.map +1 -1
- package/dist/js/feedback/ShakeToReportBug.d.ts.map +1 -1
- package/dist/js/feedback/ShakeToReportBug.js.map +1 -1
- package/dist/js/feedback/defaults.d.ts +2 -2
- package/dist/js/feedback/defaults.d.ts.map +1 -1
- package/dist/js/feedback/defaults.js.map +1 -1
- package/dist/js/feedback/integration.d.ts +13 -13
- package/dist/js/feedback/integration.d.ts.map +1 -1
- package/dist/js/feedback/integration.js.map +1 -1
- package/dist/js/feedback/lazy.d.ts +5 -0
- package/dist/js/feedback/lazy.d.ts.map +1 -1
- package/dist/js/feedback/lazy.js +12 -0
- package/dist/js/feedback/lazy.js.map +1 -1
- package/dist/js/feedback/utils.d.ts.map +1 -1
- package/dist/js/feedback/utils.js +1 -0
- package/dist/js/feedback/utils.js.map +1 -1
- package/dist/js/index.d.ts +12 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +12 -3
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/appRegistry.d.ts.map +1 -1
- package/dist/js/integrations/appRegistry.js.map +1 -1
- package/dist/js/integrations/breadcrumbs.d.ts.map +1 -1
- package/dist/js/integrations/breadcrumbs.js +1 -1
- package/dist/js/integrations/breadcrumbs.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +4 -5
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +1 -2
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +1 -1
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/expoconstants.d.ts.map +1 -1
- package/dist/js/integrations/expoconstants.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/integrations/expoupdateslistener.d.ts.map +1 -1
- package/dist/js/integrations/expoupdateslistener.js +0 -1
- package/dist/js/integrations/expoupdateslistener.js.map +1 -1
- package/dist/js/integrations/graphql.d.ts.map +1 -1
- package/dist/js/integrations/graphql.js.map +1 -1
- package/dist/js/integrations/logEnricherIntegration.d.ts.map +1 -1
- package/dist/js/integrations/logEnricherIntegration.js +1 -1
- package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts.map +1 -1
- package/dist/js/integrations/modulesloader.js.map +1 -1
- package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
- package/dist/js/integrations/nativelinkederrors.js +1 -0
- package/dist/js/integrations/nativelinkederrors.js.map +1 -1
- package/dist/js/integrations/primitiveTagIntegration.d.ts.map +1 -1
- package/dist/js/integrations/primitiveTagIntegration.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +2 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.js +0 -5
- package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/integrations/release.d.ts.map +1 -1
- package/dist/js/integrations/release.js +1 -1
- package/dist/js/integrations/release.js.map +1 -1
- package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
- package/dist/js/integrations/rewriteframes.js.map +1 -1
- package/dist/js/integrations/screenshot.d.ts.map +1 -1
- package/dist/js/integrations/screenshot.js +1 -1
- package/dist/js/integrations/screenshot.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/supabase.d.ts.map +1 -1
- package/dist/js/integrations/supabase.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +1 -1
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/misc.js.map +1 -1
- package/dist/js/options.d.ts +1 -1
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/playground/examples.d.ts.map +1 -1
- package/dist/js/playground/examples.js.map +1 -1
- package/dist/js/playground/modal.d.ts +2 -2
- package/dist/js/playground/modal.d.ts.map +1 -1
- package/dist/js/playground/modal.js +5 -103
- package/dist/js/playground/modal.js.map +1 -1
- package/dist/js/playground/modal.styles.d.ts +100 -0
- package/dist/js/playground/modal.styles.d.ts.map +1 -0
- package/dist/js/playground/modal.styles.js +98 -0
- package/dist/js/playground/modal.styles.js.map +1 -0
- package/dist/js/profiling/cache.js +2 -2
- package/dist/js/profiling/cache.js.map +1 -1
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
- package/dist/js/profiling/convertHermesProfile.js.map +1 -1
- package/dist/js/profiling/debugid.d.ts.map +1 -1
- package/dist/js/profiling/debugid.js.map +1 -1
- package/dist/js/profiling/hermes.d.ts.map +1 -1
- package/dist/js/profiling/hermes.js.map +1 -1
- package/dist/js/profiling/integration.d.ts.map +1 -1
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/profiling/types.d.ts.map +1 -1
- package/dist/js/profiling/types.js.map +1 -1
- package/dist/js/profiling/utils.d.ts.map +1 -1
- package/dist/js/profiling/utils.js +1 -1
- package/dist/js/profiling/utils.js.map +1 -1
- package/dist/js/replay/CustomMask.d.ts +1 -1
- package/dist/js/replay/CustomMask.d.ts.map +1 -1
- package/dist/js/replay/CustomMask.js +1 -1
- package/dist/js/replay/CustomMask.js.map +1 -1
- package/dist/js/replay/CustomMask.web.d.ts +1 -1
- package/dist/js/replay/CustomMask.web.d.ts.map +1 -1
- package/dist/js/replay/CustomMask.web.js +2 -2
- package/dist/js/replay/CustomMask.web.js.map +1 -1
- package/dist/js/replay/browserReplay.d.ts.map +1 -1
- package/dist/js/replay/browserReplay.js +0 -2
- package/dist/js/replay/browserReplay.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js +21 -2
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/replay/networkUtils.d.ts +0 -1
- package/dist/js/replay/networkUtils.d.ts.map +1 -1
- package/dist/js/replay/networkUtils.js.map +1 -1
- package/dist/js/replay/xhrUtils.d.ts.map +1 -1
- package/dist/js/replay/xhrUtils.js.map +1 -1
- package/dist/js/scopeSync.d.ts.map +1 -1
- package/dist/js/scopeSync.js +1 -1
- package/dist/js/scopeSync.js.map +1 -1
- package/dist/js/sdk.d.ts +21 -0
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +42 -18
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/ModulesCollector.js +1 -1
- package/dist/js/tools/ModulesCollector.js.map +1 -1
- package/dist/js/tools/collectModules.js +0 -1
- package/dist/js/tools/collectModules.js.map +1 -1
- package/dist/js/tools/easBuildHooks.d.ts.map +1 -1
- package/dist/js/tools/easBuildHooks.js +13 -14
- package/dist/js/tools/easBuildHooks.js.map +1 -1
- package/dist/js/tools/enableLogger.js +1 -2
- package/dist/js/tools/enableLogger.js.map +1 -1
- package/dist/js/tools/metroMiddleware.d.ts.map +1 -1
- package/dist/js/tools/metroMiddleware.js.map +1 -1
- package/dist/js/tools/metroconfig.d.ts.map +1 -1
- package/dist/js/tools/metroconfig.js +10 -12
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.js +9 -10
- package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +6 -7
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/sentryOptionsSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryOptionsSerializer.js +3 -5
- package/dist/js/tools/sentryOptionsSerializer.js.map +1 -1
- package/dist/js/tools/sentryReleaseInjector.d.ts +1 -1
- package/dist/js/tools/sentryReleaseInjector.d.ts.map +1 -1
- package/dist/js/tools/sentryReleaseInjector.js.map +1 -1
- package/dist/js/tools/utils.d.ts.map +1 -1
- package/dist/js/tools/utils.js +7 -10
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tools/vendor/metro/countLines.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.js +5 -5
- package/dist/js/tools/vendor/metro/utils.js.map +1 -1
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +19 -19
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/expoAsset.js.map +1 -1
- package/dist/js/tracing/expoImage.d.ts.map +1 -1
- package/dist/js/tracing/expoImage.js +1 -1
- package/dist/js/tracing/expoImage.js.map +1 -1
- package/dist/js/tracing/expoRouter.d.ts.map +1 -1
- package/dist/js/tracing/expoRouter.js.map +1 -1
- package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
- package/dist/js/tracing/gesturetracing.js.map +1 -1
- package/dist/js/tracing/integrations/appStart.d.ts +19 -1
- package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
- package/dist/js/tracing/integrations/appStart.js +144 -9
- package/dist/js/tracing/integrations/appStart.js.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.js +47 -1
- package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.js +4 -2
- package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js +15 -15
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
- package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
- package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.js +43 -14
- package/dist/js/tracing/onSpanEndUtils.js.map +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/reactnativeprofiler.d.ts.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.js +2 -2
- package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +0 -1
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts +3 -0
- 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/span.d.ts +2 -17
- package/dist/js/tracing/span.d.ts.map +1 -1
- package/dist/js/tracing/span.js +1 -1
- package/dist/js/tracing/span.js.map +1 -1
- package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.js +42 -19
- package/dist/js/tracing/timetodisplay.js.map +1 -1
- package/dist/js/tracing/timetodisplaynative.d.ts +1 -1
- package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplaynative.js +5 -4
- package/dist/js/tracing/timetodisplaynative.js.map +1 -1
- package/dist/js/tracing/types.js.map +1 -1
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/encodePolyfill.d.ts +1 -1
- package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
- package/dist/js/transports/encodePolyfill.js.map +1 -1
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
- package/dist/js/utils/encode.js.map +1 -1
- package/dist/js/utils/envelope.d.ts.map +1 -1
- package/dist/js/utils/envelope.js.map +1 -1
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/expomodules.d.ts.map +1 -1
- package/dist/js/utils/expomodules.js.map +1 -1
- package/dist/js/utils/fill.js +1 -1
- package/dist/js/utils/fill.js.map +1 -1
- package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
- package/dist/js/utils/normalize.js +2 -2
- package/dist/js/utils/normalize.js.map +1 -1
- package/dist/js/utils/outcome.js.map +1 -1
- package/dist/js/utils/primitiveConverter.js.map +1 -1
- package/dist/js/utils/release.js.map +1 -1
- package/dist/js/utils/rnlibraries.d.ts.map +1 -1
- package/dist/js/utils/rnlibraries.js +1 -7
- package/dist/js/utils/rnlibraries.js.map +1 -1
- package/dist/js/utils/safe.d.ts.map +1 -1
- package/dist/js/utils/safe.js.map +1 -1
- package/dist/js/utils/span.d.ts.map +1 -1
- package/dist/js/utils/span.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +0 -1
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/utils/xhr.d.ts +0 -1
- package/dist/js/utils/xhr.d.ts.map +1 -1
- package/dist/js/utils/xhr.js.map +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.js +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
- package/dist/js/vendor/buffer/utf8ToBytes.js +1 -1
- package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
- package/dist/js/vendor/react-native/index.d.ts.map +1 -1
- package/dist/js/vendor/react-native/index.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/dist/js/wrapper.d.ts +1 -0
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +20 -9
- package/dist/js/wrapper.js.map +1 -1
- package/expo-module.config.json +7 -0
- package/ios/RNSentry.mm +18 -1
- package/ios/RNSentryReplay.mm +1 -1
- package/ios/RNSentrySDK.m +1 -1
- package/ios/RNSentryStart.m +4 -1
- package/ios/RNSentryTimeToDisplay.m +48 -32
- package/ios/RNSentryVersion.m +1 -1
- package/ios/SentryScreenFramesWrapper.h +2 -0
- package/ios/SentryScreenFramesWrapper.m +35 -0
- package/package.json +18 -22
- package/plugin/build/logger.js +1 -1
- package/plugin/build/utils.js +2 -0
- package/plugin/build/withSentry.js +1 -2
- package/plugin/build/withSentryAndroid.js +2 -0
- package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
- package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
- package/plugin/build/withSentryIOS.js +1 -3
- package/scripts/eas-build-hook.js +0 -2
- package/scripts/expo-upload-sourcemaps.js +0 -1
- package/src/js/NativeRNSentry.ts +3 -0
- package/src/js/RNSentryReplayMaskNativeComponent.ts +2 -3
- package/src/js/RNSentryReplayUnmaskNativeComponent.ts +2 -3
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
- package/ts3.8/dist/js/feedback/FeedbackButton.d.ts +2 -1
- package/ts3.8/dist/js/feedback/{FeedbackWidget.d.ts → FeedbackForm.d.ts} +5 -5
- package/ts3.8/dist/js/feedback/FeedbackForm.styles.d.ts +11 -0
- package/ts3.8/dist/js/feedback/{FeedbackWidget.theme.d.ts → FeedbackForm.theme.d.ts} +7 -5
- package/{dist/js/feedback/FeedbackWidget.types.d.ts → ts3.8/dist/js/feedback/FeedbackForm.types.d.ts} +305 -299
- package/ts3.8/dist/js/feedback/{FeedbackWidgetManager.d.ts → FeedbackFormManager.d.ts} +12 -4
- package/ts3.8/dist/js/feedback/{FeedbackWidgetProvider.d.ts → FeedbackFormProvider.d.ts} +10 -10
- package/ts3.8/dist/js/feedback/ScreenshotButton.d.ts +2 -2
- package/ts3.8/dist/js/feedback/defaults.d.ts +2 -2
- package/ts3.8/dist/js/feedback/integration.d.ts +13 -13
- package/ts3.8/dist/js/feedback/lazy.d.ts +5 -0
- package/ts3.8/dist/js/index.d.ts +12 -3
- package/ts3.8/dist/js/options.d.ts +1 -1
- package/ts3.8/dist/js/playground/modal.d.ts +2 -2
- package/ts3.8/dist/js/playground/modal.styles.d.ts +100 -0
- package/ts3.8/dist/js/replay/CustomMask.d.ts +1 -1
- package/ts3.8/dist/js/replay/CustomMask.web.d.ts +1 -1
- package/ts3.8/dist/js/replay/networkUtils.d.ts +0 -1
- package/ts3.8/dist/js/sdk.d.ts +21 -0
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +19 -1
- package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnavigation.d.ts +3 -0
- package/ts3.8/dist/js/tracing/span.d.ts +2 -17
- package/ts3.8/dist/js/tracing/timetodisplaynative.d.ts +1 -1
- package/ts3.8/dist/js/transports/encodePolyfill.d.ts +1 -1
- package/ts3.8/dist/js/utils/worldwide.d.ts +0 -1
- package/ts3.8/dist/js/utils/xhr.d.ts +0 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +1 -0
- package/dist/js/feedback/FeedbackWidget.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.js.map +0 -1
- package/dist/js/feedback/FeedbackWidget.styles.d.ts +0 -11
- package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.styles.js.map +0 -1
- package/dist/js/feedback/FeedbackWidget.theme.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.theme.js.map +0 -1
- package/dist/js/feedback/FeedbackWidget.types.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.types.js +0 -2
- package/dist/js/feedback/FeedbackWidget.types.js.map +0 -1
- package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidgetManager.js.map +0 -1
- package/dist/js/feedback/FeedbackWidgetProvider.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidgetProvider.js.map +0 -1
- package/ts3.8/dist/js/feedback/FeedbackWidget.styles.d.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryBabelTransformerUtils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryBabelTransformerUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentryBabelTransformerUtils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryBabelTransformerUtils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAwB,MAAM,sCAAsC,CAAC;AAEnG,MAAM,MAAM,6BAA6B,GAAG;IAAE,uBAAuB,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE,CAAC;AAE3G,eAAO,MAAM,qCAAqC,0CAA0C,CAAC;AAC7F,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAEnF;;GAEG;AACH,wBAAgB,uCAAuC,CAAC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAGjG;AAED;;GAEG;AACH,wBAAgB,uCAAuC,IAAI,MAAM,GAAG,SAAS,CAE5E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,gBAAgB,CAU9D;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAgB7F;AAED;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,6BAA6B,GAAG,SAAS,CAe5F;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,gBAAgB,CAiB/D"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SENTRY_BABEL_TRANSFORMER_OPTIONS = exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH = void 0;
|
|
4
|
+
exports.setSentryDefaultBabelTransformerPathEnv = setSentryDefaultBabelTransformerPathEnv;
|
|
5
|
+
exports.getSentryDefaultBabelTransformerPathEnv = getSentryDefaultBabelTransformerPathEnv;
|
|
6
|
+
exports.loadDefaultBabelTransformer = loadDefaultBabelTransformer;
|
|
7
|
+
exports.setSentryBabelTransformerOptions = setSentryBabelTransformerOptions;
|
|
8
|
+
exports.getSentryBabelTransformerOptions = getSentryBabelTransformerOptions;
|
|
9
|
+
exports.createSentryBabelTransformer = createSentryBabelTransformer;
|
|
4
10
|
const babel_plugin_component_annotate_1 = require("@sentry/babel-plugin-component-annotate");
|
|
5
11
|
const core_1 = require("@sentry/core");
|
|
6
12
|
const process = require("process");
|
|
@@ -13,14 +19,12 @@ function setSentryDefaultBabelTransformerPathEnv(defaultBabelTransformerPath) {
|
|
|
13
19
|
process.env[exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH] = defaultBabelTransformerPath;
|
|
14
20
|
core_1.debug.log(`Saved default Babel transformer path ${defaultBabelTransformerPath}`);
|
|
15
21
|
}
|
|
16
|
-
exports.setSentryDefaultBabelTransformerPathEnv = setSentryDefaultBabelTransformerPathEnv;
|
|
17
22
|
/**
|
|
18
23
|
* Reads default Babel transformer path from the environment variables.
|
|
19
24
|
*/
|
|
20
25
|
function getSentryDefaultBabelTransformerPathEnv() {
|
|
21
26
|
return process.env[exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH];
|
|
22
27
|
}
|
|
23
|
-
exports.getSentryDefaultBabelTransformerPathEnv = getSentryDefaultBabelTransformerPathEnv;
|
|
24
28
|
/**
|
|
25
29
|
* Loads default Babel transformer from `@react-native/metro-config` -> `@react-native/metro-babel-transformer`.
|
|
26
30
|
*/
|
|
@@ -30,10 +34,8 @@ function loadDefaultBabelTransformer() {
|
|
|
30
34
|
throw new Error(`Default Babel transformer path environment variable ${exports.SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH} is not set.`);
|
|
31
35
|
}
|
|
32
36
|
core_1.debug.log(`Loading default Babel transformer from ${defaultBabelTransformerPath}`);
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
34
37
|
return require(defaultBabelTransformerPath);
|
|
35
38
|
}
|
|
36
|
-
exports.loadDefaultBabelTransformer = loadDefaultBabelTransformer;
|
|
37
39
|
/**
|
|
38
40
|
*
|
|
39
41
|
*/
|
|
@@ -44,7 +46,7 @@ function setSentryBabelTransformerOptions(options) {
|
|
|
44
46
|
optionsString = JSON.stringify(options);
|
|
45
47
|
}
|
|
46
48
|
catch (e) {
|
|
47
|
-
//
|
|
49
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
48
50
|
console.error('Failed to stringify Sentry Babel transformer options', e);
|
|
49
51
|
}
|
|
50
52
|
if (!optionsString) {
|
|
@@ -53,7 +55,6 @@ function setSentryBabelTransformerOptions(options) {
|
|
|
53
55
|
core_1.debug.log(`Sentry Babel transformer options set to ${exports.SENTRY_BABEL_TRANSFORMER_OPTIONS}`, optionsString);
|
|
54
56
|
process.env[exports.SENTRY_BABEL_TRANSFORMER_OPTIONS] = optionsString;
|
|
55
57
|
}
|
|
56
|
-
exports.setSentryBabelTransformerOptions = setSentryBabelTransformerOptions;
|
|
57
58
|
/**
|
|
58
59
|
*
|
|
59
60
|
*/
|
|
@@ -68,12 +69,11 @@ function getSentryBabelTransformerOptions() {
|
|
|
68
69
|
return JSON.parse(optionsString);
|
|
69
70
|
}
|
|
70
71
|
catch (e) {
|
|
71
|
-
//
|
|
72
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
72
73
|
console.error('Failed to parse Sentry Babel transformer options', e);
|
|
73
74
|
return undefined;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
exports.getSentryBabelTransformerOptions = getSentryBabelTransformerOptions;
|
|
77
77
|
/**
|
|
78
78
|
* Creates a Babel transformer with Sentry component annotation plugin.
|
|
79
79
|
*/
|
|
@@ -88,7 +88,6 @@ function createSentryBabelTransformer() {
|
|
|
88
88
|
};
|
|
89
89
|
return Object.assign(Object.assign({}, defaultTransformer), { transform });
|
|
90
90
|
}
|
|
91
|
-
exports.createSentryBabelTransformer = createSentryBabelTransformer;
|
|
92
91
|
function addSentryComponentAnnotatePlugin(args, options) {
|
|
93
92
|
if (!args || typeof args.filename !== 'string' || !Array.isArray(args.plugins)) {
|
|
94
93
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryBabelTransformerUtils.js","sourceRoot":"","sources":["../../../src/js/tools/sentryBabelTransformerUtils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sentryBabelTransformerUtils.js","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C;AAED,SAAS,gCAAgC,CACvC,IAAsC,EACtC,OAA6E;IAE7E,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QAC5C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,yCAAuB,EAAE,OAAO,CAAC,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAuB,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import componentAnnotatePlugin from '@sentry/babel-plugin-component-annotate';\nimport { debug } from '@sentry/core';\nimport * as process from 'process';\n\nimport type { BabelTransformer, BabelTransformerArgs } from './vendor/metro/metroBabelTransformer';\n\nexport type SentryBabelTransformerOptions = { annotateReactComponents?: { ignoredComponents?: string[] } };\n\nexport const SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH = 'SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH';\nexport const SENTRY_BABEL_TRANSFORMER_OPTIONS = 'SENTRY_BABEL_TRANSFORMER_OPTIONS';\n\n/**\n * Sets default Babel transformer path to the environment variables.\n */\nexport function setSentryDefaultBabelTransformerPathEnv(defaultBabelTransformerPath: string): void {\n process.env[SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH] = defaultBabelTransformerPath;\n debug.log(`Saved default Babel transformer path ${defaultBabelTransformerPath}`);\n}\n\n/**\n * Reads default Babel transformer path from the environment variables.\n */\nexport function getSentryDefaultBabelTransformerPathEnv(): string | undefined {\n return process.env[SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH];\n}\n\n/**\n * Loads default Babel transformer from `@react-native/metro-config` -> `@react-native/metro-babel-transformer`.\n */\nexport function loadDefaultBabelTransformer(): BabelTransformer {\n const defaultBabelTransformerPath = getSentryDefaultBabelTransformerPathEnv();\n if (!defaultBabelTransformerPath) {\n throw new Error(\n `Default Babel transformer path environment variable ${SENTRY_DEFAULT_BABEL_TRANSFORMER_PATH} is not set.`,\n );\n }\n\n debug.log(`Loading default Babel transformer from ${defaultBabelTransformerPath}`);\n return require(defaultBabelTransformerPath);\n}\n\n/**\n *\n */\nexport function setSentryBabelTransformerOptions(options: SentryBabelTransformerOptions): void {\n let optionsString: string | null = null;\n try {\n debug.log('Stringifying Sentry Babel transformer options', options);\n optionsString = JSON.stringify(options);\n } catch (e) {\n // oxlint-disable-next-line eslint(no-console)\n console.error('Failed to stringify Sentry Babel transformer options', e);\n }\n\n if (!optionsString) {\n return;\n }\n\n debug.log(`Sentry Babel transformer options set to ${SENTRY_BABEL_TRANSFORMER_OPTIONS}`, optionsString);\n process.env[SENTRY_BABEL_TRANSFORMER_OPTIONS] = optionsString;\n}\n\n/**\n *\n */\nexport function getSentryBabelTransformerOptions(): SentryBabelTransformerOptions | undefined {\n const optionsString = process.env[SENTRY_BABEL_TRANSFORMER_OPTIONS];\n if (!optionsString) {\n debug.log(`Sentry Babel transformer options environment variable ${SENTRY_BABEL_TRANSFORMER_OPTIONS} is not set`);\n return undefined;\n }\n\n try {\n debug.log(`Parsing Sentry Babel transformer options from ${optionsString}`);\n return JSON.parse(optionsString);\n } catch (e) {\n // oxlint-disable-next-line eslint(no-console)\n console.error('Failed to parse Sentry Babel transformer options', e);\n return undefined;\n }\n}\n\n/**\n * Creates a Babel transformer with Sentry component annotation plugin.\n */\nexport function createSentryBabelTransformer(): BabelTransformer {\n const defaultTransformer = loadDefaultBabelTransformer();\n const options = getSentryBabelTransformerOptions();\n\n // Using spread operator to avoid any conflicts with the default transformer\n const transform: BabelTransformer['transform'] = (...args) => {\n const transformerArgs = args[0];\n\n addSentryComponentAnnotatePlugin(transformerArgs, options?.annotateReactComponents);\n\n return defaultTransformer.transform(...args);\n };\n\n return {\n ...defaultTransformer,\n transform,\n };\n}\n\nfunction addSentryComponentAnnotatePlugin(\n args: BabelTransformerArgs | undefined,\n options: SentryBabelTransformerOptions['annotateReactComponents'] | undefined,\n): void {\n if (!args || typeof args.filename !== 'string' || !Array.isArray(args.plugins)) {\n return undefined;\n }\n\n if (!args.filename.includes('node_modules')) {\n if (options) {\n args.plugins.push([componentAnnotatePlugin, options]);\n } else {\n args.plugins.push(componentAnnotatePlugin);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryMetroSerializer.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentryMetroSerializer.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAU,eAAe,EAA4D,MAAM,SAAS,CAAC;AAmBjH;;GAEG;AACH,wBAAgB,6CAA6C,CAAC,EAC5D,UAAU,EACV,OAAO,GACR,EAAE;IACD,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,EAAE,CAcX;AAGD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GAAI,mBAAmB,eAAe,KAAG,eA4DhF,CAAC"}
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createSentryMetroSerializer =
|
|
12
|
+
exports.createSentryMetroSerializer = void 0;
|
|
13
|
+
exports.unstableBeforeAssetSerializationDebugIdPlugin = unstableBeforeAssetSerializationDebugIdPlugin;
|
|
13
14
|
const crypto = require("crypto");
|
|
14
15
|
const utils_1 = require("./utils");
|
|
15
16
|
const utils_2 = require("./vendor/metro/utils");
|
|
@@ -26,14 +27,13 @@ function unstableBeforeAssetSerializationDebugIdPlugin({ premodules, debugId, })
|
|
|
26
27
|
}
|
|
27
28
|
const debugIdModuleExists = premodules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;
|
|
28
29
|
if (debugIdModuleExists) {
|
|
29
|
-
//
|
|
30
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
30
31
|
console.warn('\n\nDebug ID module found. Skipping Sentry Debug ID module...\n\n');
|
|
31
32
|
return premodules;
|
|
32
33
|
}
|
|
33
34
|
const debugIdModule = createDebugIdModule(debugId);
|
|
34
35
|
return (0, utils_1.prependModule)(premodules, debugIdModule);
|
|
35
36
|
}
|
|
36
|
-
exports.unstableBeforeAssetSerializationDebugIdPlugin = unstableBeforeAssetSerializationDebugIdPlugin;
|
|
37
37
|
// TODO: deprecate this and afterwards rename to createSentryDebugIdSerializer
|
|
38
38
|
/**
|
|
39
39
|
* Creates a Metro serializer that adds Debug ID module to the plain bundle.
|
|
@@ -50,7 +50,7 @@ const createSentryMetroSerializer = (customSerializer) => {
|
|
|
50
50
|
}
|
|
51
51
|
const debugIdModuleExists = preModules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;
|
|
52
52
|
if (debugIdModuleExists) {
|
|
53
|
-
//
|
|
53
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
54
54
|
console.warn('Debug ID module found. Skipping Sentry Debug ID module...');
|
|
55
55
|
return serializer(entryPoint, preModules, graph, options);
|
|
56
56
|
}
|
|
@@ -70,11 +70,11 @@ const createSentryMetroSerializer = (customSerializer) => {
|
|
|
70
70
|
// from `@babel/generator` and defined it locally, it subtly changed the source map output format.
|
|
71
71
|
// https://github.com/facebook/metro/blob/main/packages/metro-source-map/src/source-map.js#L47
|
|
72
72
|
debugId = calculateDebugId(bundleCode);
|
|
73
|
-
//
|
|
73
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
74
74
|
console.log('info ' + `Bundle Debug ID (calculated): ${debugId}`);
|
|
75
75
|
}
|
|
76
76
|
// Only print debug id for command line builds => not hot reload from dev server
|
|
77
|
-
//
|
|
77
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
78
78
|
console.log('info ' + `Bundle Debug ID: ${debugId}`);
|
|
79
79
|
const debugIdComment = `${DEBUG_ID_COMMENT}${debugId}`;
|
|
80
80
|
const indexOfSourceMapComment = bundleCode.lastIndexOf(SOURCE_MAP_COMMENT);
|
|
@@ -140,7 +140,6 @@ function calculateDebugId(bundleCode, modules) {
|
|
|
140
140
|
return (0, utils_1.stringToUUID)(hash.digest('hex'));
|
|
141
141
|
}
|
|
142
142
|
function injectDebugId(code, debugId) {
|
|
143
|
-
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
|
|
144
143
|
return code.replace(new RegExp(DEBUG_ID_PLACE_HOLDER, 'g'), debugId);
|
|
145
144
|
}
|
|
146
145
|
//# sourceMappingURL=sentryMetroSerializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryMetroSerializer.js","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiC;AAIjC,mCAMiB;AACjB,gDAAoE;AAIpE,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAC1D,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AACnD,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC;;GAEG;AACH,SAAgB,6CAA6C,CAAC,EAC5D,UAAU,EACV,OAAO,GAKR;IACC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,UAAU,CAAC;KACnB;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,EAAE,aAAa,CAAC,GAAG,EAAE,CAAC;IAC9D,CAAC;CAAA;AAED,SAAS,mBAAmB,CAAC,OAAe;IAC1C,OAAO,IAAA,6BAAqB,EAAC,oBAAoB,EAAE,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAkB,EAAE,OAA2C;IACvF,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACxB,IAAI,OAAO,EAAE;QACX,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SACnB;KACF;IACD,OAAO,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,sEAAsE;IACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import * as crypto from 'crypto';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type { Bundle, MetroSerializer, MetroSerializerOutput, SerializedBundle, VirtualJSOutput } from './utils';\nimport {\n createDebugIdSnippet,\n createVirtualJSModule,\n determineDebugIdFromBundleSource,\n prependModule,\n stringToUUID,\n} from './utils';\nimport { createDefaultMetroSerializer } from './vendor/metro/utils';\n\ntype SourceMap = Record<string, unknown>;\n\nconst DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__';\nconst DEBUG_ID_MODULE_PATH = '__debugid__';\n\nconst SOURCE_MAP_COMMENT = '//# sourceMappingURL=';\nconst DEBUG_ID_COMMENT = '//# debugId=';\n\n/**\n * Adds Sentry Debug ID polyfill module to the bundle.\n */\nexport function unstableBeforeAssetSerializationDebugIdPlugin({\n premodules,\n debugId,\n}: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n}): Module[] {\n if (!debugId) {\n return premodules;\n }\n\n const debugIdModuleExists = premodules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // eslint-disable-next-line no-console\n console.warn('\\n\\nDebug ID module found. Skipping Sentry Debug ID module...\\n\\n');\n return premodules;\n }\n\n const debugIdModule = createDebugIdModule(debugId);\n return prependModule(premodules, debugIdModule);\n}\n\n// TODO: deprecate this and afterwards rename to createSentryDebugIdSerializer\n/**\n * Creates a Metro serializer that adds Debug ID module to the plain bundle.\n * The Debug ID module is a virtual module that provides a debug ID in runtime.\n *\n * RAM Bundles do not support custom serializers.\n */\nexport const createSentryMetroSerializer = (customSerializer?: MetroSerializer): MetroSerializer => {\n const serializer = customSerializer || createDefaultMetroSerializer();\n return async function (entryPoint, preModules, graph, options) {\n if (graph.transformOptions.hot) {\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModuleExists = preModules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // eslint-disable-next-line no-console\n console.warn('Debug ID module found. Skipping Sentry Debug ID module...');\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModule = createDebugIdModule(DEBUG_ID_PLACE_HOLDER);\n options.sentryBundleCallback = createSentryBundleCallback(debugIdModule);\n const modifiedPreModules = prependModule(preModules, debugIdModule);\n\n // Run wrapped serializer\n const serializerResult = serializer(entryPoint, modifiedPreModules, graph, options);\n const { code: bundleCode, map: bundleMapString } = await extractSerializerResult(serializerResult);\n\n // Add debug id comment to the bundle\n let debugId = determineDebugIdFromBundleSource(bundleCode);\n if (!debugId) {\n // For lazy-loaded chunks or bundles without the debug ID module,\n // calculate the debug ID from the bundle content.\n // This ensures Metro 0.83.2+ code-split bundles get debug IDs.\n // That needs to be done because when Metro 0.83.2 stopped importing `BabelSourceMapSegment`\n // from `@babel/generator` and defined it locally, it subtly changed the source map output format.\n // https://github.com/facebook/metro/blob/main/packages/metro-source-map/src/source-map.js#L47\n debugId = calculateDebugId(bundleCode);\n // eslint-disable-next-line no-console\n console.log('info ' + `Bundle Debug ID (calculated): ${debugId}`);\n }\n // Only print debug id for command line builds => not hot reload from dev server\n // eslint-disable-next-line no-console\n console.log('info ' + `Bundle Debug ID: ${debugId}`);\n\n const debugIdComment = `${DEBUG_ID_COMMENT}${debugId}`;\n const indexOfSourceMapComment = bundleCode.lastIndexOf(SOURCE_MAP_COMMENT);\n const bundleCodeWithDebugId =\n indexOfSourceMapComment === -1\n ? // If source map comment is missing lets just add the debug id comment\n `${bundleCode}\\n${debugIdComment}`\n : // If source map comment is present lets add the debug id comment before it\n `${bundleCode.substring(0, indexOfSourceMapComment) + debugIdComment}\\n${bundleCode.substring(\n indexOfSourceMapComment,\n )}`;\n\n const bundleMap: SourceMap = JSON.parse(bundleMapString);\n // For now we write both fields until we know what will become the standard - if ever.\n bundleMap['debug_id'] = debugId;\n bundleMap['debugId'] = debugId;\n\n return {\n code: bundleCodeWithDebugId,\n map: JSON.stringify(bundleMap),\n };\n };\n};\n\n/**\n * This function is expected to be called after serializer creates the final bundle object\n * and before the source maps are generated.\n *\n * It injects a debug ID into the bundle and returns the modified bundle.\n *\n * Access it via `options.sentryBundleCallback` in your custom serializer.\n */\nfunction createSentryBundleCallback(debugIdModule: Module<VirtualJSOutput> & { setSource: (code: string) => void }) {\n return (bundle: Bundle) => {\n const debugId = calculateDebugId(bundle.pre, bundle.modules);\n debugIdModule.setSource(injectDebugId(debugIdModule.getSource().toString(), debugId));\n bundle.pre = injectDebugId(bundle.pre, debugId);\n return bundle;\n };\n}\n\nasync function extractSerializerResult(serializerResult: MetroSerializerOutput): Promise<SerializedBundle> {\n if (typeof serializerResult === 'string') {\n return { code: serializerResult, map: '{}' };\n }\n\n if ('map' in serializerResult) {\n return { code: serializerResult.code, map: serializerResult.map };\n }\n\n const awaitedResult = await serializerResult;\n if (typeof awaitedResult === 'string') {\n return { code: awaitedResult, map: '{}' };\n }\n\n return { code: awaitedResult.code, map: awaitedResult.map };\n}\n\nfunction createDebugIdModule(debugId: string): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n return createVirtualJSModule(DEBUG_ID_MODULE_PATH, createDebugIdSnippet(debugId));\n}\n\nfunction calculateDebugId(bundleCode: string, modules?: Array<[id: number, code: string]>): string {\n const hash = crypto.createHash('md5');\n hash.update(bundleCode);\n if (modules) {\n for (const [, code] of modules) {\n hash.update(code);\n }\n }\n return stringToUUID(hash.digest('hex'));\n}\n\nfunction injectDebugId(code: string, debugId: string): string {\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n return code.replace(new RegExp(DEBUG_ID_PLACE_HOLDER, 'g'), debugId);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sentryMetroSerializer.js","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":";;;;;;;;;;;;AA0BA,sGAqBC;AA7CD,iCAAiC;AAIjC,mCAMiB;AACjB,gDAAoE;AAIpE,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAC1D,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AACnD,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC;;GAEG;AACH,SAAgB,6CAA6C,CAAC,EAC5D,UAAU,EACV,OAAO,GAKR;IACC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;IACvG,IAAI,mBAAmB,EAAE,CAAC;QACxB,8CAA8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6BAAqB,EAAC,oBAAoB,EAAE,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAkB,EAAE,OAA2C;IACvF,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACxB,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\n\nimport * as crypto from 'crypto';\n\nimport type { Bundle, MetroSerializer, MetroSerializerOutput, SerializedBundle, VirtualJSOutput } from './utils';\n\nimport {\n createDebugIdSnippet,\n createVirtualJSModule,\n determineDebugIdFromBundleSource,\n prependModule,\n stringToUUID,\n} from './utils';\nimport { createDefaultMetroSerializer } from './vendor/metro/utils';\n\ntype SourceMap = Record<string, unknown>;\n\nconst DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__';\nconst DEBUG_ID_MODULE_PATH = '__debugid__';\n\nconst SOURCE_MAP_COMMENT = '//# sourceMappingURL=';\nconst DEBUG_ID_COMMENT = '//# debugId=';\n\n/**\n * Adds Sentry Debug ID polyfill module to the bundle.\n */\nexport function unstableBeforeAssetSerializationDebugIdPlugin({\n premodules,\n debugId,\n}: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n}): Module[] {\n if (!debugId) {\n return premodules;\n }\n\n const debugIdModuleExists = premodules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // oxlint-disable-next-line eslint(no-console)\n console.warn('\\n\\nDebug ID module found. Skipping Sentry Debug ID module...\\n\\n');\n return premodules;\n }\n\n const debugIdModule = createDebugIdModule(debugId);\n return prependModule(premodules, debugIdModule);\n}\n\n// TODO: deprecate this and afterwards rename to createSentryDebugIdSerializer\n/**\n * Creates a Metro serializer that adds Debug ID module to the plain bundle.\n * The Debug ID module is a virtual module that provides a debug ID in runtime.\n *\n * RAM Bundles do not support custom serializers.\n */\nexport const createSentryMetroSerializer = (customSerializer?: MetroSerializer): MetroSerializer => {\n const serializer = customSerializer || createDefaultMetroSerializer();\n return async function (entryPoint, preModules, graph, options) {\n if (graph.transformOptions.hot) {\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModuleExists = preModules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // oxlint-disable-next-line eslint(no-console)\n console.warn('Debug ID module found. Skipping Sentry Debug ID module...');\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModule = createDebugIdModule(DEBUG_ID_PLACE_HOLDER);\n options.sentryBundleCallback = createSentryBundleCallback(debugIdModule);\n const modifiedPreModules = prependModule(preModules, debugIdModule);\n\n // Run wrapped serializer\n const serializerResult = serializer(entryPoint, modifiedPreModules, graph, options);\n const { code: bundleCode, map: bundleMapString } = await extractSerializerResult(serializerResult);\n\n // Add debug id comment to the bundle\n let debugId = determineDebugIdFromBundleSource(bundleCode);\n if (!debugId) {\n // For lazy-loaded chunks or bundles without the debug ID module,\n // calculate the debug ID from the bundle content.\n // This ensures Metro 0.83.2+ code-split bundles get debug IDs.\n // That needs to be done because when Metro 0.83.2 stopped importing `BabelSourceMapSegment`\n // from `@babel/generator` and defined it locally, it subtly changed the source map output format.\n // https://github.com/facebook/metro/blob/main/packages/metro-source-map/src/source-map.js#L47\n debugId = calculateDebugId(bundleCode);\n // oxlint-disable-next-line eslint(no-console)\n console.log('info ' + `Bundle Debug ID (calculated): ${debugId}`);\n }\n // Only print debug id for command line builds => not hot reload from dev server\n // oxlint-disable-next-line eslint(no-console)\n console.log('info ' + `Bundle Debug ID: ${debugId}`);\n\n const debugIdComment = `${DEBUG_ID_COMMENT}${debugId}`;\n const indexOfSourceMapComment = bundleCode.lastIndexOf(SOURCE_MAP_COMMENT);\n const bundleCodeWithDebugId =\n indexOfSourceMapComment === -1\n ? // If source map comment is missing lets just add the debug id comment\n `${bundleCode}\\n${debugIdComment}`\n : // If source map comment is present lets add the debug id comment before it\n `${bundleCode.substring(0, indexOfSourceMapComment) + debugIdComment}\\n${bundleCode.substring(\n indexOfSourceMapComment,\n )}`;\n\n const bundleMap: SourceMap = JSON.parse(bundleMapString);\n // For now we write both fields until we know what will become the standard - if ever.\n bundleMap['debug_id'] = debugId;\n bundleMap['debugId'] = debugId;\n\n return {\n code: bundleCodeWithDebugId,\n map: JSON.stringify(bundleMap),\n };\n };\n};\n\n/**\n * This function is expected to be called after serializer creates the final bundle object\n * and before the source maps are generated.\n *\n * It injects a debug ID into the bundle and returns the modified bundle.\n *\n * Access it via `options.sentryBundleCallback` in your custom serializer.\n */\nfunction createSentryBundleCallback(debugIdModule: Module<VirtualJSOutput> & { setSource: (code: string) => void }) {\n return (bundle: Bundle) => {\n const debugId = calculateDebugId(bundle.pre, bundle.modules);\n debugIdModule.setSource(injectDebugId(debugIdModule.getSource().toString(), debugId));\n bundle.pre = injectDebugId(bundle.pre, debugId);\n return bundle;\n };\n}\n\nasync function extractSerializerResult(serializerResult: MetroSerializerOutput): Promise<SerializedBundle> {\n if (typeof serializerResult === 'string') {\n return { code: serializerResult, map: '{}' };\n }\n\n if ('map' in serializerResult) {\n return { code: serializerResult.code, map: serializerResult.map };\n }\n\n const awaitedResult = await serializerResult;\n if (typeof awaitedResult === 'string') {\n return { code: awaitedResult, map: '{}' };\n }\n\n return { code: awaitedResult.code, map: awaitedResult.map };\n}\n\nfunction createDebugIdModule(debugId: string): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n return createVirtualJSModule(DEBUG_ID_MODULE_PATH, createDebugIdSnippet(debugId));\n}\n\nfunction calculateDebugId(bundleCode: string, modules?: Array<[id: number, code: string]>): string {\n const hash = crypto.createHash('md5');\n hash.update(bundleCode);\n if (modules) {\n for (const [, code] of modules) {\n hash.update(code);\n }\n }\n return stringToUUID(hash.digest('hex'));\n}\n\nfunction injectDebugId(code: string, debugId: string): string {\n return code.replace(new RegExp(DEBUG_ID_PLACE_HOLDER, 'g'), debugId);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryOptionsSerializer.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryOptionsSerializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentryOptionsSerializer.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryOptionsSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAA4C,MAAM,OAAO,CAAC;AAanF;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAkDzG"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withSentryOptionsFromFile =
|
|
3
|
+
exports.withSentryOptionsFromFile = withSentryOptionsFromFile;
|
|
4
4
|
const core_1 = require("@sentry/core");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const utils_1 = require("./utils");
|
|
8
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
9
8
|
const countLines_1 = require("./vendor/metro/countLines");
|
|
10
9
|
const DEFAULT_OPTIONS_FILE_NAME = 'sentry.options.json';
|
|
11
10
|
/**
|
|
@@ -18,7 +17,7 @@ function withSentryOptionsFromFile(config, optionsFile) {
|
|
|
18
17
|
}
|
|
19
18
|
const { projectRoot } = config;
|
|
20
19
|
if (!projectRoot) {
|
|
21
|
-
//
|
|
20
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
22
21
|
console.error('[@sentry/react-native/metro] Project root is required to load Sentry options from a file');
|
|
23
22
|
return config;
|
|
24
23
|
}
|
|
@@ -33,7 +32,7 @@ function withSentryOptionsFromFile(config, optionsFile) {
|
|
|
33
32
|
if (!originalSerializer) {
|
|
34
33
|
// It's okay to bail here because we don't expose this for direct usage, but as part of `withSentryConfig`
|
|
35
34
|
// If used directly in RN, the user is responsible for providing a custom serializer first, Expo provides serializer in default config
|
|
36
|
-
//
|
|
35
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
37
36
|
console.error('[@sentry/react-native/metro] `config.serializer.customSerializer` is required to load Sentry options from a file');
|
|
38
37
|
return config;
|
|
39
38
|
}
|
|
@@ -46,7 +45,6 @@ function withSentryOptionsFromFile(config, optionsFile) {
|
|
|
46
45
|
};
|
|
47
46
|
return Object.assign(Object.assign({}, config), { serializer: Object.assign(Object.assign({}, config.serializer), { customSerializer: sentryOptionsSerializer }) });
|
|
48
47
|
}
|
|
49
|
-
exports.withSentryOptionsFromFile = withSentryOptionsFromFile;
|
|
50
48
|
function createSentryOptionsModule(filePath) {
|
|
51
49
|
let content;
|
|
52
50
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryOptionsSerializer.js","sourceRoot":"","sources":["../../../src/js/tools/sentryOptionsSerializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentryOptionsSerializer.js","sourceRoot":"","sources":["../../../src/js/tools/sentryOptionsSerializer.ts"],"names":[],"mappings":";;AAgBA,8DAkDC;AAhED,uCAAsC;AACtC,yBAAyB;AACzB,6BAA6B;AAI7B,mCAAoC;AAC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AoB;QAC1B,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE;oBACJ,IAAI,EAAE,WAAW;oBACjB,SAAS,EAAE,IAAA,oBAAU,EAAC,WAAW,CAAC;oBAClC,GAAG,EAAE,EAAE;iBACR;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { MetroConfig, Module, ReadOnlyGraph, SerializerOptions } from 'metro';\n\nimport { logger } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport type { MetroCustomSerializer, VirtualJSOutput } from './utils';\n\nimport { createSet } from './utils';\nimport countLines from './vendor/metro/countLines';\n\nconst DEFAULT_OPTIONS_FILE_NAME = 'sentry.options.json';\n\n/**\n * Loads Sentry options from a file in\n */\nexport function withSentryOptionsFromFile(config: MetroConfig, optionsFile: string | boolean): MetroConfig {\n if (optionsFile === false) {\n return config;\n }\n\n const { projectRoot } = config;\n if (!projectRoot) {\n // oxlint-disable-next-line eslint(no-console)\n console.error('[@sentry/react-native/metro] Project root is required to load Sentry options from a file');\n return config;\n }\n\n let optionsPath = path.join(projectRoot, DEFAULT_OPTIONS_FILE_NAME);\n if (typeof optionsFile === 'string' && path.isAbsolute(optionsFile)) {\n optionsPath = optionsFile;\n } else if (typeof optionsFile === 'string') {\n optionsPath = path.join(projectRoot, optionsFile);\n }\n\n const originalSerializer = config.serializer?.customSerializer;\n if (!originalSerializer) {\n // It's okay to bail here because we don't expose this for direct usage, but as part of `withSentryConfig`\n // If used directly in RN, the user is responsible for providing a custom serializer first, Expo provides serializer in default config\n // oxlint-disable-next-line eslint(no-console)\n console.error(\n '[@sentry/react-native/metro] `config.serializer.customSerializer` is required to load Sentry options from a file',\n );\n return config;\n }\n\n const sentryOptionsSerializer: MetroCustomSerializer = (\n entryPoint: string,\n preModules: readonly Module[],\n graph: ReadOnlyGraph,\n options: SerializerOptions,\n ) => {\n const sentryOptionsModule = createSentryOptionsModule(optionsPath);\n if (sentryOptionsModule) {\n (preModules as Module[]).push(sentryOptionsModule);\n }\n return originalSerializer(entryPoint, preModules, graph, options);\n };\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n customSerializer: sentryOptionsSerializer,\n },\n };\n}\n\nfunction createSentryOptionsModule(filePath: string): Module<VirtualJSOutput> | null {\n let content: string;\n try {\n content = fs.readFileSync(filePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n logger.debug(`[@sentry/react-native/metro] Sentry options file does not exist at ${filePath}`);\n } else {\n logger.error(`[@sentry/react-native/metro] Failed to read Sentry options file at ${filePath}`);\n }\n return null;\n }\n\n let parsedContent: Record<string, unknown>;\n try {\n parsedContent = JSON.parse(content);\n } catch (error) {\n logger.error(`[@sentry/react-native/metro] Failed to parse Sentry options file at ${filePath}`);\n return null;\n }\n\n const minifiedContent = JSON.stringify(parsedContent);\n const optionsCode = `var __SENTRY_OPTIONS__=${minifiedContent};`;\n\n logger.debug(`[@sentry/react-native/metro] Sentry options added to the bundle from file at ${filePath}`);\n return {\n dependencies: new Map(),\n getSource: () => Buffer.from(optionsCode),\n inverseDependencies: createSet(),\n path: '__sentry-options__',\n output: [\n {\n type: 'js/script/virtual',\n data: {\n code: optionsCode,\n lineCount: countLines(optionsCode),\n map: [],\n },\n },\n ],\n };\n}\n"]}
|
|
@@ -5,6 +5,6 @@ import type { MixedOutput, Module, ReadOnlyGraph } from 'metro';
|
|
|
5
5
|
export declare const unstableReleaseConstantsPlugin: (projectRoot: string) => ({ graph, premodules }: {
|
|
6
6
|
graph: ReadOnlyGraph<MixedOutput>;
|
|
7
7
|
premodules: Module[];
|
|
8
|
-
debugId?: string
|
|
8
|
+
debugId?: string;
|
|
9
9
|
}) => Module[];
|
|
10
10
|
//# sourceMappingURL=sentryReleaseInjector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryReleaseInjector.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryReleaseInjector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentryReleaseInjector.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryReleaseInjector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQhE;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACxC,aAAa,MAAM,MACnB,uBAAuB;IAAE,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,MAAM,EAmB7G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryReleaseInjector.js","sourceRoot":"","sources":["../../../src/js/tools/sentryReleaseInjector.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sentryReleaseInjector.js","sourceRoot":"","sources":["../../../src/js/tools/sentryReleaseInjector.ts"],"names":[],"mappings":";;;AAIA,mCAA8E;AAE9E,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AAEnE;;GAEG;AACI,MAAM,8BAA8B,GACzC,CAAC,WAAmB,EAAE,EAAE,CACxB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAiF,EAAY,EAAE;IACjH,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,QAAQ,KAAK,KAAK,CAAC;IACzD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAA,qBAAa,EAAC,WAAW,CAAC,CAAC;IAErD,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,IAAA,qBAAa,EAClB,UAAU,EACV,yBAAyB,CAAC;QACxB,IAAI;QACJ,OAAO;KACR,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AArBS,QAAA,8BAA8B,kCAqBvC;AAEJ,SAAS,yBAAyB,CAAC,EACjC,IAAI,EACJ,OAAO,GAIR;IACC,OAAO,IAAA,6BAAqB,EAAC,6BAA6B,EAAE,6BAA6B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AAChH,CAAC;AAED,SAAS,6BAA6B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAqC;IACzF,OAAO,6CAA6C,IAAI,gBAAgB,OAAO,KAAK,CAAC;AACvF,CAAC","sourcesContent":["import type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\n\nimport type { VirtualJSOutput } from './utils';\n\nimport { createVirtualJSModule, getExpoConfig, prependModule } from './utils';\n\nconst RELEASE_CONSTANTS_MODULE_PATH = '__sentryReleaseConstants__';\n\n/**\n * Adds Sentry Release constants to the bundle.\n */\nexport const unstableReleaseConstantsPlugin =\n (projectRoot: string) =>\n ({ graph, premodules }: { graph: ReadOnlyGraph<MixedOutput>; premodules: Module[]; debugId?: string }): Module[] => {\n const notWeb = graph.transformOptions.platform !== 'web';\n if (notWeb) {\n return premodules;\n }\n\n const { name, version } = getExpoConfig(projectRoot);\n\n if (!name || !version) {\n return premodules;\n }\n\n return prependModule(\n premodules,\n createSentryReleaseModule({\n name,\n version,\n }),\n );\n };\n\nfunction createSentryReleaseModule({\n name,\n version,\n}: {\n name: string;\n version: string;\n}): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n return createVirtualJSModule(RELEASE_CONSTANTS_MODULE_PATH, createReleaseConstantsSnippet({ name, version }));\n}\n\nfunction createReleaseConstantsSnippet({ name, version }: { name: string; version: string }): string {\n return `var SENTRY_RELEASE;SENTRY_RELEASE={name: \"${name}\", version: \"${version}\"};`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":"
|
|
1
|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AAkC,KAC5D,qBAAqB,CAAC;AAE3B;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAahD;AAED;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKjF;AA+CD,eAAO,MAAM,SAAS,QAxCc,WAAW,CAAC,MAAM,CAwCV,CAAC;AAI7C;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,MAAM,CAAC,WAAW,CAAC,EAAE,EACvC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,GAC9B,MAAM,CAAC,WAAW,CAAC,EAAE,CAUvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,eAAe,CAAC,GAAG;IAAE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAsBjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAiBD"}
|
package/dist/js/tools/utils.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createSet = void 0;
|
|
4
|
+
exports.createDebugIdSnippet = createDebugIdSnippet;
|
|
5
|
+
exports.stringToUUID = stringToUUID;
|
|
6
|
+
exports.determineDebugIdFromBundleSource = determineDebugIdFromBundleSource;
|
|
7
|
+
exports.prependModule = prependModule;
|
|
8
|
+
exports.createVirtualJSModule = createVirtualJSModule;
|
|
9
|
+
exports.getExpoConfig = getExpoConfig;
|
|
4
10
|
const crypto = require("crypto");
|
|
5
11
|
const countLines_1 = require("./vendor/metro/countLines");
|
|
6
12
|
/**
|
|
@@ -9,7 +15,6 @@ const countLines_1 = require("./vendor/metro/countLines");
|
|
|
9
15
|
function createDebugIdSnippet(debugId) {
|
|
10
16
|
return `var _sentryDebugIds,_sentryDebugIdIdentifier;void 0===_sentryDebugIds&&(_sentryDebugIds={});try{var stack=(new Error).stack;stack&&(_sentryDebugIds[stack]="${debugId}",_sentryDebugIdIdentifier="sentry-dbid-${debugId}")}catch(e){}`;
|
|
11
17
|
}
|
|
12
|
-
exports.createDebugIdSnippet = createDebugIdSnippet;
|
|
13
18
|
/**
|
|
14
19
|
* Deterministically hashes a string and turns the hash into a uuid.
|
|
15
20
|
*
|
|
@@ -24,7 +29,6 @@ function stringToUUID(str) {
|
|
|
24
29
|
const v4variant = ['8', '9', 'a', 'b'][md5Hash.substring(16, 17).charCodeAt(0) % 4];
|
|
25
30
|
return `${md5Hash.substring(0, 8)}-${md5Hash.substring(8, 12)}-4${md5Hash.substring(13, 16)}-${v4variant}${md5Hash.substring(17, 20)}-${md5Hash.substring(20)}`.toLowerCase();
|
|
26
31
|
}
|
|
27
|
-
exports.stringToUUID = stringToUUID;
|
|
28
32
|
/**
|
|
29
33
|
* Looks for a particular string pattern (`sdbid-[debug ID]`) in the bundle
|
|
30
34
|
* source and extracts the bundle's debug ID from it.
|
|
@@ -37,7 +41,6 @@ function determineDebugIdFromBundleSource(code) {
|
|
|
37
41
|
const match = code.match(/sentry-dbid-([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})/);
|
|
38
42
|
return match ? match[1] : undefined;
|
|
39
43
|
}
|
|
40
|
-
exports.determineDebugIdFromBundleSource = determineDebugIdFromBundleSource;
|
|
41
44
|
/**
|
|
42
45
|
* CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.
|
|
43
46
|
*
|
|
@@ -61,7 +64,6 @@ function resolveSetCreator() {
|
|
|
61
64
|
*/
|
|
62
65
|
function safeRequireCountingSetFromSrc() {
|
|
63
66
|
try {
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
|
|
65
67
|
return require('metro/src/lib/CountingSet');
|
|
66
68
|
}
|
|
67
69
|
catch (e) {
|
|
@@ -75,7 +77,6 @@ function safeRequireCountingSetFromSrc() {
|
|
|
75
77
|
*/
|
|
76
78
|
function safeRequireCountingSetFromPrivate() {
|
|
77
79
|
try {
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
|
|
79
80
|
return require('metro/private/lib/CountingSet');
|
|
80
81
|
}
|
|
81
82
|
catch (e) {
|
|
@@ -100,7 +101,6 @@ function prependModule(modules, module) {
|
|
|
100
101
|
}
|
|
101
102
|
return modifiedPreModules;
|
|
102
103
|
}
|
|
103
|
-
exports.prependModule = prependModule;
|
|
104
104
|
/**
|
|
105
105
|
* Creates a virtual JS module with the given path and code.
|
|
106
106
|
*/
|
|
@@ -126,13 +126,11 @@ function createVirtualJSModule(modulePath, moduleCode) {
|
|
|
126
126
|
],
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
exports.createVirtualJSModule = createVirtualJSModule;
|
|
130
129
|
/**
|
|
131
130
|
* Tries to load Expo config using `@expo/config` package.
|
|
132
131
|
*/
|
|
133
132
|
function getExpoConfig(projectRoot) {
|
|
134
133
|
try {
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
|
|
136
134
|
const expoConfig = require('@expo/config');
|
|
137
135
|
if (expoConfig.getConfig) {
|
|
138
136
|
const { exp } = expoConfig.getConfig(projectRoot);
|
|
@@ -147,5 +145,4 @@ function getExpoConfig(projectRoot) {
|
|
|
147
145
|
}
|
|
148
146
|
return {};
|
|
149
147
|
}
|
|
150
|
-
exports.getExpoConfig = getExpoConfig;
|
|
151
148
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAIjC,0DAAmD;AAoCnD;;GAEG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,OAAO,+JAA+J,OAAO,2CAA2C,OAAO,eAAe,CAAC;AACjP,CAAC;AAFD,oDAEC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErC,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAW,CAAC;IAE9F,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,SAAS,CACjF,EAAE,EACF,EAAE,CACH,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;AACtF,CAAC;AAbD,oCAaC;AAED;;;;;;;GAOG;AACH,SAAgB,gCAAgC,CAAC,IAAY;IAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CACtB,mGAAmG,CACpG,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,C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O,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aAClF,CAAC;SACH;KACF;IAAC,WAAM;QACN,yCAAyC;KAC1C;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AArBD,sCAqBC","sourcesContent":["import * as crypto from 'crypto';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MetroConfig, MixedOutput, Module, ReadOnlyGraph, SerializerOptions } from 'metro';\nimport type CountingSet from 'metro/src/lib/CountingSet'; // types are in src but exports are in private\nimport countLines from './vendor/metro/countLines';\n\nexport type MetroCustomSerializer = Required<Required<MetroConfig>['serializer']>['customSerializer'] | undefined;\n\n// Variant of MixedOutput\n// https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/DeltaBundler/types.flow.js#L21\nexport type VirtualJSOutput = {\n type: 'js/script/virtual';\n data: {\n code: string;\n lineCount: number;\n map: [];\n };\n};\n\nexport type Bundle = {\n modules: Array<[id: number, code: string]>;\n post: string;\n pre: string;\n};\n\nexport type SentryMetroSerializerOptionsExtras = {\n sentryBundleCallback?: (bundle: Bundle) => Bundle;\n};\n\nexport type SerializedBundle = { code: string; map: string };\n\nexport type MetroSerializerOutput = string | SerializedBundle | Promise<string | SerializedBundle>;\n\nexport type MetroSerializer = (\n entryPoint: string,\n preModules: ReadonlyArray<Module>,\n graph: ReadOnlyGraph,\n options: SerializerOptions & SentryMetroSerializerOptionsExtras,\n) => MetroSerializerOutput;\n\n/**\n * Returns minified Debug ID code snippet.\n */\nexport function createDebugIdSnippet(debugId: string): string {\n return `var _sentryDebugIds,_sentryDebugIdIdentifier;void 0===_sentryDebugIds&&(_sentryDebugIds={});try{var stack=(new Error).stack;stack&&(_sentryDebugIds[stack]=\"${debugId}\",_sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\")}catch(e){}`;\n}\n\n/**\n * Deterministically hashes a string and turns the hash into a uuid.\n *\n * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/58271f1af2ade6b3e64d393d70376ae53bc5bd2f/packages/bundler-plugin-core/src/utils.ts#L174\n */\nexport function stringToUUID(str: string): string {\n const md5sum = crypto.createHash('md5');\n md5sum.update(str);\n const md5Hash = md5sum.digest('hex');\n\n // Position 16 is fixed to either 8, 9, a, or b in the uuid v4 spec (10xx in binary)\n // RFC 4122 section 4.4\n const v4variant = ['8', '9', 'a', 'b'][md5Hash.substring(16, 17).charCodeAt(0) % 4] as string;\n\n return `${md5Hash.substring(0, 8)}-${md5Hash.substring(8, 12)}-4${md5Hash.substring(\n 13,\n 16,\n )}-${v4variant}${md5Hash.substring(17, 20)}-${md5Hash.substring(20)}`.toLowerCase();\n}\n\n/**\n * Looks for a particular string pattern (`sdbid-[debug ID]`) in the bundle\n * source and extracts the bundle's debug ID from it.\n *\n * The string pattern is injected via the debug ID injection snipped.\n *\n * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/40f918458ed449d8b3eabaf64d13c08218213f65/packages/bundler-plugin-core/src/debug-id-upload.ts#L293-L294\n */\nexport function determineDebugIdFromBundleSource(code: string): string | undefined {\n const match = code.match(\n /sentry-dbid-([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12})/,\n );\n return match ? match[1] : undefined;\n}\n\n/**\n * CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.\n *\n * https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js\n */\nfunction resolveSetCreator(): () => CountingSet<string> {\n const CountingSetFromPrivate = safeRequireCountingSetFromPrivate();\n if (CountingSetFromPrivate) {\n return () => new CountingSetFromPrivate.default();\n }\n\n const CountingSetFromSrc = safeRequireCountingSetFromSrc();\n if (CountingSetFromSrc) {\n return () => new CountingSetFromSrc.default();\n }\n\n return () => new Set() as unknown as CountingSet<string>;\n}\n\n/**\n * CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.\n *\n * https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js\n */\nfunction safeRequireCountingSetFromSrc(): { default: new <T>() => CountingSet<T> } | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies\n return require('metro/src/lib/CountingSet');\n } catch (e) {\n return undefined;\n }\n}\n\n/**\n * CountingSet was moved to private in Metro 0.83.0. (all src exports were moved to private)\n *\n * https://github.com/facebook/metro/commit/ae6f42372ed361611b5672705f22081c2022cf28\n */\nfunction safeRequireCountingSetFromPrivate(): { default: new <T>() => CountingSet<T> } | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies\n return require('metro/private/lib/CountingSet');\n } catch (e) {\n return undefined;\n }\n}\n\nexport const createSet = resolveSetCreator();\n\nconst PRELUDE_MODULE_PATH = '__prelude__';\n\n/**\n * Prepends the module after default required prelude modules.\n */\nexport function prependModule(\n modules: readonly Module<MixedOutput>[],\n module: Module<VirtualJSOutput>,\n): Module<MixedOutput>[] {\n const modifiedPreModules = [...modules];\n if (modifiedPreModules.length > 0 && modifiedPreModules[0]?.path === PRELUDE_MODULE_PATH) {\n // prelude module must be first as it measures the bundle startup time\n modifiedPreModules.unshift(modules[0] as Module<VirtualJSOutput>);\n modifiedPreModules[1] = module;\n } else {\n modifiedPreModules.unshift(module);\n }\n return modifiedPreModules;\n}\n\n/**\n * Creates a virtual JS module with the given path and code.\n */\nexport function createVirtualJSModule(\n modulePath: string,\n moduleCode: string,\n): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n let sourceCode = moduleCode;\n\n return {\n setSource: (code: string) => {\n sourceCode = code;\n },\n dependencies: new Map(),\n getSource: () => Buffer.from(sourceCode),\n inverseDependencies: createSet(),\n path: modulePath,\n output: [\n {\n type: 'js/script/virtual',\n data: {\n code: sourceCode,\n lineCount: countLines(sourceCode),\n map: [],\n },\n },\n ],\n };\n}\n\n/**\n * Tries to load Expo config using `@expo/config` package.\n */\nexport function getExpoConfig(projectRoot: string): Partial<{\n name: string;\n version: string;\n}> {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies\n const expoConfig = require('@expo/config') as {\n getConfig?: (projectRoot: string) => { exp: Record<string, unknown> };\n };\n if (expoConfig.getConfig) {\n const { exp } = expoConfig.getConfig(projectRoot);\n return {\n name: typeof exp.name === 'string' && exp.name ? exp.name : undefined,\n version: typeof exp.version === 'string' && exp.version ? exp.version : undefined,\n };\n }\n } catch {\n // @expo/config not available, do nothing\n }\n\n return {};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":";;;AA4CA,oDAEC;AAOD,oCAaC;AAUD,4EAKC;AAsDD,sCAaC;AAKD,sDAyBC;AAKD,sCAoBC;AAxMD,iCAAiC;AAEjC,0DAAmD;AAoCnD;;GAEG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,OAAO,+JAA+J,OAAO,2CAA2C,OAAO,eAAe,CAAC;AACjP,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErC,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAW,CAAC;IAE9F,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAA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IAAI,CAAC;QACH,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,CAExC,CAAC;QACF,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;YACzB,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YAClD,OAAO;gBACL,IAAI,EAAE,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;gBACrE,OAAO,EAAE,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aAClF,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,WAAM,CAAC;QACP,yCAAyC;IAC3C,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type { MetroConfig, MixedOutput, Module, ReadOnlyGraph, SerializerOptions } from 'metro';\nimport type CountingSet from 'metro/src/lib/CountingSet'; // types are in src but exports are in private\n\nimport * as crypto from 'crypto';\n\nimport countLines from './vendor/metro/countLines';\n\nexport type MetroCustomSerializer = Required<Required<MetroConfig>['serializer']>['customSerializer'] | undefined;\n\n// Variant of MixedOutput\n// https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/DeltaBundler/types.flow.js#L21\nexport type VirtualJSOutput = {\n type: 'js/script/virtual';\n data: {\n code: string;\n lineCount: number;\n map: [];\n };\n};\n\nexport type Bundle = {\n modules: Array<[id: number, code: string]>;\n post: string;\n pre: string;\n};\n\nexport type SentryMetroSerializerOptionsExtras = {\n sentryBundleCallback?: (bundle: Bundle) => Bundle;\n};\n\nexport type SerializedBundle = { code: string; map: string };\n\nexport type MetroSerializerOutput = string | SerializedBundle | Promise<string | SerializedBundle>;\n\nexport type MetroSerializer = (\n entryPoint: string,\n preModules: ReadonlyArray<Module>,\n graph: ReadOnlyGraph,\n options: SerializerOptions & SentryMetroSerializerOptionsExtras,\n) => MetroSerializerOutput;\n\n/**\n * Returns minified Debug ID code snippet.\n */\nexport function createDebugIdSnippet(debugId: string): string {\n return `var _sentryDebugIds,_sentryDebugIdIdentifier;void 0===_sentryDebugIds&&(_sentryDebugIds={});try{var stack=(new Error).stack;stack&&(_sentryDebugIds[stack]=\"${debugId}\",_sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\")}catch(e){}`;\n}\n\n/**\n * Deterministically hashes a string and turns the hash into a uuid.\n *\n * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/58271f1af2ade6b3e64d393d70376ae53bc5bd2f/packages/bundler-plugin-core/src/utils.ts#L174\n */\nexport function stringToUUID(str: string): string {\n const md5sum = crypto.createHash('md5');\n md5sum.update(str);\n const md5Hash = md5sum.digest('hex');\n\n // Position 16 is fixed to either 8, 9, a, or b in the uuid v4 spec (10xx in binary)\n // RFC 4122 section 4.4\n const v4variant = ['8', '9', 'a', 'b'][md5Hash.substring(16, 17).charCodeAt(0) % 4] as string;\n\n return `${md5Hash.substring(0, 8)}-${md5Hash.substring(8, 12)}-4${md5Hash.substring(\n 13,\n 16,\n )}-${v4variant}${md5Hash.substring(17, 20)}-${md5Hash.substring(20)}`.toLowerCase();\n}\n\n/**\n * Looks for a particular string pattern (`sdbid-[debug ID]`) in the bundle\n * source and extracts the bundle's debug ID from it.\n *\n * The string pattern is injected via the debug ID injection snipped.\n *\n * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/40f918458ed449d8b3eabaf64d13c08218213f65/packages/bundler-plugin-core/src/debug-id-upload.ts#L293-L294\n */\nexport function determineDebugIdFromBundleSource(code: string): string | undefined {\n const match = code.match(\n /sentry-dbid-([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12})/,\n );\n return match ? match[1] : undefined;\n}\n\n/**\n * CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.\n *\n * https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js\n */\nfunction resolveSetCreator(): () => CountingSet<string> {\n const CountingSetFromPrivate = safeRequireCountingSetFromPrivate();\n if (CountingSetFromPrivate) {\n return () => new CountingSetFromPrivate.default();\n }\n\n const CountingSetFromSrc = safeRequireCountingSetFromSrc();\n if (CountingSetFromSrc) {\n return () => new CountingSetFromSrc.default();\n }\n\n return () => new Set() as unknown as CountingSet<string>;\n}\n\n/**\n * CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.\n *\n * https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js\n */\nfunction safeRequireCountingSetFromSrc(): { default: new <T>() => CountingSet<T> } | undefined {\n try {\n return require('metro/src/lib/CountingSet');\n } catch (e) {\n return undefined;\n }\n}\n\n/**\n * CountingSet was moved to private in Metro 0.83.0. (all src exports were moved to private)\n *\n * https://github.com/facebook/metro/commit/ae6f42372ed361611b5672705f22081c2022cf28\n */\nfunction safeRequireCountingSetFromPrivate(): { default: new <T>() => CountingSet<T> } | undefined {\n try {\n return require('metro/private/lib/CountingSet');\n } catch (e) {\n return undefined;\n }\n}\n\nexport const createSet = resolveSetCreator();\n\nconst PRELUDE_MODULE_PATH = '__prelude__';\n\n/**\n * Prepends the module after default required prelude modules.\n */\nexport function prependModule(\n modules: readonly Module<MixedOutput>[],\n module: Module<VirtualJSOutput>,\n): Module<MixedOutput>[] {\n const modifiedPreModules = [...modules];\n if (modifiedPreModules.length > 0 && modifiedPreModules[0]?.path === PRELUDE_MODULE_PATH) {\n // prelude module must be first as it measures the bundle startup time\n modifiedPreModules.unshift(modules[0] as Module<VirtualJSOutput>);\n modifiedPreModules[1] = module;\n } else {\n modifiedPreModules.unshift(module);\n }\n return modifiedPreModules;\n}\n\n/**\n * Creates a virtual JS module with the given path and code.\n */\nexport function createVirtualJSModule(\n modulePath: string,\n moduleCode: string,\n): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n let sourceCode = moduleCode;\n\n return {\n setSource: (code: string) => {\n sourceCode = code;\n },\n dependencies: new Map(),\n getSource: () => Buffer.from(sourceCode),\n inverseDependencies: createSet(),\n path: modulePath,\n output: [\n {\n type: 'js/script/virtual',\n data: {\n code: sourceCode,\n lineCount: countLines(sourceCode),\n map: [],\n },\n },\n ],\n };\n}\n\n/**\n * Tries to load Expo config using `@expo/config` package.\n */\nexport function getExpoConfig(projectRoot: string): Partial<{\n name: string;\n version: string;\n}> {\n try {\n const expoConfig = require('@expo/config') as {\n getConfig?: (projectRoot: string) => { exp: Record<string, unknown> };\n };\n if (expoConfig.getConfig) {\n const { exp } = expoConfig.getConfig(projectRoot);\n return {\n name: typeof exp.name === 'string' && exp.name ? exp.name : undefined,\n version: typeof exp.version === 'string' && exp.version ? exp.version : undefined,\n };\n }\n } catch {\n // @expo/config not available, do nothing\n }\n\n return {};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countLines.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/countLines.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"countLines.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/countLines.ts"],"names":[],"mappings":"yBAgCgB,QAAQ,MAAM,KAAG,MAAM;AAAvC,wBAAoF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA8CnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,aAAa,EACpB,qBAEG;IACD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1C,KACA,SAAS,MAAM,EAMjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,QAAO,eAqC/C,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* oxlint-disable typescript-eslint(no-unsafe-member-access) */
|
|
2
3
|
// Vendored / modified from @facebook/metro
|
|
3
4
|
var _a, _b;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
6
|
exports.createDefaultMetroSerializer = exports.getSortedModules = void 0;
|
|
7
|
+
// oxlint-disable-next-line typescript-eslint(no-explicit-any)
|
|
6
8
|
let baseJSBundleModule;
|
|
7
9
|
try {
|
|
8
10
|
baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');
|
|
@@ -12,11 +14,9 @@ catch (_c) {
|
|
|
12
14
|
}
|
|
13
15
|
const baseJSBundle = typeof baseJSBundleModule === 'function'
|
|
14
16
|
? baseJSBundleModule
|
|
15
|
-
:
|
|
16
|
-
(_a = baseJSBundleModule === null || baseJSBundleModule === void 0 ? void 0 : baseJSBundleModule.baseJSBundle) !== null && _a !== void 0 ? _a : baseJSBundleModule === null || baseJSBundleModule === void 0 ? void 0 : baseJSBundleModule.default;
|
|
17
|
+
: ((_a = baseJSBundleModule === null || baseJSBundleModule === void 0 ? void 0 : baseJSBundleModule.baseJSBundle) !== null && _a !== void 0 ? _a : baseJSBundleModule === null || baseJSBundleModule === void 0 ? void 0 : baseJSBundleModule.default);
|
|
17
18
|
let sourceMapString;
|
|
18
19
|
try {
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20
20
|
const sourceMapStringModule = require('metro/private/DeltaBundler/Serializers/sourceMapString');
|
|
21
21
|
sourceMapString = sourceMapStringModule.sourceMapString;
|
|
22
22
|
}
|
|
@@ -28,6 +28,7 @@ catch (e) {
|
|
|
28
28
|
sourceMapString = sourceMapString.sourceMapString;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
// oxlint-disable-next-line typescript-eslint(no-explicit-any)
|
|
31
32
|
let bundleToStringModule;
|
|
32
33
|
try {
|
|
33
34
|
bundleToStringModule = require('metro/private/lib/bundleToString');
|
|
@@ -37,8 +38,7 @@ catch (_d) {
|
|
|
37
38
|
}
|
|
38
39
|
const bundleToString = typeof bundleToStringModule === 'function'
|
|
39
40
|
? bundleToStringModule
|
|
40
|
-
:
|
|
41
|
-
(_b = bundleToStringModule === null || bundleToStringModule === void 0 ? void 0 : bundleToStringModule.bundleToString) !== null && _b !== void 0 ? _b : bundleToStringModule === null || bundleToStringModule === void 0 ? void 0 : bundleToStringModule.default;
|
|
41
|
+
: ((_b = bundleToStringModule === null || bundleToStringModule === void 0 ? void 0 : bundleToStringModule.bundleToString) !== null && _b !== void 0 ? _b : bundleToStringModule === null || bundleToStringModule === void 0 ? void 0 : bundleToStringModule.default);
|
|
42
42
|
/**
|
|
43
43
|
* This function ensures that modules in source maps are sorted in the same
|
|
44
44
|
* order as in a plain JS bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;;AAiC3C,IAAI,kBAAuB,CAAC;AAC5B,IAAI;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,2CAA2C;;;;AAiC3C,8DAA8D;AAC9D,IAAI,kBAAuB,CAAC;AAC5B,IAAI,CAAC;IACH,kBAAkB,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C;QAC1F,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC;;;CAGrB,CAAC,CAAC;QACC,CAAC;QAED,oEAAoE;QACpE,MAAM,GAAG,GAAG,uBAAuB,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,IAAA,wBAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;YACxF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SACtE,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,4BAA4B,gCAqCvC","sourcesContent":["/* oxlint-disable typescript-eslint(no-unsafe-member-access) */\n// Vendored / modified from @facebook/metro\n\n// https://github.com/facebook/metro/commit/9b85f83c9cc837d8cd897aa7723be7da5b296067\n\n// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type * as baseJSBundleType from 'metro/private/DeltaBundler/Serializers/baseJSBundle';\nimport type * as sourceMapStringType from 'metro/private/DeltaBundler/Serializers/sourceMapString';\nimport type * as bundleToStringType from 'metro/private/lib/bundleToString';\n\nimport type { MetroSerializer } from '../../utils';\n\n// oxlint-disable-next-line typescript-eslint(no-explicit-any)\nlet baseJSBundleModule: any;\ntry {\n baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');\n} catch {\n baseJSBundleModule = require('metro/src/DeltaBundler/Serializers/baseJSBundle');\n}\n\nconst baseJSBundle: typeof baseJSBundleType =\n typeof baseJSBundleModule === 'function'\n ? baseJSBundleModule\n : (baseJSBundleModule?.baseJSBundle ?? baseJSBundleModule?.default);\n\nlet sourceMapString: typeof sourceMapStringType;\ntry {\n const sourceMapStringModule = require('metro/private/DeltaBundler/Serializers/sourceMapString');\n sourceMapString = (sourceMapStringModule as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n} catch (e) {\n sourceMapString = require('metro/src/DeltaBundler/Serializers/sourceMapString');\n if ('sourceMapString' in sourceMapString) {\n // Changed to named export in https://github.com/facebook/metro/commit/34148e61200a508923315fbe387b26d1da27bf4b\n // Metro 0.81.0 and 0.80.10 patch\n sourceMapString = (sourceMapString as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n }\n}\n\n// oxlint-disable-next-line typescript-eslint(no-explicit-any)\nlet bundleToStringModule: any;\ntry {\n bundleToStringModule = require('metro/private/lib/bundleToString');\n} catch {\n bundleToStringModule = require('metro/src/lib/bundleToString');\n}\n\nconst bundleToString: typeof bundleToStringType =\n typeof bundleToStringModule === 'function'\n ? bundleToStringModule\n : (bundleToStringModule?.bundleToString ?? bundleToStringModule?.default);\n\ntype NewSourceMapStringExport = {\n // Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28\n sourceMapString: typeof sourceMapString;\n};\n\n/**\n * This function ensures that modules in source maps are sorted in the same\n * order as in a plain JS bundle.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984\n */\nexport const getSortedModules = (\n graph: ReadOnlyGraph,\n {\n createModuleId,\n }: {\n createModuleId: (file: string) => number;\n },\n): readonly Module[] => {\n const modules = [...graph.dependencies.values()];\n // Sort by IDs\n return modules.sort(\n (a: Module<MixedOutput>, b: Module<MixedOutput>) => createModuleId(a.path) - createModuleId(b.path),\n );\n};\n\n/**\n * Creates the default Metro plain bundle serializer.\n * Because Metro exports only the intermediate serializer functions, we need to\n * assemble the final serializer ourselves. We have to work with the modules the same as Metro does\n * to avoid unexpected changes in the final bundle.\n *\n * This is used when the user does not provide a custom serializer.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277\n */\nexport const createDefaultMetroSerializer = (): MetroSerializer => {\n return (entryPoint, preModules, graph, options) => {\n // baseJSBundle assigns IDs to modules in a consistent order\n let bundle = baseJSBundle(entryPoint, preModules, graph, options);\n if (options.sentryBundleCallback && !graph.transformOptions.hot) {\n bundle = options.sentryBundleCallback(bundle);\n }\n const { code } = bundleToString(bundle);\n if (graph.transformOptions.hot) {\n // Hot means running in dev server, sourcemaps are generated on demand\n return code;\n }\n\n let sourceMapStringFunction: typeof sourceMapString | undefined;\n if (typeof sourceMapString === 'function') {\n sourceMapStringFunction = sourceMapString;\n } else if (\n typeof sourceMapString === 'object' &&\n sourceMapString != null &&\n 'sourceMapString' in sourceMapString &&\n typeof sourceMapString['sourceMapString'] === 'function'\n ) {\n sourceMapStringFunction = (sourceMapString as NewSourceMapStringExport).sourceMapString;\n } else {\n throw new Error(`\n[@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.\nPlease check the version of Metro you are using and report the issue at http://www.github.com/getsentry/sentry-react-native/issues\n`);\n }\n\n // Always generate source maps, can't use Sentry without source maps\n const map = sourceMapStringFunction([...preModules, ...getSortedModules(graph, options)], {\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList || (() => false),\n });\n return { code, map };\n };\n};\n"]}
|