nuxt-error-tracker 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -146,6 +146,11 @@ Both helpers are always callable. Real capture happens **client-side only**; on
146
146
  the server (SSR — e.g. top-level `<script setup>`) they are safe no-ops, so
147
147
  calling them never throws.
148
148
 
149
+ `$trackError` and `$addBreadcrumb` are **fully typed** — the module ships an
150
+ augmentation for `NuxtApp` and Vue's `ComponentCustomProperties`, so both
151
+ `useNuxtApp()` and template usage resolve them as functions (no `unknown` /
152
+ TS18046). No manual `.d.ts` needed.
153
+
149
154
  ## What gets sent
150
155
 
151
156
  Per error: `message`, `stack`, `source` (`vue` | `window` | `promise` |
package/dist/module.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
1
  interface ModuleOptions {
4
2
  endpoint: string;
5
3
  publicKey: string;
@@ -18,7 +16,7 @@ interface ModuleOptions {
18
16
  /** Max breadcrumbs kept in the ring buffer / sent per error. Default 30. */
19
17
  maxBreadcrumbs?: number;
20
18
  }
21
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
19
+ declare const _default: any;
22
20
 
23
21
  export { _default as default };
24
22
  export type { ModuleOptions };
package/dist/module.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
1
  interface ModuleOptions {
4
2
  endpoint: string;
5
3
  publicKey: string;
@@ -18,7 +16,7 @@ interface ModuleOptions {
18
16
  /** Max breadcrumbs kept in the ring buffer / sent per error. Default 30. */
19
17
  maxBreadcrumbs?: number;
20
18
  }
21
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
19
+ declare const _default: any;
22
20
 
23
21
  export { _default as default };
24
22
  export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-error-tracker",
3
3
  "configKey": "errorTracker",
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addPlugin, addTypeTemplate } from '@nuxt/kit';
2
2
 
3
3
  function posInt(value, fallback) {
4
4
  const n = Number(value);
@@ -46,6 +46,30 @@ const module = defineNuxtModule({
46
46
  src: resolver.resolve("./runtime/plugin.client"),
47
47
  mode: "client"
48
48
  });
49
+ addTypeTemplate({
50
+ filename: "types/nuxt-error-tracker.d.ts",
51
+ getContents: () => `
52
+ interface Breadcrumb {
53
+ type?: string
54
+ category?: string
55
+ message?: string
56
+ level?: string
57
+ timestamp?: string
58
+ data?: Record<string, unknown>
59
+ }
60
+ interface ErrorTrackerHelpers {
61
+ $trackError: (err: unknown) => void
62
+ $addBreadcrumb: (crumb: Breadcrumb) => void
63
+ }
64
+ declare module '#app' {
65
+ interface NuxtApp extends ErrorTrackerHelpers {}
66
+ }
67
+ declare module 'vue' {
68
+ interface ComponentCustomProperties extends ErrorTrackerHelpers {}
69
+ }
70
+ export {}
71
+ `
72
+ });
49
73
  }
50
74
  });
51
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-error-tracker",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {