@debugkit/sdk 0.0.0-stage → 0.1.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.
Files changed (57) hide show
  1. package/README.md +176 -2
  2. package/dist/chunk-3UN5VMQU.js +41 -0
  3. package/dist/chunk-3UN5VMQU.js.map +1 -0
  4. package/dist/chunk-BD2FNVCP.js +71 -0
  5. package/dist/chunk-BD2FNVCP.js.map +1 -0
  6. package/dist/chunk-KUJ4EW3D.cjs +45 -0
  7. package/dist/chunk-KUJ4EW3D.cjs.map +1 -0
  8. package/dist/chunk-NSWUGBA2.cjs +75 -0
  9. package/dist/chunk-NSWUGBA2.cjs.map +1 -0
  10. package/dist/chunk-VIJ5USKQ.js +300 -0
  11. package/dist/chunk-VIJ5USKQ.js.map +1 -0
  12. package/dist/chunk-XEFWRCN4.cjs +311 -0
  13. package/dist/chunk-XEFWRCN4.cjs.map +1 -0
  14. package/dist/client-drmb0n15.d.cts +103 -0
  15. package/dist/client-drmb0n15.d.ts +103 -0
  16. package/dist/expo-router.cjs +13 -0
  17. package/dist/expo-router.cjs.map +1 -0
  18. package/dist/expo-router.d.cts +10 -0
  19. package/dist/expo-router.d.ts +10 -0
  20. package/dist/expo-router.js +11 -0
  21. package/dist/expo-router.js.map +1 -0
  22. package/dist/expo.cjs +97 -0
  23. package/dist/expo.cjs.map +1 -0
  24. package/dist/expo.d.cts +14 -0
  25. package/dist/expo.d.ts +14 -0
  26. package/dist/expo.js +47 -0
  27. package/dist/expo.js.map +1 -0
  28. package/dist/index.cjs +36 -0
  29. package/dist/index.cjs.map +1 -0
  30. package/dist/index.d.cts +11 -0
  31. package/dist/index.d.ts +11 -0
  32. package/dist/index.js +3 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/node.cjs +85 -0
  35. package/dist/node.cjs.map +1 -0
  36. package/dist/node.d.cts +23 -0
  37. package/dist/node.d.ts +23 -0
  38. package/dist/node.js +50 -0
  39. package/dist/node.js.map +1 -0
  40. package/dist/react-native.cjs +38 -0
  41. package/dist/react-native.cjs.map +1 -0
  42. package/dist/react-native.d.cts +51 -0
  43. package/dist/react-native.d.ts +51 -0
  44. package/dist/react-native.js +5 -0
  45. package/dist/react-native.js.map +1 -0
  46. package/dist/react.cjs +25 -0
  47. package/dist/react.cjs.map +1 -0
  48. package/dist/react.d.cts +50 -0
  49. package/dist/react.d.ts +50 -0
  50. package/dist/react.js +4 -0
  51. package/dist/react.js.map +1 -0
  52. package/expo/package.json +6 -0
  53. package/expo-router/package.json +6 -0
  54. package/node/package.json +6 -0
  55. package/package.json +121 -3
  56. package/react/package.json +6 -0
  57. package/react-native/package.json +6 -0
