@xifan0/monitor-web 0.0.2-beta.14 → 0.0.2-beta.16

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/dist/index.js CHANGED
@@ -41,13 +41,11 @@ var Sentry = __toESM(require("@sentry/react"));
41
41
 
42
42
  // ../monitor-core/src/createMonitor.ts
43
43
  function createMonitor(sentry) {
44
- const sentryInstance = sentry && typeof sentry === "object" && sentry.default ? sentry.default : sentry;
44
+ const sentryInstance = (sentry == null ? void 0 : sentry.default) || sentry;
45
45
  const monitor = {
46
46
  init(options) {
47
47
  if (!sentryInstance || typeof sentryInstance.init !== "function") {
48
- throw new Error(
49
- "Sentry.init is not a function. Please ensure @sentry/react is properly imported."
50
- );
48
+ throw new Error("Sentry.init is not a function");
51
49
  }
52
50
  return sentryInstance.init(options);
53
51
  },
@@ -70,7 +68,8 @@ function createMonitor(sentry) {
70
68
  /** 设置用户信息 */
71
69
  setUser(user) {
72
70
  return sentryInstance.setUser(user);
73
- }
71
+ },
72
+ ErrorBoundary: sentryInstance.ErrorBoundary
74
73
  };
75
74
  const proxy = new Proxy(monitor, {
76
75
  get(target, key, receiver) {
package/dist/index.mjs CHANGED
@@ -3,13 +3,11 @@ import * as Sentry from "@sentry/react";
3
3
 
4
4
  // ../monitor-core/src/createMonitor.ts
5
5
  function createMonitor(sentry) {
6
- const sentryInstance = sentry && typeof sentry === "object" && sentry.default ? sentry.default : sentry;
6
+ const sentryInstance = (sentry == null ? void 0 : sentry.default) || sentry;
7
7
  const monitor = {
8
8
  init(options) {
9
9
  if (!sentryInstance || typeof sentryInstance.init !== "function") {
10
- throw new Error(
11
- "Sentry.init is not a function. Please ensure @sentry/react is properly imported."
12
- );
10
+ throw new Error("Sentry.init is not a function");
13
11
  }
14
12
  return sentryInstance.init(options);
15
13
  },
@@ -32,7 +30,8 @@ function createMonitor(sentry) {
32
30
  /** 设置用户信息 */
33
31
  setUser(user) {
34
32
  return sentryInstance.setUser(user);
35
- }
33
+ },
34
+ ErrorBoundary: sentryInstance.ErrorBoundary
36
35
  };
37
36
  const proxy = new Proxy(monitor, {
38
37
  get(target, key, receiver) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xifan0/monitor-web",
3
- "version": "0.0.2-beta.14",
3
+ "version": "0.0.2-beta.16",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -22,10 +22,9 @@
22
22
  "@sentry/react": "^7"
23
23
  },
24
24
  "devDependencies": {
25
- "@sentry/react": "^7",
26
25
  "typescript": "^5",
27
26
  "tsup": "^8.5.1",
28
- "@xifan0/monitor-core": "0.0.2-beta.14"
27
+ "@xifan0/monitor-core": "0.0.2-beta.16"
29
28
  },
30
29
  "scripts": {
31
30
  "build": "tsup --dts"