Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions packages/pinia/src/devtools/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ const MUTATIONS_LAYER_ID = 'pinia:mutations'
const INSPECTOR_ID = 'pinia'
const { assign } = Object

const pluginDescriptor = {
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
settings: {
logStoreChanges: {
label: 'Notify about new/deleted stores',
type: 'boolean',
defaultValue: true,
},
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
},
} as const

// copied from devtools
interface TimelineEvent<TData = any, TMeta = any> {
time: number
Expand Down Expand Up @@ -62,12 +83,7 @@ const getStoreType = (id: string) => '🍍 ' + id
export function registerPiniaDevtools(app: App, pinia: Pinia) {
setupDevtoolsPlugin(
{
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
...pluginDescriptor,
app,
},
(api) => {
Expand Down Expand Up @@ -315,25 +331,8 @@ function addStoreToDevtools(app: App, store: StoreGeneric) {

setupDevtoolsPlugin(
{
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
...pluginDescriptor,
app,
settings: {
logStoreChanges: {
label: 'Notify about new/deleted stores',
type: 'boolean',
defaultValue: true,
},
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
},
},
(api) => {
// gracefully handle errors
Expand Down