@memobit/libs 3.10.0 → 3.11.1

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/README.md CHANGED
@@ -15,7 +15,7 @@ npm install @memobit/libs
15
15
  Peer dependencies (you provide these in your own app):
16
16
 
17
17
  ```bash
18
- npm install react@^19 react-dom@^19
18
+ npm install react@^19 react-dom@^19 @memobit/core
19
19
  ```
20
20
 
21
21
  ## Quick start
@@ -52,7 +52,7 @@ function Demo() {
52
52
  - **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
53
53
  - **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
54
54
  - **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
55
- - **Error reporting** — `@memobit/libs/errors` (React-free, works in Node too): `installErrorReporting` / `installNodeErrorReporting` send uncaught errors, unhandled rejections, `ErrorBoundary` crashes and `console.error` / `console.warn` to a collector endpoint, batched and throttled. `logger` stands in for `console.*`, and `reportError` reports errors you have handled.
55
+ - **Error reporting** — lives in [`@memobit/core`](https://www.npmjs.com/package/@memobit/core) (React-free, works in Node too), a peer dependency: `ErrorBoundary` crashes are reported through it once the app calls `installErrorReporting`.
56
56
 
57
57
  See the [component reference](https://react.memobit.ro/) for props, variants, and live examples.
58
58
 
@@ -1,10 +1,10 @@
1
1
  import './ErrorBoundary.css';
2
2
  import { EmptyState as s } from "../EmptyState/EmptyState2.js";
3
- import { reportError as a } from "../../helpers/ErrorReporting.js";
4
3
  /* empty css */
5
- import { Component as c } from "react";
4
+ import { Component as a } from "react";
6
5
  import { jsx as o } from "react/jsx-runtime";
7
- var h = class extends c {
6
+ import { reportError as c } from "@memobit/core";
7
+ var h = class extends a {
8
8
  constructor(...r) {
9
9
  super(...r), this.state = { error: null }, this.reset = () => {
10
10
  this.setState({ error: null });
@@ -14,7 +14,7 @@ var h = class extends c {
14
14
  return { error: r };
15
15
  }
16
16
  componentDidCatch(r, t) {
17
- a(r, { componentStack: t.componentStack ?? void 0 }), console.error("ErrorBoundary caught:", r, t.componentStack), this.props.onError?.(r, t);
17
+ c(r, { componentStack: t.componentStack ?? void 0 }), console.error("ErrorBoundary caught:", r, t.componentStack), this.props.onError?.(r, t);
18
18
  }
19
19
  render() {
20
20
  const { error: r } = this.state, { children: t, title: n, resetLabel: i, fallback: e } = this.props;
@@ -1,70 +1,76 @@
1
1
  import './Tooltip.css';
2
2
  /* empty css */
3
3
  import { useEffect as b, useRef as h, useState as B } from "react";
4
- import { Fragment as V, jsx as D, jsxs as N } from "react/jsx-runtime";
5
- import { createPortal as O } from "react-dom";
4
+ import { Fragment as S, jsx as N, jsxs as D } from "react/jsx-runtime";
5
+ import { createPortal as V } from "react-dom";
6
6
  var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled: $ = !1, className: F = "", maxWidth: p, maxHeight: a }) => {
7
- const [f, s] = B(!1), [M, I] = B({
7
+ const [f, u] = B(!1), [M, I] = B({
8
8
  top: 0,
9
9
  left: 0
10
- }), c = h(null), t = h(null), l = h(null), g = h(null), w = h(!1), m = a !== void 0, R = m ? 150 : 0, d = () => {
11
- if (!l.current || !g.current) return;
12
- const r = l.current.firstElementChild?.getBoundingClientRect();
13
- let e = r && r.width > 0 ? r : l.current.getBoundingClientRect();
10
+ }), c = h(null), r = h(null), l = h(null), d = h(null), g = h(!1), w = a !== void 0, v = w ? 150 : 0, R = () => {
11
+ if (!l.current || !d.current) return;
12
+ const t = l.current.firstElementChild?.getBoundingClientRect();
13
+ let e = t && t.width > 0 ? t : l.current.getBoundingClientRect();
14
14
  if (e.width === 0 && e.height === 0) {
15
15
  const C = document.createRange();
16
16
  C.selectNodeContents(l.current);
17
17
  const E = C.getBoundingClientRect();
18
18
  (E.width > 0 || E.height > 0) && (e = E);
19
19
  }
20
- const n = g.current.getBoundingClientRect(), v = 8;
20
+ const n = d.current.getBoundingClientRect(), m = 8;
21
21
  let o = 0, i = 0;
22
22
  switch (T) {
23
23
  case "top":
24
- o = e.top - n.height - v, i = e.left + e.width / 2 - n.width / 2;
24
+ o = e.top - n.height - m, i = e.left + e.width / 2 - n.width / 2;
25
25
  break;
26
26
  case "bottom":
27
- o = e.bottom + v, i = e.left + e.width / 2 - n.width / 2;
27
+ o = e.bottom + m, i = e.left + e.width / 2 - n.width / 2;
28
28
  break;
29
29
  case "left":
30
- o = e.top + e.height / 2 - n.height / 2, i = e.left - n.width - v;
30
+ o = e.top + e.height / 2 - n.height / 2, i = e.left - n.width - m;
31
31
  break;
32
32
  case "right":
33
- o = e.top + e.height / 2 - n.height / 2, i = e.right + v;
33
+ o = e.top + e.height / 2 - n.height / 2, i = e.right + m;
34
34
  }
35
- const u = 8;
36
- i < u && (i = u), i + n.width > window.innerWidth - u && (i = window.innerWidth - n.width - u), o < u && (o = u), o + n.height > window.innerHeight - u && (o = window.innerHeight - n.height - u), I({
35
+ const s = 8;
36
+ i < s && (i = s), i + n.width > window.innerWidth - s && (i = window.innerWidth - n.width - s), o < s && (o = s), o + n.height > window.innerHeight - s && (o = window.innerHeight - n.height - s), I({
37
37
  top: o,
38
38
  left: i
39
39
  });
40
40
  }, P = () => {
41
- $ || w.current || (t.current && (clearTimeout(t.current), t.current = null), c.current = setTimeout(() => {
42
- s(!0);
41
+ $ || g.current || (r.current && (clearTimeout(r.current), r.current = null), c.current = setTimeout(() => {
42
+ u(!0);
43
43
  }, _));
44
44
  }, y = () => {
45
- w.current || (c.current && clearTimeout(c.current), R > 0 ? t.current = setTimeout(() => s(!1), R) : s(!1));
46
- }, j = (r) => {
47
- r.pointerType !== "touch" && r.pointerType !== "pen" || $ || (w.current = !0, c.current && (clearTimeout(c.current), c.current = null), r.stopPropagation(), s((e) => !e));
45
+ g.current || (c.current && clearTimeout(c.current), v > 0 ? r.current = setTimeout(() => u(!1), v) : u(!1));
46
+ }, j = (t) => {
47
+ t.pointerType !== "touch" && t.pointerType !== "pen" || $ || (g.current = !0, c.current && (clearTimeout(c.current), c.current = null), t.stopPropagation(), u((e) => !e));
48
48
  };
49
- b(() => (f && (d(), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d)), () => {
50
- window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
51
- }), [f]), b(() => {
49
+ b(() => {
52
50
  if (!f) return;
53
- const r = (e) => {
54
- l.current?.contains(e.target) || g.current?.contains(e.target) || s(!1);
51
+ const t = (e) => {
52
+ e.target instanceof Node && d.current?.contains(e.target) || u(!1);
55
53
  };
56
- return document.addEventListener("pointerdown", r), () => {
57
- document.removeEventListener("pointerdown", r), w.current = !1;
54
+ return R(), window.addEventListener("scroll", t, !0), window.addEventListener("resize", R), () => {
55
+ window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", R);
56
+ };
57
+ }, [f]), b(() => {
58
+ if (!f) return;
59
+ const t = (e) => {
60
+ l.current?.contains(e.target) || d.current?.contains(e.target) || u(!1);
61
+ };
62
+ return document.addEventListener("pointerdown", t), () => {
63
+ document.removeEventListener("pointerdown", t), g.current = !1;
58
64
  };
59
65
  }, [f]), b(() => () => {
60
- c.current && clearTimeout(c.current), t.current && clearTimeout(t.current);
66
+ c.current && clearTimeout(c.current), r.current && clearTimeout(r.current);
61
67
  }, []);
62
68
  const x = () => {
63
- m && t.current && (clearTimeout(t.current), t.current = null);
69
+ w && r.current && (clearTimeout(r.current), r.current = null);
64
70
  }, z = () => {
65
- m && (t.current = setTimeout(() => s(!1), R));
71
+ w && (r.current = setTimeout(() => u(!1), v));
66
72
  };
67
- return /* @__PURE__ */ N(V, { children: [/* @__PURE__ */ D("span", {
73
+ return /* @__PURE__ */ D(S, { children: [/* @__PURE__ */ N("span", {
68
74
  ref: l,
69
75
  className: "tooltip-trigger",
70
76
  onMouseEnter: P,
@@ -73,9 +79,9 @@ var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled:
73
79
  onBlur: y,
74
80
  onPointerDown: j,
75
81
  children: k
76
- }), f && L && O(/* @__PURE__ */ N("div", {
77
- ref: g,
78
- className: `tooltip tooltip--${T} ${m ? "tooltip--scrollable" : ""} ${F}`,
82
+ }), f && L && V(/* @__PURE__ */ D("div", {
83
+ ref: d,
84
+ className: `tooltip tooltip--${T} ${w ? "tooltip--scrollable" : ""} ${F}`,
79
85
  style: {
80
86
  top: `${M.top}px`,
81
87
  left: `${M.left}px`,
@@ -84,7 +90,7 @@ var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled:
84
90
  },
85
91
  onMouseEnter: x,
86
92
  onMouseLeave: z,
87
- children: [L, /* @__PURE__ */ D("div", { className: `tooltip__arrow tooltip__arrow--${T}` })]
93
+ children: [L, /* @__PURE__ */ N("div", { className: `tooltip__arrow tooltip__arrow--${T}` })]
88
94
  }), document.body)] });
89
95
  };
90
96
  export {
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 501,
26
+ libBuildNumber: 506,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- var I = "3.10.0", B = 501, L = "a4994d2", _ = "2026-10-14T19:49:58.413Z", a = "501";
1
+ var I = "3.11.1", B = 506, L = "fdabb4d", _ = "2026-10-16T17:07:55.728Z", a = "506";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
4
  a as LIB_BUILD_ID,
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.10.0",
3
- "buildNumber": 501,
4
- "commit": "a4994d2",
5
- "buildDate": "2026-10-14T19:49:58.413Z"
2
+ "version": "3.11.1",
3
+ "buildNumber": 506,
4
+ "commit": "fdabb4d",
5
+ "buildDate": "2026-10-16T17:07:55.728Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.10.0",
3
+ "version": "3.11.1",
4
4
  "description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
5
5
  "keywords": [
6
6
  "react",
@@ -48,10 +48,6 @@
48
48
  "types": "./dist/http.d.ts",
49
49
  "import": "./dist/http.js"
50
50
  },
51
- "./errors": {
52
- "types": "./dist/errors.d.ts",
53
- "import": "./dist/errors.js"
54
- },
55
51
  "./router": {
56
52
  "types": "./dist/router.d.ts",
57
53
  "import": "./dist/router.js"
@@ -84,6 +80,7 @@
84
80
  "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\""
85
81
  },
86
82
  "peerDependencies": {
83
+ "@memobit/core": "1.0.0",
87
84
  "@memobit/icons": "^1.5.0",
88
85
  "@memobit/themes": "^1.0.0",
89
86
  "react": "19.3.0",
@@ -97,6 +94,7 @@
97
94
  },
98
95
  "devDependencies": {
99
96
  "@eslint/js": "9.39.4",
97
+ "@memobit/core": "file:../memobit-core",
100
98
  "@memobit/icons": "file:../memobit-react-icons",
101
99
  "@memobit/themes": "file:../memobit-react-themes",
102
100
  "@microsoft/api-extractor": "7.59.2",
package/dist/errors.d.ts DELETED
@@ -1,78 +0,0 @@
1
- export declare type ErrorReportContext = Record<string, unknown>;
2
-
3
- export declare interface ErrorReportingConfig {
4
- /** The app id registered in the hub, e.g. `garage`. */
5
- appId: string;
6
- /** The hub ingest URL, e.g. `https://hub.memobit.ro/api/errors/ingest`. */
7
- endpoint: string;
8
- /** Turns reporting off for this run, e.g. `import.meta.env.PROD` to report only from production builds. Defaults to true. */
9
- enabled?: boolean;
10
- /** Shown in the hub next to each error. Defaults to `production`. */
11
- environment?: string;
12
- /** Build or commit the errors came from. */
13
- release?: string;
14
- /** Also report `console.error` and `console.warn` calls. Defaults to true. */
15
- captureConsole?: boolean;
16
- /** Messages to drop, on top of the built-in browser noise filters. */
17
- ignore?: (string | RegExp)[];
18
- /** Most events sent per page load or process run. Defaults to 200. */
19
- maxEventsPerSession?: number;
20
- }
21
-
22
- /**
23
- * Error reporting shared by every memobit app, in the browser and in Node. Errors and
24
- * warnings are batched and POSTed to the hub's errors/ingest endpoint, which groups them,
25
- * lists them on the hub's Errors page and emails on new errors and on spikes.
26
- *
27
- * React-free on purpose (it ships through the `@memobit/libs/errors` entry), so Node
28
- * servers can use it too. The hub can switch reporting off — globally, per app, or
29
- * automatically on a spike — and the reporter then stays quiet for as long as it is told.
30
- */
31
- export declare type ErrorReportLevel = 'error' | 'warning';
32
-
33
- /** Sends whatever is queued now instead of waiting for the next batch. */
34
- export declare const flushErrorReports: () => Promise<void>;
35
-
36
- /** Browser apps: call once, before rendering. */
37
- export declare const installErrorReporting: (config: ErrorReportingConfig) => void;
38
-
39
- /**
40
- * Node servers: call once at startup, passing `process`. Unhandled rejections reach
41
- * Node's uncaught-exception path, so both are covered. Listening there would stop the
42
- * crash Node normally does, so — unless the server has its own handler — the process
43
- * still exits with code 1, once the report is sent (or after 3s).
44
- */
45
- export declare const installNodeErrorReporting: (nodeProcess: NodeProcessLike, config: ErrorReportingConfig) => void;
46
-
47
- /**
48
- * Use in place of `console.*` in app code. `debug` and `info` only write to the console;
49
- * `warn` and `error` also report to the hub once error reporting is installed — and only
50
- * once, even though the console capture is on.
51
- */
52
- export declare const logger: {
53
- debug: (message: string, context?: ErrorReportContext) => void;
54
- info: (message: string, context?: ErrorReportContext) => void;
55
- warn: (message: string, context?: ErrorReportContext) => void;
56
- /** `error` is the caught value, if there is one; its stack is kept. */
57
- error: (message: string, error?: unknown, context?: ErrorReportContext) => void;
58
- };
59
-
60
- /** The part of Node's `process` the reporter needs; pass `process` itself. */
61
- export declare interface NodeProcessLike {
62
- on(event: 'uncaughtException', listener: (error: Error) => void): unknown;
63
- listenerCount(event: 'uncaughtException'): number;
64
- exit(code?: number): void;
65
- }
66
-
67
- /** Reports a caught error you handled but still want to know about. */
68
- declare const reportError_2: (error: unknown, context?: ErrorReportContext) => void;
69
- export { reportError_2 as reportError }
70
-
71
- export { }
72
-
73
-
74
- declare global {
75
- interface Window {
76
- __VERSIONS__: FullVersionInfo;
77
- }
78
- }
package/dist/errors.js DELETED
@@ -1,9 +0,0 @@
1
- import { flushErrorReports as o, installErrorReporting as t, installNodeErrorReporting as e, reportError as p } from "./helpers/ErrorReporting.js";
2
- import { logger as l } from "./helpers/Logger.js";
3
- export {
4
- o as flushErrorReports,
5
- t as installErrorReporting,
6
- e as installNodeErrorReporting,
7
- l as logger,
8
- p as reportError
9
- };
@@ -1,179 +0,0 @@
1
- var b = 5e3, A = 10, U = 25, _ = 1e3, f = 4e3, m = 60, R = 3e3, T = [/ResizeObserver loop/, /^Script error\.?$/], l = null, u = !1, E = /* @__PURE__ */ new WeakSet(), d = {}, p = (e, r) => e.length > r ? `${e.slice(0, r)}…` : e, v = (e) => typeof e == "object" && e !== null && !Array.isArray(e), $ = (e) => v(e) && (e.enabled === void 0 || typeof e.enabled == "boolean"), s = (e) => {
2
- if (e instanceof Error) return e.message ? `${e.name}: ${e.message}` : e.name;
3
- if (typeof e == "string") return e;
4
- try {
5
- return p(JSON.stringify(e) ?? String(e), 500);
6
- } catch {
7
- return String(e);
8
- }
9
- }, C = (e) => {
10
- const [r, ...n] = e;
11
- return typeof r != "string" || !/%[sdifoOc]/.test(r) ? e.map(s).join(" ") : [r.replace(/%([sdifoOc%])/g, (t, o) => {
12
- if (o === "%") return "%";
13
- if (n.length === 0) return t;
14
- const a = n.shift();
15
- return o === "c" ? "" : s(a);
16
- }), ...n.map(s)].join(" ");
17
- }, O = (e) => {
18
- if (e)
19
- try {
20
- const r = JSON.stringify(e);
21
- if (r.length > f) return { truncated: p(r, f) };
22
- const n = JSON.parse(r);
23
- return v(n) ? n : void 0;
24
- } catch {
25
- return { unserializable: s(e) };
26
- }
27
- }, N = () => typeof location > "u" ? void 0 : location.origin + location.pathname, q = (e, r, n) => n?.includes("-extension://") ? !0 : e.ignore.some((t) => typeof t == "string" ? r.includes(t) : t.test(r)), h = (e, r) => {
28
- e.pausedUntil = Date.now() + Math.max(30, r) * 1e3, e.queue.clear();
29
- }, g = (e) => {
30
- e.timer === null && (e.timer = setTimeout(() => {
31
- c();
32
- }, b));
33
- }, y = (e, r) => {
34
- (d[e] ?? console[e]).apply(console, r);
35
- }, i = (e) => {
36
- const r = l;
37
- if (!(!r || u)) {
38
- if (typeof e.error == "object" && e.error !== null) {
39
- if (E.has(e.error)) return;
40
- E.add(e.error);
41
- }
42
- if (!(Date.now() < r.pausedUntil || q(r, e.message, e.stack))) {
43
- u = !0;
44
- try {
45
- const n = p(e.message, _), t = `${e.level}|${n}|${e.stack?.split(`
46
- `, 2).join("|") ?? ""}`, o = r.queue.get(t);
47
- if (o) {
48
- o.count += 1;
49
- return;
50
- }
51
- if (r.sent + r.queue.size >= r.maxEvents) {
52
- r.capReached || (r.capReached = !0, y("warn", [`[memobit] Error reporting stopped for this session after ${r.maxEvents} events.`]));
53
- return;
54
- }
55
- r.queue.set(t, {
56
- level: e.level,
57
- message: n,
58
- stack: e.stack,
59
- url: N(),
60
- context: O(e.context),
61
- count: 1
62
- }), r.queue.size >= A ? c() : g(r);
63
- } finally {
64
- u = !1;
65
- }
66
- }
67
- }
68
- }, x = (e, r) => {
69
- i({
70
- level: "error",
71
- message: s(e),
72
- stack: e instanceof Error ? e.stack : void 0,
73
- context: r,
74
- error: e
75
- });
76
- }, c = async () => {
77
- const e = l;
78
- if (!e) return;
79
- e.timer !== null && (clearTimeout(e.timer), e.timer = null);
80
- const r = [...e.queue.entries()].slice(0, U);
81
- if (r.length === 0) return;
82
- r.forEach(([t]) => e.queue.delete(t)), e.sent += r.length;
83
- const n = JSON.stringify({
84
- app: e.appId,
85
- source: e.source,
86
- environment: e.environment,
87
- release: e.release,
88
- events: r.map(([, t]) => t)
89
- });
90
- try {
91
- const t = await (await fetch(e.endpoint, {
92
- method: "POST",
93
- headers: { "Content-Type": "text/plain;charset=UTF-8" },
94
- body: n,
95
- credentials: "omit",
96
- keepalive: n.length < 6e4
97
- })).json().catch(() => null);
98
- $(t) && t.enabled === !1 && h(e, t.retryAfter ?? m);
99
- } catch {
100
- h(e, m);
101
- }
102
- e.queue.size > 0 && g(e);
103
- }, w = (e, r) => l || e.enabled === !1 || !e.appId || !e.endpoint ? !1 : (l = {
104
- appId: e.appId,
105
- endpoint: e.endpoint,
106
- source: r,
107
- environment: e.environment ?? "production",
108
- release: e.release,
109
- ignore: [...T, ...e.ignore ?? []],
110
- maxEvents: e.maxEventsPerSession ?? 200,
111
- queue: /* @__PURE__ */ new Map(),
112
- sent: 0,
113
- pausedUntil: 0,
114
- capReached: !1,
115
- timer: null
116
- }, !0), S = () => {
117
- const e = console.error, r = console.warn;
118
- d.error = e, d.warn = r;
119
- const n = (t, o) => {
120
- const a = o.find((k) => k instanceof Error);
121
- i({
122
- level: t,
123
- message: C(o),
124
- stack: a instanceof Error ? a.stack : void 0,
125
- error: a
126
- });
127
- };
128
- console.error = (...t) => {
129
- e.apply(console, t), n("error", t);
130
- }, console.warn = (...t) => {
131
- r.apply(console, t), n("warning", t);
132
- };
133
- }, I = (e) => {
134
- if (typeof window > "u" || !w(e, "client")) return;
135
- window.addEventListener("error", (n) => {
136
- const t = n.error;
137
- i({
138
- level: "error",
139
- message: t instanceof Error ? s(t) : n.message || "Unknown error",
140
- stack: t instanceof Error ? t.stack : `at ${n.filename}:${n.lineno}:${n.colno}`,
141
- error: t
142
- });
143
- }), window.addEventListener("unhandledrejection", (n) => {
144
- const t = n.reason;
145
- i({
146
- level: "error",
147
- message: `Unhandled rejection: ${s(t)}`,
148
- stack: t instanceof Error ? t.stack : void 0,
149
- error: t
150
- });
151
- });
152
- const r = () => {
153
- c();
154
- };
155
- window.addEventListener("pagehide", r), document.addEventListener("visibilitychange", () => {
156
- document.visibilityState === "hidden" && r();
157
- }), e.captureConsole !== !1 && S();
158
- }, L = (e, r) => {
159
- w(r, "server") && (e.on("uncaughtException", (n) => {
160
- if (i({
161
- level: "error",
162
- message: `Uncaught ${s(n)}`,
163
- stack: n.stack,
164
- error: n
165
- }), e.listenerCount("uncaughtException") > 1) return;
166
- y("error", [n]);
167
- const t = new Promise((o) => setTimeout(o, R));
168
- Promise.race([c(), t]).finally(() => e.exit(1));
169
- }), r.captureConsole !== !1 && S());
170
- };
171
- export {
172
- i as captureEvent,
173
- s as describeValue,
174
- c as flushErrorReports,
175
- I as installErrorReporting,
176
- L as installNodeErrorReporting,
177
- x as reportError,
178
- y as writeNativeConsole
179
- };
@@ -1,31 +0,0 @@
1
- import { captureEvent as e, describeValue as d, writeNativeConsole as n } from "./ErrorReporting.js";
2
- var v = (o, i, r) => {
3
- const a = [o];
4
- return r !== void 0 && a.push(r), i !== void 0 && a.push(i), a;
5
- }, t = {
6
- debug: (o, i) => {
7
- n("debug", v(o, i));
8
- },
9
- info: (o, i) => {
10
- n("info", v(o, i));
11
- },
12
- warn: (o, i) => {
13
- n("warn", v(o, i)), e({
14
- level: "warning",
15
- message: o,
16
- context: i
17
- });
18
- },
19
- error: (o, i, r) => {
20
- n("error", v(o, r, i)), e({
21
- level: "error",
22
- message: i === void 0 ? o : `${o}: ${d(i)}`,
23
- stack: i instanceof Error ? i.stack : void 0,
24
- context: r,
25
- error: i
26
- });
27
- }
28
- };
29
- export {
30
- t as logger
31
- };