@logux/vue-devtools
Advanced tools
Comparing version 0.1.0 to 0.2.0
122
index.js
@@ -46,6 +46,6 @@ import { setupDevtoolsPlugin } from '@vue/devtools-api' | ||
payload.instanceData.state.push({ | ||
key: '$client', | ||
type: 'Logux', | ||
key: '$client', | ||
editable: false, | ||
value: client | ||
value: client, | ||
editable: false | ||
}) | ||
@@ -106,7 +106,7 @@ } | ||
client.on('state', () => { | ||
let details | ||
let data = {} | ||
let time = Date.now() | ||
if (client.state === 'connecting' && node.connection.url) { | ||
details = { | ||
data = { | ||
nodeId: node.localNodeId, | ||
@@ -121,3 +121,3 @@ server: node.connection.url | ||
prevConnected = true | ||
details = { | ||
data = { | ||
server: node.remoteNodeId | ||
@@ -129,13 +129,6 @@ } | ||
let data = { | ||
state: client.state | ||
} | ||
if (details) { | ||
data.details = details | ||
} | ||
api.addTimelineEvent({ | ||
layerId: stateLayerId, | ||
event: { | ||
title: client.state, | ||
time, | ||
@@ -153,2 +146,4 @@ data | ||
event: { | ||
title: 'Changed', | ||
subtitle: client.role, | ||
time: Date.now(), | ||
@@ -181,28 +176,21 @@ data: { | ||
if (action.type === 'logux/subscribe') { | ||
let data = { | ||
type: 'subscribing', | ||
channel: action.channel | ||
} | ||
if (Object.keys(action).length === 2) { | ||
data.action = action | ||
} | ||
api.addTimelineEvent({ | ||
layerId: subscriptionLayerId, | ||
event: { time, data } | ||
event: { | ||
title: 'Subscribing', | ||
subtitle: action.channel, | ||
groupId: meta.id, | ||
time, | ||
data: { action, meta } | ||
} | ||
}) | ||
} else if (action.type === 'logux/unsubscribe') { | ||
let data = { | ||
type: 'unsubscribed', | ||
channel: action.channel | ||
} | ||
if (Object.keys(action).length === 2) { | ||
data.action = action | ||
} | ||
api.addTimelineEvent({ | ||
layerId: subscriptionLayerId, | ||
event: { time, data } | ||
event: { | ||
title: 'Unsubscribed', | ||
subtitle: action.channel, | ||
time, | ||
data: { action, meta } | ||
} | ||
}) | ||
@@ -216,6 +204,7 @@ } else if (action.type === 'logux/processed') { | ||
event: { | ||
title: 'Subscribed', | ||
subtitle: processed.channel, | ||
groupId: action.id, | ||
time, | ||
data: { | ||
type: 'subscribed', | ||
channel: processed.channel, | ||
action: processed | ||
@@ -235,7 +224,6 @@ } | ||
event: { | ||
title: 'Subscribed by server', | ||
subtitle: action.channel, | ||
time, | ||
data: { | ||
type: 'subscribed by server', | ||
channel: action.channel | ||
} | ||
data: { action, meta } | ||
} | ||
@@ -266,7 +254,6 @@ }) | ||
event: { | ||
title: 'Processed', | ||
subtitle: processed.type, | ||
time, | ||
data: { | ||
type: 'processed', | ||
action: processed | ||
} | ||
data: { processed, action, meta } | ||
} | ||
@@ -280,7 +267,5 @@ }) | ||
event: { | ||
title: 'Processed', | ||
time, | ||
data: { | ||
type: 'processed', | ||
action | ||
} | ||
data: { action, meta } | ||
} | ||
@@ -291,9 +276,9 @@ }) | ||
let data = { | ||
type: 'undid', | ||
actionId: action.id, | ||
reason: action.reason | ||
reason: action.reason, | ||
action, | ||
meta | ||
} | ||
if (sent[action.id]) { | ||
data.details = { | ||
data.undone = { | ||
action: sent[action.id] | ||
@@ -304,21 +289,18 @@ } | ||
if (Object.keys(action).length > 3) { | ||
if (!data.details) data.details = {} | ||
data.details.undo = action | ||
} | ||
api.addTimelineEvent({ | ||
layerId: actionLayerId, | ||
event: { time, data } | ||
event: { | ||
title: 'Undid', | ||
subtitle: data.undone.type || '', | ||
time, | ||
data | ||
} | ||
}) | ||
} else { | ||
let data = { | ||
type: 'added', | ||
action, | ||
meta | ||
} | ||
let title = 'Added' | ||
let data = { action, meta } | ||
if (meta.reasons.length === 0) { | ||
cleaned[meta.id] = true | ||
data.type += ' and cleaned' | ||
title += ' and cleaned' | ||
} | ||
@@ -328,3 +310,3 @@ | ||
if (nodeId !== node.localNodeId) { | ||
data.from = nodeId | ||
data.by = nodeId | ||
} | ||
@@ -334,3 +316,8 @@ | ||
layerId: actionLayerId, | ||
event: { time, data } | ||
event: { | ||
title, | ||
subtitle: action.type, | ||
time, | ||
data | ||
} | ||
}) | ||
@@ -347,2 +334,3 @@ } | ||
event: { | ||
title: 'Changed', | ||
time: Date.now(), | ||
@@ -371,2 +359,4 @@ data: { | ||
event: { | ||
title: 'Cleaned', | ||
subtitle: action.type, | ||
time: Date.now(), | ||
@@ -373,0 +363,0 @@ data: { action, meta } |
{ | ||
"name": "@logux/vue-devtools", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Vue devtools plugin for debugging Logux applications", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@logux/client": "^0.10.0", | ||
"@logux/client": "^0.11.1", | ||
"@logux/core": "^0.7.0", | ||
@@ -33,4 +33,4 @@ "vue": ">=3.0.11" | ||
"dependencies": { | ||
"@vue/devtools-api": "^6.0.0-beta.8" | ||
"@vue/devtools-api": "^6.0.0-beta.12" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42314
406
+ Added@logux/client@0.11.1(transitive)
+ Added@logux/state@0.1.0(transitive)
- Removed@logux/client@0.10.0(transitive)