@lookiero/checkout 0.6.0-beta.1 → 0.6.0-beta.11

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.
@@ -4,8 +4,14 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
4
4
  import { Notifications } from "../../../shared/notifications/infrastructure/ui/views/Notifications";
5
5
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
6
6
  import { Navigation } from "./navigation/Navigation";
7
- const App = ({ customerId, menu, tabBar, children }) => (React.createElement(SafeAreaProvider, null,
8
- React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
9
- React.createElement(Navigation, { customerId: customerId, menu: menu, tabBar: tabBar },
10
- React.createElement(PortalProvider, null, children))));
7
+ const a = true;
8
+ const App = ({ customerId, menu, tabBar, children }) => {
9
+ if (a) {
10
+ throw new Error("This is an error (while integrated in UAF)");
11
+ }
12
+ return (React.createElement(SafeAreaProvider, null,
13
+ React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
14
+ React.createElement(Navigation, { customerId: customerId, menu: menu, tabBar: tabBar },
15
+ React.createElement(PortalProvider, null, children))));
16
+ };
11
17
  export { App };
@@ -0,0 +1,9 @@
1
+ import { BrowserClient, Hub } from "@sentry/browser";
2
+ import { ErrorBoundary } from "@sentry/react";
3
+ import { ReactNativeTransportOptions } from "@sentry/react-native/dist/js/options";
4
+ import { Transport, Integration } from "@sentry/types";
5
+ import { ComponentType } from "react";
6
+ declare const transport: (options: ReactNativeTransportOptions) => Transport;
7
+ declare const integrations: Integration[];
8
+ declare const wrap: <P>(Component: ComponentType<P>) => ComponentType<P>;
9
+ export { BrowserClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -0,0 +1,8 @@
1
+ import { BrowserClient, Hub } from "@sentry/browser";
2
+ import { makeFetchTransport } from "@sentry/browser";
3
+ import { ErrorBoundary } from "@sentry/react";
4
+ import { BrowserTracing } from "@sentry/tracing";
5
+ const transport = (options, nativeFetch) => makeFetchTransport(options, nativeFetch);
6
+ const integrations = [new BrowserTracing()];
7
+ const wrap = (Component) => Component;
8
+ export { BrowserClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -0,0 +1,8 @@
1
+ import { ReactNativeClient, Hub, ErrorBoundary } from "@sentry/react-native";
2
+ import { ReactNativeTransportOptions } from "@sentry/react-native/dist/js/options";
3
+ import { Transport, Integration } from "@sentry/types";
4
+ import { ComponentType } from "react";
5
+ declare const transport: (options: ReactNativeTransportOptions) => Transport;
6
+ declare const integrations: Integration[];
7
+ declare const wrap: <P>(Component: ComponentType<P>) => ComponentType<P>;
8
+ export { ReactNativeClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -0,0 +1,8 @@
1
+ import { makeFetchTransport } from "@sentry/browser";
2
+ import { ReactNativeClient, Hub, ErrorBoundary, wrap as sentryWrap } from "@sentry/react-native";
3
+ import { makeReactNativeTransport } from "@sentry/react-native/dist/js/transports/native";
4
+ import { NATIVE } from "@sentry/react-native/dist/js/wrapper";
5
+ const transport = (options, nativeFetch) => NATIVE.isNativeTransportAvailable() ? makeReactNativeTransport(options) : makeFetchTransport(options, nativeFetch);
6
+ const integrations = [];
7
+ const wrap = (Component) => sentryWrap(Component);
8
+ export { ReactNativeClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -1,4 +1,3 @@
1
- import "@sentry/tracing";
2
1
  import { ComponentType } from "react";
3
2
  import { Platform } from "react-native";
4
3
  interface SentryLoggerFunctionArgs {
@@ -1,39 +1,41 @@
1
+ import { defaultStackParser } from "@sentry/browser";
1
2
  import { makeMain } from "@sentry/core";
2
- import * as Sentry from "@sentry/react-native";
3
- import "@sentry/tracing";
4
3
  import React, { useEffect } from "react";
4
+ import { Platform } from "react-native";
5
+ import { Client, Hub, ErrorBoundary, transport, integrations, wrap } from "./SentryDependencies";
5
6
  const sentryLogger = ({ publicKey, environment, release, project }) => {
6
7
  let mainHub;
7
- /**
8
- * TS complains about not providing 'transport' and 'stackParser' implementations
9
- * although 'ReactNativeClient' defaults to its own implementation for those options.
10
- */
11
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
- // @ts-ignore
13
- const client = new Sentry.ReactNativeClient({
8
+ const client = new Client({
14
9
  environment,
15
10
  release,
16
11
  dsn: `https://${publicKey}@o179049.ingest.sentry.io/${project}`,
17
- integrations: [new Sentry.ReactNativeTracing()],
12
+ integrations,
18
13
  tracesSampleRate: 1.0,
19
14
  debug: true,
15
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16
+ // @ts-ignore
17
+ enableNative: Platform.OS !== "web",
18
+ stackParser: defaultStackParser,
19
+ transport,
20
20
  });
21
- const hub = new Sentry.Hub(client);
22
- hub.bindClient(client);
21
+ const hub = new Hub(client);
23
22
  const switchMainHub = () => {
24
- mainHub = makeMain(hub);
23
+ if (!mainHub) {
24
+ mainHub = makeMain(hub);
25
+ }
25
26
  };
26
27
  const revertMainHub = () => {
27
28
  makeMain(mainHub);
28
29
  };
29
30
  return (Component) => {
30
31
  switchMainHub();
31
- const WrappedComponent = Sentry.wrap(Component);
32
- // eslint-disable-next-line react/display-name
33
- return (props) => {
32
+ const WrappedComponent = wrap(Component);
33
+ const SentryLogger = (props) => {
34
34
  useEffect(() => revertMainHub, []);
35
- return React.createElement(WrappedComponent, { ...props });
35
+ return (React.createElement(ErrorBoundary, null,
36
+ React.createElement(WrappedComponent, { ...props })));
36
37
  };
38
+ return SentryLogger;
37
39
  };
38
40
  };
39
41
  export { sentryLogger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.6.0-beta.1",
3
+ "version": "0.6.0-beta.11",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [