@sentry/vue
Advanced tools
Comparing version 9.0.0-alpha.1 to 9.0.0-alpha.2
@@ -73,3 +73,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
if (core.hasTracingEnabled(options)) { | ||
if (core.hasSpansEnabled(options)) { | ||
app.mixin(tracing.createTracingMixins(options.tracingOptions)); | ||
@@ -76,0 +76,0 @@ } |
@@ -5,3 +5,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
// Inline PiniaPlugin type | ||
// Inline Pinia types | ||
@@ -16,3 +16,13 @@ const createSentryPiniaPlugin = ( | ||
) => { | ||
const plugin = ({ store }) => { | ||
const plugin = ({ store, pinia }) => { | ||
const getAllStoreStates = () => { | ||
const states = {}; | ||
Object.keys(pinia.state.value).forEach(storeId => { | ||
states[storeId] = pinia.state.value[storeId]; | ||
}); | ||
return states; | ||
}; | ||
options.attachPiniaState !== false && | ||
@@ -23,3 +33,3 @@ core.getGlobalScope().addEventProcessor((event, hint) => { | ||
const timestamp = new Date().toTimeString().split(' ')[0]; | ||
const filename = `pinia_state_${store.$id}_${timestamp}.json`; | ||
const filename = `pinia_state_all_stores_${timestamp}.json`; | ||
@@ -30,3 +40,3 @@ hint.attachments = [ | ||
filename, | ||
data: JSON.stringify(store.$state), | ||
data: JSON.stringify(getAllStoreStates()), | ||
}, | ||
@@ -53,4 +63,4 @@ ]; | ||
core.addBreadcrumb({ | ||
category: 'action', | ||
message: transformedActionName, | ||
category: 'pinia.action', | ||
message: `Store: ${store.$id} | Action: ${transformedActionName}`, | ||
level: 'info', | ||
@@ -60,4 +70,5 @@ }); | ||
/* Set latest state to scope */ | ||
const transformedState = options.stateTransformer ? options.stateTransformer(store.$state) : store.$state; | ||
/* Set latest state of all stores to scope */ | ||
const allStates = getAllStoreStates(); | ||
const transformedState = options.stateTransformer ? options.stateTransformer(allStates) : allStates; | ||
const scope = core.getCurrentScope(); | ||
@@ -64,0 +75,0 @@ const currentState = scope.getScopeData().contexts.state; |
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const browser = require('@sentry/browser'); | ||
const core = require('@sentry/core'); | ||
const integration = require('./integration.js'); | ||
@@ -9,21 +10,11 @@ | ||
*/ | ||
function init(config = {}) { | ||
const options = { | ||
_metadata: { | ||
sdk: { | ||
name: 'sentry.javascript.vue', | ||
packages: [ | ||
{ | ||
name: 'npm:@sentry/vue', | ||
version: browser.SDK_VERSION, | ||
}, | ||
], | ||
version: browser.SDK_VERSION, | ||
}, | ||
}, | ||
defaultIntegrations: [...browser.getDefaultIntegrations(config), integration.vueIntegration()], | ||
...config, | ||
function init(options = {}) { | ||
const opts = { | ||
defaultIntegrations: [...browser.getDefaultIntegrations(options), integration.vueIntegration()], | ||
...options, | ||
}; | ||
return browser.init(options); | ||
core.applySdkMetadata(opts, 'vue'); | ||
return browser.init(opts); | ||
} | ||
@@ -30,0 +21,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { defineIntegration, consoleSandbox, hasTracingEnabled, GLOBAL_OBJ } from '@sentry/core'; | ||
import { defineIntegration, consoleSandbox, hasSpansEnabled, GLOBAL_OBJ } from '@sentry/core'; | ||
import { DEFAULT_HOOKS } from './constants.js'; | ||
@@ -71,3 +71,3 @@ import { DEBUG_BUILD } from './debug-build.js'; | ||
if (hasTracingEnabled(options)) { | ||
if (hasSpansEnabled(options)) { | ||
app.mixin(createTracingMixins(options.tracingOptions)); | ||
@@ -74,0 +74,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"9.0.0-alpha.1","sideEffects":false} | ||
{"type":"module","version":"9.0.0-alpha.2","sideEffects":false} |
import { getGlobalScope, addBreadcrumb, getCurrentScope, getClient, addNonEnumerableProperty } from '@sentry/core'; | ||
// Inline PiniaPlugin type | ||
// Inline Pinia types | ||
@@ -13,3 +13,13 @@ const createSentryPiniaPlugin = ( | ||
) => { | ||
const plugin = ({ store }) => { | ||
const plugin = ({ store, pinia }) => { | ||
const getAllStoreStates = () => { | ||
const states = {}; | ||
Object.keys(pinia.state.value).forEach(storeId => { | ||
states[storeId] = pinia.state.value[storeId]; | ||
}); | ||
return states; | ||
}; | ||
options.attachPiniaState !== false && | ||
@@ -20,3 +30,3 @@ getGlobalScope().addEventProcessor((event, hint) => { | ||
const timestamp = new Date().toTimeString().split(' ')[0]; | ||
const filename = `pinia_state_${store.$id}_${timestamp}.json`; | ||
const filename = `pinia_state_all_stores_${timestamp}.json`; | ||
@@ -27,3 +37,3 @@ hint.attachments = [ | ||
filename, | ||
data: JSON.stringify(store.$state), | ||
data: JSON.stringify(getAllStoreStates()), | ||
}, | ||
@@ -50,4 +60,4 @@ ]; | ||
addBreadcrumb({ | ||
category: 'action', | ||
message: transformedActionName, | ||
category: 'pinia.action', | ||
message: `Store: ${store.$id} | Action: ${transformedActionName}`, | ||
level: 'info', | ||
@@ -57,4 +67,5 @@ }); | ||
/* Set latest state to scope */ | ||
const transformedState = options.stateTransformer ? options.stateTransformer(store.$state) : store.$state; | ||
/* Set latest state of all stores to scope */ | ||
const allStates = getAllStoreStates(); | ||
const transformedState = options.stateTransformer ? options.stateTransformer(allStates) : allStates; | ||
const scope = getCurrentScope(); | ||
@@ -61,0 +72,0 @@ const currentState = scope.getScopeData().contexts.state; |
@@ -1,2 +0,3 @@ | ||
import { SDK_VERSION, getDefaultIntegrations, init as init$1 } from '@sentry/browser'; | ||
import { getDefaultIntegrations, init as init$1 } from '@sentry/browser'; | ||
import { applySdkMetadata } from '@sentry/core'; | ||
import { vueIntegration } from './integration.js'; | ||
@@ -7,21 +8,11 @@ | ||
*/ | ||
function init(config = {}) { | ||
const options = { | ||
_metadata: { | ||
sdk: { | ||
name: 'sentry.javascript.vue', | ||
packages: [ | ||
{ | ||
name: 'npm:@sentry/vue', | ||
version: SDK_VERSION, | ||
}, | ||
], | ||
version: SDK_VERSION, | ||
}, | ||
}, | ||
defaultIntegrations: [...getDefaultIntegrations(config), vueIntegration()], | ||
...config, | ||
function init(options = {}) { | ||
const opts = { | ||
defaultIntegrations: [...getDefaultIntegrations(options), vueIntegration()], | ||
...options, | ||
}; | ||
return init$1(options); | ||
applySdkMetadata(opts, 'vue'); | ||
return init$1(opts); | ||
} | ||
@@ -28,0 +19,0 @@ |
@@ -0,1 +1,3 @@ | ||
import { Ref } from 'vue'; | ||
type StateTree = Record<string | number | symbol, any>; | ||
type PiniaPlugin = (context: { | ||
@@ -10,2 +12,5 @@ store: { | ||
}; | ||
pinia: { | ||
state: Ref<Record<string, StateTree>>; | ||
}; | ||
}) => void; | ||
@@ -15,4 +20,4 @@ type SentryPiniaPluginOptions = { | ||
addBreadcrumbs?: boolean; | ||
actionTransformer?: (action: any) => any; | ||
stateTransformer?: (state: any) => any; | ||
actionTransformer?: (action: string) => any; | ||
stateTransformer?: (state: Record<string, unknown>) => any; | ||
}; | ||
@@ -19,0 +24,0 @@ export declare const createSentryPiniaPlugin: (options?: SentryPiniaPluginOptions) => PiniaPlugin; |
@@ -6,3 +6,3 @@ import { Client } from '@sentry/core'; | ||
*/ | ||
export declare function init(config?: Partial<Pick<Options, Exclude<keyof Options, 'tracingOptions'>>>): Client | undefined; | ||
export declare function init(options?: Partial<Pick<Options, Exclude<keyof Options, 'tracingOptions'>>>): Client | undefined; | ||
//# sourceMappingURL=sdk.d.ts.map |
@@ -0,1 +1,3 @@ | ||
import type { Ref } from 'vue'; | ||
type StateTree = Record<string | number | symbol, any>; | ||
type PiniaPlugin = (context: { | ||
@@ -10,2 +12,5 @@ store: { | ||
}; | ||
pinia: { | ||
state: Ref<Record<string, StateTree>>; | ||
}; | ||
}) => void; | ||
@@ -15,4 +20,4 @@ type SentryPiniaPluginOptions = { | ||
addBreadcrumbs?: boolean; | ||
actionTransformer?: (action: any) => any; | ||
stateTransformer?: (state: any) => any; | ||
actionTransformer?: (action: string) => any; | ||
stateTransformer?: (state: Record<string, unknown>) => any; | ||
}; | ||
@@ -19,0 +24,0 @@ export declare const createSentryPiniaPlugin: (options?: SentryPiniaPluginOptions) => PiniaPlugin; |
@@ -6,3 +6,3 @@ import type { Client } from '@sentry/core'; | ||
*/ | ||
export declare function init(config?: Partial<Omit<Options, 'tracingOptions'>>): Client | undefined; | ||
export declare function init(options?: Partial<Omit<Options, 'tracingOptions'>>): Client | undefined; | ||
//# sourceMappingURL=sdk.d.ts.map |
{ | ||
"name": "@sentry/vue", | ||
"version": "9.0.0-alpha.1", | ||
"version": "9.0.0-alpha.2", | ||
"description": "Official Sentry SDK for Vue.js", | ||
@@ -42,4 +42,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/browser": "9.0.0-alpha.1", | ||
"@sentry/core": "9.0.0-alpha.1" | ||
"@sentry/browser": "9.0.0-alpha.2", | ||
"@sentry/core": "9.0.0-alpha.2" | ||
}, | ||
@@ -46,0 +46,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
162214
1578
+ Added@sentry-internal/browser-utils@9.0.0-alpha.2(transitive)
+ Added@sentry-internal/feedback@9.0.0-alpha.2(transitive)
+ Added@sentry-internal/replay@9.0.0-alpha.2(transitive)
+ Added@sentry-internal/replay-canvas@9.0.0-alpha.2(transitive)
+ Added@sentry/browser@9.0.0-alpha.2(transitive)
+ Added@sentry/core@9.0.0-alpha.2(transitive)
- Removed@sentry-internal/browser-utils@9.0.0-alpha.1(transitive)
- Removed@sentry-internal/feedback@9.0.0-alpha.1(transitive)
- Removed@sentry-internal/replay@9.0.0-alpha.1(transitive)
- Removed@sentry-internal/replay-canvas@9.0.0-alpha.1(transitive)
- Removed@sentry/browser@9.0.0-alpha.1(transitive)
- Removed@sentry/core@9.0.0-alpha.1(transitive)
Updated@sentry/core@9.0.0-alpha.2