@error-explorer/vue 1.1.1 → 1.2.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.
- package/dist/index.cjs +155 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +155 -133
- package/dist/index.js.map +1 -1
- package/dist/router.d.cts +1 -1
- package/dist/router.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,141 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var browser = require('@error-explorer/browser');
|
|
6
6
|
var vue = require('vue');
|
|
7
7
|
|
|
8
|
+
// src/plugin.ts
|
|
9
|
+
function defaultGetRouteName(route) {
|
|
10
|
+
if (route.name && typeof route.name === "string") {
|
|
11
|
+
return route.name;
|
|
12
|
+
}
|
|
13
|
+
return route.path || "/";
|
|
14
|
+
}
|
|
15
|
+
function buildRouteData(route, options) {
|
|
16
|
+
const data = {
|
|
17
|
+
path: route.path,
|
|
18
|
+
name: route.name,
|
|
19
|
+
fullPath: route.fullPath
|
|
20
|
+
};
|
|
21
|
+
if (options.trackParams && Object.keys(route.params).length > 0) {
|
|
22
|
+
data.params = { ...route.params };
|
|
23
|
+
}
|
|
24
|
+
if (options.trackQuery && Object.keys(route.query).length > 0) {
|
|
25
|
+
data.query = { ...route.query };
|
|
26
|
+
}
|
|
27
|
+
if (route.meta && Object.keys(route.meta).length > 0) {
|
|
28
|
+
const safeMeta = {};
|
|
29
|
+
for (const [key, value] of Object.entries(route.meta)) {
|
|
30
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
31
|
+
safeMeta[key] = value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (Object.keys(safeMeta).length > 0) {
|
|
35
|
+
data.meta = safeMeta;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
function setupRouterIntegration(router, options = {}) {
|
|
41
|
+
if (options.trackNavigation === false) {
|
|
42
|
+
return () => {
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const getRouteName = options.getRouteName || defaultGetRouteName;
|
|
46
|
+
let navigationStartTime = null;
|
|
47
|
+
const beforeEachGuard = router.beforeEach((to, from) => {
|
|
48
|
+
navigationStartTime = performance.now();
|
|
49
|
+
if (from.name || from.path !== "/") {
|
|
50
|
+
const shouldAdd = options.beforeNavigationBreadcrumb ? options.beforeNavigationBreadcrumb(from, to) : true;
|
|
51
|
+
if (shouldAdd) {
|
|
52
|
+
browser.ErrorExplorer.addBreadcrumb({
|
|
53
|
+
type: "navigation",
|
|
54
|
+
category: "router",
|
|
55
|
+
message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,
|
|
56
|
+
level: "info",
|
|
57
|
+
data: {
|
|
58
|
+
from: buildRouteData(from, options),
|
|
59
|
+
to: buildRouteData(to, options)
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
});
|
|
66
|
+
const afterEachGuard = router.afterEach((to, from, failure) => {
|
|
67
|
+
const duration = navigationStartTime ? performance.now() - navigationStartTime : void 0;
|
|
68
|
+
navigationStartTime = null;
|
|
69
|
+
if (failure) {
|
|
70
|
+
browser.ErrorExplorer.addBreadcrumb({
|
|
71
|
+
type: "navigation",
|
|
72
|
+
category: "router.error",
|
|
73
|
+
message: `Navigation failed to ${getRouteName(to)}`,
|
|
74
|
+
level: "error",
|
|
75
|
+
data: {
|
|
76
|
+
to: buildRouteData(to, options),
|
|
77
|
+
error: failure.message,
|
|
78
|
+
type: failure.type,
|
|
79
|
+
duration
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
if (failure.type !== 4) {
|
|
83
|
+
browser.ErrorExplorer.captureException(failure, {
|
|
84
|
+
tags: {
|
|
85
|
+
"router.error": "navigation_failure",
|
|
86
|
+
"router.to": getRouteName(to)
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
browser.ErrorExplorer.addBreadcrumb({
|
|
92
|
+
type: "navigation",
|
|
93
|
+
category: "router",
|
|
94
|
+
message: `Navigated to ${getRouteName(to)}`,
|
|
95
|
+
level: "info",
|
|
96
|
+
data: {
|
|
97
|
+
route: buildRouteData(to, options),
|
|
98
|
+
duration
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const errorHandler = router.onError((error) => {
|
|
104
|
+
browser.ErrorExplorer.addBreadcrumb({
|
|
105
|
+
type: "error",
|
|
106
|
+
category: "router.error",
|
|
107
|
+
message: error.message,
|
|
108
|
+
level: "error"
|
|
109
|
+
});
|
|
110
|
+
browser.ErrorExplorer.captureException(error, {
|
|
111
|
+
tags: {
|
|
112
|
+
"router.error": "unhandled"
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
return () => {
|
|
117
|
+
beforeEachGuard();
|
|
118
|
+
afterEachGuard();
|
|
119
|
+
errorHandler();
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function createRouterIntegration(options = {}) {
|
|
123
|
+
let cleanup = null;
|
|
124
|
+
return {
|
|
125
|
+
/**
|
|
126
|
+
* Install the router integration
|
|
127
|
+
*/
|
|
128
|
+
install(router) {
|
|
129
|
+
cleanup = setupRouterIntegration(router, options);
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* Uninstall the router integration
|
|
133
|
+
*/
|
|
134
|
+
uninstall() {
|
|
135
|
+
if (cleanup) {
|
|
136
|
+
cleanup();
|
|
137
|
+
cleanup = null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
8
143
|
// src/plugin.ts
|
|
9
144
|
function getComponentName(instance) {
|
|
10
145
|
if (!instance) return void 0;
|
|
@@ -158,6 +293,21 @@ function setupWarnHandler(app, options) {
|
|
|
158
293
|
}
|
|
159
294
|
};
|
|
160
295
|
}
|
|
296
|
+
var routerCleanup = null;
|
|
297
|
+
function setupRouter(options) {
|
|
298
|
+
if (options.router === false || options.router === void 0) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
let router;
|
|
302
|
+
let routerOptions = {};
|
|
303
|
+
if ("instance" in options.router) {
|
|
304
|
+
router = options.router.instance;
|
|
305
|
+
routerOptions = options.router.options || {};
|
|
306
|
+
} else {
|
|
307
|
+
router = options.router;
|
|
308
|
+
}
|
|
309
|
+
routerCleanup = setupRouterIntegration(router, routerOptions);
|
|
310
|
+
}
|
|
161
311
|
function restoreHandlers(app) {
|
|
162
312
|
if (originalErrorHandler !== void 0) {
|
|
163
313
|
app.config.errorHandler = originalErrorHandler;
|
|
@@ -167,6 +317,10 @@ function restoreHandlers(app) {
|
|
|
167
317
|
app.config.warnHandler = originalWarnHandler;
|
|
168
318
|
originalWarnHandler = void 0;
|
|
169
319
|
}
|
|
320
|
+
if (routerCleanup) {
|
|
321
|
+
routerCleanup();
|
|
322
|
+
routerCleanup = null;
|
|
323
|
+
}
|
|
170
324
|
}
|
|
171
325
|
function createErrorExplorerPlugin(options = {}) {
|
|
172
326
|
return {
|
|
@@ -176,6 +330,7 @@ function createErrorExplorerPlugin(options = {}) {
|
|
|
176
330
|
}
|
|
177
331
|
setupErrorHandler(app, options);
|
|
178
332
|
setupWarnHandler(app, options);
|
|
333
|
+
setupRouter(options);
|
|
179
334
|
app.provide("errorExplorer", browser.ErrorExplorer);
|
|
180
335
|
app.config.globalProperties.$errorExplorer = browser.ErrorExplorer;
|
|
181
336
|
browser.ErrorExplorer.addBreadcrumb({
|
|
@@ -187,139 +342,6 @@ function createErrorExplorerPlugin(options = {}) {
|
|
|
187
342
|
}
|
|
188
343
|
};
|
|
189
344
|
}
|
|
190
|
-
function defaultGetRouteName(route) {
|
|
191
|
-
if (route.name && typeof route.name === "string") {
|
|
192
|
-
return route.name;
|
|
193
|
-
}
|
|
194
|
-
return route.path || "/";
|
|
195
|
-
}
|
|
196
|
-
function buildRouteData(route, options) {
|
|
197
|
-
const data = {
|
|
198
|
-
path: route.path,
|
|
199
|
-
name: route.name,
|
|
200
|
-
fullPath: route.fullPath
|
|
201
|
-
};
|
|
202
|
-
if (options.trackParams && Object.keys(route.params).length > 0) {
|
|
203
|
-
data.params = { ...route.params };
|
|
204
|
-
}
|
|
205
|
-
if (options.trackQuery && Object.keys(route.query).length > 0) {
|
|
206
|
-
data.query = { ...route.query };
|
|
207
|
-
}
|
|
208
|
-
if (route.meta && Object.keys(route.meta).length > 0) {
|
|
209
|
-
const safeMeta = {};
|
|
210
|
-
for (const [key, value] of Object.entries(route.meta)) {
|
|
211
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
212
|
-
safeMeta[key] = value;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (Object.keys(safeMeta).length > 0) {
|
|
216
|
-
data.meta = safeMeta;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return data;
|
|
220
|
-
}
|
|
221
|
-
function setupRouterIntegration(router, options = {}) {
|
|
222
|
-
if (options.trackNavigation === false) {
|
|
223
|
-
return () => {
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
const getRouteName = options.getRouteName || defaultGetRouteName;
|
|
227
|
-
let navigationStartTime = null;
|
|
228
|
-
const beforeEachGuard = router.beforeEach((to, from) => {
|
|
229
|
-
navigationStartTime = performance.now();
|
|
230
|
-
if (from.name || from.path !== "/") {
|
|
231
|
-
const shouldAdd = options.beforeNavigationBreadcrumb ? options.beforeNavigationBreadcrumb(from, to) : true;
|
|
232
|
-
if (shouldAdd) {
|
|
233
|
-
browser.ErrorExplorer.addBreadcrumb({
|
|
234
|
-
type: "navigation",
|
|
235
|
-
category: "router",
|
|
236
|
-
message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,
|
|
237
|
-
level: "info",
|
|
238
|
-
data: {
|
|
239
|
-
from: buildRouteData(from, options),
|
|
240
|
-
to: buildRouteData(to, options)
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return true;
|
|
246
|
-
});
|
|
247
|
-
const afterEachGuard = router.afterEach((to, from, failure) => {
|
|
248
|
-
const duration = navigationStartTime ? performance.now() - navigationStartTime : void 0;
|
|
249
|
-
navigationStartTime = null;
|
|
250
|
-
if (failure) {
|
|
251
|
-
browser.ErrorExplorer.addBreadcrumb({
|
|
252
|
-
type: "navigation",
|
|
253
|
-
category: "router.error",
|
|
254
|
-
message: `Navigation failed to ${getRouteName(to)}`,
|
|
255
|
-
level: "error",
|
|
256
|
-
data: {
|
|
257
|
-
to: buildRouteData(to, options),
|
|
258
|
-
error: failure.message,
|
|
259
|
-
type: failure.type,
|
|
260
|
-
duration
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
if (failure.type !== 4) {
|
|
264
|
-
browser.ErrorExplorer.captureException(failure, {
|
|
265
|
-
tags: {
|
|
266
|
-
"router.error": "navigation_failure",
|
|
267
|
-
"router.to": getRouteName(to)
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
} else {
|
|
272
|
-
browser.ErrorExplorer.addBreadcrumb({
|
|
273
|
-
type: "navigation",
|
|
274
|
-
category: "router",
|
|
275
|
-
message: `Navigated to ${getRouteName(to)}`,
|
|
276
|
-
level: "info",
|
|
277
|
-
data: {
|
|
278
|
-
route: buildRouteData(to, options),
|
|
279
|
-
duration
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
const errorHandler = router.onError((error) => {
|
|
285
|
-
browser.ErrorExplorer.addBreadcrumb({
|
|
286
|
-
type: "error",
|
|
287
|
-
category: "router.error",
|
|
288
|
-
message: error.message,
|
|
289
|
-
level: "error"
|
|
290
|
-
});
|
|
291
|
-
browser.ErrorExplorer.captureException(error, {
|
|
292
|
-
tags: {
|
|
293
|
-
"router.error": "unhandled"
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
return () => {
|
|
298
|
-
beforeEachGuard();
|
|
299
|
-
afterEachGuard();
|
|
300
|
-
errorHandler();
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function createRouterIntegration(options = {}) {
|
|
304
|
-
let cleanup = null;
|
|
305
|
-
return {
|
|
306
|
-
/**
|
|
307
|
-
* Install the router integration
|
|
308
|
-
*/
|
|
309
|
-
install(router) {
|
|
310
|
-
cleanup = setupRouterIntegration(router, options);
|
|
311
|
-
},
|
|
312
|
-
/**
|
|
313
|
-
* Uninstall the router integration
|
|
314
|
-
*/
|
|
315
|
-
uninstall() {
|
|
316
|
-
if (cleanup) {
|
|
317
|
-
cleanup();
|
|
318
|
-
cleanup = null;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
345
|
var ErrorBoundary = vue.defineComponent({
|
|
324
346
|
name: "ErrorBoundary",
|
|
325
347
|
props: {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts","../src/router.ts","../src/ErrorBoundary.ts","../src/composables.ts","../src/index.ts"],"names":["error","ErrorExplorer","defineComponent","ref","onErrorCaptured","h","inject","getCurrentInstance","onMounted","onUnmounted"],"mappings":";;;;;;;;AAWA,SAAS,iBAAiB,QAAA,EAA8D;AACtF,EAAA,IAAI,CAAC,UAAU,OAAO,MAAA;AAEtB,EAAA,MAAM,OAAA,GAAU,SAAS,CAAA,CAAE,IAAA;AAE3B,EAAA,OAAO,QAAQ,IAAA,IAAQ,OAAA,CAAQ,MAAA,IAAU,mBAAA,CAAoB,QAAQ,MAAM,CAAA;AAC7E;AAKA,SAAS,oBAAoB,IAAA,EAAmC;AAC9D,EAAA,IAAI,CAAC,MAAM,OAAO,MAAA;AAElB,EA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AAA,IAChE,SAAA,EAAW,MAAMA,qBAAAA,CAAc,SAAA;AAAU,GAC3C;AACF;AC3QA,IAAO,WAAA,GAAQ","file":"index.cjs","sourcesContent":["/**\n * Vue Plugin for Error Explorer\n */\n\nimport type { App, ComponentPublicInstance, Plugin } from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { VueErrorExplorerOptions, VueComponentContext } from './types';\n\n/**\n * Get component name from instance\n */\nfunction getComponentName(instance: ComponentPublicInstance | null): string | undefined {\n if (!instance) return undefined;\n\n const options = instance.$.type as { name?: string; __name?: string; __file?: string };\n\n return options.name || options.__name || extractNameFromFile(options.__file);\n}\n\n/**\n * Extract component name from file path\n */\nfunction extractNameFromFile(file?: string): string | undefined {\n if (!file) return undefined;\n\n const match = file.match(/([^/\\\\]+)\\.vue$/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Get component trace (parent hierarchy)\n */\nfunction getComponentTrace(instance: ComponentPublicInstance | null): string[] {\n const trace: string[] = [];\n let current = instance;\n\n while (current) {\n const name = getComponentName(current);\n if (name) {\n trace.push(name);\n }\n current = current.$.parent?.proxy ?? null;\n }\n\n return trace;\n}\n\n/**\n * Serialize component props with depth limit\n */\nfunction serializeProps(\n props: Record<string, unknown>,\n maxDepth: number\n): Record<string, unknown> {\n const serialize = (value: unknown, depth: number): unknown => {\n if (depth > maxDepth) {\n return '[Max depth reached]';\n }\n\n if (value === null || value === undefined) {\n return value;\n }\n\n if (typeof value === 'function') {\n return '[Function]';\n }\n\n if (typeof value === 'symbol') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (value instanceof Error) {\n return { name: value.name, message: value.message };\n }\n\n if (Array.isArray(value)) {\n return value.slice(0, 10).map(item => serialize(item, depth + 1));\n }\n\n if (typeof value === 'object') {\n const serialized: Record<string, unknown> = {};\n const keys = Object.keys(value as Record<string, unknown>).slice(0, 20);\n\n for (const key of keys) {\n serialized[key] = serialize((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return serialized;\n }\n\n return value;\n };\n\n return serialize(props, 0) as Record<string, unknown>;\n}\n\n/**\n * Build Vue component context\n */\nfunction buildVueContext(\n instance: ComponentPublicInstance | null,\n info: string,\n options: VueErrorExplorerOptions\n): VueComponentContext {\n const context: VueComponentContext = {\n info,\n };\n\n if (options.captureComponentName !== false && instance) {\n context.name = getComponentName(instance);\n\n const type = instance.$.type as { __file?: string };\n if (type.__file) {\n context.file = type.__file;\n }\n\n context.trace = getComponentTrace(instance);\n }\n\n if (options.captureComponentProps && instance) {\n const props = instance.$.props;\n if (props && Object.keys(props).length > 0) {\n context.props = serializeProps(props, options.propsDepth ?? 2);\n }\n }\n\n return context;\n}\n\n/**\n * Original handlers storage\n */\nlet originalErrorHandler: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => void) | undefined;\nlet originalWarnHandler: ((msg: string, instance: ComponentPublicInstance | null, trace: string) => void) | undefined;\n\n/**\n * Setup Vue error handler\n */\nfunction setupErrorHandler(app: App, options: VueErrorExplorerOptions): void {\n if (options.vueErrorHandler === false) {\n return;\n }\n\n // Save original handler\n originalErrorHandler = app.config.errorHandler;\n\n app.config.errorHandler = (err: unknown, instance: ComponentPublicInstance | null, info: string) => {\n // Check if we should capture\n if (options.beforeVueCapture) {\n const error = err instanceof Error ? err : new Error(String(err));\n if (!options.beforeVueCapture(error, instance, info)) {\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n return;\n }\n }\n\n // Build Vue context\n const vueContext = buildVueContext(instance, info, options);\n\n // Add breadcrumb for the error\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.error',\n message: err instanceof Error ? err.message : String(err),\n level: 'error',\n data: {\n component: vueContext.name,\n info: vueContext.info,\n },\n });\n\n // Capture the error\n const error = err instanceof Error ? err : new Error(String(err));\n ErrorExplorer.captureException(error, {\n tags: {\n 'vue.component': vueContext.name || 'unknown',\n 'vue.info': info,\n },\n extra: {\n vue: vueContext,\n },\n });\n\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n\n // Re-throw in development for better DX\n if (options.environment === 'development' || import.meta.env?.DEV) {\n console.error('[Vue Error]', err);\n }\n };\n}\n\n/**\n * Setup Vue warning handler\n */\nfunction setupWarnHandler(app: App, options: VueErrorExplorerOptions): void {\n // Default: only in development\n const enableWarn = options.vueWarnHandler ?? (\n options.environment === 'development' || import.meta.env?.DEV\n );\n\n if (!enableWarn) {\n return;\n }\n\n // Save original handler\n originalWarnHandler = app.config.warnHandler;\n\n app.config.warnHandler = (msg: string, instance: ComponentPublicInstance | null, trace: string) => {\n const componentName = getComponentName(instance);\n\n // Add breadcrumb for the warning\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.warn',\n message: msg,\n level: 'warning',\n data: {\n component: componentName,\n trace: trace.split('\\n').slice(0, 5),\n },\n });\n\n // Call original handler if exists\n if (originalWarnHandler) {\n originalWarnHandler(msg, instance, trace);\n }\n\n // Log to console in development\n if (import.meta.env?.DEV) {\n console.warn('[Vue Warn]', msg);\n if (trace) {\n console.warn(trace);\n }\n }\n };\n}\n\n/**\n * Restore original handlers\n */\nexport function restoreHandlers(app: App): void {\n if (originalErrorHandler !== undefined) {\n app.config.errorHandler = originalErrorHandler;\n originalErrorHandler = undefined;\n }\n\n if (originalWarnHandler !== undefined) {\n app.config.warnHandler = originalWarnHandler;\n originalWarnHandler = undefined;\n }\n}\n\n/**\n * Create Vue plugin for Error Explorer\n */\nexport function createErrorExplorerPlugin(options: VueErrorExplorerOptions = {} as VueErrorExplorerOptions): Plugin {\n return {\n install(app: App) {\n // Initialize Error Explorer if not already done\n if (!ErrorExplorer.isInitialized()) {\n ErrorExplorer.init(options);\n }\n\n // Setup handlers\n setupErrorHandler(app, options);\n setupWarnHandler(app, options);\n\n // Provide Error Explorer instance globally\n app.provide('errorExplorer', ErrorExplorer);\n\n // Add global property for Options API access\n app.config.globalProperties.$errorExplorer = ErrorExplorer;\n\n // Add breadcrumb for app mount\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'vue.lifecycle',\n message: 'Vue app mounted',\n level: 'info',\n });\n },\n };\n}\n\n// Declare module augmentation for global properties\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $errorExplorer: typeof ErrorExplorer;\n }\n}\n","/**\n * Vue Router integration for Error Explorer\n * Adds navigation breadcrumbs automatically\n */\n\nimport type { Router, RouteLocationNormalized } from 'vue-router';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * Router integration options\n */\nexport interface RouterIntegrationOptions {\n /**\n * Track route changes as breadcrumbs\n * @default true\n */\n trackNavigation?: boolean;\n\n /**\n * Track route params in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackParams?: boolean;\n\n /**\n * Track query parameters in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackQuery?: boolean;\n\n /**\n * Custom function to extract route name for breadcrumb\n */\n getRouteName?: (route: RouteLocationNormalized) => string;\n\n /**\n * Hook called before adding navigation breadcrumb\n * Return false to skip the breadcrumb\n */\n beforeNavigationBreadcrumb?: (\n from: RouteLocationNormalized,\n to: RouteLocationNormalized\n ) => boolean;\n}\n\n/**\n * Default route name extractor\n */\nfunction defaultGetRouteName(route: RouteLocationNormalized): string {\n if (route.name && typeof route.name === 'string') {\n return route.name;\n }\n\n // Use path as fallback\n return route.path || '/';\n}\n\n/**\n * Build route data for breadcrumb\n */\nfunction buildRouteData(\n route: RouteLocationNormalized,\n options: RouterIntegrationOptions\n): Record<string, unknown> {\n const data: Record<string, unknown> = {\n path: route.path,\n name: route.name,\n fullPath: route.fullPath,\n };\n\n if (options.trackParams && Object.keys(route.params).length > 0) {\n data.params = { ...route.params };\n }\n\n if (options.trackQuery && Object.keys(route.query).length > 0) {\n data.query = { ...route.query };\n }\n\n if (route.meta && Object.keys(route.meta).length > 0) {\n // Only include safe meta properties\n const safeMeta: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(route.meta)) {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n safeMeta[key] = value;\n }\n }\n if (Object.keys(safeMeta).length > 0) {\n data.meta = safeMeta;\n }\n }\n\n return data;\n}\n\n/**\n * Setup Vue Router integration\n */\nexport function setupRouterIntegration(\n router: Router,\n options: RouterIntegrationOptions = {}\n): () => void {\n if (options.trackNavigation === false) {\n return () => {};\n }\n\n const getRouteName = options.getRouteName || defaultGetRouteName;\n\n // Track navigation start time\n let navigationStartTime: number | null = null;\n\n // Before each navigation\n const beforeEachGuard = router.beforeEach((to, from) => {\n navigationStartTime = performance.now();\n\n // Add breadcrumb for navigation start\n if (from.name || from.path !== '/') {\n const shouldAdd = options.beforeNavigationBreadcrumb\n ? options.beforeNavigationBreadcrumb(from, to)\n : true;\n\n if (shouldAdd) {\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,\n level: 'info',\n data: {\n from: buildRouteData(from, options),\n to: buildRouteData(to, options),\n },\n });\n }\n }\n\n return true;\n });\n\n // After each navigation\n const afterEachGuard = router.afterEach((to, from, failure) => {\n const duration = navigationStartTime ? performance.now() - navigationStartTime : undefined;\n navigationStartTime = null;\n\n if (failure) {\n // Navigation failed\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router.error',\n message: `Navigation failed to ${getRouteName(to)}`,\n level: 'error',\n data: {\n to: buildRouteData(to, options),\n error: failure.message,\n type: failure.type,\n duration,\n },\n });\n\n // Capture as exception if it's a real error\n if (failure.type !== 4) { // Not aborted\n ErrorExplorer.captureException(failure, {\n tags: {\n 'router.error': 'navigation_failure',\n 'router.to': getRouteName(to),\n },\n });\n }\n } else {\n // Navigation succeeded\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigated to ${getRouteName(to)}`,\n level: 'info',\n data: {\n route: buildRouteData(to, options),\n duration,\n },\n });\n }\n });\n\n // Handle router errors\n const errorHandler = router.onError((error) => {\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'router.error',\n message: error.message,\n level: 'error',\n });\n\n ErrorExplorer.captureException(error, {\n tags: {\n 'router.error': 'unhandled',\n },\n });\n });\n\n // Return cleanup function\n return () => {\n beforeEachGuard();\n afterEachGuard();\n errorHandler();\n };\n}\n\n/**\n * Create a Vue Router plugin that integrates with Error Explorer\n */\nexport function createRouterIntegration(options: RouterIntegrationOptions = {}) {\n let cleanup: (() => void) | null = null;\n\n return {\n /**\n * Install the router integration\n */\n install(router: Router): void {\n cleanup = setupRouterIntegration(router, options);\n },\n\n /**\n * Uninstall the router integration\n */\n uninstall(): void {\n if (cleanup) {\n cleanup();\n cleanup = null;\n }\n },\n };\n}\n\nexport type { Router, RouteLocationNormalized };\n","/**\n * ErrorBoundary component for Vue 3\n * Catches errors in child components and reports them to Error Explorer\n */\n\nimport {\n defineComponent,\n h,\n ref,\n onErrorCaptured,\n type PropType,\n type VNode,\n type Slot,\n} from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * ErrorBoundary component\n *\n * Usage:\n * ```vue\n * <ErrorBoundary @error=\"handleError\" :fallback=\"ErrorFallback\">\n * <MyComponent />\n * </ErrorBoundary>\n * ```\n *\n * Or with scoped slot for fallback:\n * ```vue\n * <ErrorBoundary>\n * <template #default>\n * <MyComponent />\n * </template>\n * <template #fallback=\"{ error, reset }\">\n * <div>\n * <p>Error: {{ error.message }}</p>\n * <button @click=\"reset\">Retry</button>\n * </div>\n * </template>\n * </ErrorBoundary>\n * ```\n */\nexport const ErrorBoundary = defineComponent({\n name: 'ErrorBoundary',\n\n props: {\n /**\n * Whether to capture the error to Error Explorer\n */\n capture: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional tags to add when capturing\n */\n tags: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n\n /**\n * Additional context to add when capturing\n */\n context: {\n type: Object as PropType<Record<string, unknown>>,\n default: () => ({}),\n },\n\n /**\n * Fallback component to render when an error occurs\n */\n fallback: {\n type: [Object, Function, null] as PropType<VNode | (() => VNode) | null>,\n default: null,\n },\n\n /**\n * Whether to stop error propagation\n */\n stopPropagation: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: {\n /**\n * Emitted when an error is caught\n */\n error: (error: Error, info: string) => true,\n\n /**\n * Emitted when the error state is reset\n */\n reset: () => true,\n },\n\n setup(props, { slots, emit, expose }) {\n const error = ref<Error | null>(null);\n const errorInfo = ref<string>('');\n\n /**\n * Reset the error state\n */\n const reset = () => {\n error.value = null;\n errorInfo.value = '';\n emit('reset');\n };\n\n // Capture errors from child components\n onErrorCaptured((err: unknown, instance, info: string) => {\n const capturedError = err instanceof Error ? err : new Error(String(err));\n\n error.value = capturedError;\n errorInfo.value = info;\n\n // Emit error event\n emit('error', capturedError, info);\n\n // Add breadcrumb\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.errorBoundary',\n message: capturedError.message,\n level: 'error',\n data: {\n info,\n component: instance?.$.type\n ? (instance.$.type as { name?: string }).name\n : undefined,\n },\n });\n\n // Capture to Error Explorer if enabled\n if (props.capture) {\n ErrorExplorer.captureException(capturedError, {\n tags: {\n 'errorBoundary': 'true',\n 'vue.info': info,\n ...props.tags,\n },\n extra: {\n errorBoundary: {\n info,\n context: props.context,\n },\n },\n });\n }\n\n // Return true to stop propagation, false to continue\n return props.stopPropagation;\n });\n\n // Expose methods and state\n expose({\n reset,\n error,\n });\n\n return () => {\n // If there's an error, render fallback\n if (error.value) {\n // Check for fallback slot\n if (slots.fallback) {\n return slots.fallback({\n error: error.value,\n info: errorInfo.value,\n reset,\n });\n }\n\n // Check for fallback prop\n if (props.fallback) {\n if (typeof props.fallback === 'function') {\n return props.fallback();\n }\n return props.fallback;\n }\n\n // Default fallback\n return h('div', { class: 'error-boundary-fallback' }, [\n h('p', { style: 'color: red;' }, `Error: ${error.value.message}`),\n h(\n 'button',\n {\n onClick: reset,\n style: 'margin-top: 8px; padding: 4px 12px; cursor: pointer;',\n },\n 'Try Again'\n ),\n ]);\n }\n\n // No error, render default slot\n return slots.default?.();\n };\n },\n});\n\n/**\n * Higher-order component to wrap a component with ErrorBoundary\n */\nexport function withErrorBoundary<T extends { new (): any }>(\n Component: T,\n options: {\n capture?: boolean;\n tags?: Record<string, string>;\n context?: Record<string, unknown>;\n fallback?: VNode | (() => VNode);\n onError?: (error: Error, info: string) => void;\n } = {}\n) {\n return defineComponent({\n name: `WithErrorBoundary(${(Component as any).name || 'Component'})`,\n\n setup(_, { attrs, slots }) {\n return () =>\n h(\n ErrorBoundary,\n {\n capture: options.capture ?? true,\n tags: options.tags ?? {},\n context: options.context ?? {},\n fallback: options.fallback ?? null,\n onError: options.onError,\n },\n {\n default: () => h(Component as any, attrs, slots),\n }\n );\n },\n });\n}\n\nexport type ErrorBoundaryInstance = InstanceType<typeof ErrorBoundary>;\n","/**\n * Vue 3 Composables for Error Explorer\n */\n\nimport { inject, onMounted, onUnmounted, getCurrentInstance } from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { Breadcrumb, CaptureContext, UserContext } from '@error-explorer/browser';\n\n/**\n * Injection key for Error Explorer\n */\nexport const ErrorExplorerKey = Symbol('errorExplorer');\n\n/**\n * Use Error Explorer instance\n *\n * @example\n * ```ts\n * const { captureException, addBreadcrumb } = useErrorExplorer();\n *\n * try {\n * await riskyOperation();\n * } catch (error) {\n * captureException(error);\n * }\n * ```\n */\nexport function useErrorExplorer() {\n // Try to get from injection (if using plugin)\n const injected = inject<typeof ErrorExplorer | null>(ErrorExplorerKey, null) ||\n inject<typeof ErrorExplorer | null>('errorExplorer', null);\n\n // Fall back to singleton\n const errorExplorer = injected || ErrorExplorer;\n\n return {\n /**\n * Check if Error Explorer is initialized\n */\n isInitialized: () => errorExplorer.isInitialized(),\n\n /**\n * Capture an exception\n */\n captureException: (error: Error, context?: CaptureContext) =>\n errorExplorer.captureException(error, context),\n\n /**\n * Capture a message\n */\n captureMessage: (message: string, level?: 'debug' | 'info' | 'warning' | 'error' | 'critical') =>\n errorExplorer.captureMessage(message, level),\n\n /**\n * Add a breadcrumb\n */\n addBreadcrumb: (breadcrumb: Breadcrumb) =>\n errorExplorer.addBreadcrumb(breadcrumb),\n\n /**\n * Set user context\n */\n setUser: (user: UserContext) => errorExplorer.setUser(user),\n\n /**\n * Clear user context\n */\n clearUser: () => errorExplorer.clearUser(),\n\n /**\n * Set a tag\n */\n setTag: (key: string, value: string) => errorExplorer.setTag(key, value),\n\n /**\n * Set multiple tags\n */\n setTags: (tags: Record<string, string>) => errorExplorer.setTags(tags),\n\n /**\n * Set extra context\n */\n setExtra: (extra: Record<string, unknown>) => errorExplorer.setExtra(extra),\n\n /**\n * Set named context\n */\n setContext: (name: string, context: Record<string, unknown>) =>\n errorExplorer.setContext(name, context),\n\n /**\n * Flush pending events\n */\n flush: (timeout?: number) => errorExplorer.flush(timeout),\n\n /**\n * Close the SDK\n */\n close: (timeout?: number) => errorExplorer.close(timeout),\n };\n}\n\n/**\n * Track component lifecycle for debugging\n *\n * @example\n * ```ts\n * // In setup()\n * useComponentBreadcrumbs();\n * ```\n */\nexport function useComponentBreadcrumbs() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n onMounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} mounted`,\n level: 'debug',\n });\n });\n\n onUnmounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} unmounted`,\n level: 'debug',\n });\n });\n}\n\n/**\n * Create a breadcrumb tracker for user actions\n *\n * @example\n * ```ts\n * const { trackAction } = useActionTracker();\n *\n * const handleClick = () => {\n * trackAction('button_clicked', { buttonId: 'submit' });\n * // ... actual handler\n * };\n * ```\n */\nexport function useActionTracker() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n return {\n /**\n * Track a user action\n */\n trackAction: (action: string, data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: 'action',\n message: action,\n level: 'info',\n data: {\n component: componentName,\n ...data,\n },\n });\n },\n\n /**\n * Track a UI interaction\n */\n trackInteraction: (element: string, action: 'click' | 'input' | 'focus' | 'blur' | 'submit', data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: `ui.${action}`,\n message: `${action} on ${element}`,\n level: 'info',\n data: {\n component: componentName,\n element,\n ...data,\n },\n });\n },\n };\n}\n\n/**\n * Create an error handler for async operations\n *\n * @example\n * ```ts\n * const { wrapAsync, handleError } = useErrorHandler();\n *\n * // Option 1: Wrap async function\n * const safeSubmit = wrapAsync(async () => {\n * await api.submit(data);\n * });\n *\n * // Option 2: Manual handling\n * try {\n * await riskyOperation();\n * } catch (error) {\n * handleError(error, { tags: { operation: 'risky' } });\n * }\n * ```\n */\nexport function useErrorHandler(defaultContext?: CaptureContext) {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n /**\n * Handle an error with context\n */\n const handleError = (error: unknown, context?: CaptureContext) => {\n const err = error instanceof Error ? error : new Error(String(error));\n\n ErrorExplorer.captureException(err, {\n ...defaultContext,\n ...context,\n tags: {\n 'vue.component': componentName,\n ...defaultContext?.tags,\n ...context?.tags,\n },\n });\n\n return err;\n };\n\n /**\n * Wrap an async function with error handling\n */\n const wrapAsync = <T extends (...args: any[]) => Promise<any>>(\n fn: T,\n context?: CaptureContext\n ): ((...args: Parameters<T>) => Promise<Awaited<ReturnType<T>> | undefined>) => {\n return async (...args: Parameters<T>) => {\n try {\n return await fn(...args);\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n };\n\n /**\n * Create a try-catch wrapper that captures errors\n */\n const tryCatch = <T>(fn: () => T, context?: CaptureContext): T | undefined => {\n try {\n return fn();\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n\n return {\n handleError,\n wrapAsync,\n tryCatch,\n };\n}\n\n/**\n * Set user context from a reactive source\n *\n * @example\n * ```ts\n * const user = ref({ id: '123', email: 'user@example.com' });\n * useUserContext(user);\n * ```\n */\nexport function useUserContext(user: { value: UserContext | null } | UserContext | null) {\n const setUserFromValue = (value: UserContext | null) => {\n if (value) {\n ErrorExplorer.setUser(value);\n } else {\n ErrorExplorer.clearUser();\n }\n };\n\n // Handle both refs and plain objects\n if (user && typeof user === 'object' && 'value' in user) {\n // It's a ref - cast to the expected type\n const refValue = (user as { value: UserContext | null }).value;\n setUserFromValue(refValue);\n\n // Note: We don't set up a watcher here because that would require\n // importing watch from vue, which adds complexity.\n // Users should manually call setUser when the user changes.\n } else {\n setUserFromValue(user as UserContext | null);\n }\n\n return {\n setUser: (newUser: UserContext) => ErrorExplorer.setUser(newUser),\n clearUser: () => ErrorExplorer.clearUser(),\n };\n}\n","/**\n * @error-explorer/vue\n * Error Explorer SDK for Vue.js 3 - Automatic error tracking with Vue integration\n */\n\n// Plugin\nexport { createErrorExplorerPlugin, restoreHandlers } from './plugin';\n\n// Router Integration\nexport {\n setupRouterIntegration,\n createRouterIntegration,\n type RouterIntegrationOptions,\n} from './router';\n\n// Components\nexport { ErrorBoundary, withErrorBoundary, type ErrorBoundaryInstance } from './ErrorBoundary';\n\n// Composables\nexport {\n useErrorExplorer,\n useComponentBreadcrumbs,\n useActionTracker,\n useErrorHandler,\n useUserContext,\n ErrorExplorerKey,\n} from './composables';\n\n// Types\nexport type {\n VueErrorExplorerOptions,\n VueComponentContext,\n VuePluginInstall,\n ErrorBoundaryProps,\n ErrorBoundaryExposed,\n InitOptions,\n UserContext,\n Breadcrumb,\n CaptureContext,\n} from './types';\n\n// Re-export ErrorExplorer for direct access\nexport { ErrorExplorer } from '@error-explorer/browser';\n\n// Default export is the plugin creator for convenience\nimport { createErrorExplorerPlugin } from './plugin';\nexport default createErrorExplorerPlugin;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/router.ts","../src/plugin.ts","../src/ErrorBoundary.ts","../src/composables.ts","../src/index.ts"],"names":["ErrorExplorer","error","defineComponent","ref","onErrorCaptured","h","inject","getCurrentInstance","onMounted","onUnmounted"],"mappings":";;;;;;;;AAgDA,SAAS,oBAAoB,KAAA,EAAwC;AACnE,EAAA,IAAI,KAAA,CAAM,IAAA,IAAQ,OAAO,KAAA,CAAM,SAAS,QAAA,EAAU;AAChD,IAAA,OAAO,KAAA,CAAM,IAAA;AAAA,EACf;AAGA,EAAA,OAAO,MAAM,IAAA,IAAQ,GAAA;AACvB;AAKA,SAAS,cAAA,CACP,OACA,OAAA,EACyB;AACzB,EAAA,MAAM,IAAA,GAAgC;AAAA,IACpC,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,UAAU,KAAA,CAAM;AAAA,GAClB;AAEA,EAAA,IAAI,OAAA,CAAQ,eAAe,MAAA,CAAO,IAAA,CAAK,MAAM,MAAM,CAAA,CAAE,SAAS,CAAA,EAAG;AAC/D,IAAA,IAAA,CAAK,MAAA,GAAS,EAAE,GAAG,KAAA,CAAM,MAAA,EAAO;AAAA,EAClC;AAEA,EAAA,IAAI,OAAA,CAAQ,cAAc,MAAA,CAAO,IAAA,CAAK,MAAM,KAAK,CAAA,CAAE,SAAS,CAAA,EAAG;AAC7D,IAAA,IAAA,CAAK,KAAA,GAAQ,EAAE,GAAG,KAAA,CAAM,KAAA,EAAM;AAAA,EAChC;AAEA,EAAA,IAAI,KAAA,CAAM,QAAQ,MAAA,CAAO,IAAA,CAAK,MAAM,IAAI,CAAA,CAAE,SAAS,CAAA,EAAG;AAEpD,IAAA,MAAM,WAAoC,EAAC;AAC3C,IAAA,KAAA,MAAW,CAAC,KA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ACL,OAAA,EAAS,CAAC,OAAA,KAAyBA,qBAAAA,CAAc,QAAQ,OAAO,CAAA;AAAA,IAChE,SAAA,EAAW,MAAMA,qBAAAA,CAAc,SAAA;AAAU,GAC3C;AACF;AC3QA,IAAO,WAAA,GAAQ","file":"index.cjs","sourcesContent":["/**\n * Vue Router integration for Error Explorer\n * Adds navigation breadcrumbs automatically\n */\n\nimport type { Router, RouteLocationNormalized } from 'vue-router';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * Router integration options\n */\nexport interface RouterIntegrationOptions {\n /**\n * Track route changes as breadcrumbs\n * @default true\n */\n trackNavigation?: boolean;\n\n /**\n * Track route params in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackParams?: boolean;\n\n /**\n * Track query parameters in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackQuery?: boolean;\n\n /**\n * Custom function to extract route name for breadcrumb\n */\n getRouteName?: (route: RouteLocationNormalized) => string;\n\n /**\n * Hook called before adding navigation breadcrumb\n * Return false to skip the breadcrumb\n */\n beforeNavigationBreadcrumb?: (\n from: RouteLocationNormalized,\n to: RouteLocationNormalized\n ) => boolean;\n}\n\n/**\n * Default route name extractor\n */\nfunction defaultGetRouteName(route: RouteLocationNormalized): string {\n if (route.name && typeof route.name === 'string') {\n return route.name;\n }\n\n // Use path as fallback\n return route.path || '/';\n}\n\n/**\n * Build route data for breadcrumb\n */\nfunction buildRouteData(\n route: RouteLocationNormalized,\n options: RouterIntegrationOptions\n): Record<string, unknown> {\n const data: Record<string, unknown> = {\n path: route.path,\n name: route.name,\n fullPath: route.fullPath,\n };\n\n if (options.trackParams && Object.keys(route.params).length > 0) {\n data.params = { ...route.params };\n }\n\n if (options.trackQuery && Object.keys(route.query).length > 0) {\n data.query = { ...route.query };\n }\n\n if (route.meta && Object.keys(route.meta).length > 0) {\n // Only include safe meta properties\n const safeMeta: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(route.meta)) {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n safeMeta[key] = value;\n }\n }\n if (Object.keys(safeMeta).length > 0) {\n data.meta = safeMeta;\n }\n }\n\n return data;\n}\n\n/**\n * Setup Vue Router integration\n */\nexport function setupRouterIntegration(\n router: Router,\n options: RouterIntegrationOptions = {}\n): () => void {\n if (options.trackNavigation === false) {\n return () => {};\n }\n\n const getRouteName = options.getRouteName || defaultGetRouteName;\n\n // Track navigation start time\n let navigationStartTime: number | null = null;\n\n // Before each navigation\n const beforeEachGuard = router.beforeEach((to, from) => {\n navigationStartTime = performance.now();\n\n // Add breadcrumb for navigation start\n if (from.name || from.path !== '/') {\n const shouldAdd = options.beforeNavigationBreadcrumb\n ? options.beforeNavigationBreadcrumb(from, to)\n : true;\n\n if (shouldAdd) {\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,\n level: 'info',\n data: {\n from: buildRouteData(from, options),\n to: buildRouteData(to, options),\n },\n });\n }\n }\n\n return true;\n });\n\n // After each navigation\n const afterEachGuard = router.afterEach((to, from, failure) => {\n const duration = navigationStartTime ? performance.now() - navigationStartTime : undefined;\n navigationStartTime = null;\n\n if (failure) {\n // Navigation failed\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router.error',\n message: `Navigation failed to ${getRouteName(to)}`,\n level: 'error',\n data: {\n to: buildRouteData(to, options),\n error: failure.message,\n type: failure.type,\n duration,\n },\n });\n\n // Capture as exception if it's a real error\n if (failure.type !== 4) { // Not aborted\n ErrorExplorer.captureException(failure, {\n tags: {\n 'router.error': 'navigation_failure',\n 'router.to': getRouteName(to),\n },\n });\n }\n } else {\n // Navigation succeeded\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigated to ${getRouteName(to)}`,\n level: 'info',\n data: {\n route: buildRouteData(to, options),\n duration,\n },\n });\n }\n });\n\n // Handle router errors\n const errorHandler = router.onError((error) => {\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'router.error',\n message: error.message,\n level: 'error',\n });\n\n ErrorExplorer.captureException(error, {\n tags: {\n 'router.error': 'unhandled',\n },\n });\n });\n\n // Return cleanup function\n return () => {\n beforeEachGuard();\n afterEachGuard();\n errorHandler();\n };\n}\n\n/**\n * Create a Vue Router plugin that integrates with Error Explorer\n */\nexport function createRouterIntegration(options: RouterIntegrationOptions = {}) {\n let cleanup: (() => void) | null = null;\n\n return {\n /**\n * Install the router integration\n */\n install(router: Router): void {\n cleanup = setupRouterIntegration(router, options);\n },\n\n /**\n * Uninstall the router integration\n */\n uninstall(): void {\n if (cleanup) {\n cleanup();\n cleanup = null;\n }\n },\n };\n}\n\nexport type { Router, RouteLocationNormalized };\n","/**\n * Vue Plugin for Error Explorer\n */\n\nimport type { App, ComponentPublicInstance, Plugin } from 'vue';\nimport type { Router } from 'vue-router';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { VueErrorExplorerOptions, VueComponentContext } from './types';\nimport { setupRouterIntegration } from './router';\n\n/**\n * Get component name from instance\n */\nfunction getComponentName(instance: ComponentPublicInstance | null): string | undefined {\n if (!instance) return undefined;\n\n const options = instance.$.type as { name?: string; __name?: string; __file?: string };\n\n return options.name || options.__name || extractNameFromFile(options.__file);\n}\n\n/**\n * Extract component name from file path\n */\nfunction extractNameFromFile(file?: string): string | undefined {\n if (!file) return undefined;\n\n const match = file.match(/([^/\\\\]+)\\.vue$/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Get component trace (parent hierarchy)\n */\nfunction getComponentTrace(instance: ComponentPublicInstance | null): string[] {\n const trace: string[] = [];\n let current = instance;\n\n while (current) {\n const name = getComponentName(current);\n if (name) {\n trace.push(name);\n }\n current = current.$.parent?.proxy ?? null;\n }\n\n return trace;\n}\n\n/**\n * Serialize component props with depth limit\n */\nfunction serializeProps(\n props: Record<string, unknown>,\n maxDepth: number\n): Record<string, unknown> {\n const serialize = (value: unknown, depth: number): unknown => {\n if (depth > maxDepth) {\n return '[Max depth reached]';\n }\n\n if (value === null || value === undefined) {\n return value;\n }\n\n if (typeof value === 'function') {\n return '[Function]';\n }\n\n if (typeof value === 'symbol') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (value instanceof Error) {\n return { name: value.name, message: value.message };\n }\n\n if (Array.isArray(value)) {\n return value.slice(0, 10).map(item => serialize(item, depth + 1));\n }\n\n if (typeof value === 'object') {\n const serialized: Record<string, unknown> = {};\n const keys = Object.keys(value as Record<string, unknown>).slice(0, 20);\n\n for (const key of keys) {\n serialized[key] = serialize((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return serialized;\n }\n\n return value;\n };\n\n return serialize(props, 0) as Record<string, unknown>;\n}\n\n/**\n * Build Vue component context\n */\nfunction buildVueContext(\n instance: ComponentPublicInstance | null,\n info: string,\n options: VueErrorExplorerOptions\n): VueComponentContext {\n const context: VueComponentContext = {\n info,\n };\n\n if (options.captureComponentName !== false && instance) {\n context.name = getComponentName(instance);\n\n const type = instance.$.type as { __file?: string };\n if (type.__file) {\n context.file = type.__file;\n }\n\n context.trace = getComponentTrace(instance);\n }\n\n if (options.captureComponentProps && instance) {\n const props = instance.$.props;\n if (props && Object.keys(props).length > 0) {\n context.props = serializeProps(props, options.propsDepth ?? 2);\n }\n }\n\n return context;\n}\n\n/**\n * Original handlers storage\n */\nlet originalErrorHandler: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => void) | undefined;\nlet originalWarnHandler: ((msg: string, instance: ComponentPublicInstance | null, trace: string) => void) | undefined;\n\n/**\n * Setup Vue error handler\n */\nfunction setupErrorHandler(app: App, options: VueErrorExplorerOptions): void {\n if (options.vueErrorHandler === false) {\n return;\n }\n\n // Save original handler\n originalErrorHandler = app.config.errorHandler;\n\n app.config.errorHandler = (err: unknown, instance: ComponentPublicInstance | null, info: string) => {\n // Check if we should capture\n if (options.beforeVueCapture) {\n const error = err instanceof Error ? err : new Error(String(err));\n if (!options.beforeVueCapture(error, instance, info)) {\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n return;\n }\n }\n\n // Build Vue context\n const vueContext = buildVueContext(instance, info, options);\n\n // Add breadcrumb for the error\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.error',\n message: err instanceof Error ? err.message : String(err),\n level: 'error',\n data: {\n component: vueContext.name,\n info: vueContext.info,\n },\n });\n\n // Capture the error\n const error = err instanceof Error ? err : new Error(String(err));\n ErrorExplorer.captureException(error, {\n tags: {\n 'vue.component': vueContext.name || 'unknown',\n 'vue.info': info,\n },\n extra: {\n vue: vueContext,\n },\n });\n\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n\n // Re-throw in development for better DX\n if (options.environment === 'development' || import.meta.env?.DEV) {\n console.error('[Vue Error]', err);\n }\n };\n}\n\n/**\n * Setup Vue warning handler\n */\nfunction setupWarnHandler(app: App, options: VueErrorExplorerOptions): void {\n // Default: only in development\n const enableWarn = options.vueWarnHandler ?? (\n options.environment === 'development' || import.meta.env?.DEV\n );\n\n if (!enableWarn) {\n return;\n }\n\n // Save original handler\n originalWarnHandler = app.config.warnHandler;\n\n app.config.warnHandler = (msg: string, instance: ComponentPublicInstance | null, trace: string) => {\n const componentName = getComponentName(instance);\n\n // Add breadcrumb for the warning\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.warn',\n message: msg,\n level: 'warning',\n data: {\n component: componentName,\n trace: trace.split('\\n').slice(0, 5),\n },\n });\n\n // Call original handler if exists\n if (originalWarnHandler) {\n originalWarnHandler(msg, instance, trace);\n }\n\n // Log to console in development\n if (import.meta.env?.DEV) {\n console.warn('[Vue Warn]', msg);\n if (trace) {\n console.warn(trace);\n }\n }\n };\n}\n\n/**\n * Router cleanup function storage\n */\nlet routerCleanup: (() => void) | null = null;\n\n/**\n * Setup router integration if configured\n */\nfunction setupRouter(options: VueErrorExplorerOptions): void {\n if (options.router === false || options.router === undefined) {\n return;\n }\n\n let router: Router;\n let routerOptions = {};\n\n if ('instance' in options.router) {\n // Object with instance and options\n router = options.router.instance;\n routerOptions = options.router.options || {};\n } else {\n // Direct Router instance\n router = options.router;\n }\n\n routerCleanup = setupRouterIntegration(router, routerOptions);\n}\n\n/**\n * Restore original handlers\n */\nexport function restoreHandlers(app: App): void {\n if (originalErrorHandler !== undefined) {\n app.config.errorHandler = originalErrorHandler;\n originalErrorHandler = undefined;\n }\n\n if (originalWarnHandler !== undefined) {\n app.config.warnHandler = originalWarnHandler;\n originalWarnHandler = undefined;\n }\n\n if (routerCleanup) {\n routerCleanup();\n routerCleanup = null;\n }\n}\n\n/**\n * Create Vue plugin for Error Explorer\n */\nexport function createErrorExplorerPlugin(options: VueErrorExplorerOptions = {} as VueErrorExplorerOptions): Plugin {\n return {\n install(app: App) {\n // Initialize Error Explorer if not already done\n if (!ErrorExplorer.isInitialized()) {\n ErrorExplorer.init(options);\n }\n\n // Setup handlers\n setupErrorHandler(app, options);\n setupWarnHandler(app, options);\n\n // Setup router integration if configured\n setupRouter(options);\n\n // Provide Error Explorer instance globally\n app.provide('errorExplorer', ErrorExplorer);\n\n // Add global property for Options API access\n app.config.globalProperties.$errorExplorer = ErrorExplorer;\n\n // Add breadcrumb for app mount\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'vue.lifecycle',\n message: 'Vue app mounted',\n level: 'info',\n });\n },\n };\n}\n\n// Declare module augmentation for global properties\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $errorExplorer: typeof ErrorExplorer;\n }\n}\n","/**\n * ErrorBoundary component for Vue 3\n * Catches errors in child components and reports them to Error Explorer\n */\n\nimport {\n defineComponent,\n h,\n ref,\n onErrorCaptured,\n type PropType,\n type VNode,\n type Slot,\n} from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * ErrorBoundary component\n *\n * Usage:\n * ```vue\n * <ErrorBoundary @error=\"handleError\" :fallback=\"ErrorFallback\">\n * <MyComponent />\n * </ErrorBoundary>\n * ```\n *\n * Or with scoped slot for fallback:\n * ```vue\n * <ErrorBoundary>\n * <template #default>\n * <MyComponent />\n * </template>\n * <template #fallback=\"{ error, reset }\">\n * <div>\n * <p>Error: {{ error.message }}</p>\n * <button @click=\"reset\">Retry</button>\n * </div>\n * </template>\n * </ErrorBoundary>\n * ```\n */\nexport const ErrorBoundary = defineComponent({\n name: 'ErrorBoundary',\n\n props: {\n /**\n * Whether to capture the error to Error Explorer\n */\n capture: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional tags to add when capturing\n */\n tags: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n\n /**\n * Additional context to add when capturing\n */\n context: {\n type: Object as PropType<Record<string, unknown>>,\n default: () => ({}),\n },\n\n /**\n * Fallback component to render when an error occurs\n */\n fallback: {\n type: [Object, Function, null] as PropType<VNode | (() => VNode) | null>,\n default: null,\n },\n\n /**\n * Whether to stop error propagation\n */\n stopPropagation: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: {\n /**\n * Emitted when an error is caught\n */\n error: (error: Error, info: string) => true,\n\n /**\n * Emitted when the error state is reset\n */\n reset: () => true,\n },\n\n setup(props, { slots, emit, expose }) {\n const error = ref<Error | null>(null);\n const errorInfo = ref<string>('');\n\n /**\n * Reset the error state\n */\n const reset = () => {\n error.value = null;\n errorInfo.value = '';\n emit('reset');\n };\n\n // Capture errors from child components\n onErrorCaptured((err: unknown, instance, info: string) => {\n const capturedError = err instanceof Error ? err : new Error(String(err));\n\n error.value = capturedError;\n errorInfo.value = info;\n\n // Emit error event\n emit('error', capturedError, info);\n\n // Add breadcrumb\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.errorBoundary',\n message: capturedError.message,\n level: 'error',\n data: {\n info,\n component: instance?.$.type\n ? (instance.$.type as { name?: string }).name\n : undefined,\n },\n });\n\n // Capture to Error Explorer if enabled\n if (props.capture) {\n ErrorExplorer.captureException(capturedError, {\n tags: {\n 'errorBoundary': 'true',\n 'vue.info': info,\n ...props.tags,\n },\n extra: {\n errorBoundary: {\n info,\n context: props.context,\n },\n },\n });\n }\n\n // Return true to stop propagation, false to continue\n return props.stopPropagation;\n });\n\n // Expose methods and state\n expose({\n reset,\n error,\n });\n\n return () => {\n // If there's an error, render fallback\n if (error.value) {\n // Check for fallback slot\n if (slots.fallback) {\n return slots.fallback({\n error: error.value,\n info: errorInfo.value,\n reset,\n });\n }\n\n // Check for fallback prop\n if (props.fallback) {\n if (typeof props.fallback === 'function') {\n return props.fallback();\n }\n return props.fallback;\n }\n\n // Default fallback\n return h('div', { class: 'error-boundary-fallback' }, [\n h('p', { style: 'color: red;' }, `Error: ${error.value.message}`),\n h(\n 'button',\n {\n onClick: reset,\n style: 'margin-top: 8px; padding: 4px 12px; cursor: pointer;',\n },\n 'Try Again'\n ),\n ]);\n }\n\n // No error, render default slot\n return slots.default?.();\n };\n },\n});\n\n/**\n * Higher-order component to wrap a component with ErrorBoundary\n */\nexport function withErrorBoundary<T extends { new (): any }>(\n Component: T,\n options: {\n capture?: boolean;\n tags?: Record<string, string>;\n context?: Record<string, unknown>;\n fallback?: VNode | (() => VNode);\n onError?: (error: Error, info: string) => void;\n } = {}\n) {\n return defineComponent({\n name: `WithErrorBoundary(${(Component as any).name || 'Component'})`,\n\n setup(_, { attrs, slots }) {\n return () =>\n h(\n ErrorBoundary,\n {\n capture: options.capture ?? true,\n tags: options.tags ?? {},\n context: options.context ?? {},\n fallback: options.fallback ?? null,\n onError: options.onError,\n },\n {\n default: () => h(Component as any, attrs, slots),\n }\n );\n },\n });\n}\n\nexport type ErrorBoundaryInstance = InstanceType<typeof ErrorBoundary>;\n","/**\n * Vue 3 Composables for Error Explorer\n */\n\nimport { inject, onMounted, onUnmounted, getCurrentInstance } from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { Breadcrumb, CaptureContext, UserContext } from '@error-explorer/browser';\n\n/**\n * Injection key for Error Explorer\n */\nexport const ErrorExplorerKey = Symbol('errorExplorer');\n\n/**\n * Use Error Explorer instance\n *\n * @example\n * ```ts\n * const { captureException, addBreadcrumb } = useErrorExplorer();\n *\n * try {\n * await riskyOperation();\n * } catch (error) {\n * captureException(error);\n * }\n * ```\n */\nexport function useErrorExplorer() {\n // Try to get from injection (if using plugin)\n const injected = inject<typeof ErrorExplorer | null>(ErrorExplorerKey, null) ||\n inject<typeof ErrorExplorer | null>('errorExplorer', null);\n\n // Fall back to singleton\n const errorExplorer = injected || ErrorExplorer;\n\n return {\n /**\n * Check if Error Explorer is initialized\n */\n isInitialized: () => errorExplorer.isInitialized(),\n\n /**\n * Capture an exception\n */\n captureException: (error: Error, context?: CaptureContext) =>\n errorExplorer.captureException(error, context),\n\n /**\n * Capture a message\n */\n captureMessage: (message: string, level?: 'debug' | 'info' | 'warning' | 'error' | 'critical') =>\n errorExplorer.captureMessage(message, level),\n\n /**\n * Add a breadcrumb\n */\n addBreadcrumb: (breadcrumb: Breadcrumb) =>\n errorExplorer.addBreadcrumb(breadcrumb),\n\n /**\n * Set user context\n */\n setUser: (user: UserContext) => errorExplorer.setUser(user),\n\n /**\n * Clear user context\n */\n clearUser: () => errorExplorer.clearUser(),\n\n /**\n * Set a tag\n */\n setTag: (key: string, value: string) => errorExplorer.setTag(key, value),\n\n /**\n * Set multiple tags\n */\n setTags: (tags: Record<string, string>) => errorExplorer.setTags(tags),\n\n /**\n * Set extra context\n */\n setExtra: (extra: Record<string, unknown>) => errorExplorer.setExtra(extra),\n\n /**\n * Set named context\n */\n setContext: (name: string, context: Record<string, unknown>) =>\n errorExplorer.setContext(name, context),\n\n /**\n * Flush pending events\n */\n flush: (timeout?: number) => errorExplorer.flush(timeout),\n\n /**\n * Close the SDK\n */\n close: (timeout?: number) => errorExplorer.close(timeout),\n };\n}\n\n/**\n * Track component lifecycle for debugging\n *\n * @example\n * ```ts\n * // In setup()\n * useComponentBreadcrumbs();\n * ```\n */\nexport function useComponentBreadcrumbs() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n onMounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} mounted`,\n level: 'debug',\n });\n });\n\n onUnmounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} unmounted`,\n level: 'debug',\n });\n });\n}\n\n/**\n * Create a breadcrumb tracker for user actions\n *\n * @example\n * ```ts\n * const { trackAction } = useActionTracker();\n *\n * const handleClick = () => {\n * trackAction('button_clicked', { buttonId: 'submit' });\n * // ... actual handler\n * };\n * ```\n */\nexport function useActionTracker() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n return {\n /**\n * Track a user action\n */\n trackAction: (action: string, data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: 'action',\n message: action,\n level: 'info',\n data: {\n component: componentName,\n ...data,\n },\n });\n },\n\n /**\n * Track a UI interaction\n */\n trackInteraction: (element: string, action: 'click' | 'input' | 'focus' | 'blur' | 'submit', data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: `ui.${action}`,\n message: `${action} on ${element}`,\n level: 'info',\n data: {\n component: componentName,\n element,\n ...data,\n },\n });\n },\n };\n}\n\n/**\n * Create an error handler for async operations\n *\n * @example\n * ```ts\n * const { wrapAsync, handleError } = useErrorHandler();\n *\n * // Option 1: Wrap async function\n * const safeSubmit = wrapAsync(async () => {\n * await api.submit(data);\n * });\n *\n * // Option 2: Manual handling\n * try {\n * await riskyOperation();\n * } catch (error) {\n * handleError(error, { tags: { operation: 'risky' } });\n * }\n * ```\n */\nexport function useErrorHandler(defaultContext?: CaptureContext) {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n /**\n * Handle an error with context\n */\n const handleError = (error: unknown, context?: CaptureContext) => {\n const err = error instanceof Error ? error : new Error(String(error));\n\n ErrorExplorer.captureException(err, {\n ...defaultContext,\n ...context,\n tags: {\n 'vue.component': componentName,\n ...defaultContext?.tags,\n ...context?.tags,\n },\n });\n\n return err;\n };\n\n /**\n * Wrap an async function with error handling\n */\n const wrapAsync = <T extends (...args: any[]) => Promise<any>>(\n fn: T,\n context?: CaptureContext\n ): ((...args: Parameters<T>) => Promise<Awaited<ReturnType<T>> | undefined>) => {\n return async (...args: Parameters<T>) => {\n try {\n return await fn(...args);\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n };\n\n /**\n * Create a try-catch wrapper that captures errors\n */\n const tryCatch = <T>(fn: () => T, context?: CaptureContext): T | undefined => {\n try {\n return fn();\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n\n return {\n handleError,\n wrapAsync,\n tryCatch,\n };\n}\n\n/**\n * Set user context from a reactive source\n *\n * @example\n * ```ts\n * const user = ref({ id: '123', email: 'user@example.com' });\n * useUserContext(user);\n * ```\n */\nexport function useUserContext(user: { value: UserContext | null } | UserContext | null) {\n const setUserFromValue = (value: UserContext | null) => {\n if (value) {\n ErrorExplorer.setUser(value);\n } else {\n ErrorExplorer.clearUser();\n }\n };\n\n // Handle both refs and plain objects\n if (user && typeof user === 'object' && 'value' in user) {\n // It's a ref - cast to the expected type\n const refValue = (user as { value: UserContext | null }).value;\n setUserFromValue(refValue);\n\n // Note: We don't set up a watcher here because that would require\n // importing watch from vue, which adds complexity.\n // Users should manually call setUser when the user changes.\n } else {\n setUserFromValue(user as UserContext | null);\n }\n\n return {\n setUser: (newUser: UserContext) => ErrorExplorer.setUser(newUser),\n clearUser: () => ErrorExplorer.clearUser(),\n };\n}\n","/**\n * @error-explorer/vue\n * Error Explorer SDK for Vue.js 3 - Automatic error tracking with Vue integration\n */\n\n// Plugin\nexport { createErrorExplorerPlugin, restoreHandlers } from './plugin';\n\n// Router Integration\nexport {\n setupRouterIntegration,\n createRouterIntegration,\n type RouterIntegrationOptions,\n} from './router';\n\n// Components\nexport { ErrorBoundary, withErrorBoundary, type ErrorBoundaryInstance } from './ErrorBoundary';\n\n// Composables\nexport {\n useErrorExplorer,\n useComponentBreadcrumbs,\n useActionTracker,\n useErrorHandler,\n useUserContext,\n ErrorExplorerKey,\n} from './composables';\n\n// Types\nexport type {\n VueErrorExplorerOptions,\n VueComponentContext,\n VuePluginInstall,\n ErrorBoundaryProps,\n ErrorBoundaryExposed,\n InitOptions,\n UserContext,\n Breadcrumb,\n CaptureContext,\n} from './types';\n\n// Re-export ErrorExplorer for direct access\nexport { ErrorExplorer } from '@error-explorer/browser';\n\n// Default export is the plugin creator for convenience\nimport { createErrorExplorerPlugin } from './plugin';\nexport default createErrorExplorerPlugin;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2,8 +2,9 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { App, ComponentPublicInstance, Plugin, PropType, VNode } from 'vue';
|
|
3
3
|
import { InitOptions, ErrorExplorer, CaptureContext, Breadcrumb, UserContext } from '@error-explorer/browser';
|
|
4
4
|
export { Breadcrumb, CaptureContext, ErrorExplorer, InitOptions, UserContext } from '@error-explorer/browser';
|
|
5
|
-
|
|
6
|
-
import '
|
|
5
|
+
import { Router } from 'vue-router';
|
|
6
|
+
import { RouterIntegrationOptions } from './router.cjs';
|
|
7
|
+
export { createRouterIntegration, setupRouterIntegration } from './router.cjs';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Types for @error-explorer/vue
|
|
@@ -28,10 +29,15 @@ interface VueErrorExplorerOptions extends InitOptions {
|
|
|
28
29
|
*/
|
|
29
30
|
vueWarnHandler?: boolean;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* Vue Router integration for navigation breadcrumbs.
|
|
33
|
+
* Pass a Router instance to enable automatic navigation tracking.
|
|
34
|
+
* Pass an object with router and options for more control.
|
|
35
|
+
* Pass false to disable.
|
|
33
36
|
*/
|
|
34
|
-
router?:
|
|
37
|
+
router?: Router | {
|
|
38
|
+
instance: Router;
|
|
39
|
+
options?: RouterIntegrationOptions;
|
|
40
|
+
} | false;
|
|
35
41
|
/**
|
|
36
42
|
* Capture component name in error context
|
|
37
43
|
* @default true
|
|
@@ -430,4 +436,4 @@ declare function useUserContext(user: {
|
|
|
430
436
|
* Error Explorer SDK for Vue.js 3 - Automatic error tracking with Vue integration
|
|
431
437
|
*/
|
|
432
438
|
|
|
433
|
-
export { ErrorBoundary, type ErrorBoundaryExposed, type ErrorBoundaryInstance, type ErrorBoundaryProps, ErrorExplorerKey, type VueComponentContext, type VueErrorExplorerOptions, type VuePluginInstall, createErrorExplorerPlugin, createErrorExplorerPlugin as default, restoreHandlers, useActionTracker, useComponentBreadcrumbs, useErrorExplorer, useErrorHandler, useUserContext, withErrorBoundary };
|
|
439
|
+
export { ErrorBoundary, type ErrorBoundaryExposed, type ErrorBoundaryInstance, type ErrorBoundaryProps, ErrorExplorerKey, RouterIntegrationOptions, type VueComponentContext, type VueErrorExplorerOptions, type VuePluginInstall, createErrorExplorerPlugin, createErrorExplorerPlugin as default, restoreHandlers, useActionTracker, useComponentBreadcrumbs, useErrorExplorer, useErrorHandler, useUserContext, withErrorBoundary };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { App, ComponentPublicInstance, Plugin, PropType, VNode } from 'vue';
|
|
3
3
|
import { InitOptions, ErrorExplorer, CaptureContext, Breadcrumb, UserContext } from '@error-explorer/browser';
|
|
4
4
|
export { Breadcrumb, CaptureContext, ErrorExplorer, InitOptions, UserContext } from '@error-explorer/browser';
|
|
5
|
-
|
|
6
|
-
import '
|
|
5
|
+
import { Router } from 'vue-router';
|
|
6
|
+
import { RouterIntegrationOptions } from './router.js';
|
|
7
|
+
export { createRouterIntegration, setupRouterIntegration } from './router.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Types for @error-explorer/vue
|
|
@@ -28,10 +29,15 @@ interface VueErrorExplorerOptions extends InitOptions {
|
|
|
28
29
|
*/
|
|
29
30
|
vueWarnHandler?: boolean;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* Vue Router integration for navigation breadcrumbs.
|
|
33
|
+
* Pass a Router instance to enable automatic navigation tracking.
|
|
34
|
+
* Pass an object with router and options for more control.
|
|
35
|
+
* Pass false to disable.
|
|
33
36
|
*/
|
|
34
|
-
router?:
|
|
37
|
+
router?: Router | {
|
|
38
|
+
instance: Router;
|
|
39
|
+
options?: RouterIntegrationOptions;
|
|
40
|
+
} | false;
|
|
35
41
|
/**
|
|
36
42
|
* Capture component name in error context
|
|
37
43
|
* @default true
|
|
@@ -430,4 +436,4 @@ declare function useUserContext(user: {
|
|
|
430
436
|
* Error Explorer SDK for Vue.js 3 - Automatic error tracking with Vue integration
|
|
431
437
|
*/
|
|
432
438
|
|
|
433
|
-
export { ErrorBoundary, type ErrorBoundaryExposed, type ErrorBoundaryInstance, type ErrorBoundaryProps, ErrorExplorerKey, type VueComponentContext, type VueErrorExplorerOptions, type VuePluginInstall, createErrorExplorerPlugin, createErrorExplorerPlugin as default, restoreHandlers, useActionTracker, useComponentBreadcrumbs, useErrorExplorer, useErrorHandler, useUserContext, withErrorBoundary };
|
|
439
|
+
export { ErrorBoundary, type ErrorBoundaryExposed, type ErrorBoundaryInstance, type ErrorBoundaryProps, ErrorExplorerKey, RouterIntegrationOptions, type VueComponentContext, type VueErrorExplorerOptions, type VuePluginInstall, createErrorExplorerPlugin, createErrorExplorerPlugin as default, restoreHandlers, useActionTracker, useComponentBreadcrumbs, useErrorExplorer, useErrorHandler, useUserContext, withErrorBoundary };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,141 @@ import { ErrorExplorer } from '@error-explorer/browser';
|
|
|
2
2
|
export { ErrorExplorer } from '@error-explorer/browser';
|
|
3
3
|
import { defineComponent, ref, onErrorCaptured, h, inject, getCurrentInstance, onMounted, onUnmounted } from 'vue';
|
|
4
4
|
|
|
5
|
+
// src/plugin.ts
|
|
6
|
+
function defaultGetRouteName(route) {
|
|
7
|
+
if (route.name && typeof route.name === "string") {
|
|
8
|
+
return route.name;
|
|
9
|
+
}
|
|
10
|
+
return route.path || "/";
|
|
11
|
+
}
|
|
12
|
+
function buildRouteData(route, options) {
|
|
13
|
+
const data = {
|
|
14
|
+
path: route.path,
|
|
15
|
+
name: route.name,
|
|
16
|
+
fullPath: route.fullPath
|
|
17
|
+
};
|
|
18
|
+
if (options.trackParams && Object.keys(route.params).length > 0) {
|
|
19
|
+
data.params = { ...route.params };
|
|
20
|
+
}
|
|
21
|
+
if (options.trackQuery && Object.keys(route.query).length > 0) {
|
|
22
|
+
data.query = { ...route.query };
|
|
23
|
+
}
|
|
24
|
+
if (route.meta && Object.keys(route.meta).length > 0) {
|
|
25
|
+
const safeMeta = {};
|
|
26
|
+
for (const [key, value] of Object.entries(route.meta)) {
|
|
27
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
28
|
+
safeMeta[key] = value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (Object.keys(safeMeta).length > 0) {
|
|
32
|
+
data.meta = safeMeta;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
function setupRouterIntegration(router, options = {}) {
|
|
38
|
+
if (options.trackNavigation === false) {
|
|
39
|
+
return () => {
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const getRouteName = options.getRouteName || defaultGetRouteName;
|
|
43
|
+
let navigationStartTime = null;
|
|
44
|
+
const beforeEachGuard = router.beforeEach((to, from) => {
|
|
45
|
+
navigationStartTime = performance.now();
|
|
46
|
+
if (from.name || from.path !== "/") {
|
|
47
|
+
const shouldAdd = options.beforeNavigationBreadcrumb ? options.beforeNavigationBreadcrumb(from, to) : true;
|
|
48
|
+
if (shouldAdd) {
|
|
49
|
+
ErrorExplorer.addBreadcrumb({
|
|
50
|
+
type: "navigation",
|
|
51
|
+
category: "router",
|
|
52
|
+
message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,
|
|
53
|
+
level: "info",
|
|
54
|
+
data: {
|
|
55
|
+
from: buildRouteData(from, options),
|
|
56
|
+
to: buildRouteData(to, options)
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
});
|
|
63
|
+
const afterEachGuard = router.afterEach((to, from, failure) => {
|
|
64
|
+
const duration = navigationStartTime ? performance.now() - navigationStartTime : void 0;
|
|
65
|
+
navigationStartTime = null;
|
|
66
|
+
if (failure) {
|
|
67
|
+
ErrorExplorer.addBreadcrumb({
|
|
68
|
+
type: "navigation",
|
|
69
|
+
category: "router.error",
|
|
70
|
+
message: `Navigation failed to ${getRouteName(to)}`,
|
|
71
|
+
level: "error",
|
|
72
|
+
data: {
|
|
73
|
+
to: buildRouteData(to, options),
|
|
74
|
+
error: failure.message,
|
|
75
|
+
type: failure.type,
|
|
76
|
+
duration
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
if (failure.type !== 4) {
|
|
80
|
+
ErrorExplorer.captureException(failure, {
|
|
81
|
+
tags: {
|
|
82
|
+
"router.error": "navigation_failure",
|
|
83
|
+
"router.to": getRouteName(to)
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
ErrorExplorer.addBreadcrumb({
|
|
89
|
+
type: "navigation",
|
|
90
|
+
category: "router",
|
|
91
|
+
message: `Navigated to ${getRouteName(to)}`,
|
|
92
|
+
level: "info",
|
|
93
|
+
data: {
|
|
94
|
+
route: buildRouteData(to, options),
|
|
95
|
+
duration
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const errorHandler = router.onError((error) => {
|
|
101
|
+
ErrorExplorer.addBreadcrumb({
|
|
102
|
+
type: "error",
|
|
103
|
+
category: "router.error",
|
|
104
|
+
message: error.message,
|
|
105
|
+
level: "error"
|
|
106
|
+
});
|
|
107
|
+
ErrorExplorer.captureException(error, {
|
|
108
|
+
tags: {
|
|
109
|
+
"router.error": "unhandled"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
beforeEachGuard();
|
|
115
|
+
afterEachGuard();
|
|
116
|
+
errorHandler();
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function createRouterIntegration(options = {}) {
|
|
120
|
+
let cleanup = null;
|
|
121
|
+
return {
|
|
122
|
+
/**
|
|
123
|
+
* Install the router integration
|
|
124
|
+
*/
|
|
125
|
+
install(router) {
|
|
126
|
+
cleanup = setupRouterIntegration(router, options);
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* Uninstall the router integration
|
|
130
|
+
*/
|
|
131
|
+
uninstall() {
|
|
132
|
+
if (cleanup) {
|
|
133
|
+
cleanup();
|
|
134
|
+
cleanup = null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
5
140
|
// src/plugin.ts
|
|
6
141
|
function getComponentName(instance) {
|
|
7
142
|
if (!instance) return void 0;
|
|
@@ -155,6 +290,21 @@ function setupWarnHandler(app, options) {
|
|
|
155
290
|
}
|
|
156
291
|
};
|
|
157
292
|
}
|
|
293
|
+
var routerCleanup = null;
|
|
294
|
+
function setupRouter(options) {
|
|
295
|
+
if (options.router === false || options.router === void 0) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
let router;
|
|
299
|
+
let routerOptions = {};
|
|
300
|
+
if ("instance" in options.router) {
|
|
301
|
+
router = options.router.instance;
|
|
302
|
+
routerOptions = options.router.options || {};
|
|
303
|
+
} else {
|
|
304
|
+
router = options.router;
|
|
305
|
+
}
|
|
306
|
+
routerCleanup = setupRouterIntegration(router, routerOptions);
|
|
307
|
+
}
|
|
158
308
|
function restoreHandlers(app) {
|
|
159
309
|
if (originalErrorHandler !== void 0) {
|
|
160
310
|
app.config.errorHandler = originalErrorHandler;
|
|
@@ -164,6 +314,10 @@ function restoreHandlers(app) {
|
|
|
164
314
|
app.config.warnHandler = originalWarnHandler;
|
|
165
315
|
originalWarnHandler = void 0;
|
|
166
316
|
}
|
|
317
|
+
if (routerCleanup) {
|
|
318
|
+
routerCleanup();
|
|
319
|
+
routerCleanup = null;
|
|
320
|
+
}
|
|
167
321
|
}
|
|
168
322
|
function createErrorExplorerPlugin(options = {}) {
|
|
169
323
|
return {
|
|
@@ -173,6 +327,7 @@ function createErrorExplorerPlugin(options = {}) {
|
|
|
173
327
|
}
|
|
174
328
|
setupErrorHandler(app, options);
|
|
175
329
|
setupWarnHandler(app, options);
|
|
330
|
+
setupRouter(options);
|
|
176
331
|
app.provide("errorExplorer", ErrorExplorer);
|
|
177
332
|
app.config.globalProperties.$errorExplorer = ErrorExplorer;
|
|
178
333
|
ErrorExplorer.addBreadcrumb({
|
|
@@ -184,139 +339,6 @@ function createErrorExplorerPlugin(options = {}) {
|
|
|
184
339
|
}
|
|
185
340
|
};
|
|
186
341
|
}
|
|
187
|
-
function defaultGetRouteName(route) {
|
|
188
|
-
if (route.name && typeof route.name === "string") {
|
|
189
|
-
return route.name;
|
|
190
|
-
}
|
|
191
|
-
return route.path || "/";
|
|
192
|
-
}
|
|
193
|
-
function buildRouteData(route, options) {
|
|
194
|
-
const data = {
|
|
195
|
-
path: route.path,
|
|
196
|
-
name: route.name,
|
|
197
|
-
fullPath: route.fullPath
|
|
198
|
-
};
|
|
199
|
-
if (options.trackParams && Object.keys(route.params).length > 0) {
|
|
200
|
-
data.params = { ...route.params };
|
|
201
|
-
}
|
|
202
|
-
if (options.trackQuery && Object.keys(route.query).length > 0) {
|
|
203
|
-
data.query = { ...route.query };
|
|
204
|
-
}
|
|
205
|
-
if (route.meta && Object.keys(route.meta).length > 0) {
|
|
206
|
-
const safeMeta = {};
|
|
207
|
-
for (const [key, value] of Object.entries(route.meta)) {
|
|
208
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
209
|
-
safeMeta[key] = value;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (Object.keys(safeMeta).length > 0) {
|
|
213
|
-
data.meta = safeMeta;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return data;
|
|
217
|
-
}
|
|
218
|
-
function setupRouterIntegration(router, options = {}) {
|
|
219
|
-
if (options.trackNavigation === false) {
|
|
220
|
-
return () => {
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
const getRouteName = options.getRouteName || defaultGetRouteName;
|
|
224
|
-
let navigationStartTime = null;
|
|
225
|
-
const beforeEachGuard = router.beforeEach((to, from) => {
|
|
226
|
-
navigationStartTime = performance.now();
|
|
227
|
-
if (from.name || from.path !== "/") {
|
|
228
|
-
const shouldAdd = options.beforeNavigationBreadcrumb ? options.beforeNavigationBreadcrumb(from, to) : true;
|
|
229
|
-
if (shouldAdd) {
|
|
230
|
-
ErrorExplorer.addBreadcrumb({
|
|
231
|
-
type: "navigation",
|
|
232
|
-
category: "router",
|
|
233
|
-
message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,
|
|
234
|
-
level: "info",
|
|
235
|
-
data: {
|
|
236
|
-
from: buildRouteData(from, options),
|
|
237
|
-
to: buildRouteData(to, options)
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return true;
|
|
243
|
-
});
|
|
244
|
-
const afterEachGuard = router.afterEach((to, from, failure) => {
|
|
245
|
-
const duration = navigationStartTime ? performance.now() - navigationStartTime : void 0;
|
|
246
|
-
navigationStartTime = null;
|
|
247
|
-
if (failure) {
|
|
248
|
-
ErrorExplorer.addBreadcrumb({
|
|
249
|
-
type: "navigation",
|
|
250
|
-
category: "router.error",
|
|
251
|
-
message: `Navigation failed to ${getRouteName(to)}`,
|
|
252
|
-
level: "error",
|
|
253
|
-
data: {
|
|
254
|
-
to: buildRouteData(to, options),
|
|
255
|
-
error: failure.message,
|
|
256
|
-
type: failure.type,
|
|
257
|
-
duration
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
if (failure.type !== 4) {
|
|
261
|
-
ErrorExplorer.captureException(failure, {
|
|
262
|
-
tags: {
|
|
263
|
-
"router.error": "navigation_failure",
|
|
264
|
-
"router.to": getRouteName(to)
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
ErrorExplorer.addBreadcrumb({
|
|
270
|
-
type: "navigation",
|
|
271
|
-
category: "router",
|
|
272
|
-
message: `Navigated to ${getRouteName(to)}`,
|
|
273
|
-
level: "info",
|
|
274
|
-
data: {
|
|
275
|
-
route: buildRouteData(to, options),
|
|
276
|
-
duration
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
const errorHandler = router.onError((error) => {
|
|
282
|
-
ErrorExplorer.addBreadcrumb({
|
|
283
|
-
type: "error",
|
|
284
|
-
category: "router.error",
|
|
285
|
-
message: error.message,
|
|
286
|
-
level: "error"
|
|
287
|
-
});
|
|
288
|
-
ErrorExplorer.captureException(error, {
|
|
289
|
-
tags: {
|
|
290
|
-
"router.error": "unhandled"
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
return () => {
|
|
295
|
-
beforeEachGuard();
|
|
296
|
-
afterEachGuard();
|
|
297
|
-
errorHandler();
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
function createRouterIntegration(options = {}) {
|
|
301
|
-
let cleanup = null;
|
|
302
|
-
return {
|
|
303
|
-
/**
|
|
304
|
-
* Install the router integration
|
|
305
|
-
*/
|
|
306
|
-
install(router) {
|
|
307
|
-
cleanup = setupRouterIntegration(router, options);
|
|
308
|
-
},
|
|
309
|
-
/**
|
|
310
|
-
* Uninstall the router integration
|
|
311
|
-
*/
|
|
312
|
-
uninstall() {
|
|
313
|
-
if (cleanup) {
|
|
314
|
-
cleanup();
|
|
315
|
-
cleanup = null;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
342
|
var ErrorBoundary = defineComponent({
|
|
321
343
|
name: "ErrorBoundary",
|
|
322
344
|
props: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts","../src/router.ts","../src/ErrorBoundary.ts","../src/composables.ts","../src/index.ts"],"names":["error","ErrorExplorer"],"mappings":";;;;;AAWA,SAAS,iBAAiB,QAAA,EAA8D;AACtF,EAAA,IAAI,CAAC,UAAU,OAAO,MAAA;AAEtB,EAAA,MAAM,OAAA,GAAU,SAAS,CAAA,CAAE,IAAA;AAE3B,EAAA,OAAO,QAAQ,IAAA,IAAQ,OAAA,CAAQ,MAAA,IAAU,mBAAA,CAAoB,QAAQ,MAAM,CAAA;AAC7E;AAKA,SAAS,oBAAoB,IAAA,EAAmC;AAC9D,EAAA,IAAI,CAAC,MAAM,OAAO,MAAA;AAElB,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,iBAAiB,CAAA;AAC1C,EAAA,OAAO,KAAA,GAAQ,KAAA,CAAM,CAAC,CAAA,GAAI,MAAA;AAC5B;AAKA,SAAS,kBAAkB,QAAA,EAAoD;AAC7E,EAAA,MAAM,QAAkB,EAAC;AACzB,EAAA,IAAI,OAAA,GAAU,QAAA;AAEd,EAAA,OAAO,OAAA,EAAS;AACd,IAAA,MAAM,IAAA,GAAO,iBAAiB,OAAO,CAAA;AACrC,IAAA,IAAI,IAAA,EAAM;AACR,MAAA,KAAA,CAAM,KAAK,IAAI,CAAA;AAAA,IAC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,IAAA,IAAI;AACF,MAAA,OAAO,EAAA,EAAG;AAAA,IACZ,SAAS,KAAA,EAAO;AACd,MAAA,WAAA,CAAY,OAAO,OAAO,CAAA;AAC1B,MAAA,OAAO,MAAA;AAAA,IACT;AAAA,EACF,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,WAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACF;AAWO,SAAS,eAAe,IAAA,EAA0D;AACvF,EAAA,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAA8B;AACtD,IAAA,IAAI,KAAA,EAAO;AACT,MAAAA,aAAAA,CAAc,QAAQ,KAAK,CAAA;AAAA,IAC7B,CAAA,MAAO;AACL,MAAAA,cAAc,SAAA,EAAU;AAAA,IAC1B;AAAA,EACF,CAAA;AAGA,EAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,IAAY,WAAW,IAAA,EAAM;AAEvD,IAAA,MAAM,WAAY,IAAA,CAAuC,KAAA;AACzD,IAAA,gBAAA,CAAiB,QAAQ,CAAA;AAAA,EAK3B,CAAA,MAAO;AACL,IAAA,gBAAA,CAAiB,IAA0B,CAAA;AAAA,EAC7C;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAAC,OAAA,KAAyBA,aAAAA,CAAc,QAAQ,OAAO,CAAA;AAAA,IAChE,SAAA,EAAW,MAAMA,aAAAA,CAAc,SAAA;AAAU,GAC3C;AACF;AC3QA,IAAO,WAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * Vue Plugin for Error Explorer\n */\n\nimport type { App, ComponentPublicInstance, Plugin } from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { VueErrorExplorerOptions, VueComponentContext } from './types';\n\n/**\n * Get component name from instance\n */\nfunction getComponentName(instance: ComponentPublicInstance | null): string | undefined {\n if (!instance) return undefined;\n\n const options = instance.$.type as { name?: string; __name?: string; __file?: string };\n\n return options.name || options.__name || extractNameFromFile(options.__file);\n}\n\n/**\n * Extract component name from file path\n */\nfunction extractNameFromFile(file?: string): string | undefined {\n if (!file) return undefined;\n\n const match = file.match(/([^/\\\\]+)\\.vue$/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Get component trace (parent hierarchy)\n */\nfunction getComponentTrace(instance: ComponentPublicInstance | null): string[] {\n const trace: string[] = [];\n let current = instance;\n\n while (current) {\n const name = getComponentName(current);\n if (name) {\n trace.push(name);\n }\n current = current.$.parent?.proxy ?? null;\n }\n\n return trace;\n}\n\n/**\n * Serialize component props with depth limit\n */\nfunction serializeProps(\n props: Record<string, unknown>,\n maxDepth: number\n): Record<string, unknown> {\n const serialize = (value: unknown, depth: number): unknown => {\n if (depth > maxDepth) {\n return '[Max depth reached]';\n }\n\n if (value === null || value === undefined) {\n return value;\n }\n\n if (typeof value === 'function') {\n return '[Function]';\n }\n\n if (typeof value === 'symbol') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (value instanceof Error) {\n return { name: value.name, message: value.message };\n }\n\n if (Array.isArray(value)) {\n return value.slice(0, 10).map(item => serialize(item, depth + 1));\n }\n\n if (typeof value === 'object') {\n const serialized: Record<string, unknown> = {};\n const keys = Object.keys(value as Record<string, unknown>).slice(0, 20);\n\n for (const key of keys) {\n serialized[key] = serialize((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return serialized;\n }\n\n return value;\n };\n\n return serialize(props, 0) as Record<string, unknown>;\n}\n\n/**\n * Build Vue component context\n */\nfunction buildVueContext(\n instance: ComponentPublicInstance | null,\n info: string,\n options: VueErrorExplorerOptions\n): VueComponentContext {\n const context: VueComponentContext = {\n info,\n };\n\n if (options.captureComponentName !== false && instance) {\n context.name = getComponentName(instance);\n\n const type = instance.$.type as { __file?: string };\n if (type.__file) {\n context.file = type.__file;\n }\n\n context.trace = getComponentTrace(instance);\n }\n\n if (options.captureComponentProps && instance) {\n const props = instance.$.props;\n if (props && Object.keys(props).length > 0) {\n context.props = serializeProps(props, options.propsDepth ?? 2);\n }\n }\n\n return context;\n}\n\n/**\n * Original handlers storage\n */\nlet originalErrorHandler: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => void) | undefined;\nlet originalWarnHandler: ((msg: string, instance: ComponentPublicInstance | null, trace: string) => void) | undefined;\n\n/**\n * Setup Vue error handler\n */\nfunction setupErrorHandler(app: App, options: VueErrorExplorerOptions): void {\n if (options.vueErrorHandler === false) {\n return;\n }\n\n // Save original handler\n originalErrorHandler = app.config.errorHandler;\n\n app.config.errorHandler = (err: unknown, instance: ComponentPublicInstance | null, info: string) => {\n // Check if we should capture\n if (options.beforeVueCapture) {\n const error = err instanceof Error ? err : new Error(String(err));\n if (!options.beforeVueCapture(error, instance, info)) {\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n return;\n }\n }\n\n // Build Vue context\n const vueContext = buildVueContext(instance, info, options);\n\n // Add breadcrumb for the error\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.error',\n message: err instanceof Error ? err.message : String(err),\n level: 'error',\n data: {\n component: vueContext.name,\n info: vueContext.info,\n },\n });\n\n // Capture the error\n const error = err instanceof Error ? err : new Error(String(err));\n ErrorExplorer.captureException(error, {\n tags: {\n 'vue.component': vueContext.name || 'unknown',\n 'vue.info': info,\n },\n extra: {\n vue: vueContext,\n },\n });\n\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n\n // Re-throw in development for better DX\n if (options.environment === 'development' || import.meta.env?.DEV) {\n console.error('[Vue Error]', err);\n }\n };\n}\n\n/**\n * Setup Vue warning handler\n */\nfunction setupWarnHandler(app: App, options: VueErrorExplorerOptions): void {\n // Default: only in development\n const enableWarn = options.vueWarnHandler ?? (\n options.environment === 'development' || import.meta.env?.DEV\n );\n\n if (!enableWarn) {\n return;\n }\n\n // Save original handler\n originalWarnHandler = app.config.warnHandler;\n\n app.config.warnHandler = (msg: string, instance: ComponentPublicInstance | null, trace: string) => {\n const componentName = getComponentName(instance);\n\n // Add breadcrumb for the warning\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.warn',\n message: msg,\n level: 'warning',\n data: {\n component: componentName,\n trace: trace.split('\\n').slice(0, 5),\n },\n });\n\n // Call original handler if exists\n if (originalWarnHandler) {\n originalWarnHandler(msg, instance, trace);\n }\n\n // Log to console in development\n if (import.meta.env?.DEV) {\n console.warn('[Vue Warn]', msg);\n if (trace) {\n console.warn(trace);\n }\n }\n };\n}\n\n/**\n * Restore original handlers\n */\nexport function restoreHandlers(app: App): void {\n if (originalErrorHandler !== undefined) {\n app.config.errorHandler = originalErrorHandler;\n originalErrorHandler = undefined;\n }\n\n if (originalWarnHandler !== undefined) {\n app.config.warnHandler = originalWarnHandler;\n originalWarnHandler = undefined;\n }\n}\n\n/**\n * Create Vue plugin for Error Explorer\n */\nexport function createErrorExplorerPlugin(options: VueErrorExplorerOptions = {} as VueErrorExplorerOptions): Plugin {\n return {\n install(app: App) {\n // Initialize Error Explorer if not already done\n if (!ErrorExplorer.isInitialized()) {\n ErrorExplorer.init(options);\n }\n\n // Setup handlers\n setupErrorHandler(app, options);\n setupWarnHandler(app, options);\n\n // Provide Error Explorer instance globally\n app.provide('errorExplorer', ErrorExplorer);\n\n // Add global property for Options API access\n app.config.globalProperties.$errorExplorer = ErrorExplorer;\n\n // Add breadcrumb for app mount\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'vue.lifecycle',\n message: 'Vue app mounted',\n level: 'info',\n });\n },\n };\n}\n\n// Declare module augmentation for global properties\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $errorExplorer: typeof ErrorExplorer;\n }\n}\n","/**\n * Vue Router integration for Error Explorer\n * Adds navigation breadcrumbs automatically\n */\n\nimport type { Router, RouteLocationNormalized } from 'vue-router';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * Router integration options\n */\nexport interface RouterIntegrationOptions {\n /**\n * Track route changes as breadcrumbs\n * @default true\n */\n trackNavigation?: boolean;\n\n /**\n * Track route params in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackParams?: boolean;\n\n /**\n * Track query parameters in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackQuery?: boolean;\n\n /**\n * Custom function to extract route name for breadcrumb\n */\n getRouteName?: (route: RouteLocationNormalized) => string;\n\n /**\n * Hook called before adding navigation breadcrumb\n * Return false to skip the breadcrumb\n */\n beforeNavigationBreadcrumb?: (\n from: RouteLocationNormalized,\n to: RouteLocationNormalized\n ) => boolean;\n}\n\n/**\n * Default route name extractor\n */\nfunction defaultGetRouteName(route: RouteLocationNormalized): string {\n if (route.name && typeof route.name === 'string') {\n return route.name;\n }\n\n // Use path as fallback\n return route.path || '/';\n}\n\n/**\n * Build route data for breadcrumb\n */\nfunction buildRouteData(\n route: RouteLocationNormalized,\n options: RouterIntegrationOptions\n): Record<string, unknown> {\n const data: Record<string, unknown> = {\n path: route.path,\n name: route.name,\n fullPath: route.fullPath,\n };\n\n if (options.trackParams && Object.keys(route.params).length > 0) {\n data.params = { ...route.params };\n }\n\n if (options.trackQuery && Object.keys(route.query).length > 0) {\n data.query = { ...route.query };\n }\n\n if (route.meta && Object.keys(route.meta).length > 0) {\n // Only include safe meta properties\n const safeMeta: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(route.meta)) {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n safeMeta[key] = value;\n }\n }\n if (Object.keys(safeMeta).length > 0) {\n data.meta = safeMeta;\n }\n }\n\n return data;\n}\n\n/**\n * Setup Vue Router integration\n */\nexport function setupRouterIntegration(\n router: Router,\n options: RouterIntegrationOptions = {}\n): () => void {\n if (options.trackNavigation === false) {\n return () => {};\n }\n\n const getRouteName = options.getRouteName || defaultGetRouteName;\n\n // Track navigation start time\n let navigationStartTime: number | null = null;\n\n // Before each navigation\n const beforeEachGuard = router.beforeEach((to, from) => {\n navigationStartTime = performance.now();\n\n // Add breadcrumb for navigation start\n if (from.name || from.path !== '/') {\n const shouldAdd = options.beforeNavigationBreadcrumb\n ? options.beforeNavigationBreadcrumb(from, to)\n : true;\n\n if (shouldAdd) {\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,\n level: 'info',\n data: {\n from: buildRouteData(from, options),\n to: buildRouteData(to, options),\n },\n });\n }\n }\n\n return true;\n });\n\n // After each navigation\n const afterEachGuard = router.afterEach((to, from, failure) => {\n const duration = navigationStartTime ? performance.now() - navigationStartTime : undefined;\n navigationStartTime = null;\n\n if (failure) {\n // Navigation failed\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router.error',\n message: `Navigation failed to ${getRouteName(to)}`,\n level: 'error',\n data: {\n to: buildRouteData(to, options),\n error: failure.message,\n type: failure.type,\n duration,\n },\n });\n\n // Capture as exception if it's a real error\n if (failure.type !== 4) { // Not aborted\n ErrorExplorer.captureException(failure, {\n tags: {\n 'router.error': 'navigation_failure',\n 'router.to': getRouteName(to),\n },\n });\n }\n } else {\n // Navigation succeeded\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigated to ${getRouteName(to)}`,\n level: 'info',\n data: {\n route: buildRouteData(to, options),\n duration,\n },\n });\n }\n });\n\n // Handle router errors\n const errorHandler = router.onError((error) => {\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'router.error',\n message: error.message,\n level: 'error',\n });\n\n ErrorExplorer.captureException(error, {\n tags: {\n 'router.error': 'unhandled',\n },\n });\n });\n\n // Return cleanup function\n return () => {\n beforeEachGuard();\n afterEachGuard();\n errorHandler();\n };\n}\n\n/**\n * Create a Vue Router plugin that integrates with Error Explorer\n */\nexport function createRouterIntegration(options: RouterIntegrationOptions = {}) {\n let cleanup: (() => void) | null = null;\n\n return {\n /**\n * Install the router integration\n */\n install(router: Router): void {\n cleanup = setupRouterIntegration(router, options);\n },\n\n /**\n * Uninstall the router integration\n */\n uninstall(): void {\n if (cleanup) {\n cleanup();\n cleanup = null;\n }\n },\n };\n}\n\nexport type { Router, RouteLocationNormalized };\n","/**\n * ErrorBoundary component for Vue 3\n * Catches errors in child components and reports them to Error Explorer\n */\n\nimport {\n defineComponent,\n h,\n ref,\n onErrorCaptured,\n type PropType,\n type VNode,\n type Slot,\n} from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * ErrorBoundary component\n *\n * Usage:\n * ```vue\n * <ErrorBoundary @error=\"handleError\" :fallback=\"ErrorFallback\">\n * <MyComponent />\n * </ErrorBoundary>\n * ```\n *\n * Or with scoped slot for fallback:\n * ```vue\n * <ErrorBoundary>\n * <template #default>\n * <MyComponent />\n * </template>\n * <template #fallback=\"{ error, reset }\">\n * <div>\n * <p>Error: {{ error.message }}</p>\n * <button @click=\"reset\">Retry</button>\n * </div>\n * </template>\n * </ErrorBoundary>\n * ```\n */\nexport const ErrorBoundary = defineComponent({\n name: 'ErrorBoundary',\n\n props: {\n /**\n * Whether to capture the error to Error Explorer\n */\n capture: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional tags to add when capturing\n */\n tags: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n\n /**\n * Additional context to add when capturing\n */\n context: {\n type: Object as PropType<Record<string, unknown>>,\n default: () => ({}),\n },\n\n /**\n * Fallback component to render when an error occurs\n */\n fallback: {\n type: [Object, Function, null] as PropType<VNode | (() => VNode) | null>,\n default: null,\n },\n\n /**\n * Whether to stop error propagation\n */\n stopPropagation: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: {\n /**\n * Emitted when an error is caught\n */\n error: (error: Error, info: string) => true,\n\n /**\n * Emitted when the error state is reset\n */\n reset: () => true,\n },\n\n setup(props, { slots, emit, expose }) {\n const error = ref<Error | null>(null);\n const errorInfo = ref<string>('');\n\n /**\n * Reset the error state\n */\n const reset = () => {\n error.value = null;\n errorInfo.value = '';\n emit('reset');\n };\n\n // Capture errors from child components\n onErrorCaptured((err: unknown, instance, info: string) => {\n const capturedError = err instanceof Error ? err : new Error(String(err));\n\n error.value = capturedError;\n errorInfo.value = info;\n\n // Emit error event\n emit('error', capturedError, info);\n\n // Add breadcrumb\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.errorBoundary',\n message: capturedError.message,\n level: 'error',\n data: {\n info,\n component: instance?.$.type\n ? (instance.$.type as { name?: string }).name\n : undefined,\n },\n });\n\n // Capture to Error Explorer if enabled\n if (props.capture) {\n ErrorExplorer.captureException(capturedError, {\n tags: {\n 'errorBoundary': 'true',\n 'vue.info': info,\n ...props.tags,\n },\n extra: {\n errorBoundary: {\n info,\n context: props.context,\n },\n },\n });\n }\n\n // Return true to stop propagation, false to continue\n return props.stopPropagation;\n });\n\n // Expose methods and state\n expose({\n reset,\n error,\n });\n\n return () => {\n // If there's an error, render fallback\n if (error.value) {\n // Check for fallback slot\n if (slots.fallback) {\n return slots.fallback({\n error: error.value,\n info: errorInfo.value,\n reset,\n });\n }\n\n // Check for fallback prop\n if (props.fallback) {\n if (typeof props.fallback === 'function') {\n return props.fallback();\n }\n return props.fallback;\n }\n\n // Default fallback\n return h('div', { class: 'error-boundary-fallback' }, [\n h('p', { style: 'color: red;' }, `Error: ${error.value.message}`),\n h(\n 'button',\n {\n onClick: reset,\n style: 'margin-top: 8px; padding: 4px 12px; cursor: pointer;',\n },\n 'Try Again'\n ),\n ]);\n }\n\n // No error, render default slot\n return slots.default?.();\n };\n },\n});\n\n/**\n * Higher-order component to wrap a component with ErrorBoundary\n */\nexport function withErrorBoundary<T extends { new (): any }>(\n Component: T,\n options: {\n capture?: boolean;\n tags?: Record<string, string>;\n context?: Record<string, unknown>;\n fallback?: VNode | (() => VNode);\n onError?: (error: Error, info: string) => void;\n } = {}\n) {\n return defineComponent({\n name: `WithErrorBoundary(${(Component as any).name || 'Component'})`,\n\n setup(_, { attrs, slots }) {\n return () =>\n h(\n ErrorBoundary,\n {\n capture: options.capture ?? true,\n tags: options.tags ?? {},\n context: options.context ?? {},\n fallback: options.fallback ?? null,\n onError: options.onError,\n },\n {\n default: () => h(Component as any, attrs, slots),\n }\n );\n },\n });\n}\n\nexport type ErrorBoundaryInstance = InstanceType<typeof ErrorBoundary>;\n","/**\n * Vue 3 Composables for Error Explorer\n */\n\nimport { inject, onMounted, onUnmounted, getCurrentInstance } from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { Breadcrumb, CaptureContext, UserContext } from '@error-explorer/browser';\n\n/**\n * Injection key for Error Explorer\n */\nexport const ErrorExplorerKey = Symbol('errorExplorer');\n\n/**\n * Use Error Explorer instance\n *\n * @example\n * ```ts\n * const { captureException, addBreadcrumb } = useErrorExplorer();\n *\n * try {\n * await riskyOperation();\n * } catch (error) {\n * captureException(error);\n * }\n * ```\n */\nexport function useErrorExplorer() {\n // Try to get from injection (if using plugin)\n const injected = inject<typeof ErrorExplorer | null>(ErrorExplorerKey, null) ||\n inject<typeof ErrorExplorer | null>('errorExplorer', null);\n\n // Fall back to singleton\n const errorExplorer = injected || ErrorExplorer;\n\n return {\n /**\n * Check if Error Explorer is initialized\n */\n isInitialized: () => errorExplorer.isInitialized(),\n\n /**\n * Capture an exception\n */\n captureException: (error: Error, context?: CaptureContext) =>\n errorExplorer.captureException(error, context),\n\n /**\n * Capture a message\n */\n captureMessage: (message: string, level?: 'debug' | 'info' | 'warning' | 'error' | 'critical') =>\n errorExplorer.captureMessage(message, level),\n\n /**\n * Add a breadcrumb\n */\n addBreadcrumb: (breadcrumb: Breadcrumb) =>\n errorExplorer.addBreadcrumb(breadcrumb),\n\n /**\n * Set user context\n */\n setUser: (user: UserContext) => errorExplorer.setUser(user),\n\n /**\n * Clear user context\n */\n clearUser: () => errorExplorer.clearUser(),\n\n /**\n * Set a tag\n */\n setTag: (key: string, value: string) => errorExplorer.setTag(key, value),\n\n /**\n * Set multiple tags\n */\n setTags: (tags: Record<string, string>) => errorExplorer.setTags(tags),\n\n /**\n * Set extra context\n */\n setExtra: (extra: Record<string, unknown>) => errorExplorer.setExtra(extra),\n\n /**\n * Set named context\n */\n setContext: (name: string, context: Record<string, unknown>) =>\n errorExplorer.setContext(name, context),\n\n /**\n * Flush pending events\n */\n flush: (timeout?: number) => errorExplorer.flush(timeout),\n\n /**\n * Close the SDK\n */\n close: (timeout?: number) => errorExplorer.close(timeout),\n };\n}\n\n/**\n * Track component lifecycle for debugging\n *\n * @example\n * ```ts\n * // In setup()\n * useComponentBreadcrumbs();\n * ```\n */\nexport function useComponentBreadcrumbs() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n onMounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} mounted`,\n level: 'debug',\n });\n });\n\n onUnmounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} unmounted`,\n level: 'debug',\n });\n });\n}\n\n/**\n * Create a breadcrumb tracker for user actions\n *\n * @example\n * ```ts\n * const { trackAction } = useActionTracker();\n *\n * const handleClick = () => {\n * trackAction('button_clicked', { buttonId: 'submit' });\n * // ... actual handler\n * };\n * ```\n */\nexport function useActionTracker() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n return {\n /**\n * Track a user action\n */\n trackAction: (action: string, data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: 'action',\n message: action,\n level: 'info',\n data: {\n component: componentName,\n ...data,\n },\n });\n },\n\n /**\n * Track a UI interaction\n */\n trackInteraction: (element: string, action: 'click' | 'input' | 'focus' | 'blur' | 'submit', data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: `ui.${action}`,\n message: `${action} on ${element}`,\n level: 'info',\n data: {\n component: componentName,\n element,\n ...data,\n },\n });\n },\n };\n}\n\n/**\n * Create an error handler for async operations\n *\n * @example\n * ```ts\n * const { wrapAsync, handleError } = useErrorHandler();\n *\n * // Option 1: Wrap async function\n * const safeSubmit = wrapAsync(async () => {\n * await api.submit(data);\n * });\n *\n * // Option 2: Manual handling\n * try {\n * await riskyOperation();\n * } catch (error) {\n * handleError(error, { tags: { operation: 'risky' } });\n * }\n * ```\n */\nexport function useErrorHandler(defaultContext?: CaptureContext) {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n /**\n * Handle an error with context\n */\n const handleError = (error: unknown, context?: CaptureContext) => {\n const err = error instanceof Error ? error : new Error(String(error));\n\n ErrorExplorer.captureException(err, {\n ...defaultContext,\n ...context,\n tags: {\n 'vue.component': componentName,\n ...defaultContext?.tags,\n ...context?.tags,\n },\n });\n\n return err;\n };\n\n /**\n * Wrap an async function with error handling\n */\n const wrapAsync = <T extends (...args: any[]) => Promise<any>>(\n fn: T,\n context?: CaptureContext\n ): ((...args: Parameters<T>) => Promise<Awaited<ReturnType<T>> | undefined>) => {\n return async (...args: Parameters<T>) => {\n try {\n return await fn(...args);\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n };\n\n /**\n * Create a try-catch wrapper that captures errors\n */\n const tryCatch = <T>(fn: () => T, context?: CaptureContext): T | undefined => {\n try {\n return fn();\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n\n return {\n handleError,\n wrapAsync,\n tryCatch,\n };\n}\n\n/**\n * Set user context from a reactive source\n *\n * @example\n * ```ts\n * const user = ref({ id: '123', email: 'user@example.com' });\n * useUserContext(user);\n * ```\n */\nexport function useUserContext(user: { value: UserContext | null } | UserContext | null) {\n const setUserFromValue = (value: UserContext | null) => {\n if (value) {\n ErrorExplorer.setUser(value);\n } else {\n ErrorExplorer.clearUser();\n }\n };\n\n // Handle both refs and plain objects\n if (user && typeof user === 'object' && 'value' in user) {\n // It's a ref - cast to the expected type\n const refValue = (user as { value: UserContext | null }).value;\n setUserFromValue(refValue);\n\n // Note: We don't set up a watcher here because that would require\n // importing watch from vue, which adds complexity.\n // Users should manually call setUser when the user changes.\n } else {\n setUserFromValue(user as UserContext | null);\n }\n\n return {\n setUser: (newUser: UserContext) => ErrorExplorer.setUser(newUser),\n clearUser: () => ErrorExplorer.clearUser(),\n };\n}\n","/**\n * @error-explorer/vue\n * Error Explorer SDK for Vue.js 3 - Automatic error tracking with Vue integration\n */\n\n// Plugin\nexport { createErrorExplorerPlugin, restoreHandlers } from './plugin';\n\n// Router Integration\nexport {\n setupRouterIntegration,\n createRouterIntegration,\n type RouterIntegrationOptions,\n} from './router';\n\n// Components\nexport { ErrorBoundary, withErrorBoundary, type ErrorBoundaryInstance } from './ErrorBoundary';\n\n// Composables\nexport {\n useErrorExplorer,\n useComponentBreadcrumbs,\n useActionTracker,\n useErrorHandler,\n useUserContext,\n ErrorExplorerKey,\n} from './composables';\n\n// Types\nexport type {\n VueErrorExplorerOptions,\n VueComponentContext,\n VuePluginInstall,\n ErrorBoundaryProps,\n ErrorBoundaryExposed,\n InitOptions,\n UserContext,\n Breadcrumb,\n CaptureContext,\n} from './types';\n\n// Re-export ErrorExplorer for direct access\nexport { ErrorExplorer } from '@error-explorer/browser';\n\n// Default export is the plugin creator for convenience\nimport { createErrorExplorerPlugin } from './plugin';\nexport default createErrorExplorerPlugin;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/router.ts","../src/plugin.ts","../src/ErrorBoundary.ts","../src/composables.ts","../src/index.ts"],"names":["error","ErrorExplorer"],"mappings":";;;;;AAgDA,SAAS,oBAAoB,KAAA,EAAwC;AACnE,EAAA,IAAI,KAAA,CAAM,IAAA,IAAQ,OAAO,KAAA,CAAM,SAAS,QAAA,EAAU;AAChD,IAAA,OAAO,KAAA,CAAM,IAAA;AAAA,EACf;AAGA,EAAA,OAAO,MA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E,IAAA,IAAI;AACF,MAAA,OAAO,EAAA,EAAG;AAAA,IACZ,SAAS,KAAA,EAAO;AACd,MAAA,WAAA,CAAY,OAAO,OAAO,CAAA;AAC1B,MAAA,OAAO,MAAA;AAAA,IACT;AAAA,EACF,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,WAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACF;AAWO,SAAS,eAAe,IAAA,EAA0D;AACvF,EAAA,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAA8B;AACtD,IAAA,IAAI,KAAA,EAAO;AACT,MAAAA,aAAAA,CAAc,QAAQ,KAAK,CAAA;AAAA,IAC7B,CAAA,MAAO;AACL,MAAAA,cAAc,SAAA,EAAU;AAAA,IAC1B;AAAA,EACF,CAAA;AAGA,EAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,IAAY,WAAW,IAAA,EAAM;AAEvD,IAAA,MAAM,WAAY,IAAA,CAAuC,KAAA;AACzD,IAAA,gBAAA,CAAiB,QAAQ,CAAA;AAAA,EAK3B,CAAA,MAAO;AACL,IAAA,gBAAA,CAAiB,IAA0B,CAAA;AAAA,EAC7C;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAAC,OAAA,KAAyBA,aAAAA,CAAc,QAAQ,OAAO,CAAA;AAAA,IAChE,SAAA,EAAW,MAAMA,aAAAA,CAAc,SAAA;AAAU,GAC3C;AACF;AC3QA,IAAO,WAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * Vue Router integration for Error Explorer\n * Adds navigation breadcrumbs automatically\n */\n\nimport type { Router, RouteLocationNormalized } from 'vue-router';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * Router integration options\n */\nexport interface RouterIntegrationOptions {\n /**\n * Track route changes as breadcrumbs\n * @default true\n */\n trackNavigation?: boolean;\n\n /**\n * Track route params in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackParams?: boolean;\n\n /**\n * Track query parameters in breadcrumbs\n * @default false (may contain sensitive data)\n */\n trackQuery?: boolean;\n\n /**\n * Custom function to extract route name for breadcrumb\n */\n getRouteName?: (route: RouteLocationNormalized) => string;\n\n /**\n * Hook called before adding navigation breadcrumb\n * Return false to skip the breadcrumb\n */\n beforeNavigationBreadcrumb?: (\n from: RouteLocationNormalized,\n to: RouteLocationNormalized\n ) => boolean;\n}\n\n/**\n * Default route name extractor\n */\nfunction defaultGetRouteName(route: RouteLocationNormalized): string {\n if (route.name && typeof route.name === 'string') {\n return route.name;\n }\n\n // Use path as fallback\n return route.path || '/';\n}\n\n/**\n * Build route data for breadcrumb\n */\nfunction buildRouteData(\n route: RouteLocationNormalized,\n options: RouterIntegrationOptions\n): Record<string, unknown> {\n const data: Record<string, unknown> = {\n path: route.path,\n name: route.name,\n fullPath: route.fullPath,\n };\n\n if (options.trackParams && Object.keys(route.params).length > 0) {\n data.params = { ...route.params };\n }\n\n if (options.trackQuery && Object.keys(route.query).length > 0) {\n data.query = { ...route.query };\n }\n\n if (route.meta && Object.keys(route.meta).length > 0) {\n // Only include safe meta properties\n const safeMeta: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(route.meta)) {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n safeMeta[key] = value;\n }\n }\n if (Object.keys(safeMeta).length > 0) {\n data.meta = safeMeta;\n }\n }\n\n return data;\n}\n\n/**\n * Setup Vue Router integration\n */\nexport function setupRouterIntegration(\n router: Router,\n options: RouterIntegrationOptions = {}\n): () => void {\n if (options.trackNavigation === false) {\n return () => {};\n }\n\n const getRouteName = options.getRouteName || defaultGetRouteName;\n\n // Track navigation start time\n let navigationStartTime: number | null = null;\n\n // Before each navigation\n const beforeEachGuard = router.beforeEach((to, from) => {\n navigationStartTime = performance.now();\n\n // Add breadcrumb for navigation start\n if (from.name || from.path !== '/') {\n const shouldAdd = options.beforeNavigationBreadcrumb\n ? options.beforeNavigationBreadcrumb(from, to)\n : true;\n\n if (shouldAdd) {\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigating from ${getRouteName(from)} to ${getRouteName(to)}`,\n level: 'info',\n data: {\n from: buildRouteData(from, options),\n to: buildRouteData(to, options),\n },\n });\n }\n }\n\n return true;\n });\n\n // After each navigation\n const afterEachGuard = router.afterEach((to, from, failure) => {\n const duration = navigationStartTime ? performance.now() - navigationStartTime : undefined;\n navigationStartTime = null;\n\n if (failure) {\n // Navigation failed\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router.error',\n message: `Navigation failed to ${getRouteName(to)}`,\n level: 'error',\n data: {\n to: buildRouteData(to, options),\n error: failure.message,\n type: failure.type,\n duration,\n },\n });\n\n // Capture as exception if it's a real error\n if (failure.type !== 4) { // Not aborted\n ErrorExplorer.captureException(failure, {\n tags: {\n 'router.error': 'navigation_failure',\n 'router.to': getRouteName(to),\n },\n });\n }\n } else {\n // Navigation succeeded\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'router',\n message: `Navigated to ${getRouteName(to)}`,\n level: 'info',\n data: {\n route: buildRouteData(to, options),\n duration,\n },\n });\n }\n });\n\n // Handle router errors\n const errorHandler = router.onError((error) => {\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'router.error',\n message: error.message,\n level: 'error',\n });\n\n ErrorExplorer.captureException(error, {\n tags: {\n 'router.error': 'unhandled',\n },\n });\n });\n\n // Return cleanup function\n return () => {\n beforeEachGuard();\n afterEachGuard();\n errorHandler();\n };\n}\n\n/**\n * Create a Vue Router plugin that integrates with Error Explorer\n */\nexport function createRouterIntegration(options: RouterIntegrationOptions = {}) {\n let cleanup: (() => void) | null = null;\n\n return {\n /**\n * Install the router integration\n */\n install(router: Router): void {\n cleanup = setupRouterIntegration(router, options);\n },\n\n /**\n * Uninstall the router integration\n */\n uninstall(): void {\n if (cleanup) {\n cleanup();\n cleanup = null;\n }\n },\n };\n}\n\nexport type { Router, RouteLocationNormalized };\n","/**\n * Vue Plugin for Error Explorer\n */\n\nimport type { App, ComponentPublicInstance, Plugin } from 'vue';\nimport type { Router } from 'vue-router';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { VueErrorExplorerOptions, VueComponentContext } from './types';\nimport { setupRouterIntegration } from './router';\n\n/**\n * Get component name from instance\n */\nfunction getComponentName(instance: ComponentPublicInstance | null): string | undefined {\n if (!instance) return undefined;\n\n const options = instance.$.type as { name?: string; __name?: string; __file?: string };\n\n return options.name || options.__name || extractNameFromFile(options.__file);\n}\n\n/**\n * Extract component name from file path\n */\nfunction extractNameFromFile(file?: string): string | undefined {\n if (!file) return undefined;\n\n const match = file.match(/([^/\\\\]+)\\.vue$/);\n return match ? match[1] : undefined;\n}\n\n/**\n * Get component trace (parent hierarchy)\n */\nfunction getComponentTrace(instance: ComponentPublicInstance | null): string[] {\n const trace: string[] = [];\n let current = instance;\n\n while (current) {\n const name = getComponentName(current);\n if (name) {\n trace.push(name);\n }\n current = current.$.parent?.proxy ?? null;\n }\n\n return trace;\n}\n\n/**\n * Serialize component props with depth limit\n */\nfunction serializeProps(\n props: Record<string, unknown>,\n maxDepth: number\n): Record<string, unknown> {\n const serialize = (value: unknown, depth: number): unknown => {\n if (depth > maxDepth) {\n return '[Max depth reached]';\n }\n\n if (value === null || value === undefined) {\n return value;\n }\n\n if (typeof value === 'function') {\n return '[Function]';\n }\n\n if (typeof value === 'symbol') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (value instanceof Error) {\n return { name: value.name, message: value.message };\n }\n\n if (Array.isArray(value)) {\n return value.slice(0, 10).map(item => serialize(item, depth + 1));\n }\n\n if (typeof value === 'object') {\n const serialized: Record<string, unknown> = {};\n const keys = Object.keys(value as Record<string, unknown>).slice(0, 20);\n\n for (const key of keys) {\n serialized[key] = serialize((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return serialized;\n }\n\n return value;\n };\n\n return serialize(props, 0) as Record<string, unknown>;\n}\n\n/**\n * Build Vue component context\n */\nfunction buildVueContext(\n instance: ComponentPublicInstance | null,\n info: string,\n options: VueErrorExplorerOptions\n): VueComponentContext {\n const context: VueComponentContext = {\n info,\n };\n\n if (options.captureComponentName !== false && instance) {\n context.name = getComponentName(instance);\n\n const type = instance.$.type as { __file?: string };\n if (type.__file) {\n context.file = type.__file;\n }\n\n context.trace = getComponentTrace(instance);\n }\n\n if (options.captureComponentProps && instance) {\n const props = instance.$.props;\n if (props && Object.keys(props).length > 0) {\n context.props = serializeProps(props, options.propsDepth ?? 2);\n }\n }\n\n return context;\n}\n\n/**\n * Original handlers storage\n */\nlet originalErrorHandler: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => void) | undefined;\nlet originalWarnHandler: ((msg: string, instance: ComponentPublicInstance | null, trace: string) => void) | undefined;\n\n/**\n * Setup Vue error handler\n */\nfunction setupErrorHandler(app: App, options: VueErrorExplorerOptions): void {\n if (options.vueErrorHandler === false) {\n return;\n }\n\n // Save original handler\n originalErrorHandler = app.config.errorHandler;\n\n app.config.errorHandler = (err: unknown, instance: ComponentPublicInstance | null, info: string) => {\n // Check if we should capture\n if (options.beforeVueCapture) {\n const error = err instanceof Error ? err : new Error(String(err));\n if (!options.beforeVueCapture(error, instance, info)) {\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n return;\n }\n }\n\n // Build Vue context\n const vueContext = buildVueContext(instance, info, options);\n\n // Add breadcrumb for the error\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.error',\n message: err instanceof Error ? err.message : String(err),\n level: 'error',\n data: {\n component: vueContext.name,\n info: vueContext.info,\n },\n });\n\n // Capture the error\n const error = err instanceof Error ? err : new Error(String(err));\n ErrorExplorer.captureException(error, {\n tags: {\n 'vue.component': vueContext.name || 'unknown',\n 'vue.info': info,\n },\n extra: {\n vue: vueContext,\n },\n });\n\n // Call original handler if exists\n if (originalErrorHandler) {\n originalErrorHandler(err, instance, info);\n }\n\n // Re-throw in development for better DX\n if (options.environment === 'development' || import.meta.env?.DEV) {\n console.error('[Vue Error]', err);\n }\n };\n}\n\n/**\n * Setup Vue warning handler\n */\nfunction setupWarnHandler(app: App, options: VueErrorExplorerOptions): void {\n // Default: only in development\n const enableWarn = options.vueWarnHandler ?? (\n options.environment === 'development' || import.meta.env?.DEV\n );\n\n if (!enableWarn) {\n return;\n }\n\n // Save original handler\n originalWarnHandler = app.config.warnHandler;\n\n app.config.warnHandler = (msg: string, instance: ComponentPublicInstance | null, trace: string) => {\n const componentName = getComponentName(instance);\n\n // Add breadcrumb for the warning\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.warn',\n message: msg,\n level: 'warning',\n data: {\n component: componentName,\n trace: trace.split('\\n').slice(0, 5),\n },\n });\n\n // Call original handler if exists\n if (originalWarnHandler) {\n originalWarnHandler(msg, instance, trace);\n }\n\n // Log to console in development\n if (import.meta.env?.DEV) {\n console.warn('[Vue Warn]', msg);\n if (trace) {\n console.warn(trace);\n }\n }\n };\n}\n\n/**\n * Router cleanup function storage\n */\nlet routerCleanup: (() => void) | null = null;\n\n/**\n * Setup router integration if configured\n */\nfunction setupRouter(options: VueErrorExplorerOptions): void {\n if (options.router === false || options.router === undefined) {\n return;\n }\n\n let router: Router;\n let routerOptions = {};\n\n if ('instance' in options.router) {\n // Object with instance and options\n router = options.router.instance;\n routerOptions = options.router.options || {};\n } else {\n // Direct Router instance\n router = options.router;\n }\n\n routerCleanup = setupRouterIntegration(router, routerOptions);\n}\n\n/**\n * Restore original handlers\n */\nexport function restoreHandlers(app: App): void {\n if (originalErrorHandler !== undefined) {\n app.config.errorHandler = originalErrorHandler;\n originalErrorHandler = undefined;\n }\n\n if (originalWarnHandler !== undefined) {\n app.config.warnHandler = originalWarnHandler;\n originalWarnHandler = undefined;\n }\n\n if (routerCleanup) {\n routerCleanup();\n routerCleanup = null;\n }\n}\n\n/**\n * Create Vue plugin for Error Explorer\n */\nexport function createErrorExplorerPlugin(options: VueErrorExplorerOptions = {} as VueErrorExplorerOptions): Plugin {\n return {\n install(app: App) {\n // Initialize Error Explorer if not already done\n if (!ErrorExplorer.isInitialized()) {\n ErrorExplorer.init(options);\n }\n\n // Setup handlers\n setupErrorHandler(app, options);\n setupWarnHandler(app, options);\n\n // Setup router integration if configured\n setupRouter(options);\n\n // Provide Error Explorer instance globally\n app.provide('errorExplorer', ErrorExplorer);\n\n // Add global property for Options API access\n app.config.globalProperties.$errorExplorer = ErrorExplorer;\n\n // Add breadcrumb for app mount\n ErrorExplorer.addBreadcrumb({\n type: 'navigation',\n category: 'vue.lifecycle',\n message: 'Vue app mounted',\n level: 'info',\n });\n },\n };\n}\n\n// Declare module augmentation for global properties\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $errorExplorer: typeof ErrorExplorer;\n }\n}\n","/**\n * ErrorBoundary component for Vue 3\n * Catches errors in child components and reports them to Error Explorer\n */\n\nimport {\n defineComponent,\n h,\n ref,\n onErrorCaptured,\n type PropType,\n type VNode,\n type Slot,\n} from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\n\n/**\n * ErrorBoundary component\n *\n * Usage:\n * ```vue\n * <ErrorBoundary @error=\"handleError\" :fallback=\"ErrorFallback\">\n * <MyComponent />\n * </ErrorBoundary>\n * ```\n *\n * Or with scoped slot for fallback:\n * ```vue\n * <ErrorBoundary>\n * <template #default>\n * <MyComponent />\n * </template>\n * <template #fallback=\"{ error, reset }\">\n * <div>\n * <p>Error: {{ error.message }}</p>\n * <button @click=\"reset\">Retry</button>\n * </div>\n * </template>\n * </ErrorBoundary>\n * ```\n */\nexport const ErrorBoundary = defineComponent({\n name: 'ErrorBoundary',\n\n props: {\n /**\n * Whether to capture the error to Error Explorer\n */\n capture: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional tags to add when capturing\n */\n tags: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n\n /**\n * Additional context to add when capturing\n */\n context: {\n type: Object as PropType<Record<string, unknown>>,\n default: () => ({}),\n },\n\n /**\n * Fallback component to render when an error occurs\n */\n fallback: {\n type: [Object, Function, null] as PropType<VNode | (() => VNode) | null>,\n default: null,\n },\n\n /**\n * Whether to stop error propagation\n */\n stopPropagation: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: {\n /**\n * Emitted when an error is caught\n */\n error: (error: Error, info: string) => true,\n\n /**\n * Emitted when the error state is reset\n */\n reset: () => true,\n },\n\n setup(props, { slots, emit, expose }) {\n const error = ref<Error | null>(null);\n const errorInfo = ref<string>('');\n\n /**\n * Reset the error state\n */\n const reset = () => {\n error.value = null;\n errorInfo.value = '';\n emit('reset');\n };\n\n // Capture errors from child components\n onErrorCaptured((err: unknown, instance, info: string) => {\n const capturedError = err instanceof Error ? err : new Error(String(err));\n\n error.value = capturedError;\n errorInfo.value = info;\n\n // Emit error event\n emit('error', capturedError, info);\n\n // Add breadcrumb\n ErrorExplorer.addBreadcrumb({\n type: 'error',\n category: 'vue.errorBoundary',\n message: capturedError.message,\n level: 'error',\n data: {\n info,\n component: instance?.$.type\n ? (instance.$.type as { name?: string }).name\n : undefined,\n },\n });\n\n // Capture to Error Explorer if enabled\n if (props.capture) {\n ErrorExplorer.captureException(capturedError, {\n tags: {\n 'errorBoundary': 'true',\n 'vue.info': info,\n ...props.tags,\n },\n extra: {\n errorBoundary: {\n info,\n context: props.context,\n },\n },\n });\n }\n\n // Return true to stop propagation, false to continue\n return props.stopPropagation;\n });\n\n // Expose methods and state\n expose({\n reset,\n error,\n });\n\n return () => {\n // If there's an error, render fallback\n if (error.value) {\n // Check for fallback slot\n if (slots.fallback) {\n return slots.fallback({\n error: error.value,\n info: errorInfo.value,\n reset,\n });\n }\n\n // Check for fallback prop\n if (props.fallback) {\n if (typeof props.fallback === 'function') {\n return props.fallback();\n }\n return props.fallback;\n }\n\n // Default fallback\n return h('div', { class: 'error-boundary-fallback' }, [\n h('p', { style: 'color: red;' }, `Error: ${error.value.message}`),\n h(\n 'button',\n {\n onClick: reset,\n style: 'margin-top: 8px; padding: 4px 12px; cursor: pointer;',\n },\n 'Try Again'\n ),\n ]);\n }\n\n // No error, render default slot\n return slots.default?.();\n };\n },\n});\n\n/**\n * Higher-order component to wrap a component with ErrorBoundary\n */\nexport function withErrorBoundary<T extends { new (): any }>(\n Component: T,\n options: {\n capture?: boolean;\n tags?: Record<string, string>;\n context?: Record<string, unknown>;\n fallback?: VNode | (() => VNode);\n onError?: (error: Error, info: string) => void;\n } = {}\n) {\n return defineComponent({\n name: `WithErrorBoundary(${(Component as any).name || 'Component'})`,\n\n setup(_, { attrs, slots }) {\n return () =>\n h(\n ErrorBoundary,\n {\n capture: options.capture ?? true,\n tags: options.tags ?? {},\n context: options.context ?? {},\n fallback: options.fallback ?? null,\n onError: options.onError,\n },\n {\n default: () => h(Component as any, attrs, slots),\n }\n );\n },\n });\n}\n\nexport type ErrorBoundaryInstance = InstanceType<typeof ErrorBoundary>;\n","/**\n * Vue 3 Composables for Error Explorer\n */\n\nimport { inject, onMounted, onUnmounted, getCurrentInstance } from 'vue';\nimport { ErrorExplorer } from '@error-explorer/browser';\nimport type { Breadcrumb, CaptureContext, UserContext } from '@error-explorer/browser';\n\n/**\n * Injection key for Error Explorer\n */\nexport const ErrorExplorerKey = Symbol('errorExplorer');\n\n/**\n * Use Error Explorer instance\n *\n * @example\n * ```ts\n * const { captureException, addBreadcrumb } = useErrorExplorer();\n *\n * try {\n * await riskyOperation();\n * } catch (error) {\n * captureException(error);\n * }\n * ```\n */\nexport function useErrorExplorer() {\n // Try to get from injection (if using plugin)\n const injected = inject<typeof ErrorExplorer | null>(ErrorExplorerKey, null) ||\n inject<typeof ErrorExplorer | null>('errorExplorer', null);\n\n // Fall back to singleton\n const errorExplorer = injected || ErrorExplorer;\n\n return {\n /**\n * Check if Error Explorer is initialized\n */\n isInitialized: () => errorExplorer.isInitialized(),\n\n /**\n * Capture an exception\n */\n captureException: (error: Error, context?: CaptureContext) =>\n errorExplorer.captureException(error, context),\n\n /**\n * Capture a message\n */\n captureMessage: (message: string, level?: 'debug' | 'info' | 'warning' | 'error' | 'critical') =>\n errorExplorer.captureMessage(message, level),\n\n /**\n * Add a breadcrumb\n */\n addBreadcrumb: (breadcrumb: Breadcrumb) =>\n errorExplorer.addBreadcrumb(breadcrumb),\n\n /**\n * Set user context\n */\n setUser: (user: UserContext) => errorExplorer.setUser(user),\n\n /**\n * Clear user context\n */\n clearUser: () => errorExplorer.clearUser(),\n\n /**\n * Set a tag\n */\n setTag: (key: string, value: string) => errorExplorer.setTag(key, value),\n\n /**\n * Set multiple tags\n */\n setTags: (tags: Record<string, string>) => errorExplorer.setTags(tags),\n\n /**\n * Set extra context\n */\n setExtra: (extra: Record<string, unknown>) => errorExplorer.setExtra(extra),\n\n /**\n * Set named context\n */\n setContext: (name: string, context: Record<string, unknown>) =>\n errorExplorer.setContext(name, context),\n\n /**\n * Flush pending events\n */\n flush: (timeout?: number) => errorExplorer.flush(timeout),\n\n /**\n * Close the SDK\n */\n close: (timeout?: number) => errorExplorer.close(timeout),\n };\n}\n\n/**\n * Track component lifecycle for debugging\n *\n * @example\n * ```ts\n * // In setup()\n * useComponentBreadcrumbs();\n * ```\n */\nexport function useComponentBreadcrumbs() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n onMounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} mounted`,\n level: 'debug',\n });\n });\n\n onUnmounted(() => {\n ErrorExplorer.addBreadcrumb({\n type: 'debug',\n category: 'vue.lifecycle',\n message: `${componentName} unmounted`,\n level: 'debug',\n });\n });\n}\n\n/**\n * Create a breadcrumb tracker for user actions\n *\n * @example\n * ```ts\n * const { trackAction } = useActionTracker();\n *\n * const handleClick = () => {\n * trackAction('button_clicked', { buttonId: 'submit' });\n * // ... actual handler\n * };\n * ```\n */\nexport function useActionTracker() {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n return {\n /**\n * Track a user action\n */\n trackAction: (action: string, data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: 'action',\n message: action,\n level: 'info',\n data: {\n component: componentName,\n ...data,\n },\n });\n },\n\n /**\n * Track a UI interaction\n */\n trackInteraction: (element: string, action: 'click' | 'input' | 'focus' | 'blur' | 'submit', data?: Record<string, unknown>) => {\n ErrorExplorer.addBreadcrumb({\n type: 'user-action',\n category: `ui.${action}`,\n message: `${action} on ${element}`,\n level: 'info',\n data: {\n component: componentName,\n element,\n ...data,\n },\n });\n },\n };\n}\n\n/**\n * Create an error handler for async operations\n *\n * @example\n * ```ts\n * const { wrapAsync, handleError } = useErrorHandler();\n *\n * // Option 1: Wrap async function\n * const safeSubmit = wrapAsync(async () => {\n * await api.submit(data);\n * });\n *\n * // Option 2: Manual handling\n * try {\n * await riskyOperation();\n * } catch (error) {\n * handleError(error, { tags: { operation: 'risky' } });\n * }\n * ```\n */\nexport function useErrorHandler(defaultContext?: CaptureContext) {\n const instance = getCurrentInstance();\n const componentName = instance?.type\n ? (instance.type as { name?: string; __name?: string }).name ||\n (instance.type as { __name?: string }).__name ||\n 'Unknown'\n : 'Unknown';\n\n /**\n * Handle an error with context\n */\n const handleError = (error: unknown, context?: CaptureContext) => {\n const err = error instanceof Error ? error : new Error(String(error));\n\n ErrorExplorer.captureException(err, {\n ...defaultContext,\n ...context,\n tags: {\n 'vue.component': componentName,\n ...defaultContext?.tags,\n ...context?.tags,\n },\n });\n\n return err;\n };\n\n /**\n * Wrap an async function with error handling\n */\n const wrapAsync = <T extends (...args: any[]) => Promise<any>>(\n fn: T,\n context?: CaptureContext\n ): ((...args: Parameters<T>) => Promise<Awaited<ReturnType<T>> | undefined>) => {\n return async (...args: Parameters<T>) => {\n try {\n return await fn(...args);\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n };\n\n /**\n * Create a try-catch wrapper that captures errors\n */\n const tryCatch = <T>(fn: () => T, context?: CaptureContext): T | undefined => {\n try {\n return fn();\n } catch (error) {\n handleError(error, context);\n return undefined;\n }\n };\n\n return {\n handleError,\n wrapAsync,\n tryCatch,\n };\n}\n\n/**\n * Set user context from a reactive source\n *\n * @example\n * ```ts\n * const user = ref({ id: '123', email: 'user@example.com' });\n * useUserContext(user);\n * ```\n */\nexport function useUserContext(user: { value: UserContext | null } | UserContext | null) {\n const setUserFromValue = (value: UserContext | null) => {\n if (value) {\n ErrorExplorer.setUser(value);\n } else {\n ErrorExplorer.clearUser();\n }\n };\n\n // Handle both refs and plain objects\n if (user && typeof user === 'object' && 'value' in user) {\n // It's a ref - cast to the expected type\n const refValue = (user as { value: UserContext | null }).value;\n setUserFromValue(refValue);\n\n // Note: We don't set up a watcher here because that would require\n // importing watch from vue, which adds complexity.\n // Users should manually call setUser when the user changes.\n } else {\n setUserFromValue(user as UserContext | null);\n }\n\n return {\n setUser: (newUser: UserContext) => ErrorExplorer.setUser(newUser),\n clearUser: () => ErrorExplorer.clearUser(),\n };\n}\n","/**\n * @error-explorer/vue\n * Error Explorer SDK for Vue.js 3 - Automatic error tracking with Vue integration\n */\n\n// Plugin\nexport { createErrorExplorerPlugin, restoreHandlers } from './plugin';\n\n// Router Integration\nexport {\n setupRouterIntegration,\n createRouterIntegration,\n type RouterIntegrationOptions,\n} from './router';\n\n// Components\nexport { ErrorBoundary, withErrorBoundary, type ErrorBoundaryInstance } from './ErrorBoundary';\n\n// Composables\nexport {\n useErrorExplorer,\n useComponentBreadcrumbs,\n useActionTracker,\n useErrorHandler,\n useUserContext,\n ErrorExplorerKey,\n} from './composables';\n\n// Types\nexport type {\n VueErrorExplorerOptions,\n VueComponentContext,\n VuePluginInstall,\n ErrorBoundaryProps,\n ErrorBoundaryExposed,\n InitOptions,\n UserContext,\n Breadcrumb,\n CaptureContext,\n} from './types';\n\n// Re-export ErrorExplorer for direct access\nexport { ErrorExplorer } from '@error-explorer/browser';\n\n// Default export is the plugin creator for convenience\nimport { createErrorExplorerPlugin } from './plugin';\nexport default createErrorExplorerPlugin;\n"]}
|
package/dist/router.d.cts
CHANGED
package/dist/router.d.ts
CHANGED