@swifty.js/sentry 0.0.5 → 0.0.7
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 +108 -110
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/core/api.cjs +1 -1
- package/dist/core/api.d.ts +28 -9
- package/dist/core/api.js +1 -1
- package/dist/core/breadcrumb.cjs +1 -1
- package/dist/core/breadcrumb.js +1 -1
- package/dist/core/decorate-http.cjs +1 -1
- package/dist/core/decorate-http.js +1 -1
- package/dist/core/decorate-route.cjs +1 -1
- package/dist/core/decorate-route.js +1 -1
- package/dist/core/decorates.cjs +1 -1
- package/dist/core/decorates.js +1 -1
- package/dist/core/error-dedup.cjs +1 -0
- package/dist/core/error-dedup.js +1 -0
- package/dist/core/framework-error.cjs +1 -1
- package/dist/core/framework-error.js +1 -1
- package/dist/core/handle-code-error.cjs +1 -1
- package/dist/core/handle-code-error.js +1 -1
- package/dist/core/handle-error.cjs +1 -1
- package/dist/core/handle-error.js +1 -1
- package/dist/core/handle-events.cjs +1 -1
- package/dist/core/handle-events.js +1 -1
- package/dist/core/handle-route.cjs +1 -1
- package/dist/core/handle-route.js +1 -1
- package/dist/core/options-schema.cjs +1 -1
- package/dist/core/options-schema.d.ts +42 -44
- package/dist/core/options-schema.js +1 -1
- package/dist/core/pv-lifecycle.cjs +1 -1
- package/dist/core/pv-lifecycle.js +1 -1
- package/dist/core/sdk-lifecycle.cjs +1 -1
- package/dist/core/sdk-lifecycle.js +1 -1
- package/dist/core/setup.cjs +1 -1
- package/dist/core/setup.js +1 -1
- package/dist/core/white-screen.cjs +1 -1
- package/dist/core/white-screen.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/node/dev-endpoint.cjs +1 -0
- package/dist/node/dev-endpoint.js +1 -0
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/exposure/index.cjs +1 -1
- package/dist/plugins/exposure/index.d.ts +0 -1
- package/dist/plugins/exposure/index.js +1 -1
- package/dist/plugins/performance/first-screen-paint.cjs +1 -1
- package/dist/plugins/performance/first-screen-paint.js +1 -1
- package/dist/plugins/performance/index.cjs +1 -1
- package/dist/plugins/performance/index.d.ts +0 -1
- package/dist/plugins/performance/index.js +1 -1
- package/dist/plugins/performance/navigation-timing.cjs +1 -1
- package/dist/plugins/performance/navigation-timing.js +1 -1
- package/dist/plugins/performance/perf.cjs +1 -1
- package/dist/plugins/performance/perf.js +1 -1
- package/dist/plugins/performance/resource-element-fallback.cjs +1 -1
- package/dist/plugins/performance/resource-element-fallback.js +1 -1
- package/dist/plugins/performance/resource-timing.cjs +1 -1
- package/dist/plugins/performance/resource-timing.js +1 -1
- package/dist/plugins/screen-record/index.cjs +1 -1
- package/dist/plugins/screen-record/index.js +1 -1
- package/dist/plugins/screen-record/recorder.cjs +1 -1
- package/dist/plugins/screen-record/recorder.d.ts +1 -1
- package/dist/plugins/screen-record/recorder.js +1 -1
- package/dist/react.d.ts +6 -80
- package/dist/reporter/index.cjs +1 -1
- package/dist/reporter/index.js +1 -1
- package/dist/reporter/network-listener.cjs +1 -1
- package/dist/reporter/network-listener.js +1 -1
- package/dist/reporter/offline-cache.cjs +1 -1
- package/dist/reporter/offline-cache.js +1 -1
- package/dist/reporter/report-data-schema.cjs +1 -1
- package/dist/reporter/report-data-schema.js +1 -1
- package/dist/reporter/report-data.cjs +1 -1
- package/dist/reporter/report-data.js +1 -1
- package/dist/reporter/server-recovery.cjs +1 -1
- package/dist/reporter/server-recovery.js +1 -1
- package/dist/reporter/transports.cjs +1 -1
- package/dist/reporter/transports.js +1 -1
- package/dist/source-map/source-map.cjs +1 -1
- package/dist/source-map/source-map.js +1 -1
- package/dist/types/common.d.ts +9 -10
- package/dist/types/enums.cjs +1 -1
- package/dist/types/enums.d.ts +1 -43
- package/dist/types/enums.js +1 -1
- package/dist/types/options.d.ts +9 -13
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.d.ts +0 -3
- package/dist/types/plugin.js +1 -1
- package/dist/utils/data-structures.cjs +1 -1
- package/dist/utils/data-structures.js +1 -1
- package/dist/utils/get-base-data.cjs +1 -1
- package/dist/utils/get-base-data.js +1 -1
- package/dist/utils/logger.cjs +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/noop.cjs +1 -0
- package/dist/utils/noop.js +1 -0
- package/dist/utils/sentry.cjs +1 -1
- package/dist/utils/sentry.js +1 -1
- package/dist/utils/session.cjs +1 -1
- package/dist/utils/session.js +1 -1
- package/dist/utils/throttle.cjs +1 -1
- package/dist/utils/throttle.js +1 -1
- package/dist/utils/transform-http-data.cjs +1 -1
- package/dist/utils/transform-http-data.js +1 -1
- package/dist/utils/uuid.cjs +1 -0
- package/dist/utils/uuid.js +1 -0
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +3 -5
- package/skills/swifty-sentry/SKILL.md +1293 -0
- package/dist/core/ip.cjs +0 -1
- package/dist/core/ip.d.ts +0 -24
- package/dist/core/ip.js +0 -1
- package/dist/reporter/batch.cjs +0 -1
- package/dist/reporter/batch.js +0 -1
- package/dist/utils/base64.cjs +0 -1
- package/dist/utils/base64.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("../constants/index.cjs");exports.
|
|
1
|
+
"use strict";var t=require("../constants/index.cjs");exports.BoundedList=class{capacity;items=[];constructor(s=t.MAX_BREADCRUMBS){this.capacity=s}push(t){this.items.push(t),this.items.length>this.capacity&&this.items.splice(0,this.items.length-this.capacity)}dump(){return[...this.items]}clear(){this.items=[]}},exports.BoundedSet=class{map=new Map;capacity;constructor(t){this.capacity=t}has(t){return this.map.has(t)}add(t){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,!0),this.map.size>this.capacity){const t=this.map.keys().next().value;void 0!==t&&this.map.delete(t)}}clear(){this.map.clear()}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_BREADCRUMBS as t}from"../constants/index.js";class s{capacity
|
|
1
|
+
import{MAX_BREADCRUMBS as t}from"../constants/index.js";class s{capacity;items=[];constructor(s=t){this.capacity=s}push(t){this.items.push(t),this.items.length>this.capacity&&this.items.splice(0,this.items.length-this.capacity)}dump(){return[...this.items]}clear(){this.items=[]}}class i{map=new Map;capacity;constructor(t){this.capacity=t}has(t){return this.map.has(t)}add(t){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,!0),this.map.size>this.capacity){const t=this.map.keys().next().value;void 0!==t&&this.map.delete(t)}}clear(){this.map.clear()}}export{s as BoundedList,i as BoundedSet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../types/enums.cjs"),t=require("./session.cjs");exports.default=function(){return{id:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../types/enums.cjs"),t=require("./session.cjs"),s=require("./uuid.cjs");exports.default=function(){return{id:s.generateUUID(),deviceId:t.getDeviceId(),sessionId:t.getSessionId(),message:"",timestamp:Date.now(),time:(new Date).toISOString(),name:"",status:e.Status.OK,type:e.EventType.Custom}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EventType as t,Status as e}from"../types/enums.js";import{getSessionId as s,getDeviceId as
|
|
1
|
+
import{EventType as t,Status as e}from"../types/enums.js";import{getSessionId as s,getDeviceId as m}from"./session.js";import{generateUUID as o}from"./uuid.js";function i(){return{id:o(),deviceId:m(),sessionId:s(),message:"",timestamp:Date.now(),time:(new Date).toISOString(),name:"",status:e.OK,type:t.Custom}}export{i as default};
|
package/dist/utils/logger.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o="#74d4ff",
|
|
1
|
+
"use strict";const o="#74d4ff",e="#bbf450",s="#ffa2a2",r="#62748e",n="font-family: Iosevka, Maple Mono, Menlo, Cascadia Code;",c=o=>`color: ${o}; ${n}`,l=o=>`color: ${r}; background: ${o}; border-radius: 4px; ${n}`,i={info:{message:c(o),prefix:l(o)},success:{message:c(e),prefix:l(e)},error:{message:c(s),prefix:l(s)}},t=console.error.bind(console),a="@swifty.js/sentry";function f(){return globalThis.__sentry__?.options.debug??!1}function u(o,e,s,r){f()&&(console.groupCollapsed(`%c ${e} %c ${s} `,i[o].prefix,i[o].message),r(),console.groupEnd())}function g(o,e){if(void 0!==o){if(!Array.isArray(o))return"object"==typeof o&&null!==o?(console.group("Details"),console.log(o),void console.groupEnd()):void console.log(o);e?console.table(o,e):console.table(o)}}const d={get isEnabled(){return f()},info(o,e,s,r=a){u("info",r,o,()=>{g(e,s)})},success(o,e,s,r=a){u("success",r,o,()=>{void 0!==s&&console.log(`%c Time cost %c ${s}ms`,i.success.prefix,i.success.message),g(e)})},error(o,e,s=a){u("error",s,o,()=>{void 0!==e&&(console.group("Details"),t(e),console.groupEnd())})}};exports.sentryLogger=d;
|
package/dist/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="#74d4ff",e="#bbf450",s="#
|
|
1
|
+
const o="#74d4ff",e="#bbf450",s="#ffa2a2",r="#62748e",n="font-family: Iosevka, Maple Mono, Menlo, Cascadia Code;",c=o=>`color: ${o}; ${n}`,l=o=>`color: ${r}; background: ${o}; border-radius: 4px; ${n}`,i={info:{message:c(o),prefix:l(o)},success:{message:c(e),prefix:l(e)},error:{message:c(s),prefix:l(s)}},a=console.error.bind(console),f="@swifty.js/sentry";function t(){return globalThis.__sentry__?.options.debug??!1}function u(o,e,s,r){t()&&(console.groupCollapsed(`%c ${e} %c ${s} `,i[o].prefix,i[o].message),r(),console.groupEnd())}function d(o,e){if(void 0!==o){if(!Array.isArray(o))return"object"==typeof o&&null!==o?(console.group("Details"),console.log(o),void console.groupEnd()):void console.log(o);e?console.table(o,e):console.table(o)}}const g={get isEnabled(){return t()},info(o,e,s,r=f){u("info",r,o,()=>{d(e,s)})},success(o,e,s,r=f){u("success",r,o,()=>{void 0!==s&&console.log(`%c Time cost %c ${s}ms`,i.success.prefix,i.success.message),d(e)})},error(o,e,s=f){u("error",s,o,()=>{void 0!==e&&(console.group("Details"),a(e),console.groupEnd())})}};export{g as sentryLogger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.noop=function(){};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(){}export{n as noop};
|
package/dist/utils/sentry.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants/index.cjs"),s=require("./data-structures.cjs"),o=require("ua-parser-js");const r=new class{codeErrors=new s.BoundedSet(1e3);options={...e.DEFAULT_OPTIONS};shouldScreenRecord=!1;#e=null;get deviceInfo(){return this.#e??=function(){const s=(new o.UAParser).getResult();return{browserName:s.browser.name??e.UNKNOWN,browserVersion:s.browser.version??e.UNKNOWN,osName:s.os.name??e.UNKNOWN,osVersion:s.os.version??e.UNKNOWN,userAgent:s.ua,deviceModel:s.device.model??e.UNKNOWN,deviceType:s.device.type??e.UNKNOWN,language:"navigator"in globalThis&&globalThis.navigator.language||e.UNKNOWN,screenResolution:"screen"in globalThis?`${globalThis.screen.width}x${globalThis.screen.height}`:e.UNKNOWN}}(),this.#e}setOptions(e){this.options={...this.options,...e}}};globalThis.__sentry__=r,exports.default=r;
|
package/dist/utils/sentry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_OPTIONS as e,UNKNOWN as
|
|
1
|
+
import{DEFAULT_OPTIONS as e,UNKNOWN as o}from"../constants/index.js";import{BoundedSet as s}from"./data-structures.js";import{UAParser as n}from"ua-parser-js";const r=new class{codeErrors=new s(1e3);options={...e};shouldScreenRecord=!1;#e=null;get deviceInfo(){return this.#e??=function(){const e=(new n).getResult();return{browserName:e.browser.name??o,browserVersion:e.browser.version??o,osName:e.os.name??o,osVersion:e.os.version??o,userAgent:e.ua,deviceModel:e.device.model??o,deviceType:e.device.type??o,language:"navigator"in globalThis&&globalThis.navigator.language||o,screenResolution:"screen"in globalThis?`${globalThis.screen.width}x${globalThis.screen.height}`:o}}(),this.#e}setOptions(e){this.options={...this.options,...e}}};globalThis.__sentry__=r;export{r as default};
|
package/dist/utils/session.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t="swifty_sentry_device_id",
|
|
1
|
+
"use strict";var e=require("./uuid.cjs");const t="swifty_sentry_device_id",r="swifty_sentry_session_id";exports.getDeviceId=function(){try{let r=localStorage.getItem(t);return r||(r=e.generateUUID(),localStorage.setItem(t,r)),r}catch{return e.generateUUID()}},exports.getSessionId=function(){try{let t=sessionStorage.getItem(r);return t||(t=e.generateUUID(),sessionStorage.setItem(r,t)),t}catch{return e.generateUUID()}};
|
package/dist/utils/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{generateUUID as t}from"./uuid.js";const e="swifty_sentry_device_id",r="swifty_sentry_session_id";function s(){try{let r=localStorage.getItem(e);return r||(r=t(),localStorage.setItem(e,r)),r}catch{return t()}}function o(){try{let e=sessionStorage.getItem(r);return e||(e=t(),sessionStorage.setItem(r,e)),e}catch{return t()}}export{s as getDeviceId,o as getSessionId};
|
package/dist/utils/throttle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.throttle=function(t,
|
|
1
|
+
"use strict";exports.throttle=function(t,n){if(n<=0)return function(...n){t.apply(this,n)};let e=Number.NEGATIVE_INFINITY;return function(...r){const i=Date.now();i-e>=n&&(e=i,t.apply(this,r))}};
|
package/dist/utils/throttle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,n
|
|
1
|
+
function t(t,n){if(n<=0)return function(...n){t.apply(this,n)};let e=Number.NEGATIVE_INFINITY;return function(...i){const o=Date.now();o-e>=n&&(e=o,t.apply(this,i))}}export{t as throttle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../types/enums.cjs");exports.default=function(s){const{statusCode:r}=s;let t,o;return r>=100&&r<200?(t="Informational response",o=e.Status.OK):r>=200&&r<300?(t="Successful responses",o=e.Status.OK):r>=300&&r<400?(t="Redirection messages",o=e.Status.OK):r>=400&&r<500?(t="Client error responses",o=e.Status.Error):r>=500&&r<600?(t="Server error responses",o=e.Status.Error):(t="Invalid status code",o=e.Status.Error),{...s,message:t,status:o}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../types/enums.cjs");exports.default=function(s){const{statusCode:r}=s;let t,o;return 0===r?(t=s.message||"Network error",o=e.Status.Error):r>=100&&r<200?(t="Informational response",o=e.Status.OK):r>=200&&r<300?(t="Successful responses",o=e.Status.OK):r>=300&&r<400?(t="Redirection messages",o=e.Status.OK):r>=400&&r<500?(t="Client error responses",o=e.Status.Error):r>=500&&r<600?(t="Server error responses",o=e.Status.Error):(t="Invalid status code",o=e.Status.Error),{...s,message:t,status:o}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Status as
|
|
1
|
+
import{Status as r}from"../types/enums.js";function e(e){const{statusCode:s}=e;let o,t;return 0===s?(o=e.message||"Network error",t=r.Error):s>=100&&s<200?(o="Informational response",t=r.OK):s>=200&&s<300?(o="Successful responses",t=r.OK):s>=300&&s<400?(o="Redirection messages",t=r.OK):s>=400&&s<500?(o="Client error responses",t=r.Error):s>=500&&s<600?(o="Server error responses",t=r.Error):(o="Invalid status code",t=r.Error),{...e,message:o,status:t}}export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.generateUUID=function(){const n=globalThis.crypto;if(n&&"function"==typeof n.randomUUID)return n.randomUUID();if(n&&"function"==typeof n.getRandomValues){const t=n.getRandomValues(new Uint8Array(16));t[6]=15&t[6]|64,t[8]=63&t[8]|128;const o=Array.from(t,n=>n.toString(16).padStart(2,"0"));return[o.slice(0,4).join(""),o.slice(4,6).join(""),o.slice(6,8).join(""),o.slice(8,10).join(""),o.slice(10).join("")].join("-")}return`${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(){const n=globalThis.crypto;if(n&&"function"==typeof n.randomUUID)return n.randomUUID();if(n&&"function"==typeof n.getRandomValues){const o=n.getRandomValues(new Uint8Array(16));o[6]=15&o[6]|64,o[8]=63&o[8]|128;const t=Array.from(o,n=>n.toString(16).padStart(2,"0"));return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10).join("")].join("-")}return`${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`}export{n as generateUUID};
|
package/dist/vite.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./node/dev-endpoint.cjs"),r=require("./source-map/vite.cjs");function t({dsn:t}){const n=t??e.DEFAULT_MOCK_DSN;let o=null;return{name:"vite-plugin-sentry",apply:"serve",configureServer(t){o=e.createLogStream(),console.log(`[@swifty.js/sentry] mock report endpoint active, logging to ${o.logFile}`),t.middlewares.use(e.createMockMiddleware(n,o.fileStream,e=>r.enrichReportData(t,e)))},closeBundle(){o&&e.closeLogStream(o.fileStream)}}}function n(e={}){return t(e)}exports.default=n,exports.sentryPlugin=n,exports.sentryPlugin7=function(e={}){return t(e)};
|
package/dist/vite.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ import { Plugin } from 'vite';
|
|
|
26
26
|
interface ISentryPluginOptions {
|
|
27
27
|
dsn?: string;
|
|
28
28
|
}
|
|
29
|
-
declare function
|
|
30
|
-
declare function
|
|
29
|
+
declare function sentryPlugin(options?: ISentryPluginOptions): Plugin;
|
|
30
|
+
declare function sentryPlugin7(options?: ISentryPluginOptions): Plugin$1;
|
|
31
31
|
|
|
32
32
|
export { sentryPlugin as default, sentryPlugin, sentryPlugin7 };
|
|
33
33
|
export type { ISentryPluginOptions };
|
package/dist/vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createLogStream as e,createMockMiddleware as n,DEFAULT_MOCK_DSN as t,closeLogStream as o}from"./node/dev-endpoint.js";import{enrichReportData as r}from"./source-map/vite.js";function i({dsn:i}){const l=i??t;let s=null;return{name:"vite-plugin-sentry",apply:"serve",configureServer(t){s=e(),console.log(`[@swifty.js/sentry] mock report endpoint active, logging to ${s.logFile}`),t.middlewares.use(n(l,s.fileStream,e=>r(t,e)))},closeBundle(){s&&o(s.fileStream)}}}function l(e={}){return i(e)}function s(e={}){return i(e)}export{l as default,l as sentryPlugin,s as sentryPlugin7};
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=require("./core/sdk-lifecycle.cjs"),e=require("./types/enums.cjs"),o=require("./core/framework-error.cjs");exports.vuePlugin=(c,n)=>{const t=c.config.errorHandler;c.config.errorHandler=(r,c,n)=>{o.reportFrameworkError({type:e.EventType.Vue,error:r,context:{vueInstance:c,info:n}}),t?.
|
|
1
|
+
"use strict";var r=require("./core/sdk-lifecycle.cjs"),e=require("./types/enums.cjs"),o=require("./core/framework-error.cjs");exports.vuePlugin=(c,n)=>{const t=c.config.errorHandler;c.config.errorHandler=(r,c,n)=>{o.reportFrameworkError({type:e.EventType.Vue,error:r,context:{vueInstance:c,info:n}}),t?.(r,c,n)},r.init(n)};
|
package/dist/vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{init as r}from"./core/sdk-lifecycle.js";import{EventType as o}from"./types/enums.js";import{reportFrameworkError as e}from"./core/framework-error.js";const n=(n,
|
|
1
|
+
import{init as r}from"./core/sdk-lifecycle.js";import{EventType as o}from"./types/enums.js";import{reportFrameworkError as e}from"./core/framework-error.js";const n=(n,t)=>{const c=n.config.errorHandler;n.config.errorHandler=(r,n,t)=>{e({type:o.Vue,error:r,context:{vueInstance:n,info:t}}),c?.(r,n,t)},r(t)};export{n as vuePlugin};
|
package/dist/webpack.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./node/dev-endpoint.cjs"),t=require("./source-map/webpack.cjs"),r=require("./source-map/source-map.cjs");class o{dsn;constructor(e={}){this.dsn=e.dsn}apply(o){if(!o.options.devServer)return;const s=o.options.devServer,{fileStream:n,logFile:a}=e.createLogStream(),i=t.createAssetMapStore(),c=e.createMockMiddleware(this.dsn??e.DEFAULT_MOCK_DSN,n,e=>r.enrichReportData(i.loadMap,e));o.hooks.assetEmitted.tap("SentryWebpackPlugin",(e,{content:t})=>{e.endsWith(".map")&&i.put(e,t.toString("utf8"))}),console.log(`[@swifty.js/sentry] mock report endpoint active, logging to ${a}`);const d=s.setupMiddlewares;s.setupMiddlewares=(e,t)=>{const r=d?d(e,t):e,o={name:"sentry-mock",middleware:c};return r.unshift(o),r},o.hooks.shutdown.tap("SentryWebpackPlugin",()=>{e.closeLogStream(n)})}}function s(e={}){return new o(e)}exports.SentryWebpackPlugin=o,exports.default=s,exports.sentryMiddleware=function(t={}){const{fileStream:r,logFile:o}=e.createLogStream();return console.log(`[@swifty.js/sentry] mock report endpoint active, logging to ${o}`),e.createMockMiddleware(t.dsn??e.DEFAULT_MOCK_DSN,r)},exports.sentryPlugin=s;
|
package/dist/webpack.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createLogStream as t,createMockMiddleware as e,DEFAULT_MOCK_DSN as o,closeLogStream as n}from"./node/dev-endpoint.js";import{createAssetMapStore as s}from"./source-map/webpack.js";import{enrichReportData as r}from"./source-map/source-map.js";function i(n={}){const{fileStream:s,logFile:r}=t();return console.log(`[@swifty.js/sentry] mock report endpoint active, logging to ${r}`),e(n.dsn??o,s)}class p{dsn;constructor(t={}){this.dsn=t.dsn}apply(i){if(!i.options.devServer)return;const p=i.options.devServer,{fileStream:a,logFile:c}=t(),d=s(),l=e(this.dsn??o,a,t=>r(d.loadMap,t));i.hooks.assetEmitted.tap("SentryWebpackPlugin",(t,{content:e})=>{t.endsWith(".map")&&d.put(t,e.toString("utf8"))}),console.log(`[@swifty.js/sentry] mock report endpoint active, logging to ${c}`);const u=p.setupMiddlewares;p.setupMiddlewares=(t,e)=>{const o=u?u(t,e):t,n={name:"sentry-mock",middleware:l};return o.unshift(n),o},i.hooks.shutdown.tap("SentryWebpackPlugin",()=>{n(a)})}}function a(t={}){return new p(t)}export{p as SentryWebpackPlugin,a as default,i as sentryMiddleware,a as sentryPlugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swifty.js/sentry",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Framework-agnostic sentry sdk with first-class support for react and vue3+",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"error-tracking",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
|
+
"skills",
|
|
26
27
|
"README.md"
|
|
27
28
|
],
|
|
28
29
|
"type": "module",
|
|
@@ -76,7 +77,6 @@
|
|
|
76
77
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
77
78
|
"@rollup/plugin-terser": "^1.0.0",
|
|
78
79
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
79
|
-
"@rrweb/record": "2.1.0",
|
|
80
80
|
"@types/jsdom": "^28.0.3",
|
|
81
81
|
"@types/node": "^25.9.5",
|
|
82
82
|
"@types/pako": "^2.0.4",
|
|
@@ -88,7 +88,6 @@
|
|
|
88
88
|
"react": "^19.2.8",
|
|
89
89
|
"rollup": "^4.62.4",
|
|
90
90
|
"rollup-plugin-dts": "^6.5.1",
|
|
91
|
-
"tsup": "^8.5.1",
|
|
92
91
|
"typescript": "^6.0.3",
|
|
93
92
|
"vite": "^8.2.1",
|
|
94
93
|
"vite7": "npm:vite@7.3.3",
|
|
@@ -128,7 +127,6 @@
|
|
|
128
127
|
"vite7": "pnpm add -D vite7@npm:vite@7.3.3",
|
|
129
128
|
"format": "oxfmt --write ./",
|
|
130
129
|
"build": "rollup -c ./rollup.config.ts",
|
|
131
|
-
"build:watch": "rollup -c ./rollup.config.ts -w"
|
|
132
|
-
"build:tsup": "tsup --config ./tsup.config.ts"
|
|
130
|
+
"build:watch": "rollup -c ./rollup.config.ts -w"
|
|
133
131
|
}
|
|
134
132
|
}
|