@lark.js/sentry 0.0.6 → 0.0.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 +3 -15
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/public/react-error-boundary.cjs +1 -1
- package/dist/public/react-error-boundary.d.ts +88 -3
- package/dist/public/react-error-boundary.js +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +1 -0
- package/dist/webpack.d.ts +55 -0
- package/dist/webpack.js +1 -0
- package/package.json +40 -18
package/README.md
CHANGED
|
@@ -24,11 +24,7 @@ npm install vue
|
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
import { init, destroy, isInitialized, pluginEnable } from "@lark.js/sentry";
|
|
27
|
-
import {
|
|
28
|
-
PerformancePlugin,
|
|
29
|
-
ScreenRecordPlugin,
|
|
30
|
-
ExposurePlugin,
|
|
31
|
-
} from "@lark.js/sentry/plugins";
|
|
27
|
+
import { PerformancePlugin, ScreenRecordPlugin, ExposurePlugin } from "@lark.js/sentry/plugins";
|
|
32
28
|
import { ReactErrorBoundary } from "@lark.js/sentry/react";
|
|
33
29
|
import { vuePlugin } from "@lark.js/sentry/vue";
|
|
34
30
|
```
|
|
@@ -39,11 +35,7 @@ Each public export provides ESM, CJS, and TypeScript declaration files.
|
|
|
39
35
|
|
|
40
36
|
```ts
|
|
41
37
|
import { init, pluginEnable } from "@lark.js/sentry";
|
|
42
|
-
import {
|
|
43
|
-
PerformancePlugin,
|
|
44
|
-
ScreenRecordPlugin,
|
|
45
|
-
ExposurePlugin,
|
|
46
|
-
} from "@lark.js/sentry/plugins";
|
|
38
|
+
import { PerformancePlugin, ScreenRecordPlugin, ExposurePlugin } from "@lark.js/sentry/plugins";
|
|
47
39
|
|
|
48
40
|
init({
|
|
49
41
|
dsn: "/api/log",
|
|
@@ -439,11 +431,7 @@ await sendLocal();
|
|
|
439
431
|
Register hooks after initialization or provide equivalent hooks in `init` options.
|
|
440
432
|
|
|
441
433
|
```ts
|
|
442
|
-
import {
|
|
443
|
-
afterSendData,
|
|
444
|
-
beforePushEventList,
|
|
445
|
-
beforeSendData,
|
|
446
|
-
} from "@lark.js/sentry";
|
|
434
|
+
import { afterSendData, beforePushEventList, beforeSendData } from "@lark.js/sentry";
|
|
447
435
|
|
|
448
436
|
beforeSendData((data) => {
|
|
449
437
|
if (data.type === "Click") {
|
package/dist/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="0.0.8",r={version:e};exports.default=r,exports.version=e;
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="0.0.
|
|
1
|
+
var a="0.0.8",e={version:a};export{e as default,a as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("react"),e=require("../types/enums.cjs"),t=require("./framework-error.cjs");class o extends r.Component{state={error:
|
|
1
|
+
"use strict";var r=require("react"),e=require("../types/enums.cjs"),t=require("./framework-error.cjs");class o extends r.Component{state={};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,o){this.setState({error:r,errorInfo:o}),t.reportFrameworkError({type:e.EventType.React,error:r,context:o})}render(){const{error:r,errorInfo:e}=this.state;if(r){const{fallback:t}=this.props;return"function"==typeof t?t(r,e):t??null}return this.props.children??null}}exports.ReactErrorBoundary=o;
|
|
@@ -1,15 +1,100 @@
|
|
|
1
1
|
import { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link ReactErrorBoundary} component.
|
|
5
|
+
*
|
|
6
|
+
* The boundary renders `children` normally. When a descendant throws during
|
|
7
|
+
* rendering, it switches to rendering {@link fallback} and reports the error
|
|
8
|
+
* to the Sentry SDK.
|
|
9
|
+
*/
|
|
3
10
|
interface ReactErrorBoundaryProps {
|
|
11
|
+
/**
|
|
12
|
+
* The subtree to render when no error has occurred. When an error is
|
|
13
|
+
* caught, this is replaced by {@link fallback}.
|
|
14
|
+
*/
|
|
4
15
|
readonly children?: ReactNode;
|
|
5
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The UI to display when a descendant throws.
|
|
18
|
+
*
|
|
19
|
+
* Can be a static `ReactNode` (no access to the error) or a render function
|
|
20
|
+
* that receives the caught error and React's component-stack info.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* The render function may be invoked twice during an error cycle:
|
|
24
|
+
* 1. First, right after `getDerivedStateFromError` runs in the render
|
|
25
|
+
* phase — at this point `errorInfo` is still `undefined` because React
|
|
26
|
+
* only delivers {@link ErrorInfo} in `componentDidCatch` (commit phase).
|
|
27
|
+
* 2. Again after `componentDidCatch` merges `errorInfo` into state.
|
|
28
|
+
*
|
|
29
|
+
* Therefore `errorInfo` is typed as optional. Guard against `undefined` if
|
|
30
|
+
* your fallback relies on `componentStack`.
|
|
31
|
+
*
|
|
32
|
+
* @param error - The Error thrown by the descendant component. Always
|
|
33
|
+
* defined when the fallback is invoked, because the boundary only enters
|
|
34
|
+
* the error state when an Error is present.
|
|
35
|
+
* @param errorInfo - React's {@link ErrorInfo}, containing `componentStack`.
|
|
36
|
+
* `undefined` on the first render after the error is caught.
|
|
37
|
+
* @returns The fallback React subtree to render.
|
|
38
|
+
*/
|
|
39
|
+
readonly fallback?: ReactNode | ((error: Error, errorInfo?: ErrorInfo) => ReactNode);
|
|
6
40
|
}
|
|
41
|
+
/** Internal state tracking the caught error and React component-stack info. */
|
|
7
42
|
interface ReactErrorBoundaryState {
|
|
8
|
-
readonly error
|
|
9
|
-
readonly errorInfo
|
|
43
|
+
readonly error?: Error;
|
|
44
|
+
readonly errorInfo?: ErrorInfo;
|
|
10
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* A React Error Boundary that reports caught errors to the Sentry SDK.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <ReactErrorBoundary fallback={<div>Something went wrong</div>}>
|
|
52
|
+
* <Page />
|
|
53
|
+
* </ReactErrorBoundary>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
11
56
|
declare class ReactErrorBoundary extends Component<ReactErrorBoundaryProps, ReactErrorBoundaryState> {
|
|
12
57
|
state: ReactErrorBoundaryState;
|
|
58
|
+
/**
|
|
59
|
+
* Called by React during the **render phase** when a descendant throws.
|
|
60
|
+
*
|
|
61
|
+
* This is a pure static method — it must not access `this` or cause side
|
|
62
|
+
* effects. Its sole responsibility is to return the next state so React can
|
|
63
|
+
* immediately re-render the boundary and show the fallback UI without
|
|
64
|
+
* waiting for the commit phase.
|
|
65
|
+
*
|
|
66
|
+
* Only `error` is available here; React does not deliver {@link ErrorInfo}
|
|
67
|
+
* until {@link componentDidCatch} runs (commit phase), so `errorInfo` is
|
|
68
|
+
* left `undefined` at this point.
|
|
69
|
+
*
|
|
70
|
+
* This method is **not redundant** with {@link componentDidCatch}. It
|
|
71
|
+
* triggers the fallback render synchronously in the render phase; without
|
|
72
|
+
* it the fallback would not appear until after commit.
|
|
73
|
+
*
|
|
74
|
+
* @param error - The Error thrown by the descendant component.
|
|
75
|
+
* @returns The next state, setting `error` so the boundary renders the
|
|
76
|
+
* fallback.
|
|
77
|
+
*/
|
|
78
|
+
static getDerivedStateFromError(error: Error): ReactErrorBoundaryState;
|
|
79
|
+
/**
|
|
80
|
+
* Called by React during the **commit phase** (after the DOM has been
|
|
81
|
+
* updated) when a descendant throws.
|
|
82
|
+
*
|
|
83
|
+
* This is where side effects belong. It performs two duties:
|
|
84
|
+
* 1. Merges `errorInfo` (React's component-stack trace) into state so the
|
|
85
|
+
* fallback render function can access it. `error` is also set again —
|
|
86
|
+
* it is already present from
|
|
87
|
+
* {@link getDerivedStateFromError | getDerivedStateFromError} but is
|
|
88
|
+
* included for a single atomic state update.
|
|
89
|
+
* 2. Reports the error to the Sentry SDK as a `React` event via
|
|
90
|
+
* {@link reportFrameworkError}.
|
|
91
|
+
*
|
|
92
|
+
* @param error - The Error thrown by the descendant component.
|
|
93
|
+
* @param errorInfo - React's {@link ErrorInfo}, containing `componentStack`:
|
|
94
|
+
* a string describing the component tree from the throwing component up to
|
|
95
|
+
* this boundary. Useful for locating where in the component hierarchy the
|
|
96
|
+
* error originated.
|
|
97
|
+
*/
|
|
13
98
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
14
99
|
render(): ReactNode;
|
|
15
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as r}from"react";import{EventType as t}from"../types/enums.js";import{reportFrameworkError as e}from"./framework-error.js";class o extends r{state={error:
|
|
1
|
+
import{Component as r}from"react";import{EventType as t}from"../types/enums.js";import{reportFrameworkError as e}from"./framework-error.js";class o extends r{state={};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,o){this.setState({error:r,errorInfo:o}),e({type:t.React,error:r,context:o})}render(){const{error:r,errorInfo:t}=this.state;if(r){const{fallback:e}=this.props;return"function"==typeof e?e(r,t):e??null}return this.props.children??null}}export{o as ReactErrorBoundary};
|
package/dist/vite.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node:buffer"),t=require("node:path"),n=require("node:fs");require("./constants/index.cjs"),require("./types/enums.cjs");var r=require("./utils/sentry.cjs"),s=require("./utils/logger.cjs"),i=require("zod");function o(t,n){return"string"==typeof n?t+n:e.Buffer.isBuffer(n)?t+n.toString("utf8"):n instanceof Uint8Array?t+e.Buffer.from(n).toString("utf8"):t}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node:buffer"),t=require("node:path"),n=require("node:fs");require("./constants/index.cjs"),require("./types/enums.cjs");var r=require("./utils/sentry.cjs"),s=require("./utils/logger.cjs"),i=require("zod");function o(t,n){return"string"==typeof n?t+n:e.Buffer.isBuffer(n)?t+n.toString("utf8"):n instanceof Uint8Array?t+e.Buffer.from(n).toString("utf8"):t}function l(e){return i.z.json().parse(e)}const u=(e,t)=>n=>{n.middlewares.use((n,r,s)=>{if(n.url===e&&"POST"===n.method){let e="";n.on("data",t=>{e=o(e,t)}),n.on("end",()=>{if(e)try{const n=l(e);t.write(JSON.stringify(n)+"\n")}catch{t.write(e+"\n")}r.setHeader("Content-Type","application/json"),r.statusCode=200,r.end(JSON.stringify({code:0,message:"success"}))})}else s()})},c=(e,t)=>n=>{n.middlewares.use((n,r,s)=>{if(n.url===e&&"POST"===n.method){let e="";n.on("data",t=>{e=o(e,t)}),n.on("end",()=>{if(e)try{const n=l(e);t.write(JSON.stringify(n)+"\n")}catch{t.write(e+"\n")}r.setHeader("Content-Type","application/json"),r.statusCode=200,r.end(JSON.stringify({code:0,message:"success"}))})}else s()})};function a(){const e=t.join(process.cwd(),"logs");n.existsSync(e)||n.mkdirSync(e,{recursive:!0});const r=(new Date).toISOString().replace(/[-:.]/g,"").slice(0,14),s=t.join(e,`sentry_${r}.log`);return{fileStream:n.createWriteStream(s,{flags:"a"}),logFile:s}}function f({dsn:e}){const{fileStream:t,logFile:n}=a();return s.sentryLogger.info("@lark.js/sentry",`Sentry mock plugin initialized, logs will be written to ${n}`),{name:"vite-plugin-sentry",configureServer:c(e||r.default.options.dsn||"/sentry",t),closeBundle(){t&&t.close()}}}exports.default=f,exports.sentryPlugin=f,exports.sentryPlugin7=function({dsn:e}={}){const{fileStream:t,logFile:n}=a();return s.sentryLogger.info("@lark.js/sentry",`Sentry mock plugin initialized, logs will be written to ${n}`),{name:"vite-plugin-sentry",configureServer:u(e||r.default.options.dsn||"/sentry",t),closeBundle(){t&&t.close()}}};
|
package/dist/vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Buffer as e}from"node:buffer";import{join as t}from"node:path";import{existsSync as n,mkdirSync as
|
|
1
|
+
import{Buffer as e}from"node:buffer";import{join as t}from"node:path";import{existsSync as n,mkdirSync as o,createWriteStream as s}from"node:fs";import"./constants/index.js";import"./types/enums.js";import r from"./utils/sentry.js";import{sentryLogger as i}from"./utils/logger.js";import{z as l}from"zod";function c(t,n){return"string"==typeof n?t+n:e.isBuffer(n)?t+n.toString("utf8"):n instanceof Uint8Array?t+e.from(n).toString("utf8"):t}function a(e){return l.json().parse(e)}const f=(e,t)=>n=>{n.middlewares.use((n,o,s)=>{if(n.url===e&&"POST"===n.method){let e="";n.on("data",t=>{e=c(e,t)}),n.on("end",()=>{if(e)try{const n=a(e);t.write(JSON.stringify(n)+"\n")}catch{t.write(e+"\n")}o.setHeader("Content-Type","application/json"),o.statusCode=200,o.end(JSON.stringify({code:0,message:"success"}))})}else s()})},u=(e,t)=>n=>{n.middlewares.use((n,o,s)=>{if(n.url===e&&"POST"===n.method){let e="";n.on("data",t=>{e=c(e,t)}),n.on("end",()=>{if(e)try{const n=a(e);t.write(JSON.stringify(n)+"\n")}catch{t.write(e+"\n")}o.setHeader("Content-Type","application/json"),o.statusCode=200,o.end(JSON.stringify({code:0,message:"success"}))})}else s()})};function d(){const e=t(process.cwd(),"logs");n(e)||o(e,{recursive:!0});const r=(new Date).toISOString().replace(/[-:.]/g,"").slice(0,14),i=t(e,`sentry_${r}.log`);return{fileStream:s(i,{flags:"a"}),logFile:i}}function m({dsn:e}={}){const{fileStream:t,logFile:n}=d();return i.info("@lark.js/sentry",`Sentry mock plugin initialized, logs will be written to ${n}`),{name:"vite-plugin-sentry",configureServer:f(e||r.options.dsn||"/sentry",t),closeBundle(){t&&t.close()}}}function g({dsn:e}){const{fileStream:t,logFile:n}=d();return i.info("@lark.js/sentry",`Sentry mock plugin initialized, logs will be written to ${n}`),{name:"vite-plugin-sentry",configureServer:u(e||r.options.dsn||"/sentry",t),closeBundle(){t&&t.close()}}}export{g as default,g as sentryPlugin,m as sentryPlugin7};
|
package/dist/webpack.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node:buffer"),t=require("node:path"),r=require("node:fs"),n=require("zod");require("./constants/index.cjs"),require("./types/enums.cjs");var s=require("./utils/sentry.cjs"),i=require("./utils/logger.cjs");function o(t,r){return(s,i,o)=>{if(s.url===t&&"POST"===s.method){let t="";s.on("data",r=>{t=function(t,r){return"string"==typeof r?t+r:e.Buffer.isBuffer(r)?t+r.toString("utf8"):r instanceof Uint8Array?t+e.Buffer.from(r).toString("utf8"):t}(t,r)}),s.on("end",()=>{if(t)try{const e=function(e){return n.z.json().parse(e)}(t);r.write(JSON.stringify(e)+"\n")}catch{r.write(t+"\n")}i.setHeader("Content-Type","application/json"),i.statusCode=200,i.end(JSON.stringify({code:0,message:"success"}))})}else o()}}function u(){const e=t.join(process.cwd(),"logs");r.existsSync(e)||r.mkdirSync(e,{recursive:!0});const n=(new Date).toISOString().replace(/[-:.]/g,"").slice(0,14),s=t.join(e,`sentry_${n}.log`);return{fileStream:r.createWriteStream(s,{flags:"a"}),logFile:s}}class l{dsn;constructor(e={}){this.dsn=e.dsn}apply(e){const t=e.options.devServer,{fileStream:r,logFile:n}=u(),l=o(this.dsn||s.default.options.dsn||"/sentry",r);i.sentryLogger.info("@lark.js/sentry",`Sentry mock plugin initialized, logs will be written to ${n}`);const c=t.setupMiddlewares;t.setupMiddlewares=(e,t)=>{const r=c?c(e,t):e,n={name:"sentry-mock",middleware:l};return r.unshift(n),r},e.hooks.shutdown.tap("SentryWebpackPlugin",()=>{r&&!r.destroyed&&r.close()})}}function c(e={}){return new l(e)}exports.SentryWebpackPlugin=l,exports.default=c,exports.sentryMiddleware=function(e={}){const{fileStream:t,logFile:r}=u();return i.sentryLogger.info("@lark.js/sentry",`Sentry mock middleware initialized, logs will be written to ${r}`),o(e.dsn||s.default.options.dsn||"/sentry",t)},exports.sentryPlugin=c;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import { WebpackPluginInstance, Compiler } from 'webpack';
|
|
3
|
+
import DevServer from 'webpack-dev-server';
|
|
4
|
+
|
|
5
|
+
type SentryDevMiddleware = (req: IncomingMessage, res: ServerResponse, next: DevServer.NextFunction) => void;
|
|
6
|
+
interface ISentryWebpackPluginOptions {
|
|
7
|
+
dsn?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Connect/express-style middleware that mocks the sentry report endpoint
|
|
11
|
+
* during webpack-dev-server development. Mount it manually inside the
|
|
12
|
+
* `setupMiddlewares` option of webpack-dev-server.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { sentryMiddleware } from "@lark.js/sentry/webpack";
|
|
17
|
+
*
|
|
18
|
+
* export default {
|
|
19
|
+
* devServer: {
|
|
20
|
+
* setupMiddlewares(middlewares) {
|
|
21
|
+
* middlewares.unshift({
|
|
22
|
+
* name: "sentry-mock",
|
|
23
|
+
* middleware: sentryMiddleware({ dsn: "/api/log" }),
|
|
24
|
+
* });
|
|
25
|
+
* return middlewares;
|
|
26
|
+
* },
|
|
27
|
+
* },
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare function sentryMiddleware(options?: ISentryWebpackPluginOptions): SentryDevMiddleware;
|
|
32
|
+
/**
|
|
33
|
+
* Webpack plugin that automatically wires the sentry log-collection middleware
|
|
34
|
+
* into webpack-dev-server. It only takes effect when
|
|
35
|
+
* `compiler.options.devServer` exists, so production builds remain untouched.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { sentryPlugin } from "@lark.js/sentry/webpack";
|
|
40
|
+
*
|
|
41
|
+
* export default {
|
|
42
|
+
* plugins: [sentryPlugin({ dsn: "/api/log" })],
|
|
43
|
+
* devServer: { ... },
|
|
44
|
+
* };
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare class SentryWebpackPlugin implements WebpackPluginInstance {
|
|
48
|
+
private readonly dsn;
|
|
49
|
+
constructor(options?: ISentryWebpackPluginOptions);
|
|
50
|
+
apply(compiler: Compiler): void;
|
|
51
|
+
}
|
|
52
|
+
declare function sentryPlugin(options?: ISentryWebpackPluginOptions): SentryWebpackPlugin;
|
|
53
|
+
|
|
54
|
+
export { SentryWebpackPlugin, sentryPlugin as default, sentryMiddleware, sentryPlugin };
|
|
55
|
+
export type { ISentryWebpackPluginOptions, SentryDevMiddleware };
|
package/dist/webpack.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Buffer as t}from"node:buffer";import{join as e}from"node:path";import{existsSync as n,mkdirSync as o,createWriteStream as r}from"node:fs";import{z as s}from"zod";import"./constants/index.js";import"./types/enums.js";import i from"./utils/sentry.js";import{sentryLogger as l}from"./utils/logger.js";function a(e,n){return(o,r,i)=>{if(o.url===e&&"POST"===o.method){let e="";o.on("data",n=>{e=function(e,n){return"string"==typeof n?e+n:t.isBuffer(n)?e+n.toString("utf8"):n instanceof Uint8Array?e+t.from(n).toString("utf8"):e}(e,n)}),o.on("end",()=>{if(e)try{const t=function(t){return s.json().parse(t)}(e);n.write(JSON.stringify(t)+"\n")}catch{n.write(e+"\n")}r.setHeader("Content-Type","application/json"),r.statusCode=200,r.end(JSON.stringify({code:0,message:"success"}))})}else i()}}function d(){const t=e(process.cwd(),"logs");n(t)||o(t,{recursive:!0});const s=(new Date).toISOString().replace(/[-:.]/g,"").slice(0,14),i=e(t,`sentry_${s}.log`);return{fileStream:r(i,{flags:"a"}),logFile:i}}function c(t={}){const{fileStream:e,logFile:n}=d();l.info("@lark.js/sentry",`Sentry mock middleware initialized, logs will be written to ${n}`);return a(t.dsn||i.options.dsn||"/sentry",e)}class f{dsn;constructor(t={}){this.dsn=t.dsn}apply(t){const e=t.options.devServer,{fileStream:n,logFile:o}=d(),r=a(this.dsn||i.options.dsn||"/sentry",n);l.info("@lark.js/sentry",`Sentry mock plugin initialized, logs will be written to ${o}`);const s=e.setupMiddlewares;e.setupMiddlewares=(t,e)=>{const n=s?s(t,e):t,o={name:"sentry-mock",middleware:r};return n.unshift(o),n},t.hooks.shutdown.tap("SentryWebpackPlugin",()=>{n&&!n.destroyed&&n.close()})}}function u(t={}){return new f(t)}export{f as SentryWebpackPlugin,u as default,c as sentryMiddleware,u as sentryPlugin};
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark.js/sentry",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "sentry sdk",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"keywords": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"sdk",
|
|
7
|
+
"sentry"
|
|
9
8
|
],
|
|
10
|
-
"author": "github.com/hangtiancheng",
|
|
11
9
|
"license": "MIT",
|
|
12
|
-
"
|
|
13
|
-
"module": "./dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
10
|
+
"author": "github.com/hangtiancheng",
|
|
15
11
|
"files": [
|
|
16
12
|
"dist",
|
|
17
|
-
"
|
|
13
|
+
"README.md"
|
|
18
14
|
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
"types": "./dist/vite.d.ts",
|
|
42
42
|
"import": "./dist/vite.js",
|
|
43
43
|
"require": "./dist/vite.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./webpack": {
|
|
46
|
+
"types": "./dist/webpack.d.ts",
|
|
47
|
+
"import": "./dist/webpack.js",
|
|
48
|
+
"require": "./dist/webpack.cjs"
|
|
44
49
|
}
|
|
45
50
|
},
|
|
46
51
|
"scripts": {
|
|
@@ -48,39 +53,50 @@
|
|
|
48
53
|
"test:watch": "vitest --config ./vitest.config.ts",
|
|
49
54
|
"test:coverage": "vitest run --config ./vitest.config.ts --coverage",
|
|
50
55
|
"typecheck": "tsc --noEmit",
|
|
51
|
-
"vite7": "pnpm add -D vite7@npm:vite@7.3.3"
|
|
56
|
+
"vite7": "pnpm add -D vite7@npm:vite@7.3.3",
|
|
57
|
+
"format": "oxfmt --write ./",
|
|
58
|
+
"build": "rollup -c ./rollup.config.ts",
|
|
59
|
+
"build:tsup": "tsup --config ./tsup.config.ts"
|
|
52
60
|
},
|
|
53
61
|
"dependencies": {
|
|
54
62
|
"@fingerprintjs/fingerprintjs": "^5.2.0",
|
|
55
63
|
"@rrweb/record": "2.0.0-alpha.20",
|
|
56
|
-
"pako": "^2.
|
|
64
|
+
"pako": "^2.2.0",
|
|
57
65
|
"ua-parser-js": "^2.0.10",
|
|
58
66
|
"web-vitals": "^5.3.0",
|
|
59
67
|
"zod": "^4.4.3"
|
|
60
68
|
},
|
|
61
69
|
"devDependencies": {
|
|
62
70
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
71
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
63
72
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
73
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
64
74
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
65
75
|
"@rrweb/record": "2.0.0-alpha.20",
|
|
66
|
-
"@types/node": "^25.9.
|
|
76
|
+
"@types/node": "^25.9.4",
|
|
67
77
|
"@types/pako": "^2.0.4",
|
|
68
|
-
"@types/react": "^19.2.
|
|
78
|
+
"@types/react": "^19.2.17",
|
|
69
79
|
"@types/react-dom": "^19.2.3",
|
|
70
80
|
"@vitest/coverage-v8": "^1.6.1",
|
|
71
81
|
"jsdom": "^24.1.3",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
82
|
+
"oxfmt": "^0.54.0",
|
|
83
|
+
"react": "^19.2.7",
|
|
84
|
+
"rollup": "^4.62.2",
|
|
85
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
86
|
+
"tsup": "^8.5.1",
|
|
74
87
|
"typescript": "^6.0.3",
|
|
75
|
-
"vite": "^8.0
|
|
88
|
+
"vite": "^8.1.0",
|
|
76
89
|
"vite7": "npm:vite@7.3.3",
|
|
77
90
|
"vitest": "^1.6.1",
|
|
78
|
-
"vue": "^3.5.
|
|
91
|
+
"vue": "^3.5.39",
|
|
92
|
+
"webpack": "^5.108.1",
|
|
93
|
+
"webpack-dev-server": "^5.2.5"
|
|
79
94
|
},
|
|
80
95
|
"peerDependencies": {
|
|
81
96
|
"react": "^19.0.0",
|
|
82
97
|
"vite": "^7.0.0 || ^8.0.0",
|
|
83
|
-
"vue": "^3.0.0"
|
|
98
|
+
"vue": "^3.0.0",
|
|
99
|
+
"webpack": "^4.0.0 || ^5.0.0"
|
|
84
100
|
},
|
|
85
101
|
"peerDependenciesMeta": {
|
|
86
102
|
"react": {
|
|
@@ -91,6 +107,12 @@
|
|
|
91
107
|
},
|
|
92
108
|
"vue": {
|
|
93
109
|
"optional": true
|
|
110
|
+
},
|
|
111
|
+
"webpack": {
|
|
112
|
+
"optional": true
|
|
113
|
+
},
|
|
114
|
+
"webpack-dev-server": {
|
|
115
|
+
"optional": true
|
|
94
116
|
}
|
|
95
117
|
}
|
|
96
118
|
}
|