package/dist/expo.cjs ADDED
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+
3
+ var chunkNSWUGBA2_cjs = require('./chunk-NSWUGBA2.cjs');
4
+ var chunkKUJ4EW3D_cjs = require('./chunk-KUJ4EW3D.cjs');
5
+ var chunkXEFWRCN4_cjs = require('./chunk-XEFWRCN4.cjs');
6
+ var Application = require('expo-application');
7
+ var Device = require('expo-device');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var Application__namespace = /*#__PURE__*/_interopNamespace(Application);
28
+ var Device__namespace = /*#__PURE__*/_interopNamespace(Device);
29
+
30
+ function osName2(raw) {
31
+ const n = (raw != null ? raw : "").toLowerCase();
32
+ if (n.includes("android")) return "android";
33
+ if (n === "ios" || n === "ipados") return "ios";
34
+ return n || "unknown";
35
+ }
36
+ var DEVICE_TYPES = { 1: "phone", 2: "tablet", 3: "desktop", 4: "tv" };
37
+ function expoContext() {
38
+ var _a, _b, _c, _d, _e, _f, _g;
39
+ return {
40
+ os: Device__namespace.osVersion ? { name: osName2(Device__namespace.osName), version: Device__namespace.osVersion } : void 0,
41
+ device: {
42
+ model: (_a = Device__namespace.modelName) != null ? _a : void 0,
43
+ manufacturer: (_b = Device__namespace.manufacturer) != null ? _b : void 0,
44
+ brand: (_c = Device__namespace.brand) != null ? _c : void 0,
45
+ isEmulator: !Device__namespace.isDevice,
46
+ memoryMb: Device__namespace.totalMemory ? Math.round(Device__namespace.totalMemory / 1024 / 1024) : void 0,
47
+ type: (_e = DEVICE_TYPES[(_d = Device__namespace.deviceType) != null ? _d : 0]) != null ? _e : "unknown"
48
+ },
49
+ app: {
50
+ version: (_f = Application__namespace.nativeApplicationVersion) != null ? _f : void 0,
51
+ build: (_g = Application__namespace.nativeBuildVersion) != null ? _g : void 0
52
+ }
53
+ };
54
+ }
55
+ function initExpo(options, client = chunkXEFWRCN4_cjs.deBug) {
56
+ var _a;
57
+ const ctx = expoContext();
58
+ const merged = chunkXEFWRCN4_cjs.mergeContext(ctx, (_a = options.context) != null ? _a : {});
59
+ if (!ctx.os) delete merged.os;
60
+ return chunkNSWUGBA2_cjs.initReactNative(
61
+ { ...options, app: { ...ctx.app, ...options.app }, context: merged },
62
+ client
63
+ );
64
+ }
65
+
66
+ Object.defineProperty(exports, "initReactNative", {
67
+ enumerable: true,
68
+ get: function () { return chunkNSWUGBA2_cjs.initReactNative; }
69
+ });
70
+ Object.defineProperty(exports, "nativeContext", {
71
+ enumerable: true,
72
+ get: function () { return chunkNSWUGBA2_cjs.nativeContext; }
73
+ });
74
+ Object.defineProperty(exports, "trackReactNavigation", {
75
+ enumerable: true,
76
+ get: function () { return chunkNSWUGBA2_cjs.trackReactNavigation; }
77
+ });
78
+ Object.defineProperty(exports, "DebugErrorBoundary", {
79
+ enumerable: true,
80
+ get: function () { return chunkKUJ4EW3D_cjs.DebugErrorBoundary; }
81
+ });
82
+ Object.defineProperty(exports, "trackTanStackRouter", {
83
+ enumerable: true,
84
+ get: function () { return chunkKUJ4EW3D_cjs.trackTanStackRouter; }
85
+ });
86
+ Object.defineProperty(exports, "useDebugNavigation", {
87
+ enumerable: true,
88
+ get: function () { return chunkKUJ4EW3D_cjs.useDebugNavigation; }
89
+ });
90
+ Object.defineProperty(exports, "deBug", {
91
+ enumerable: true,
92
+ get: function () { return chunkXEFWRCN4_cjs.deBug; }
93
+ });
94
+ exports.expoContext = expoContext;
95
+ exports.initExpo = initExpo;
96
+ //# sourceMappingURL=expo.cjs.map
97
+ //# sourceMappingURL=expo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/expo.ts"],"names":["osName","Device","Application","deBug","mergeContext","initReactNative"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAASA,QAAO,GAAA,EAA4B;AAC1C,EAAA,MAAM,CAAA,GAAA,CAAK,GAAA,IAAA,IAAA,GAAA,GAAA,GAAO,EAAA,EAAI,WAAA,EAAY;AAClC,EAAA,IAAI,CAAA,CAAE,QAAA,CAAS,SAAS,CAAA,EAAG,OAAO,SAAA;AAClC,EAAA,IAAI,CAAA,KAAM,KAAA,IAAS,CAAA,KAAM,QAAA,EAAU,OAAO,KAAA;AAC1C,EAAA,OAAO,CAAA,IAAK,SAAA;AACd;AAEA,IAAM,YAAA,GAAe,EAAE,CAAA,EAAG,OAAA,EAAS,GAAG,QAAA,EAAU,CAAA,EAAG,SAAA,EAAW,CAAA,EAAG,IAAA,EAAK;AAG/D,SAAS,WAAA,GAA4B;AAlB5C,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAmBE,EAAA,OAAO;AAAA,IACL,EAAA,EAAWC,8BAAY,EAAE,IAAA,EAAMD,QAAcC,iBAAA,CAAA,MAAM,CAAA,EAAG,OAAA,EAAgBA,iBAAA,CAAA,SAAA,EAAU,GAAI,MAAA;AAAA,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L,EAAE,GAAG,OAAA,EAAS,GAAA,EAAK,EAAE,GAAI,GAAA,CAAI,GAAA,EAAgB,GAAG,OAAA,CAAQ,GAAA,EAAI,EAAoC,SAAS,MAAA,EAAO;AAAA,IAChH;AAAA,GACF;AACF","file":"expo.cjs","sourcesContent":["import * as Application from \"expo-application\";\nimport * as Device from \"expo-device\";\nimport { deBug, type DebugClient } from \"./index\";\nimport { mergeContext, type ContextPatch } from \"./context\";\nimport { initReactNative, type ReactNativeInitOptions } from \"./react-native\";\n\nexport * from \"./react-native\";\n\nfunction osName(raw: string | null): string {\n const n = (raw ?? \"\").toLowerCase();\n if (n.includes(\"android\")) return \"android\";\n if (n === \"ios\" || n === \"ipados\") return \"ios\";\n return n || \"unknown\"; // web: the browser's OS, e.g. \"mac os\"\n}\n\nconst DEVICE_TYPES = { 1: \"phone\", 2: \"tablet\", 3: \"desktop\", 4: \"tv\" } as const;\n\n/** Device and app context from expo-device and expo-application. */\nexport function expoContext(): ContextPatch {\n return {\n os: Device.osVersion ? { name: osName(Device.osName), version: Device.osVersion } : undefined,\n device: {\n model: Device.modelName ?? undefined,\n manufacturer: Device.manufacturer ?? undefined,\n brand: Device.brand ?? undefined,\n isEmulator: !Device.isDevice,\n memoryMb: Device.totalMemory ? Math.round(Device.totalMemory / 1024 / 1024) : undefined,\n type: DEVICE_TYPES[(Device.deviceType ?? 0) as keyof typeof DEVICE_TYPES] ?? \"unknown\",\n },\n app: {\n version: Application.nativeApplicationVersion ?? undefined,\n build: Application.nativeBuildVersion ?? undefined,\n } as ContextPatch[\"app\"],\n };\n}\n\n/** Initialise deBug in an Expo app. Device, OS and app version are filled in automatically. */\nexport function initExpo(options: Omit<ReactNativeInitOptions, \"deviceInfo\">, client: DebugClient = deBug): DebugClient {\n const ctx = expoContext();\n const merged = mergeContext(ctx, options.context ?? {});\n // Drop undefined os so the react-native fallback is kept when expo-device has no data (e.g. web).\n if (!ctx.os) delete (merged as { os?: unknown }).os;\n return initReactNative(\n { ...options, app: { ...(ctx.app as object), ...options.app } as ReactNativeInitOptions[\"app\"], context: merged },\n client,\n );\n}\n"]}
@@ -0,0 +1,14 @@
1
+ export { deBug } from './index.cjs';
2
+ import { C as ContextPatch, D as DebugClient } from './client-drmb0n15.cjs';
3
+ import { ReactNativeInitOptions } from './react-native.cjs';
4
+ export { DeviceInfoModule, initReactNative, nativeContext, trackReactNavigation } from './react-native.cjs';
5
+ export { DebugErrorBoundary, DebugErrorBoundaryProps, trackTanStackRouter, useDebugNavigation } from './react.cjs';
6
+ import '@debugkit/schema/core';
7
+ import 'react';
8
+
9
+ /** Device and app context from expo-device and expo-application. */
10
+ declare function expoContext(): ContextPatch;
11
+ /** Initialise deBug in an Expo app. Device, OS and app version are filled in automatically. */
12
+ declare function initExpo(options: Omit<ReactNativeInitOptions, "deviceInfo">, client?: DebugClient): DebugClient;
13
+
14
+ export { ReactNativeInitOptions, expoContext, initExpo };
package/dist/expo.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export { deBug } from './index.js';
2
+ import { C as ContextPatch, D as DebugClient } from './client-drmb0n15.js';
3
+ import { ReactNativeInitOptions } from './react-native.js';
4
+ export { DeviceInfoModule, initReactNative, nativeContext, trackReactNavigation } from './react-native.js';
5
+ export { DebugErrorBoundary, DebugErrorBoundaryProps, trackTanStackRouter, useDebugNavigation } from './react.js';
6
+ import '@debugkit/schema/core';
7
+ import 'react';
8
+
9
+ /** Device and app context from expo-device and expo-application. */
10
+ declare function expoContext(): ContextPatch;
11
+ /** Initialise deBug in an Expo app. Device, OS and app version are filled in automatically. */
12
+ declare function initExpo(options: Omit<ReactNativeInitOptions, "deviceInfo">, client?: DebugClient): DebugClient;
13
+
14
+ export { ReactNativeInitOptions, expoContext, initExpo };
package/dist/expo.js ADDED
@@ -0,0 +1,47 @@
1
+ import { initReactNative } from './chunk-BD2FNVCP.js';
2
+ export { initReactNative, nativeContext, trackReactNavigation } from './chunk-BD2FNVCP.js';
3
+ export { DebugErrorBoundary, trackTanStackRouter, useDebugNavigation } from './chunk-3UN5VMQU.js';
4
+ import { deBug, mergeContext } from './chunk-VIJ5USKQ.js';
5
+ export { deBug } from './chunk-VIJ5USKQ.js';
6
+ import * as Application from 'expo-application';
7
+ import * as Device from 'expo-device';
8
+
9
+ function osName2(raw) {
10
+ const n = (raw != null ? raw : "").toLowerCase();
11
+ if (n.includes("android")) return "android";
12
+ if (n === "ios" || n === "ipados") return "ios";
13
+ return n || "unknown";
14
+ }
15
+ var DEVICE_TYPES = { 1: "phone", 2: "tablet", 3: "desktop", 4: "tv" };
16
+ function expoContext() {
17
+ var _a, _b, _c, _d, _e, _f, _g;
18
+ return {
19
+ os: Device.osVersion ? { name: osName2(Device.osName), version: Device.osVersion } : void 0,
20
+ device: {
21
+ model: (_a = Device.modelName) != null ? _a : void 0,
22
+ manufacturer: (_b = Device.manufacturer) != null ? _b : void 0,
23
+ brand: (_c = Device.brand) != null ? _c : void 0,
24
+ isEmulator: !Device.isDevice,
25
+ memoryMb: Device.totalMemory ? Math.round(Device.totalMemory / 1024 / 1024) : void 0,
26
+ type: (_e = DEVICE_TYPES[(_d = Device.deviceType) != null ? _d : 0]) != null ? _e : "unknown"
27
+ },
28
+ app: {
29
+ version: (_f = Application.nativeApplicationVersion) != null ? _f : void 0,
30
+ build: (_g = Application.nativeBuildVersion) != null ? _g : void 0
31
+ }
32
+ };
33
+ }
34
+ function initExpo(options, client = deBug) {
35
+ var _a;
36
+ const ctx = expoContext();
37
+ const merged = mergeContext(ctx, (_a = options.context) != null ? _a : {});
38
+ if (!ctx.os) delete merged.os;
39
+ return initReactNative(
40
+ { ...options, app: { ...ctx.app, ...options.app }, context: merged },
41
+ client
42
+ );
43
+ }
44
+
45
+ export { expoContext, initExpo };
46
+ //# sourceMappingURL=expo.js.map
47
+ //# sourceMappingURL=expo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/expo.ts"],"names":["osName"],"mappings":";;;;;;;;AAQA,SAASA,QAAO,GAAA,EAA4B;AAC1C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P,IAAA,GAAA,EAAA,GAAqB,CAA+B,MAAlE,IAAA,GAAA,EAAA,GAAuE;AAAA,KAC/E;AAAA,IACA,GAAA,EAAK;AAAA,MACH,OAAA,EAAA,CAAS,EAAA,GAAY,WAAA,CAAA,wBAAA,KAAZ,IAAA,GAAA,EAAA,GAAwC,MAAA;AAAA,MACjD,KAAA,EAAA,CAAO,EAAA,GAAY,WAAA,CAAA,kBAAA,KAAZ,IAAA,GAAA,EAAA,GAAkC;AAAA;AAC3C,GACF;AACF;AAGO,SAAS,QAAA,CAAS,OAAA,EAAqD,MAAA,GAAsB,KAAA,EAAoB;AArCxH,EAAA,IAAA,EAAA;AAsCE,EAAA,MAAM,MAAM,WAAA,EAAY;AACxB,EAAA,MAAM,SAAS,YAAA,CAAa,GAAA,EAAA,CAAK,aAAQ,OAAA,KAAR,IAAA,GAAA,EAAA,GAAmB,EAAE,CAAA;AAEtD,EAAA,IAAI,CAAC,GAAA,CAAI,EAAA,EAAI,OAAQ,MAAA,CAA4B,EAAA;AACjD,EAAA,OAAO,eAAA;AAAA,IACL,EAAE,GAAG,OAAA,EAAS,GAAA,EAAK,EAAE,GAAI,GAAA,CAAI,GAAA,EAAgB,GAAG,OAAA,CAAQ,GAAA,EAAI,EAAoC,SAAS,MAAA,EAAO;AAAA,IAChH;AAAA,GACF;AACF","file":"expo.js","sourcesContent":["import * as Application from \"expo-application\";\nimport * as Device from \"expo-device\";\nimport { deBug, type DebugClient } from \"./index\";\nimport { mergeContext, type ContextPatch } from \"./context\";\nimport { initReactNative, type ReactNativeInitOptions } from \"./react-native\";\n\nexport * from \"./react-native\";\n\nfunction osName(raw: string | null): string {\n const n = (raw ?? \"\").toLowerCase();\n if (n.includes(\"android\")) return \"android\";\n if (n === \"ios\" || n === \"ipados\") return \"ios\";\n return n || \"unknown\"; // web: the browser's OS, e.g. \"mac os\"\n}\n\nconst DEVICE_TYPES = { 1: \"phone\", 2: \"tablet\", 3: \"desktop\", 4: \"tv\" } as const;\n\n/** Device and app context from expo-device and expo-application. */\nexport function expoContext(): ContextPatch {\n return {\n os: Device.osVersion ? { name: osName(Device.osName), version: Device.osVersion } : undefined,\n device: {\n model: Device.modelName ?? undefined,\n manufacturer: Device.manufacturer ?? undefined,\n brand: Device.brand ?? undefined,\n isEmulator: !Device.isDevice,\n memoryMb: Device.totalMemory ? Math.round(Device.totalMemory / 1024 / 1024) : undefined,\n type: DEVICE_TYPES[(Device.deviceType ?? 0) as keyof typeof DEVICE_TYPES] ?? \"unknown\",\n },\n app: {\n version: Application.nativeApplicationVersion ?? undefined,\n build: Application.nativeBuildVersion ?? undefined,\n } as ContextPatch[\"app\"],\n };\n}\n\n/** Initialise deBug in an Expo app. Device, OS and app version are filled in automatically. */\nexport function initExpo(options: Omit<ReactNativeInitOptions, \"deviceInfo\">, client: DebugClient = deBug): DebugClient {\n const ctx = expoContext();\n const merged = mergeContext(ctx, options.context ?? {});\n // Drop undefined os so the react-native fallback is kept when expo-device has no data (e.g. web).\n if (!ctx.os) delete (merged as { os?: unknown }).os;\n return initReactNative(\n { ...options, app: { ...(ctx.app as object), ...options.app } as ReactNativeInitOptions[\"app\"], context: merged },\n client,\n );\n}\n"]}
package/dist/index.cjs ADDED
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ var chunkXEFWRCN4_cjs = require('./chunk-XEFWRCN4.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "DebugClient", {
8
+ enumerable: true,
9
+ get: function () { return chunkXEFWRCN4_cjs.DebugClient; }
10
+ });
11
+ Object.defineProperty(exports, "SDK_NAME", {
12
+ enumerable: true,
13
+ get: function () { return chunkXEFWRCN4_cjs.SDK_NAME; }
14
+ });
15
+ Object.defineProperty(exports, "SDK_VERSION", {
16
+ enumerable: true,
17
+ get: function () { return chunkXEFWRCN4_cjs.SDK_VERSION; }
18
+ });
19
+ Object.defineProperty(exports, "browserContext", {
20
+ enumerable: true,
21
+ get: function () { return chunkXEFWRCN4_cjs.browserContext; }
22
+ });
23
+ Object.defineProperty(exports, "deBug", {
24
+ enumerable: true,
25
+ get: function () { return chunkXEFWRCN4_cjs.deBug; }
26
+ });
27
+ Object.defineProperty(exports, "mergeContext", {
28
+ enumerable: true,
29
+ get: function () { return chunkXEFWRCN4_cjs.mergeContext; }
30
+ });
31
+ Object.defineProperty(exports, "parseStack", {
32
+ enumerable: true,
33
+ get: function () { return chunkXEFWRCN4_cjs.parseStack; }
34
+ });
35
+ //# sourceMappingURL=index.cjs.map
36
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,11 @@
1
+ import { D as DebugClient } from './client-drmb0n15.cjs';
2
+ export { C as ContextPatch, E as EventMeta, I as InitOptions, Q as QueueStorage, S as SDK_NAME, a as SDK_VERSION, b as browserContext, m as mergeContext } from './client-drmb0n15.cjs';
3
+ export { Breadcrumb, EventInput, Severity, StackFrame, parseStack } from '@debugkit/schema/core';
4
+
5
+ /**
6
+ * Default client. Framework entry points (`/react`, `/react-native`, `/expo`, `/node`) use this
7
+ * same instance, so `import { deBug } from "@debugkit/sdk"` works everywhere.
8
+ */
9
+ declare const deBug: DebugClient;
10
+
11
+ export { DebugClient, deBug };
@@ -0,0 +1,11 @@
1
+ import { D as DebugClient } from './client-drmb0n15.js';
2
+ export { C as ContextPatch, E as EventMeta, I as InitOptions, Q as QueueStorage, S as SDK_NAME, a as SDK_VERSION, b as browserContext, m as mergeContext } from './client-drmb0n15.js';
3
+ export { Breadcrumb, EventInput, Severity, StackFrame, parseStack } from '@debugkit/schema/core';
4
+
5
+ /**
6
+ * Default client. Framework entry points (`/react`, `/react-native`, `/expo`, `/node`) use this
7
+ * same instance, so `import { deBug } from "@debugkit/sdk"` works everywhere.
8
+ */
9
+ declare const deBug: DebugClient;
10
+
11
+ export { DebugClient, deBug };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { DebugClient, SDK_NAME, SDK_VERSION, browserContext, deBug, mergeContext, parseStack } from './chunk-VIJ5USKQ.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/node.cjs ADDED
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ var chunkXEFWRCN4_cjs = require('./chunk-XEFWRCN4.cjs');
4
+ var os = require('os');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var os__default = /*#__PURE__*/_interopDefault(os);
9
+
10
+ function nodeContext() {
11
+ return {
12
+ os: { name: os__default.default.platform(), version: os__default.default.release() },
13
+ runtime: { name: "node", version: process.versions.node },
14
+ device: { type: "unknown", memoryMb: Math.round(os__default.default.totalmem() / 1024 / 1024) },
15
+ timezone: chunkXEFWRCN4_cjs.timezone()
16
+ };
17
+ }
18
+ var installed = false;
19
+ function initNode(options, client = chunkXEFWRCN4_cjs.deBug) {
20
+ var _a;
21
+ const { captureProcessErrors = true, shutdownTimeoutMs = 2e3, ...rest } = options;
22
+ client.init({ ...rest, captureGlobalErrors: false, context: chunkXEFWRCN4_cjs.mergeContext(nodeContext(), (_a = rest.context) != null ? _a : {}) });
23
+ if (!captureProcessErrors || installed) return client;
24
+ installed = true;
25
+ const flushThenExit = async (err) => {
26
+ await Promise.race([client.flush(), new Promise((r) => setTimeout(r, shutdownTimeoutMs))]);
27
+ console.error(err);
28
+ process.exit(1);
29
+ };
30
+ process.on("uncaughtException", (err) => {
31
+ client.error(err, { handled: false, severity: "critical", tags: { source: "uncaughtException" } });
32
+ void flushThenExit(err);
33
+ });
34
+ process.on("unhandledRejection", (reason) => {
35
+ client.error(reason, { handled: false, tags: { source: "unhandledRejection" } });
36
+ if (process.listenerCount("unhandledRejection") === 1) void flushThenExit(reason);
37
+ });
38
+ process.on("beforeExit", () => void client.flush());
39
+ return client;
40
+ }
41
+ function withDebug(flow, fn, client = chunkXEFWRCN4_cjs.deBug) {
42
+ return async (...args) => {
43
+ try {
44
+ return await fn(...args);
45
+ } catch (err) {
46
+ client.error(err, { flow, handled: false });
47
+ await client.flush();
48
+ throw err;
49
+ }
50
+ };
51
+ }
52
+
53
+ Object.defineProperty(exports, "DebugClient", {
54
+ enumerable: true,
55
+ get: function () { return chunkXEFWRCN4_cjs.DebugClient; }
56
+ });
57
+ Object.defineProperty(exports, "SDK_NAME", {
58
+ enumerable: true,
59
+ get: function () { return chunkXEFWRCN4_cjs.SDK_NAME; }
60
+ });
61
+ Object.defineProperty(exports, "SDK_VERSION", {
62
+ enumerable: true,
63
+ get: function () { return chunkXEFWRCN4_cjs.SDK_VERSION; }
64
+ });
65
+ Object.defineProperty(exports, "browserContext", {
66
+ enumerable: true,
67
+ get: function () { return chunkXEFWRCN4_cjs.browserContext; }
68
+ });
69
+ Object.defineProperty(exports, "deBug", {
70
+ enumerable: true,
71
+ get: function () { return chunkXEFWRCN4_cjs.deBug; }
72
+ });
73
+ Object.defineProperty(exports, "mergeContext", {
74
+ enumerable: true,
75
+ get: function () { return chunkXEFWRCN4_cjs.mergeContext; }
76
+ });
77
+ Object.defineProperty(exports, "parseStack", {
78
+ enumerable: true,
79
+ get: function () { return chunkXEFWRCN4_cjs.parseStack; }
80
+ });
81
+ exports.initNode = initNode;
82
+ exports.nodeContext = nodeContext;
83
+ exports.withDebug = withDebug;
84
+ //# sourceMappingURL=node.cjs.map
85
+ //# sourceMappingURL=node.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/node.ts"],"names":["os","timezone","deBug","mergeContext"],"mappings":";;;;;;;;;AAKO,SAAS,WAAA,GAA4B;AAC1C,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,EAAE,IAAA,EAAMA,mBAAA,CAAG,UAAS,EAAG,OAAA,EAASA,mBAAA,CAAG,OAAA,EAAQ,EAAE;AAAA,IACjD,SAAS,EAAE,IAAA,EAAM,QAAQ,OAAA,EAAS,OAAA,CAAQ,SA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AQ,mBAAA,EAAoB,EAAG,CAAA;AACjG,IAAA,KAAK,cAAc,GAAG,CAAA;AAAA,EACxB,CAAC,CAAA;AACD,EAAA,OAAA,CAAQ,EAAA,CAAG,oBAAA,EAAsB,CAAC,MAAA,KAAW;AAC3C,IAAA,MAAA,CAAO,KAAA,CAAM,MAAA,EAAQ,EAAE,OAAA,EAAS,KAAA,EAAO,MAAM,EAAE,MAAA,EAAQ,oBAAA,EAAqB,EAAG,CAAA;AAC/E,IAAA,IAAI,QAAQ,aAAA,CAAc,oBAAoB,MAAM,CAAA,EAAG,KAAK,cAAc,MAAM,CAAA;AAAA,EAClF,CAAC,CAAA;AACD,EAAA,OAAA,CAAQ,GAAG,YAAA,EAAc,MAAM,KAAK,MAAA,CAAO,OAAO,CAAA;AAClD,EAAA,OAAO,MAAA;AACT;AAOO,SAAS,SAAA,CAAkC,IAAA,EAAc,EAAA,EAAgC,MAAA,GAAsBD,uBAAA,EAAO;AAC3H,EAAA,OAAO,UAAU,IAAA,KAAwB;AACvC,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,EAAA,CAAG,GAAG,IAAI,CAAA;AAAA,IACzB,SAAS,GAAA,EAAK;AACZ,MAAA,MAAA,CAAO,MAAM,GAAA,EAAK,EAAE,IAAA,EAAM,OAAA,EAAS,OAAO,CAAA;AAC1C,MAAA,MAAM,OAAO,KAAA,EAAM;AACnB,MAAA,MAAM,GAAA;AAAA,IACR;AAAA,EACF,CAAA;AACF","file":"node.cjs","sourcesContent":["import os from \"node:os\";\nimport { deBug, type DebugClient, type InitOptions } from \"./index\";\nimport { mergeContext, timezone, type ContextPatch } from \"./context\";\n\n/** Context for Node servers (TanStack Start server functions, Next API routes, Express ...). */\nexport function nodeContext(): ContextPatch {\n return {\n os: { name: os.platform(), version: os.release() },\n runtime: { name: \"node\", version: process.versions.node },\n device: { type: \"unknown\", memoryMb: Math.round(os.totalmem() / 1024 / 1024) },\n timezone: timezone(),\n };\n}\n\nexport interface NodeInitOptions extends InitOptions {\n /** Capture uncaught exceptions and unhandled rejections, then exit like Node would. Default true. */\n captureProcessErrors?: boolean;\n /** Max time to wait for a final flush before exiting on a fatal error. Default 2000ms. */\n shutdownTimeoutMs?: number;\n}\n\nlet installed = false;\n\n/** Initialise deBug on a Node server. */\nexport function initNode(options: NodeInitOptions, client: DebugClient = deBug): DebugClient {\n const { captureProcessErrors = true, shutdownTimeoutMs = 2000, ...rest } = options;\n client.init({ ...rest, captureGlobalErrors: false, context: mergeContext(nodeContext(), rest.context ?? {}) });\n if (!captureProcessErrors || installed) return client;\n installed = true;\n\n const flushThenExit = async (err: unknown) => {\n await Promise.race([client.flush(), new Promise((r) => setTimeout(r, shutdownTimeoutMs))]);\n console.error(err);\n process.exit(1);\n };\n // Adding these listeners disables Node's default crash, so we re-create it after flushing.\n process.on(\"uncaughtException\", (err) => {\n client.error(err, { handled: false, severity: \"critical\", tags: { source: \"uncaughtException\" } });\n void flushThenExit(err);\n });\n process.on(\"unhandledRejection\", (reason) => {\n client.error(reason, { handled: false, tags: { source: \"unhandledRejection\" } });\n if (process.listenerCount(\"unhandledRejection\") === 1) void flushThenExit(reason);\n });\n process.on(\"beforeExit\", () => void client.flush());\n return client;\n}\n\n/**\n * Wrap a server handler so any error it throws is reported (and re-thrown).\n * Good for TanStack Start server functions and route handlers:\n * .handler(withDebug(\"checkout.payment\", async ({ data }) => { ... }))\n */\nexport function withDebug<A extends unknown[], R>(flow: string, fn: (...args: A) => Promise<R>, client: DebugClient = deBug) {\n return async (...args: A): Promise<R> => {\n try {\n return await fn(...args);\n } catch (err) {\n client.error(err, { flow, handled: false });\n await client.flush();\n throw err;\n }\n };\n}\n\nexport * from \"./index\";\n"]}
@@ -0,0 +1,23 @@
1
+ export { deBug } from './index.cjs';
2
+ import { I as InitOptions, D as DebugClient, C as ContextPatch } from './client-drmb0n15.cjs';
3
+ export { E as EventMeta, Q as QueueStorage, S as SDK_NAME, a as SDK_VERSION, b as browserContext, m as mergeContext } from './client-drmb0n15.cjs';
4
+ export { Breadcrumb, EventInput, Severity, StackFrame, parseStack } from '@debugkit/schema/core';
5
+
6
+ /** Context for Node servers (TanStack Start server functions, Next API routes, Express ...). */
7
+ declare function nodeContext(): ContextPatch;
8
+ interface NodeInitOptions extends InitOptions {
9
+ /** Capture uncaught exceptions and unhandled rejections, then exit like Node would. Default true. */
10
+ captureProcessErrors?: boolean;
11
+ /** Max time to wait for a final flush before exiting on a fatal error. Default 2000ms. */
12
+ shutdownTimeoutMs?: number;
13
+ }
14
+ /** Initialise deBug on a Node server. */
15
+ declare function initNode(options: NodeInitOptions, client?: DebugClient): DebugClient;
16
+ /**
17
+ * Wrap a server handler so any error it throws is reported (and re-thrown).
18
+ * Good for TanStack Start server functions and route handlers:
19
+ * .handler(withDebug("checkout.payment", async ({ data }) => { ... }))
20
+ */
21
+ declare function withDebug<A extends unknown[], R>(flow: string, fn: (...args: A) => Promise<R>, client?: DebugClient): (...args: A) => Promise<R>;
22
+
23
+ export { ContextPatch, DebugClient, InitOptions, type NodeInitOptions, initNode, nodeContext, withDebug };
package/dist/node.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ export { deBug } from './index.js';
2
+ import { I as InitOptions, D as DebugClient, C as ContextPatch } from './client-drmb0n15.js';
3
+ export { E as EventMeta, Q as QueueStorage, S as SDK_NAME, a as SDK_VERSION, b as browserContext, m as mergeContext } from './client-drmb0n15.js';
4
+ export { Breadcrumb, EventInput, Severity, StackFrame, parseStack } from '@debugkit/schema/core';
5
+
6
+ /** Context for Node servers (TanStack Start server functions, Next API routes, Express ...). */
7
+ declare function nodeContext(): ContextPatch;
8
+ interface NodeInitOptions extends InitOptions {
9
+ /** Capture uncaught exceptions and unhandled rejections, then exit like Node would. Default true. */
10
+ captureProcessErrors?: boolean;
11
+ /** Max time to wait for a final flush before exiting on a fatal error. Default 2000ms. */
12
+ shutdownTimeoutMs?: number;
13
+ }
14
+ /** Initialise deBug on a Node server. */
15
+ declare function initNode(options: NodeInitOptions, client?: DebugClient): DebugClient;
16
+ /**
17
+ * Wrap a server handler so any error it throws is reported (and re-thrown).
18
+ * Good for TanStack Start server functions and route handlers:
19
+ * .handler(withDebug("checkout.payment", async ({ data }) => { ... }))
20
+ */
21
+ declare function withDebug<A extends unknown[], R>(flow: string, fn: (...args: A) => Promise<R>, client?: DebugClient): (...args: A) => Promise<R>;
22
+
23
+ export { ContextPatch, DebugClient, InitOptions, type NodeInitOptions, initNode, nodeContext, withDebug };
package/dist/node.js ADDED
@@ -0,0 +1,50 @@
1
+ import { deBug, timezone, mergeContext } from './chunk-VIJ5USKQ.js';
2
+ export { DebugClient, SDK_NAME, SDK_VERSION, browserContext, deBug, mergeContext, parseStack } from './chunk-VIJ5USKQ.js';
3
+ import os from 'os';
4
+
5
+ function nodeContext() {
6
+ return {
7
+ os: { name: os.platform(), version: os.release() },
8
+ runtime: { name: "node", version: process.versions.node },
9
+ device: { type: "unknown", memoryMb: Math.round(os.totalmem() / 1024 / 1024) },
10
+ timezone: timezone()
11
+ };
12
+ }
13
+ var installed = false;
14
+ function initNode(options, client = deBug) {
15
+ var _a;
16
+ const { captureProcessErrors = true, shutdownTimeoutMs = 2e3, ...rest } = options;
17
+ client.init({ ...rest, captureGlobalErrors: false, context: mergeContext(nodeContext(), (_a = rest.context) != null ? _a : {}) });
18
+ if (!captureProcessErrors || installed) return client;
19
+ installed = true;
20
+ const flushThenExit = async (err) => {
21
+ await Promise.race([client.flush(), new Promise((r) => setTimeout(r, shutdownTimeoutMs))]);
22
+ console.error(err);
23
+ process.exit(1);
24
+ };
25
+ process.on("uncaughtException", (err) => {
26
+ client.error(err, { handled: false, severity: "critical", tags: { source: "uncaughtException" } });
27
+ void flushThenExit(err);
28
+ });
29
+ process.on("unhandledRejection", (reason) => {
30
+ client.error(reason, { handled: false, tags: { source: "unhandledRejection" } });
31
+ if (process.listenerCount("unhandledRejection") === 1) void flushThenExit(reason);
32
+ });
33
+ process.on("beforeExit", () => void client.flush());
34
+ return client;
35
+ }
36
+ function withDebug(flow, fn, client = deBug) {
37
+ return async (...args) => {
38
+ try {
39
+ return await fn(...args);
40
+ } catch (err) {
41
+ client.error(err, { flow, handled: false });
42
+ await client.flush();
43
+ throw err;
44
+ }
45
+ };
46
+ }
47
+
48
+ export { initNode, nodeContext, withDebug };
49
+ //# sourceMappingURL=node.js.map
50
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/node.ts"],"names":[],"mappings":";;;;AAKO,SAAS,WAAA,GAA4B;AAC1C,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,EAAE,IAAA,EAAM,EAAA,CAAG,UAAS,EAAG,OAAA,EAAS,EAAA,CAAG,OAAA,EAAQ,EAAE;AAAA,IACjD,SAAS,EAAE,IAAA,EAAM,QAAQ,OAAA,EAAS,OAAA,CAAQ,SAAS,IAAA,EAAK;AAAA,IACxD,MAAA,EAAQ,EAAE,IAAA,EAAM,SAAA,EAAW,QAAA,EAAU,IAAA,CAAK,KAAA,CAAM,EAAA,CAAG,QAAA,EAAS,GAAI,IAAA,GAAO,IAAI,CAAA,EAAE;AAAA,IAC7E,UAAU,QAAA;AAAS,GACrB;AACF;AASA,IAAI,SAAA,GAAY,KAAA;AAGT,SAAS,QAAA,CAAS,OAAA,EAA0B,MAAA,GAAsB,KAAA,EAAoB;AAxB7F,EAAA,IAAA,EAAA;AAyBE,EAAA,MAAM,EAAE,oBAAA,GAAuB,IAAA,EAAM,oBAAoB,GAAA,EAAM,GAAG,MAAK,GAAI,OAAA;AAC3E,EAAA,MAAA,CAAO,KAAK,EAAE,GAAG,IAAA,EAAM,mBAAA,EAAqB,OAAO,OAAA,EAAS,YAAA,CAAa,WAAA,EAAY,EAAA,CAAG,UAAK,OAAA,KAAL,IAAA,GAAA,EAAA,GAAgB,EAAE,GAAG,CAAA;AAC7G,EAAA,IAAI,CAAC,oBAAA,IAAwB,SAAA,EAAW,OAAO,MAAA;AAC/C,EAAA,SAAA,GAAY,IAAA;AAEZ,EAAA,MA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ACZ,MAAA,MAAA,CAAO,MAAM,GAAA,EAAK,EAAE,IAAA,EAAM,OAAA,EAAS,OAAO,CAAA;AAC1C,MAAA,MAAM,OAAO,KAAA,EAAM;AACnB,MAAA,MAAM,GAAA;AAAA,IACR;AAAA,EACF,CAAA;AACF","file":"node.js","sourcesContent":["import os from \"node:os\";\nimport { deBug, type DebugClient, type InitOptions } from \"./index\";\nimport { mergeContext, timezone, type ContextPatch } from \"./context\";\n\n/** Context for Node servers (TanStack Start server functions, Next API routes, Express ...). */\nexport function nodeContext(): ContextPatch {\n return {\n os: { name: os.platform(), version: os.release() },\n runtime: { name: \"node\", version: process.versions.node },\n device: { type: \"unknown\", memoryMb: Math.round(os.totalmem() / 1024 / 1024) },\n timezone: timezone(),\n };\n}\n\nexport interface NodeInitOptions extends InitOptions {\n /** Capture uncaught exceptions and unhandled rejections, then exit like Node would. Default true. */\n captureProcessErrors?: boolean;\n /** Max time to wait for a final flush before exiting on a fatal error. Default 2000ms. */\n shutdownTimeoutMs?: number;\n}\n\nlet installed = false;\n\n/** Initialise deBug on a Node server. */\nexport function initNode(options: NodeInitOptions, client: DebugClient = deBug): DebugClient {\n const { captureProcessErrors = true, shutdownTimeoutMs = 2000, ...rest } = options;\n client.init({ ...rest, captureGlobalErrors: false, context: mergeContext(nodeContext(), rest.context ?? {}) });\n if (!captureProcessErrors || installed) return client;\n installed = true;\n\n const flushThenExit = async (err: unknown) => {\n await Promise.race([client.flush(), new Promise((r) => setTimeout(r, shutdownTimeoutMs))]);\n console.error(err);\n process.exit(1);\n };\n // Adding these listeners disables Node's default crash, so we re-create it after flushing.\n process.on(\"uncaughtException\", (err) => {\n client.error(err, { handled: false, severity: \"critical\", tags: { source: \"uncaughtException\" } });\n void flushThenExit(err);\n });\n process.on(\"unhandledRejection\", (reason) => {\n client.error(reason, { handled: false, tags: { source: \"unhandledRejection\" } });\n if (process.listenerCount(\"unhandledRejection\") === 1) void flushThenExit(reason);\n });\n process.on(\"beforeExit\", () => void client.flush());\n return client;\n}\n\n/**\n * Wrap a server handler so any error it throws is reported (and re-thrown).\n * Good for TanStack Start server functions and route handlers:\n * .handler(withDebug(\"checkout.payment\", async ({ data }) => { ... }))\n */\nexport function withDebug<A extends unknown[], R>(flow: string, fn: (...args: A) => Promise<R>, client: DebugClient = deBug) {\n return async (...args: A): Promise<R> => {\n try {\n return await fn(...args);\n } catch (err) {\n client.error(err, { flow, handled: false });\n await client.flush();\n throw err;\n }\n };\n}\n\nexport * from \"./index\";\n"]}
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ var chunkNSWUGBA2_cjs = require('./chunk-NSWUGBA2.cjs');
4
+ var chunkKUJ4EW3D_cjs = require('./chunk-KUJ4EW3D.cjs');
5
+ var chunkXEFWRCN4_cjs = require('./chunk-XEFWRCN4.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "initReactNative", {
10
+ enumerable: true,
11
+ get: function () { return chunkNSWUGBA2_cjs.initReactNative; }
12
+ });
13
+ Object.defineProperty(exports, "nativeContext", {
14
+ enumerable: true,
15
+ get: function () { return chunkNSWUGBA2_cjs.nativeContext; }
16
+ });
17
+ Object.defineProperty(exports, "trackReactNavigation", {
18
+ enumerable: true,
19
+ get: function () { return chunkNSWUGBA2_cjs.trackReactNavigation; }
20
+ });
21
+ Object.defineProperty(exports, "DebugErrorBoundary", {
22
+ enumerable: true,
23
+ get: function () { return chunkKUJ4EW3D_cjs.DebugErrorBoundary; }
24
+ });
25
+ Object.defineProperty(exports, "trackTanStackRouter", {
26
+ enumerable: true,
27
+ get: function () { return chunkKUJ4EW3D_cjs.trackTanStackRouter; }
28
+ });
29
+ Object.defineProperty(exports, "useDebugNavigation", {
30
+ enumerable: true,
31
+ get: function () { return chunkKUJ4EW3D_cjs.useDebugNavigation; }
32
+ });
33
+ Object.defineProperty(exports, "deBug", {
34
+ enumerable: true,
35
+ get: function () { return chunkXEFWRCN4_cjs.deBug; }
36
+ });
37
+ //# sourceMappingURL=react-native.cjs.map
38
+ //# sourceMappingURL=react-native.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"react-native.cjs"}
@@ -0,0 +1,51 @@
1
+ export { deBug } from './index.cjs';
2
+ import { I as InitOptions, D as DebugClient, C as ContextPatch } from './client-drmb0n15.cjs';
3
+ export { DebugErrorBoundary, DebugErrorBoundaryProps, trackTanStackRouter, useDebugNavigation } from './react.cjs';
4
+ import '@debugkit/schema/core';
5
+ import 'react';
6
+
7
+ /** The subset of react-native-device-info we read. Pass the module itself: `import DeviceInfo from "react-native-device-info"`. */
8
+ interface DeviceInfoModule {
9
+ getModel(): string;
10
+ getBrand(): string;
11
+ getVersion(): string;
12
+ getBuildNumber(): string;
13
+ isTablet(): boolean;
14
+ getManufacturerSync?(): string;
15
+ isEmulatorSync?(): boolean;
16
+ getTotalMemorySync?(): number;
17
+ }
18
+ /**
19
+ * Context for bare React Native. Reads what `react-native` exposes on its own; pass
20
+ * react-native-device-info for model, app version and memory on both platforms.
21
+ */
22
+ declare function nativeContext(opts?: {
23
+ deviceInfo?: DeviceInfoModule;
24
+ }): ContextPatch;
25
+ interface ReactNativeInitOptions extends InitOptions {
26
+ deviceInfo?: DeviceInfoModule;
27
+ /**
28
+ * Report unhandled promise rejections (Hermes). Default "production": in development React
29
+ * Native's own yellow-box warning keeps working. `true` captures in development too.
30
+ */
31
+ captureUnhandledRejections?: boolean | "production";
32
+ }
33
+ /** Initialise deBug in a React Native app (bare or Expo). Fills in device context and flushes when the app is backgrounded. */
34
+ declare function initReactNative(options: ReactNativeInitOptions, client?: DebugClient): DebugClient;
35
+ /** Minimal shape of a React Navigation container ref. */
36
+ interface NavigationRefLike {
37
+ getCurrentRoute(): {
38
+ name: string;
39
+ } | undefined;
40
+ }
41
+ /**
42
+ * Breadcrumbs for React Navigation. Spread the result onto your container:
43
+ * const nav = useNavigationContainerRef();
44
+ * <NavigationContainer ref={nav} {...trackReactNavigation(nav)}>
45
+ */
46
+ declare function trackReactNavigation(ref: NavigationRefLike, client?: DebugClient): {
47
+ onReady: () => void;
48
+ onStateChange: () => void;
49
+ };
50
+
51
+ export { type DeviceInfoModule, type ReactNativeInitOptions, initReactNative, nativeContext, trackReactNavigation };
@@ -0,0 +1,51 @@
1
+ export { deBug } from './index.js';
2
+ import { I as InitOptions, D as DebugClient, C as ContextPatch } from './client-drmb0n15.js';
3
+ export { DebugErrorBoundary, DebugErrorBoundaryProps, trackTanStackRouter, useDebugNavigation } from './react.js';
4
+ import '@debugkit/schema/core';
5
+ import 'react';
6
+
7
+ /** The subset of react-native-device-info we read. Pass the module itself: `import DeviceInfo from "react-native-device-info"`. */
8
+ interface DeviceInfoModule {
9
+ getModel(): string;
10
+ getBrand(): string;
11
+ getVersion(): string;
12
+ getBuildNumber(): string;
13
+ isTablet(): boolean;
14
+ getManufacturerSync?(): string;
15
+ isEmulatorSync?(): boolean;
16
+ getTotalMemorySync?(): number;
17
+ }
18
+ /**
19
+ * Context for bare React Native. Reads what `react-native` exposes on its own; pass
20
+ * react-native-device-info for model, app version and memory on both platforms.
21
+ */
22
+ declare function nativeContext(opts?: {
23
+ deviceInfo?: DeviceInfoModule;
24
+ }): ContextPatch;
25
+ interface ReactNativeInitOptions extends InitOptions {
26
+ deviceInfo?: DeviceInfoModule;
27
+ /**
28
+ * Report unhandled promise rejections (Hermes). Default "production": in development React
29
+ * Native's own yellow-box warning keeps working. `true` captures in development too.
30
+ */
31
+ captureUnhandledRejections?: boolean | "production";
32
+ }
33
+ /** Initialise deBug in a React Native app (bare or Expo). Fills in device context and flushes when the app is backgrounded. */
34
+ declare function initReactNative(options: ReactNativeInitOptions, client?: DebugClient): DebugClient;
35
+ /** Minimal shape of a React Navigation container ref. */
36
+ interface NavigationRefLike {
37
+ getCurrentRoute(): {
38
+ name: string;
39
+ } | undefined;
40
+ }
41
+ /**
42
+ * Breadcrumbs for React Navigation. Spread the result onto your container:
43
+ * const nav = useNavigationContainerRef();
44
+ * <NavigationContainer ref={nav} {...trackReactNavigation(nav)}>
45
+ */
46
+ declare function trackReactNavigation(ref: NavigationRefLike, client?: DebugClient): {
47
+ onReady: () => void;
48
+ onStateChange: () => void;
49
+ };
50
+
51
+ export { type DeviceInfoModule, type ReactNativeInitOptions, initReactNative, nativeContext, trackReactNavigation };
@@ -0,0 +1,5 @@
1
+ export { initReactNative, nativeContext, trackReactNavigation } from './chunk-BD2FNVCP.js';
2
+ export { DebugErrorBoundary, trackTanStackRouter, useDebugNavigation } from './chunk-3UN5VMQU.js';
3
+ export { deBug } from './chunk-VIJ5USKQ.js';
4
+ //# sourceMappingURL=react-native.js.map
5
+ //# sourceMappingURL=react-native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"react-native.js"}