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

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,7 @@
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 { BrowserTracing } from "@sentry/tracing";
5
+ import { Transport } from "@sentry/types";
6
+ declare const transport: (options: ReactNativeTransportOptions) => Transport;
7
+ export { BrowserClient as Client, Hub, ErrorBoundary, BrowserTracing as Tracing, transport };
@@ -0,0 +1,6 @@
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
+ export { BrowserClient as Client, Hub, ErrorBoundary, BrowserTracing as Tracing, transport };
@@ -0,0 +1,5 @@
1
+ import { ReactNativeClient, Hub, ErrorBoundary, ReactNativeTracing } from "@sentry/react-native";
2
+ import { ReactNativeTransportOptions } from "@sentry/react-native/dist/js/options";
3
+ import { Transport } from "@sentry/types";
4
+ declare const transport: (options: ReactNativeTransportOptions) => Transport;
5
+ export { ReactNativeClient as Client, Hub, ErrorBoundary, ReactNativeTracing as Tracing, transport };
@@ -0,0 +1,6 @@
1
+ import { makeFetchTransport } from "@sentry/browser";
2
+ import { ReactNativeClient, Hub, ErrorBoundary, ReactNativeTracing } 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
+ export { ReactNativeClient as Client, Hub, ErrorBoundary, ReactNativeTracing as Tracing, transport };
@@ -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,38 +1,49 @@
1
+ import { defaultStackParser } from "@sentry/browser";
2
+ // import { FetchImpl } from "@sentry/browser/types/transports/utils";
1
3
  import { makeMain } from "@sentry/core";
2
- import * as Sentry from "@sentry/react-native";
3
- import "@sentry/tracing";
4
+ // import { ReactNativeTransportOptions } from "@sentry/react-native/dist/js/options";
5
+ // import { makeReactNativeTransport } from "@sentry/react-native/dist/js/transports/native";
6
+ // import { NATIVE } from "@sentry/react-native/dist/js/wrapper";
7
+ // import "@sentry/tracing";
8
+ // import { Transport } from "@sentry/types";
4
9
  import React, { useEffect } from "react";
10
+ import { Platform } from "react-native";
11
+ import { Client, Hub, ErrorBoundary, Tracing, transport } from "./SentryDependencies";
5
12
  const sentryLogger = ({ publicKey, environment, release, project }) => {
6
13
  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({
14
+ const client = new Client({
14
15
  environment,
15
16
  release,
16
17
  dsn: `https://${publicKey}@o179049.ingest.sentry.io/${project}`,
17
- integrations: [new Sentry.ReactNativeTracing()],
18
+ integrations: [new Tracing()],
18
19
  tracesSampleRate: 1.0,
19
20
  debug: true,
21
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22
+ // @ts-ignore
23
+ enableNative: Platform.OS !== "web",
24
+ stackParser: defaultStackParser,
25
+ transport,
20
26
  });
21
- const hub = new Sentry.Hub(client);
22
- hub.bindClient(client);
27
+ const hub = new Hub(client);
23
28
  const switchMainHub = () => {
24
- mainHub = makeMain(hub);
29
+ if (!mainHub) {
30
+ mainHub = makeMain(hub);
31
+ }
25
32
  };
26
33
  const revertMainHub = () => {
27
34
  makeMain(mainHub);
28
35
  };
29
36
  return (Component) => {
30
37
  switchMainHub();
31
- const WrappedComponent = Sentry.wrap(Component);
38
+ // const WrappedComponent = Sentry.wrap(Component);
32
39
  // eslint-disable-next-line react/display-name
33
40
  return (props) => {
34
41
  useEffect(() => revertMainHub, []);
35
- return React.createElement(WrappedComponent, { ...props });
42
+ return (
43
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
44
+ // @ts-ignore
45
+ React.createElement(ErrorBoundary, null,
46
+ React.createElement(Component, { ...props })));
36
47
  };
37
48
  };
38
49
  };
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.10",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [