@picked/sentry 0.0.1-dev.1765328754832 → 0.0.1-dev.1765398246270

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/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sentry/svelte"),r=require("@picked/client"),u=t=>({name:"sentry-plugin",setup:c=>{if(!(!r.supportsWindow()||!t))try{c.eventBus.watch(e=>{const i=s.getGlobalScope();if(e.type==="exception"&&s.withScope(a=>{a.setTag("pickedException",!0),e.level==="info"&&t.captureMessage(typeof e.data=="string"?e.data:JSON.stringify(e.data)),t.captureException(e.data)}),e.type==="session"&&i.setTag("pickedId",e.id),e.type==="feature_decide"){const a=`picked.feature.${e.feature.id}`;i.setTag(a,e.feature.bucket)}e.type==="user_decide"&&i.setTag("picked.is_user",e.value)})}catch{}}});exports.sentryPlugin=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@sentry/core"),c=require("@picked/client"),u=({client:r,globalScope:i})=>({name:"sentry-plugin",setup:s=>{if(c.supportsWindow())try{s.eventBus.watch(e=>{if(e.type==="exception"){const t=new a.Scope;t.setTag("picked",!0),e.level==="info"&&r.captureMessage(typeof e.data=="string"?e.data:JSON.stringify(e.data),"info",void 0,t),r.captureException(e.data,void 0,t)}if(e.type==="session"&&i.setTag("picked.id",e.id),e.type==="feature_decide"){const t=`picked.feature.${e.feature.id}`;i.setTag(t,e.feature.bucket)}e.type==="user_decide"&&i.setTag("picked.is_user",e.value)})}catch{}}});exports.sentryPlugin=u;
package/dist/esm/index.js CHANGED
@@ -1,26 +1,33 @@
1
- import { getGlobalScope as r, withScope as c } from "@sentry/svelte";
2
- import { supportsWindow as o } from "@picked/client";
3
- const d = (e) => ({
1
+ import { Scope as s } from "@sentry/core";
2
+ import { supportsWindow as p } from "@picked/client";
3
+ const c = ({
4
+ client: a,
5
+ globalScope: e
6
+ }) => ({
4
7
  name: "sentry-plugin",
5
- setup: (p) => {
6
- if (!(!o() || !e))
8
+ setup: (r) => {
9
+ if (p())
7
10
  try {
8
- p.eventBus.watch((t) => {
9
- const i = r();
10
- if (t.type === "exception" && c((a) => {
11
- a.setTag("pickedException", !0), t.level === "info" && e.captureMessage(
12
- typeof t.data == "string" ? t.data : JSON.stringify(t.data)
13
- ), e.captureException(t.data);
14
- }), t.type === "session" && i.setTag("pickedId", t.id), t.type === "feature_decide") {
15
- const a = `picked.feature.${t.feature.id}`;
16
- i.setTag(a, t.feature.bucket);
11
+ r.eventBus.watch((i) => {
12
+ if (i.type === "exception") {
13
+ const t = new s();
14
+ t.setTag("picked", !0), i.level === "info" && a.captureMessage(
15
+ typeof i.data == "string" ? i.data : JSON.stringify(i.data),
16
+ "info",
17
+ void 0,
18
+ t
19
+ ), a.captureException(i.data, void 0, t);
17
20
  }
18
- t.type === "user_decide" && i.setTag("picked.is_user", t.value);
21
+ if (i.type === "session" && e.setTag("picked.id", i.id), i.type === "feature_decide") {
22
+ const t = `picked.feature.${i.feature.id}`;
23
+ e.setTag(t, i.feature.bucket);
24
+ }
25
+ i.type === "user_decide" && e.setTag("picked.is_user", i.value);
19
26
  });
20
27
  } catch {
21
28
  }
22
29
  }
23
30
  });
24
31
  export {
25
- d as sentryPlugin
32
+ c as sentryPlugin
26
33
  };
@@ -1,4 +1,7 @@
1
- import { init } from '@sentry/svelte';
1
+ import { Client, Scope } from '@sentry/core';
2
2
  import { Plugin } from '@picked/client';
3
- export declare const sentryPlugin: (sentry: ReturnType<typeof init> | undefined) => Plugin;
3
+ export declare const sentryPlugin: ({ client, globalScope, }: {
4
+ client: Client;
5
+ globalScope: Scope;
6
+ }) => Plugin;
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5D,eAAO,MAAM,YAAY,GAAI,QAAQ,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,SAAS,KAAG,MA4D1E,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5D,eAAO,MAAM,YAAY,GAAI,0BAG1B;IACD,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,KAAK,CAAA;CACnB,KAAG,MA+DH,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/sentry",
3
3
  "description": "Sentry plugin",
4
- "version": "0.0.1-dev.1765328754832",
4
+ "version": "0.0.1-dev.1765398246270",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
7
7
  "@picked/client": "workspace:*",
@@ -9,7 +9,7 @@
9
9
  "@repo/eslint-config": "workspace:*",
10
10
  "@repo/typescript-config": "workspace:*",
11
11
  "@rollup/plugin-replace": "^6.0.2",
12
- "@sentry/svelte": "^10.5.0",
12
+ "@sentry/core": "^10.5.0",
13
13
  "@types/jsdom": "^21.1.7",
14
14
  "@types/node": "^22",
15
15
  "@vitest/coverage-v8": "^3.2.4",
@@ -33,8 +33,7 @@
33
33
  "main": "./dist/cjs/index.js",
34
34
  "module": "./dist/esm/index.js",
35
35
  "peerDependencies": {
36
- "@picked/client": "0.0.1-dev.1765328754832",
37
- "@sentry/svelte": "^10.5.0"
36
+ "@picked/client": "0.0.1-dev.1765398246270"
38
37
  },
39
38
  "private": false,
40
39
  "scripts": {