@devkitio/faultlens 0.1.5
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/chunk-K63I3OJT.js +154 -0
- package/dist/chunk-LRHXSFK2.js +535 -0
- package/dist/chunk-P6Q63P6L.js +40 -0
- package/dist/chunk-RXQF7F2E.js +30 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +205 -0
- package/dist/express/index.d.ts +13 -0
- package/dist/express/index.js +22 -0
- package/dist/fastify/index.d.ts +19 -0
- package/dist/fastify/index.js +28 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -0
- package/dist/node/index.d.ts +34 -0
- package/dist/node/index.js +117 -0
- package/dist/nuxt/index.d.ts +23 -0
- package/dist/nuxt/index.js +52 -0
- package/dist/nuxt/runtime/config-handler.d.ts +5 -0
- package/dist/nuxt/runtime/config-handler.js +32 -0
- package/dist/nuxt/runtime/nitro-plugin.d.ts +3 -0
- package/dist/nuxt/runtime/nitro-plugin.js +51 -0
- package/dist/nuxt/runtime/plugin.d.ts +3 -0
- package/dist/nuxt/runtime/plugin.js +22 -0
- package/dist/nuxt/runtime/server-handler.d.ts +5 -0
- package/dist/nuxt/runtime/server-handler.js +86 -0
- package/dist/react/index.d.ts +26 -0
- package/dist/react/index.js +33 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.js +24 -0
- package/dist/types-DxONWOH8.d.ts +136 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.js +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { clientRedact, SDK_VERSION, parseErrorStack } from '../../chunk-LRHXSFK2.js';
|
|
2
|
+
import { createSignedRelayHeaders } from '../../chunk-RXQF7F2E.js';
|
|
3
|
+
import { randomUUID } from 'crypto';
|
|
4
|
+
|
|
5
|
+
var nitro_plugin_default = defineNitroPlugin((nitroApp) => {
|
|
6
|
+
nitroApp.hooks.hook("error", async (error, context) => {
|
|
7
|
+
if (error.stack?.includes("/__faultlens/envelope")) return;
|
|
8
|
+
const runtime = useRuntimeConfig(context.event).faultLens;
|
|
9
|
+
if (!runtime.upstream || !runtime.relayKeyId || !runtime.relayKeyVersion || !runtime.relaySecret) return;
|
|
10
|
+
const id = randomUUID();
|
|
11
|
+
const requestId = context.event?.node.req.headers["x-request-id"];
|
|
12
|
+
const envelope = clientRedact({
|
|
13
|
+
protocolVersion: "1.0",
|
|
14
|
+
sdkName: "@devkitio/faultlens",
|
|
15
|
+
sdkVersion: SDK_VERSION,
|
|
16
|
+
clientType: "nitro",
|
|
17
|
+
expectedEnvironment: runtime.environment,
|
|
18
|
+
release: runtime.release,
|
|
19
|
+
dist: runtime.dist ?? "server",
|
|
20
|
+
buildId: runtime.release,
|
|
21
|
+
clientBatchId: randomUUID(),
|
|
22
|
+
events: [
|
|
23
|
+
{
|
|
24
|
+
eventId: id,
|
|
25
|
+
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26
|
+
type: error.name || "Error",
|
|
27
|
+
message: error.message.slice(0, 32768),
|
|
28
|
+
handled: false,
|
|
29
|
+
mechanism: "nitro.error",
|
|
30
|
+
level: "error",
|
|
31
|
+
stack: parseErrorStack(error),
|
|
32
|
+
tags: typeof requestId === "string" ? { requestId } : {},
|
|
33
|
+
context: {}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
const body = JSON.stringify(envelope);
|
|
38
|
+
try {
|
|
39
|
+
await fetch(runtime.upstream, {
|
|
40
|
+
method: "POST",
|
|
41
|
+
headers: createSignedRelayHeaders(runtime, body, id),
|
|
42
|
+
body,
|
|
43
|
+
redirect: "error",
|
|
44
|
+
cache: "no-store"
|
|
45
|
+
});
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export { nitro_plugin_default as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createErrorMonitor } from '../../chunk-K63I3OJT.js';
|
|
2
|
+
import { installVueErrorMonitor } from '../../chunk-P6Q63P6L.js';
|
|
3
|
+
import '../../chunk-LRHXSFK2.js';
|
|
4
|
+
import { defineNuxtPlugin, useRuntimeConfig } from '#app';
|
|
5
|
+
|
|
6
|
+
var plugin_default = defineNuxtPlugin({
|
|
7
|
+
name: "faultlens",
|
|
8
|
+
enforce: "pre",
|
|
9
|
+
setup(nuxtApp) {
|
|
10
|
+
const runtime = useRuntimeConfig().public.faultLens;
|
|
11
|
+
const monitor = createErrorMonitor({
|
|
12
|
+
ingest: { mode: "relay", endpoint: runtime.relayEndpoint },
|
|
13
|
+
expectedEnvironment: runtime.environment,
|
|
14
|
+
release: runtime.release,
|
|
15
|
+
...runtime.dist ? { dist: runtime.dist } : {}
|
|
16
|
+
});
|
|
17
|
+
installVueErrorMonitor(nuxtApp.vueApp, monitor);
|
|
18
|
+
nuxtApp.provide("faultLens", monitor);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { plugin_default as default };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { createSignedRelayHeaders } from '../../chunk-RXQF7F2E.js';
|
|
2
|
+
import { defineEventHandler, getRequestHeader, setResponseStatus, setResponseHeader } from 'h3';
|
|
3
|
+
|
|
4
|
+
var MAX_RELAY_BODY_BYTES = 1024 * 1024;
|
|
5
|
+
async function readLimitedBody(event) {
|
|
6
|
+
const contentLength = Number(getRequestHeader(event, "content-length") ?? "0");
|
|
7
|
+
if (Number.isFinite(contentLength) && contentLength > MAX_RELAY_BODY_BYTES) {
|
|
8
|
+
throw new Error("payload_too_large");
|
|
9
|
+
}
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const chunks = [];
|
|
12
|
+
let size = 0;
|
|
13
|
+
let exceeded = false;
|
|
14
|
+
event.node.req.on("data", (chunk) => {
|
|
15
|
+
if (exceeded) return;
|
|
16
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
17
|
+
size += buffer.length;
|
|
18
|
+
if (size > MAX_RELAY_BODY_BYTES) {
|
|
19
|
+
exceeded = true;
|
|
20
|
+
chunks.length = 0;
|
|
21
|
+
event.node.req.resume();
|
|
22
|
+
reject(new Error("payload_too_large"));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
chunks.push(buffer);
|
|
26
|
+
});
|
|
27
|
+
event.node.req.once("error", reject);
|
|
28
|
+
event.node.req.once("end", () => {
|
|
29
|
+
if (!exceeded) resolve(chunks.length > 0 ? Buffer.concat(chunks).toString("utf8") : void 0);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var server_handler_default = defineEventHandler(async (event) => {
|
|
34
|
+
if (getRequestHeader(event, "content-encoding")) {
|
|
35
|
+
setResponseStatus(event, 415);
|
|
36
|
+
return { code: "unsupported_encoding", retryable: false };
|
|
37
|
+
}
|
|
38
|
+
let body;
|
|
39
|
+
try {
|
|
40
|
+
body = await readLimitedBody(event);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (error instanceof Error && error.message === "payload_too_large") {
|
|
43
|
+
setResponseStatus(event, 413);
|
|
44
|
+
return { code: "payload_too_large", retryable: false };
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
if (!body) {
|
|
49
|
+
setResponseStatus(event, 400);
|
|
50
|
+
return { code: "invalid_envelope", retryable: false };
|
|
51
|
+
}
|
|
52
|
+
const runtime = useRuntimeConfig(event).faultLens;
|
|
53
|
+
if (!runtime.upstream || !runtime.relayKeyId || !runtime.relayKeyVersion || !runtime.relaySecret) {
|
|
54
|
+
setResponseStatus(event, 503);
|
|
55
|
+
return { code: "relay_not_configured", retryable: true };
|
|
56
|
+
}
|
|
57
|
+
let eventId;
|
|
58
|
+
try {
|
|
59
|
+
const envelope = JSON.parse(body);
|
|
60
|
+
const firstEventId = envelope.events?.[0]?.eventId;
|
|
61
|
+
if (typeof firstEventId !== "string") throw new Error("\u7F3A\u5C11\u4E8B\u4EF6 ID");
|
|
62
|
+
eventId = firstEventId;
|
|
63
|
+
body = JSON.stringify({ ...envelope, clientType: "browser" });
|
|
64
|
+
} catch {
|
|
65
|
+
setResponseStatus(event, 400);
|
|
66
|
+
return { code: "invalid_envelope", retryable: false };
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
const response = await fetch(runtime.upstream, {
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers: createSignedRelayHeaders(runtime, body, eventId),
|
|
72
|
+
body,
|
|
73
|
+
redirect: "error",
|
|
74
|
+
cache: "no-store"
|
|
75
|
+
});
|
|
76
|
+
setResponseStatus(event, response.status);
|
|
77
|
+
setResponseHeader(event, "cache-control", "no-store");
|
|
78
|
+
const text = await response.text();
|
|
79
|
+
return text ? JSON.parse(text) : void 0;
|
|
80
|
+
} catch {
|
|
81
|
+
setResponseStatus(event, 503);
|
|
82
|
+
return { code: "relay_unavailable", retryable: true, retryAfterMs: 1e3 };
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export { server_handler_default as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
|
+
import { E as ErrorMonitor, M as MonitorOptions } from '../types-DxONWOH8.js';
|
|
3
|
+
|
|
4
|
+
interface ReactMonitorOptions extends Omit<MonitorOptions, "ingest"> {
|
|
5
|
+
ingest: {
|
|
6
|
+
mode: "direct";
|
|
7
|
+
dsn: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
declare function createReactErrorMonitor(options: ReactMonitorOptions): ErrorMonitor;
|
|
11
|
+
interface FaultLensErrorBoundaryProps {
|
|
12
|
+
monitor: ErrorMonitor;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
fallback?: ReactNode | ((error: Error) => ReactNode);
|
|
15
|
+
}
|
|
16
|
+
interface FaultLensErrorBoundaryState {
|
|
17
|
+
error: Error | null;
|
|
18
|
+
}
|
|
19
|
+
declare class FaultLensErrorBoundary extends Component<FaultLensErrorBoundaryProps, FaultLensErrorBoundaryState> {
|
|
20
|
+
state: FaultLensErrorBoundaryState;
|
|
21
|
+
static getDerivedStateFromError(error: Error): FaultLensErrorBoundaryState;
|
|
22
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
23
|
+
render(): ReactNode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { FaultLensErrorBoundary, type FaultLensErrorBoundaryProps, type ReactMonitorOptions, createReactErrorMonitor };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createErrorMonitor } from '../chunk-K63I3OJT.js';
|
|
2
|
+
import '../chunk-LRHXSFK2.js';
|
|
3
|
+
import { Component, createElement } from 'react';
|
|
4
|
+
|
|
5
|
+
function createReactErrorMonitor(options) {
|
|
6
|
+
if (options.ingest.mode !== "direct") {
|
|
7
|
+
throw new Error("React \u6D4F\u89C8\u5668\u96C6\u6210\u53EA\u5141\u8BB8\u4F7F\u7528 Direct DSN");
|
|
8
|
+
}
|
|
9
|
+
return createErrorMonitor(options);
|
|
10
|
+
}
|
|
11
|
+
var FaultLensErrorBoundary = class extends Component {
|
|
12
|
+
state = { error: null };
|
|
13
|
+
static getDerivedStateFromError(error) {
|
|
14
|
+
return { error };
|
|
15
|
+
}
|
|
16
|
+
componentDidCatch(error, info) {
|
|
17
|
+
this.props.monitor.captureException(error, {
|
|
18
|
+
handled: true,
|
|
19
|
+
mechanism: "react.error_boundary",
|
|
20
|
+
context: { componentStack: info.componentStack }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const { error } = this.state;
|
|
25
|
+
if (!error) return this.props.children ?? null;
|
|
26
|
+
const { fallback } = this.props;
|
|
27
|
+
if (typeof fallback === "function") return fallback(error);
|
|
28
|
+
if (fallback !== void 0) return fallback;
|
|
29
|
+
return createElement("div", { role: "alert" }, "\u9875\u9762\u53D1\u751F\u9519\u8BEF");
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { FaultLensErrorBoundary, createReactErrorMonitor };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { c as EventTransport, d as EventEnvelope, T as TransportOutcome, M as MonitorOptions, E as ErrorMonitor } from '../types-DxONWOH8.js';
|
|
2
|
+
|
|
3
|
+
declare class TestTransport implements EventTransport {
|
|
4
|
+
readonly envelopes: EventEnvelope[];
|
|
5
|
+
private readonly outcomes;
|
|
6
|
+
constructor(outcomes?: TransportOutcome[]);
|
|
7
|
+
send(envelope: EventEnvelope): Promise<TransportOutcome>;
|
|
8
|
+
}
|
|
9
|
+
declare function createTestMonitor(options: MonitorOptions, transport: EventTransport): ErrorMonitor;
|
|
10
|
+
|
|
11
|
+
export { TestTransport, createTestMonitor };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createMonitorRuntime } from '../chunk-LRHXSFK2.js';
|
|
2
|
+
|
|
3
|
+
// src/testing/index.ts
|
|
4
|
+
var TestTransport = class {
|
|
5
|
+
envelopes = [];
|
|
6
|
+
outcomes;
|
|
7
|
+
constructor(outcomes = [{ kind: "accepted" }]) {
|
|
8
|
+
this.outcomes = [...outcomes];
|
|
9
|
+
}
|
|
10
|
+
async send(envelope) {
|
|
11
|
+
this.envelopes.push(structuredClone(envelope));
|
|
12
|
+
return this.outcomes.shift() ?? { kind: "accepted" };
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function createTestMonitor(options, transport) {
|
|
16
|
+
let sequence = 0;
|
|
17
|
+
return createMonitorRuntime(options, {
|
|
18
|
+
transport,
|
|
19
|
+
random: () => 0,
|
|
20
|
+
createEventId: () => `test-event-${++sequence}`
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { TestTransport, createTestMonitor };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
interface StackFrame {
|
|
2
|
+
filename: string;
|
|
3
|
+
function?: string;
|
|
4
|
+
line?: number;
|
|
5
|
+
column?: number;
|
|
6
|
+
inApp: boolean;
|
|
7
|
+
debugId?: string;
|
|
8
|
+
}
|
|
9
|
+
interface ErrorEvent {
|
|
10
|
+
eventId: string;
|
|
11
|
+
occurredAt: string;
|
|
12
|
+
type: string;
|
|
13
|
+
message: string;
|
|
14
|
+
handled: boolean;
|
|
15
|
+
mechanism: string;
|
|
16
|
+
level: "debug" | "info" | "warning" | "error" | "fatal";
|
|
17
|
+
stack: StackFrame[];
|
|
18
|
+
tags: Record<string, string>;
|
|
19
|
+
context?: unknown;
|
|
20
|
+
fingerprint?: string[];
|
|
21
|
+
}
|
|
22
|
+
interface EventEnvelope {
|
|
23
|
+
protocolVersion: string;
|
|
24
|
+
sdkName: string;
|
|
25
|
+
sdkVersion: string;
|
|
26
|
+
clientType: "browser" | "relay" | "nitro" | "testing";
|
|
27
|
+
expectedEnvironment?: string;
|
|
28
|
+
release: string;
|
|
29
|
+
dist?: string;
|
|
30
|
+
buildId: string;
|
|
31
|
+
clientBatchId: string;
|
|
32
|
+
events: ErrorEvent[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type ContextMode = "minimal" | "full";
|
|
36
|
+
type IngestConfig = {
|
|
37
|
+
mode: "direct";
|
|
38
|
+
dsn: string;
|
|
39
|
+
} | {
|
|
40
|
+
mode: "relay";
|
|
41
|
+
endpoint: string;
|
|
42
|
+
};
|
|
43
|
+
interface CaptureOptions {
|
|
44
|
+
handled?: boolean;
|
|
45
|
+
mechanism?: string;
|
|
46
|
+
context?: unknown;
|
|
47
|
+
level?: ErrorEvent["level"];
|
|
48
|
+
tags?: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
interface Breadcrumb {
|
|
51
|
+
category: string;
|
|
52
|
+
message: string;
|
|
53
|
+
level?: "debug" | "info" | "warning" | "error";
|
|
54
|
+
timestamp?: string;
|
|
55
|
+
data?: unknown;
|
|
56
|
+
}
|
|
57
|
+
interface MonitorOptions {
|
|
58
|
+
ingest: IngestConfig;
|
|
59
|
+
expectedEnvironment: string;
|
|
60
|
+
release: string;
|
|
61
|
+
dist?: string;
|
|
62
|
+
buildId?: string;
|
|
63
|
+
contextMode?: ContextMode;
|
|
64
|
+
ignoreError?: (error: unknown) => boolean;
|
|
65
|
+
beforeSend?: (event: ErrorEvent) => ErrorEvent | null | Promise<ErrorEvent | null>;
|
|
66
|
+
sampleRate?: number;
|
|
67
|
+
queueLimit?: number;
|
|
68
|
+
}
|
|
69
|
+
interface MonitorStatus {
|
|
70
|
+
queueLength: number;
|
|
71
|
+
recentSendStatus: "idle" | "sending" | "accepted" | "retryable" | "permanent_error";
|
|
72
|
+
droppedReasons: Readonly<Record<string, number>>;
|
|
73
|
+
protocolVersion: string;
|
|
74
|
+
sdkVersion: string;
|
|
75
|
+
lastRateLimitedAt: string | null;
|
|
76
|
+
remotelyDisabled: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface ErrorMonitor {
|
|
79
|
+
captureException(error: unknown, options?: CaptureOptions): string;
|
|
80
|
+
captureMessage(message: string, options?: CaptureOptions): string;
|
|
81
|
+
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
82
|
+
setUser(user: Record<string, unknown> | null): void;
|
|
83
|
+
setContext(name: string, value: unknown): void;
|
|
84
|
+
getStatus(): MonitorStatus;
|
|
85
|
+
flush(timeout: number): Promise<boolean>;
|
|
86
|
+
close(): Promise<boolean>;
|
|
87
|
+
}
|
|
88
|
+
type TransportOutcome = {
|
|
89
|
+
kind: "accepted";
|
|
90
|
+
} | {
|
|
91
|
+
kind: "retryable";
|
|
92
|
+
retryAfterMs: number;
|
|
93
|
+
} | {
|
|
94
|
+
kind: "permanent_error";
|
|
95
|
+
code: string;
|
|
96
|
+
} | {
|
|
97
|
+
kind: "network_error";
|
|
98
|
+
};
|
|
99
|
+
interface EventTransport {
|
|
100
|
+
send(envelope: EventEnvelope): Promise<TransportOutcome>;
|
|
101
|
+
loadRemoteConfig?(): Promise<RemoteSdkConfig | undefined>;
|
|
102
|
+
}
|
|
103
|
+
interface RemoteSdkConfig {
|
|
104
|
+
enabled?: boolean;
|
|
105
|
+
sampleRate?: number;
|
|
106
|
+
errorTypeAllowlist?: string[];
|
|
107
|
+
queueLimit?: number;
|
|
108
|
+
retryBaseMs?: number;
|
|
109
|
+
}
|
|
110
|
+
interface RuntimeDependencies {
|
|
111
|
+
transport: EventTransport;
|
|
112
|
+
now: () => Date;
|
|
113
|
+
random: () => number;
|
|
114
|
+
createEventId: () => string;
|
|
115
|
+
persistentQueue: PersistentEventQueue;
|
|
116
|
+
sendLease: SendLease;
|
|
117
|
+
installGlobalHandlers: (monitor: ErrorMonitor, transportPath: string) => () => void;
|
|
118
|
+
}
|
|
119
|
+
interface PersistentEventQueue {
|
|
120
|
+
load(now: number): Promise<PersistedQueueItem[]>;
|
|
121
|
+
put(item: PersistedQueueItem): Promise<void>;
|
|
122
|
+
remove(ids: string[]): Promise<void>;
|
|
123
|
+
clear(): Promise<void>;
|
|
124
|
+
}
|
|
125
|
+
interface PersistedQueueItem {
|
|
126
|
+
id: string;
|
|
127
|
+
event: ErrorEvent;
|
|
128
|
+
enqueuedAt: number;
|
|
129
|
+
bytes: number;
|
|
130
|
+
}
|
|
131
|
+
interface SendLease {
|
|
132
|
+
acquire(now: number): boolean;
|
|
133
|
+
release(): void;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type { Breadcrumb as B, CaptureOptions as C, ErrorMonitor as E, IngestConfig as I, MonitorOptions as M, RuntimeDependencies as R, TransportOutcome as T, ContextMode as a, MonitorStatus as b, EventTransport as c, EventEnvelope as d };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { E as ErrorMonitor } from '../types-DxONWOH8.js';
|
|
2
|
+
|
|
3
|
+
interface VueLikeApp {
|
|
4
|
+
config: {
|
|
5
|
+
errorHandler?: (error: unknown, instance: unknown, info: string) => unknown;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare function installVueErrorMonitor(app: VueLikeApp, monitor: ErrorMonitor): () => void;
|
|
9
|
+
declare function createVueErrorMonitorPlugin(monitor: ErrorMonitor): {
|
|
10
|
+
install(app: VueLikeApp): void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { type VueLikeApp, createVueErrorMonitorPlugin, installVueErrorMonitor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createVueErrorMonitorPlugin, installVueErrorMonitor } from '../chunk-P6Q63P6L.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devkitio/faultlens",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "FaultLens 的 Browser、Node、Vue、Nuxt、React 与 Web 框架错误采集 SDK",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=22 <25"
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./vue": {
|
|
20
|
+
"types": "./dist/vue/index.d.ts",
|
|
21
|
+
"import": "./dist/vue/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./nuxt": {
|
|
24
|
+
"types": "./dist/nuxt/index.d.ts",
|
|
25
|
+
"import": "./dist/nuxt/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./node": {
|
|
28
|
+
"types": "./dist/node/index.d.ts",
|
|
29
|
+
"import": "./dist/node/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./express": {
|
|
32
|
+
"types": "./dist/express/index.d.ts",
|
|
33
|
+
"import": "./dist/express/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./fastify": {
|
|
36
|
+
"types": "./dist/fastify/index.d.ts",
|
|
37
|
+
"import": "./dist/fastify/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./react": {
|
|
40
|
+
"types": "./dist/react/index.d.ts",
|
|
41
|
+
"import": "./dist/react/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./testing": {
|
|
44
|
+
"types": "./dist/testing/index.d.ts",
|
|
45
|
+
"import": "./dist/testing/index.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"bin": {
|
|
49
|
+
"faultlens": "dist/cli/index.js"
|
|
50
|
+
},
|
|
51
|
+
"files": ["dist"],
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"registry": "https://registry.npmjs.org/",
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
59
|
+
"prepack": "pnpm build"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"@nuxt/kit": ">=4.1.0 <5",
|
|
63
|
+
"@nuxt/schema": ">=4.1.0 <5",
|
|
64
|
+
"express": ">=4.18.0 <6",
|
|
65
|
+
"fastify": ">=4.0.0 <6",
|
|
66
|
+
"h3": ">=1.15.0 <2",
|
|
67
|
+
"react": ">=18.0.0 <20",
|
|
68
|
+
"vue": ">=3.3.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"@nuxt/kit": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@nuxt/schema": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"express": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"fastify": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"h3": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"react": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"vue": {
|
|
90
|
+
"optional": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@faultlens/security": "workspace:*",
|
|
95
|
+
"@nuxt/kit": "4.1.0",
|
|
96
|
+
"@nuxt/schema": "4.1.0",
|
|
97
|
+
"@types/react": "19.1.11",
|
|
98
|
+
"h3": "1.15.9",
|
|
99
|
+
"react": "19.1.1",
|
|
100
|
+
"tsup": "8.5.0",
|
|
101
|
+
"vue": "3.5.20"
|
|
102
|
+
}
|
|
103
|
+
}
|