@dovetail-ts/inspector 0.0.0-stage → 1.0.1
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/CHANGELOG.md +30 -0
- package/LICENSE +21 -0
- package/README.md +65 -2
- package/addon-main.cjs +4 -0
- package/declarations/components/dovetail-inspector.d.ts +34 -0
- package/declarations/components/dovetail-inspector.d.ts.map +1 -0
- package/declarations/index.d.ts +5 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/model.d.ts +77 -0
- package/declarations/model.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/index.js.map +1 -0
- package/package.json +90 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @dovetail-ts/inspector
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 21b3dbf: Publish through OIDC trusted publishing only, with the Ember Workbench release kit. Each version from this release on has npm provenance.
|
|
8
|
+
- Updated dependencies [21b3dbf]
|
|
9
|
+
- @dovetail-ts/core@1.0.1
|
|
10
|
+
- @dovetail-ts/integrations@1.0.1
|
|
11
|
+
|
|
12
|
+
## 1.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- 480744b: First release of Dovetail: real-time and offline sync for Ember.
|
|
17
|
+
|
|
18
|
+
- `@dovetail-ts/core`: the connection life cycle, live store subscriptions, the optimistic ledger with rebase and rollback, the offline write queue in IndexedDB with a leader tab and dead letters, `DocSession` and `PresenceRoom`.
|
|
19
|
+
- `@dovetail-ts/warp-drive`: the store feed into WarpDrive.
|
|
20
|
+
- `@dovetail-ts/crdt`, `crdt-yjs`, `crdt-loro` and `crdt-automerge`: one `DocEngine` interface with three engines.
|
|
21
|
+
- `@dovetail-ts/tiptap`: co-editing in Tiptap 3 with carets, per-user undo, versions and comment threads.
|
|
22
|
+
- `@dovetail-ts/ember`, `notifications` and `inspector`: presence and status components, the inbox, toasts and activity feeds, and a dev panel.
|
|
23
|
+
- `@dovetail-ts/server`, the transports (`transport-ws`, `transport-sse`, `transport-cable`) and `conformance`: a Node server and one wire protocol that the Rails gems also pass.
|
|
24
|
+
- Adapters for Hocuspocus, Liveblocks, PartyKit and Supabase, and integrations for Switchyard, Millwork, Benchdog and Lattice. The Neon adapter is not in 1.0: it waits for a stable Neon Realtime client (1.1).
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [480744b]
|
|
29
|
+
- @dovetail-ts/core@1.0.0
|
|
30
|
+
- @dovetail-ts/integrations@1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Gaudet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dovetail-ts/inspector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A development panel for Dovetail. It shows the connection state and its transitions, the rooms,
|
|
4
|
+
the write queue, the dead letters, the ledger errors, the presence peers and the sync state of
|
|
5
|
+
each document. It uses Joinery components.
|
|
6
|
+
|
|
7
|
+
Part of [Dovetail](https://joegaudet.com/dovetail/). Not released yet.
|
|
8
|
+
|
|
9
|
+
## Use the panel
|
|
10
|
+
|
|
11
|
+
Give the panel the `dovetail` service of `@dovetail-ts/ember`:
|
|
12
|
+
|
|
13
|
+
```gts
|
|
14
|
+
import Component from '@glimmer/component'
|
|
15
|
+
import { service } from '@ember/service'
|
|
16
|
+
import { DovetailInspector } from '@dovetail-ts/inspector'
|
|
17
|
+
import type { DovetailService } from '@dovetail-ts/ember'
|
|
18
|
+
|
|
19
|
+
export default class DevTools extends Component {
|
|
20
|
+
@service declare dovetail: DovetailService
|
|
21
|
+
presence = [this.dovetail.presence(this, 'board:1')]
|
|
22
|
+
|
|
23
|
+
<template><DovetailInspector @dovetail={{this.dovetail}} @presence={{this.presence}} /></template>
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Argument | What it does |
|
|
28
|
+
| ------------- | -------------------------------------------------------------------------------------- |
|
|
29
|
+
| `@dovetail` | The `dovetail` service. The panel reads its `connection` and its `sync` client. |
|
|
30
|
+
| `@connection` | A `Connection`, in place of the one of the service. |
|
|
31
|
+
| `@sync` | A `SyncClient`, in place of the one of the service. |
|
|
32
|
+
| `@presence` | The presence rooms to show: each item has `room` and `presence` (a `LivePresence`). |
|
|
33
|
+
| `@docs` | The doc sessions to show (`DocSession`, or `liveDoc.session`). |
|
|
34
|
+
| `@snapshot` | Plain data (an `InspectorSnapshot`) in place of the live objects, for a story or docs. |
|
|
35
|
+
|
|
36
|
+
The panel reads its arguments one time, when it renders. It stops following the core objects when
|
|
37
|
+
it is destroyed. The history starts when the panel renders, and it keeps the last 100
|
|
38
|
+
transitions.
|
|
39
|
+
|
|
40
|
+
The connection does not list its presence rooms and its doc sessions, so give them as arguments.
|
|
41
|
+
The panel shows each room with its last feed cursor and its number of holders
|
|
42
|
+
(`Connection.holders`): `note:1 @ c3 (2 holders)`.
|
|
43
|
+
|
|
44
|
+
## The model
|
|
45
|
+
|
|
46
|
+
`InspectorModel` is the live data of the panel, without the template. It takes the same sources
|
|
47
|
+
(`dovetail`, `connection`, `sync`, `presence`, `docs`, and `limit` and `now` for the history) and
|
|
48
|
+
copies their state into tracked fields: `connection`, `history`, `rooms`, `sync`, `presence` and
|
|
49
|
+
`docs`. Call `destroy()` to stop it.
|
|
50
|
+
|
|
51
|
+
## The statechart
|
|
52
|
+
|
|
53
|
+
The connection is a Switchyard statechart. To see the live chart, use `<SwitchyardDebug>` of
|
|
54
|
+
`@switchyard-ts/ember/debug` with `@machine={{connection.machine}}`. The README of
|
|
55
|
+
`@dovetail-ts/integrations` has the other Switchyard tools.
|
|
56
|
+
|
|
57
|
+
## Tests
|
|
58
|
+
|
|
59
|
+
`InspectorHarness` of `@dovetail-ts/test-support` reads the panel: `state()`, `history()`,
|
|
60
|
+
`rooms()`, `holders()`, `queued()`, `deadLetters()`, `errors()`, `peers()` and `docs()`.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const inspector = new InspectorHarness(ember())
|
|
64
|
+
await inspector.state.should.equal('offline')
|
|
65
|
+
await inspector.queued.should.equal(1)
|
|
66
|
+
```
|
package/addon-main.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type Owner from '@ember/owner';
|
|
3
|
+
import type { Connection } from '@dovetail-ts/core';
|
|
4
|
+
import { InspectorModel } from '../model.ts';
|
|
5
|
+
import type { DocLike, InspectorSnapshot, InspectorSources, PresenceLike, SyncLike } from '../model.ts';
|
|
6
|
+
export interface DovetailInspectorSignature {
|
|
7
|
+
Args: {
|
|
8
|
+
/** The `dovetail` service of `@dovetail-ts/ember`. */
|
|
9
|
+
dovetail?: InspectorSources['dovetail'];
|
|
10
|
+
/** A connection, in place of the one of the service. */
|
|
11
|
+
connection?: Connection | undefined;
|
|
12
|
+
/** A sync client, in place of the one of the service. */
|
|
13
|
+
sync?: SyncLike | undefined;
|
|
14
|
+
/** The presence rooms to show, for example `dovetail.presence(owner, room)`. */
|
|
15
|
+
presence?: readonly PresenceLike[];
|
|
16
|
+
/** The doc sessions to show. */
|
|
17
|
+
docs?: readonly DocLike[];
|
|
18
|
+
/** Plain data in place of the live objects, for example in a story. */
|
|
19
|
+
snapshot?: InspectorSnapshot;
|
|
20
|
+
};
|
|
21
|
+
Element: HTMLElement;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A development panel for Dovetail: the connection state and its transitions, the rooms, the
|
|
25
|
+
* write queue, the dead letters, the ledger errors, the presence peers and the sync state of
|
|
26
|
+
* each document. The arguments are read once, when the panel renders.
|
|
27
|
+
*/
|
|
28
|
+
export default class DovetailInspector extends Component<DovetailInspectorSignature> {
|
|
29
|
+
readonly model: InspectorModel | undefined;
|
|
30
|
+
constructor(owner: Owner, args: DovetailInspectorSignature['Args']);
|
|
31
|
+
get view(): InspectorSnapshot;
|
|
32
|
+
get state(): string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=dovetail-inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dovetail-inspector.d.ts","sourceRoot":"","sources":["../../src/components/dovetail-inspector.gts"],"names":[],"mappings":"AA6KA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,mBAAmB,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACT,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE;QACJ,sDAAsD;QACtD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;QACvC,wDAAwD;QACxD,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;QACnC,yDAAyD;QACzD,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;QAC3B,gFAAgF;QAChF,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;QAClC,gCAAgC;QAChC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;QACzB,uEAAuE;QACvE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;KAC7B,CAAA;IACD,OAAO,EAAE,WAAW,CAAA;CACrB;AAyBD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS,CAAC,0BAA0B,CAAC;IAClF,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAAA;gBAE9B,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC;IAQlE,IAAI,IAAI,IAAI,iBAAiB,CAE5B;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;CA2WF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as DovetailInspector } from './components/dovetail-inspector';
|
|
2
|
+
export type { DovetailInspectorSignature } from './components/dovetail-inspector';
|
|
3
|
+
export { InspectorModel } from './model.ts';
|
|
4
|
+
export type { DocLike, InspectorDoc, InspectorPresence, InspectorRoom, InspectorSnapshot, InspectorSources, PresenceLike, SyncLike, } from './model.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAClF,YAAY,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,YAAY,EACV,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,QAAQ,GACT,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Connection, PresencePeer, PresenceState, SyncState } from '@dovetail-ts/core';
|
|
2
|
+
import type { ConnectionSnapshot, ConnectionTransition } from '@dovetail-ts/integrations/switchyard';
|
|
3
|
+
/** A room of the connection, with its last feed cursor and its number of holders. */
|
|
4
|
+
export interface InspectorRoom {
|
|
5
|
+
room: string;
|
|
6
|
+
cursor: string | undefined;
|
|
7
|
+
holders: number;
|
|
8
|
+
}
|
|
9
|
+
/** The peers of one presence room. */
|
|
10
|
+
export interface InspectorPresence {
|
|
11
|
+
room: string;
|
|
12
|
+
peers: readonly PresencePeer[];
|
|
13
|
+
}
|
|
14
|
+
/** The sync state of one document. */
|
|
15
|
+
export interface InspectorDoc {
|
|
16
|
+
room: string;
|
|
17
|
+
doc: string;
|
|
18
|
+
synced: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** What the panel shows. */
|
|
21
|
+
export interface InspectorSnapshot {
|
|
22
|
+
readonly connection: ConnectionSnapshot | undefined;
|
|
23
|
+
readonly history: readonly ConnectionTransition[];
|
|
24
|
+
readonly rooms: readonly InspectorRoom[];
|
|
25
|
+
readonly sync: SyncState | undefined;
|
|
26
|
+
readonly presence: readonly InspectorPresence[];
|
|
27
|
+
readonly docs: readonly InspectorDoc[];
|
|
28
|
+
}
|
|
29
|
+
/** The part of a `SyncClient` that the inspector reads. */
|
|
30
|
+
export interface SyncLike {
|
|
31
|
+
readonly state: SyncState;
|
|
32
|
+
onChange(listener: (state: SyncState) => void): () => void;
|
|
33
|
+
}
|
|
34
|
+
/** A presence room and its room name. A `LivePresence` of `@dovetail-ts/ember` fits. */
|
|
35
|
+
export interface PresenceLike {
|
|
36
|
+
readonly room: string;
|
|
37
|
+
readonly presence: {
|
|
38
|
+
readonly state: PresenceState;
|
|
39
|
+
subscribe(listener: (state: PresenceState) => void): () => void;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** The part of a `DocSession` that the inspector reads. */
|
|
43
|
+
export interface DocLike {
|
|
44
|
+
readonly room: string;
|
|
45
|
+
readonly doc: string;
|
|
46
|
+
readonly synced: boolean;
|
|
47
|
+
onSyncChange(listener: (synced: boolean) => void): () => void;
|
|
48
|
+
}
|
|
49
|
+
export interface InspectorSources {
|
|
50
|
+
/** The `dovetail` service of `@dovetail-ts/ember`: its connection and its sync client. */
|
|
51
|
+
dovetail?: {
|
|
52
|
+
readonly connection?: Connection | undefined;
|
|
53
|
+
readonly sync?: SyncLike | undefined;
|
|
54
|
+
};
|
|
55
|
+
connection?: Connection | undefined;
|
|
56
|
+
sync?: SyncLike | undefined;
|
|
57
|
+
presence?: readonly PresenceLike[] | undefined;
|
|
58
|
+
docs?: readonly DocLike[] | undefined;
|
|
59
|
+
/** The number of transitions to keep. Default 100. */
|
|
60
|
+
limit?: number;
|
|
61
|
+
/** The clock of the history. Default `Date.now`. */
|
|
62
|
+
now?: () => number;
|
|
63
|
+
}
|
|
64
|
+
/** Follows the core objects of `sources` until `destroy()`. */
|
|
65
|
+
export declare class InspectorModel implements InspectorSnapshot {
|
|
66
|
+
#private;
|
|
67
|
+
connection: ConnectionSnapshot | undefined;
|
|
68
|
+
history: readonly ConnectionTransition[];
|
|
69
|
+
rooms: readonly InspectorRoom[];
|
|
70
|
+
sync: SyncState | undefined;
|
|
71
|
+
presence: readonly InspectorPresence[];
|
|
72
|
+
docs: readonly InspectorDoc[];
|
|
73
|
+
constructor(sources: InspectorSources);
|
|
74
|
+
/** Stops following the core objects. The last state stays. */
|
|
75
|
+
destroy(): void;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAEpG,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;CAC/B;AAED,sCAAsC;AACtC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,4BAA4B;AAC5B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACnD,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACjD,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IACxC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC/C,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAA;CACvC;AAED,2DAA2D;A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;CACnB;AAED,+DAA+D;AAC/D,qBAAa,cAAe,YAAW,iBAAiB;;IAC7C,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAA;IAC1C,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAK;IAC7C,KAAK,EAAE,SAAS,aAAa,EAAE,CAAK;IACpC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAK;IAC3C,IAAI,EAAE,SAAS,YAAY,EAAE,CAAK;gBAG/B,OAAO,EAAE,gBAAgB;IAqDrC,8DAA8D;IAC9D,OAAO,IAAI,IAAI;CAGhB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { registerDestructor } from '@ember/destroyable';
|
|
3
|
+
import { Badge, Card } from '@ember-joinery/ember';
|
|
4
|
+
import { tracked } from '@glimmer/tracking';
|
|
5
|
+
import { transitionLog, readConnection } from '@dovetail-ts/integrations/switchyard';
|
|
6
|
+
import { g, i } from 'decorator-transforms/runtime';
|
|
7
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
8
|
+
import { setComponentTemplate } from '@ember/component';
|
|
9
|
+
|
|
10
|
+
// The live data of the inspector panel. It follows the core objects and copies their state into
|
|
11
|
+
// tracked fields. The panel takes this model or a plain `InspectorSnapshot` (for stories).
|
|
12
|
+
/** Follows the core objects of `sources` until `destroy()`. */
|
|
13
|
+
class InspectorModel {
|
|
14
|
+
static {
|
|
15
|
+
g(this.prototype, "connection", [tracked]);
|
|
16
|
+
}
|
|
17
|
+
#connection = (i(this, "connection"), void 0);
|
|
18
|
+
static {
|
|
19
|
+
g(this.prototype, "history", [tracked], function () {
|
|
20
|
+
return [];
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
#history = (i(this, "history"), void 0);
|
|
24
|
+
static {
|
|
25
|
+
g(this.prototype, "rooms", [tracked], function () {
|
|
26
|
+
return [];
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
#rooms = (i(this, "rooms"), void 0);
|
|
30
|
+
static {
|
|
31
|
+
g(this.prototype, "sync", [tracked]);
|
|
32
|
+
}
|
|
33
|
+
#sync = (i(this, "sync"), void 0);
|
|
34
|
+
static {
|
|
35
|
+
g(this.prototype, "presence", [tracked], function () {
|
|
36
|
+
return [];
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
#presence = (i(this, "presence"), void 0);
|
|
40
|
+
static {
|
|
41
|
+
g(this.prototype, "docs", [tracked], function () {
|
|
42
|
+
return [];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
#docs = (i(this, "docs"), void 0);
|
|
46
|
+
#stops = [];
|
|
47
|
+
constructor(sources) {
|
|
48
|
+
const connection = sources.connection ?? sources.dovetail?.connection;
|
|
49
|
+
const sync = sources.sync ?? sources.dovetail?.sync;
|
|
50
|
+
if (connection) this.#follow(connection, sources);
|
|
51
|
+
if (sync) {
|
|
52
|
+
this.sync = sync.state;
|
|
53
|
+
this.#stops.push(sync.onChange(state => this.sync = state));
|
|
54
|
+
}
|
|
55
|
+
const presence = sources.presence ?? [];
|
|
56
|
+
const readPresence = () => this.presence = presence.map(({
|
|
57
|
+
room,
|
|
58
|
+
presence: p
|
|
59
|
+
}) => ({
|
|
60
|
+
room,
|
|
61
|
+
peers: p.state.peers
|
|
62
|
+
}));
|
|
63
|
+
readPresence();
|
|
64
|
+
for (const {
|
|
65
|
+
presence: p
|
|
66
|
+
} of presence) this.#stops.push(p.subscribe(readPresence));
|
|
67
|
+
const docs = sources.docs ?? [];
|
|
68
|
+
const readDocs = () => this.docs = docs.map(({
|
|
69
|
+
room,
|
|
70
|
+
doc,
|
|
71
|
+
synced
|
|
72
|
+
}) => ({
|
|
73
|
+
room,
|
|
74
|
+
doc,
|
|
75
|
+
synced
|
|
76
|
+
}));
|
|
77
|
+
readDocs();
|
|
78
|
+
for (const doc of docs) this.#stops.push(doc.onSyncChange(readDocs));
|
|
79
|
+
}
|
|
80
|
+
#follow(connection, sources) {
|
|
81
|
+
// The cursor of a join comes after the `ack` listeners, so the model reads again on the join.
|
|
82
|
+
const followed = new Set();
|
|
83
|
+
const read = () => {
|
|
84
|
+
for (const room of connection.rooms) {
|
|
85
|
+
if (followed.has(room)) continue;
|
|
86
|
+
followed.add(room);
|
|
87
|
+
this.#stops.push(connection.onJoin(room, read));
|
|
88
|
+
}
|
|
89
|
+
this.connection = readConnection(connection);
|
|
90
|
+
this.rooms = connection.rooms.map(room => ({
|
|
91
|
+
room,
|
|
92
|
+
cursor: connection.cursor(room),
|
|
93
|
+
holders: connection.holders(room)
|
|
94
|
+
}));
|
|
95
|
+
};
|
|
96
|
+
read();
|
|
97
|
+
const log = transitionLog(connection, {
|
|
98
|
+
...(sources.limit ? {
|
|
99
|
+
limit: sources.limit
|
|
100
|
+
} : {}),
|
|
101
|
+
...(sources.now ? {
|
|
102
|
+
now: sources.now
|
|
103
|
+
} : {})
|
|
104
|
+
});
|
|
105
|
+
this.#stops.push(log.subscribe(() => this.history = log.entries), log.stop, connection.onStateChange(read),
|
|
106
|
+
// The rooms change with a join or a leave (an ack), and the cursors with a feed.
|
|
107
|
+
connection.onMessage('ack', read), connection.onMessage('feed', read),
|
|
108
|
+
// A component can take a hold in a render that already read the model, so read later.
|
|
109
|
+
connection.onHoldersChange(() => queueMicrotask(read)));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Stops following the core objects. The last state stays. */
|
|
113
|
+
destroy() {
|
|
114
|
+
for (const stop of this.#stops.splice(0)) stop();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** `upsert note 1`, `delete note 1` or `upsert 3 records`. */function describeOp(op) {
|
|
119
|
+
if (op.op === 'delete') return `delete ${op.ref.type} ${op.ref.id}`;
|
|
120
|
+
const data = op.document.data;
|
|
121
|
+
if (Array.isArray(data)) return `upsert ${data.length} records`;
|
|
122
|
+
return data ? `upsert ${data.type} ${data.id}` : 'upsert';
|
|
123
|
+
}
|
|
124
|
+
/** A refused write: `upsert note 1 (422): The title is empty`. */
|
|
125
|
+
function describeRefusal(refusal) {
|
|
126
|
+
const first = refusal.errors[0];
|
|
127
|
+
return `${describeOp(refusal.op)} (${refusal.status}): ${first?.detail ?? first?.title ?? 'refused'}`;
|
|
128
|
+
}
|
|
129
|
+
/** `note:1 @ 3 (2 holders)`, or `note:1 (1 holder)` with no cursor. */
|
|
130
|
+
const roomText = (room, cursor, holders) => `${cursor === undefined ? room : `${room} @ ${cursor}`} (${holders} ${holders === 1 ? 'holder' : 'holders'})`;
|
|
131
|
+
const peerText = (room, peer) => `${room}: ${peer.user.name} (${peer.status})`;
|
|
132
|
+
const docText = (room, doc, synced) => `${room} ${doc}: ${synced ? 'synced' : 'syncing'}`;
|
|
133
|
+
/**
|
|
134
|
+
* A development panel for Dovetail: the connection state and its transitions, the rooms, the
|
|
135
|
+
* write queue, the dead letters, the ledger errors, the presence peers and the sync state of
|
|
136
|
+
* each document. The arguments are read once, when the panel renders.
|
|
137
|
+
*/
|
|
138
|
+
class DovetailInspector extends Component {
|
|
139
|
+
model;
|
|
140
|
+
constructor(owner, args) {
|
|
141
|
+
super(owner, args);
|
|
142
|
+
if (args.snapshot) return;
|
|
143
|
+
const model = new InspectorModel(args);
|
|
144
|
+
this.model = model;
|
|
145
|
+
registerDestructor(this, () => model.destroy());
|
|
146
|
+
}
|
|
147
|
+
get view() {
|
|
148
|
+
return this.args.snapshot ?? this.model;
|
|
149
|
+
}
|
|
150
|
+
get state() {
|
|
151
|
+
return this.view.connection?.state ?? 'none';
|
|
152
|
+
}
|
|
153
|
+
static {
|
|
154
|
+
setComponentTemplate(precompileTemplate("<section aria-label=\"Dovetail inspector\" data-test-dovetail-inspector data-state={{this.state}} data-queued={{if this.view.sync this.view.sync.queued 0}} style=\"display: grid; gap: 0.75rem\" ...attributes>\n <Card @size=\"sm\" as |c|>\n <c.Header>\n <c.Title>Connection</c.Title>\n <c.Action><Badge @variant=\"outline\">{{this.state}}</Badge></c.Action>\n </c.Header>\n <c.Content>\n {{#if this.view.connection}}\n <p>Attempt\n {{this.view.connection.attempt}}{{#if this.view.connection.session}}, session\n {{this.view.connection.session}}{{/if}}</p>\n {{/if}}\n <h3>Transitions</h3>\n <ol>\n {{#each this.view.history as |t|}}\n <li data-test-dovetail-inspector-transition>{{t.event}}: {{t.from}} \u2192 {{t.to}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ol>\n <h3>Rooms</h3>\n <ul>\n {{#each this.view.rooms as |r|}}\n <li data-test-dovetail-inspector-room data-holders={{r.holders}}>{{roomText r.room r.cursor r.holders}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n <Card @size=\"sm\" as |c|>\n <c.Header>\n <c.Title>Queue</c.Title>\n <c.Action><Badge @variant=\"secondary\">{{if this.view.sync this.view.sync.queued 0}}\n queued</Badge></c.Action>\n </c.Header>\n <c.Content>\n <h3>Dead letters</h3>\n <ul>\n {{#each this.view.sync.deadLetters as |letter|}}\n <li data-test-dovetail-inspector-dead-letter>{{describeRefusal letter}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n <h3>Ledger errors</h3>\n <ul>\n {{#each this.view.sync.errors as |error|}}\n <li data-test-dovetail-inspector-error>{{describeRefusal error}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n <Card @size=\"sm\" as |c|>\n <c.Header><c.Title>Presence</c.Title></c.Header>\n <c.Content>\n <ul>\n {{#each this.view.presence as |p|}}\n {{#each p.peers as |peer|}}\n <li data-test-dovetail-inspector-peer>{{peerText p.room peer}}</li>\n {{/each}}\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n <Card @size=\"sm\" as |c|>\n <c.Header><c.Title>Documents</c.Title></c.Header>\n <c.Content>\n <ul>\n {{#each this.view.docs as |d|}}\n <li data-test-dovetail-inspector-doc>{{docText d.room d.doc d.synced}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n</section>", {
|
|
155
|
+
strictMode: true,
|
|
156
|
+
scope: () => ({
|
|
157
|
+
Card,
|
|
158
|
+
Badge,
|
|
159
|
+
roomText,
|
|
160
|
+
describeRefusal,
|
|
161
|
+
peerText,
|
|
162
|
+
docText
|
|
163
|
+
})
|
|
164
|
+
}), this);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export { DovetailInspector, InspectorModel };
|
|
169
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/model.ts","../src/components/dovetail-inspector.gts"],"sourcesContent":["// The live data of the inspector panel. It follows the core objects and copies their state into\n// tracked fields. The panel takes this model or a plain `InspectorSnapshot` (for stories).\nimport { tracked } from '@glimmer/tracking'\nimport type { Connection, PresencePeer, PresenceState, SyncState } from '@dovetail-ts/core'\nimport { readConnection, transitionLog } from '@dovetail-ts/integrations/switchyard'\nimport type { ConnectionSnapshot, ConnectionTransition } from '@dovetail-ts/integrations/switchyard'\n\n/** A room of the connection, with its last feed cursor and its number of holders. */\nexport interface InspectorRoom {\n room: string\n cursor: string | undefined\n holders: number\n}\n\n/** The peers of one presence room. */\nexport interface InspectorPresence {\n room: string\n peers: readonly PresencePeer[]\n}\n\n/** The sync state of one document. */\nexport interface InspectorDoc {\n room: string\n doc: string\n synced: boolean\n}\n\n/** What the panel shows. */\nexport interface InspectorSnapshot {\n readonly connection: ConnectionSnapshot | undefined\n readonly history: readonly ConnectionTransition[]\n readonly rooms: readonly InspectorRoom[]\n readonly sync: SyncState | undefined\n readonly presence: readonly InspectorPresence[]\n readonly docs: readonly InspectorDoc[]\n}\n\n/** The part of a `SyncClient` that the inspector reads. */\nexport interface SyncLike {\n readonly state: SyncState\n onChange(listener: (state: SyncState) => void): () => void\n}\n\n/** A presence room and its room name. A `LivePresence` of `@dovetail-ts/ember` fits. */\nexport interface PresenceLike {\n readonly room: string\n readonly presence: {\n readonly state: PresenceState\n subscribe(listener: (state: PresenceState) => void): () => void\n }\n}\n\n/** The part of a `DocSession` that the inspector reads. */\nexport interface DocLike {\n readonly room: string\n readonly doc: string\n readonly synced: boolean\n onSyncChange(listener: (synced: boolean) => void): () => void\n}\n\nexport interface InspectorSources {\n /** The `dovetail` service of `@dovetail-ts/ember`: its connection and its sync client. */\n dovetail?: { readonly connection?: Connection | undefined; readonly sync?: SyncLike | undefined }\n connection?: Connection | undefined\n sync?: SyncLike | undefined\n presence?: readonly PresenceLike[] | undefined\n docs?: readonly DocLike[] | undefined\n /** The number of transitions to keep. Default 100. */\n limit?: number\n /** The clock of the history. Default `Date.now`. */\n now?: () => number\n}\n\n/** Follows the core objects of `sources` until `destroy()`. */\nexport class InspectorModel implements InspectorSnapshot {\n @tracked connection: ConnectionSnapshot | undefined\n @tracked history: readonly ConnectionTransition[] = []\n @tracked rooms: readonly InspectorRoom[] = []\n @tracked sync: SyncState | undefined\n @tracked presence: readonly InspectorPresence[] = []\n @tracked docs: readonly InspectorDoc[] = []\n readonly #stops: (() => void)[] = []\n\n constructor(sources: InspectorSources) {\n const connection = sources.connection ?? sources.dovetail?.connection\n const sync = sources.sync ?? sources.dovetail?.sync\n if (connection) this.#follow(connection, sources)\n if (sync) {\n this.sync = sync.state\n this.#stops.push(sync.onChange(state => (this.sync = state)))\n }\n const presence = sources.presence ?? []\n const readPresence = () =>\n (this.presence = presence.map(({ room, presence: p }) => ({ room, peers: p.state.peers })))\n readPresence()\n for (const { presence: p } of presence) this.#stops.push(p.subscribe(readPresence))\n const docs = sources.docs ?? []\n const readDocs = () =>\n (this.docs = docs.map(({ room, doc, synced }) => ({ room, doc, synced })))\n readDocs()\n for (const doc of docs) this.#stops.push(doc.onSyncChange(readDocs))\n }\n\n #follow(connection: Connection, sources: InspectorSources): void {\n // The cursor of a join comes after the `ack` listeners, so the model reads again on the join.\n const followed = new Set<string>()\n const read = () => {\n for (const room of connection.rooms) {\n if (followed.has(room)) continue\n followed.add(room)\n this.#stops.push(connection.onJoin(room, read))\n }\n this.connection = readConnection(connection)\n this.rooms = connection.rooms.map(room => ({\n room,\n cursor: connection.cursor(room),\n holders: connection.holders(room),\n }))\n }\n read()\n const log = transitionLog(connection, {\n ...(sources.limit ? { limit: sources.limit } : {}),\n ...(sources.now ? { now: sources.now } : {}),\n })\n this.#stops.push(\n log.subscribe(() => (this.history = log.entries)),\n log.stop,\n connection.onStateChange(read),\n // The rooms change with a join or a leave (an ack), and the cursors with a feed.\n connection.onMessage('ack', read),\n connection.onMessage('feed', read),\n // A component can take a hold in a render that already read the model, so read later.\n connection.onHoldersChange(() => queueMicrotask(read)),\n )\n }\n\n /** Stops following the core objects. The last state stays. */\n destroy(): void {\n for (const stop of this.#stops.splice(0)) stop()\n }\n}\n","import Component from '@glimmer/component'\nimport type Owner from '@ember/owner'\nimport { registerDestructor } from '@ember/destroyable'\nimport { Badge, Card } from '@ember-joinery/ember'\nimport type { Connection, LedgerError, PresencePeer } from '@dovetail-ts/core'\nimport { InspectorModel } from '../model.ts'\nimport type {\n DocLike,\n InspectorSnapshot,\n InspectorSources,\n PresenceLike,\n SyncLike,\n} from '../model.ts'\n\nexport interface DovetailInspectorSignature {\n Args: {\n /** The `dovetail` service of `@dovetail-ts/ember`. */\n dovetail?: InspectorSources['dovetail']\n /** A connection, in place of the one of the service. */\n connection?: Connection | undefined\n /** A sync client, in place of the one of the service. */\n sync?: SyncLike | undefined\n /** The presence rooms to show, for example `dovetail.presence(owner, room)`. */\n presence?: readonly PresenceLike[]\n /** The doc sessions to show. */\n docs?: readonly DocLike[]\n /** Plain data in place of the live objects, for example in a story. */\n snapshot?: InspectorSnapshot\n }\n Element: HTMLElement\n}\n\n/** `upsert note 1`, `delete note 1` or `upsert 3 records`. */\nfunction describeOp(op: LedgerError['op']): string {\n if (op.op === 'delete') return `delete ${op.ref.type} ${op.ref.id}`\n const data = op.document.data\n if (Array.isArray(data)) return `upsert ${data.length} records`\n return data ? `upsert ${data.type} ${data.id}` : 'upsert'\n}\n\n/** A refused write: `upsert note 1 (422): The title is empty`. */\nfunction describeRefusal(refusal: Pick<LedgerError, 'op' | 'status' | 'errors'>): string {\n const first = refusal.errors[0]\n return `${describeOp(refusal.op)} (${refusal.status}): ${first?.detail ?? first?.title ?? 'refused'}`\n}\n\n/** `note:1 @ 3 (2 holders)`, or `note:1 (1 holder)` with no cursor. */\nconst roomText = (room: string, cursor: string | undefined, holders: number) =>\n `${cursor === undefined ? room : `${room} @ ${cursor}`} (${holders} ${holders === 1 ? 'holder' : 'holders'})`\n\nconst peerText = (room: string, peer: PresencePeer) => `${room}: ${peer.user.name} (${peer.status})`\n\nconst docText = (room: string, doc: string, synced: boolean) =>\n `${room} ${doc}: ${synced ? 'synced' : 'syncing'}`\n\n/**\n * A development panel for Dovetail: the connection state and its transitions, the rooms, the\n * write queue, the dead letters, the ledger errors, the presence peers and the sync state of\n * each document. The arguments are read once, when the panel renders.\n */\nexport default class DovetailInspector extends Component<DovetailInspectorSignature> {\n readonly model: InspectorModel | undefined\n\n constructor(owner: Owner, args: DovetailInspectorSignature['Args']) {\n super(owner, args)\n if (args.snapshot) return\n const model = new InspectorModel(args)\n this.model = model\n registerDestructor(this, () => model.destroy())\n }\n\n get view(): InspectorSnapshot {\n return this.args.snapshot ?? this.model!\n }\n\n get state(): string {\n return this.view.connection?.state ?? 'none'\n }\n\n <template>\n <section\n aria-label='Dovetail inspector'\n data-test-dovetail-inspector\n data-state={{this.state}}\n data-queued={{if this.view.sync this.view.sync.queued 0}}\n style='display: grid; gap: 0.75rem'\n ...attributes\n >\n <Card @size='sm' as |c|>\n <c.Header>\n <c.Title>Connection</c.Title>\n <c.Action><Badge @variant='outline'>{{this.state}}</Badge></c.Action>\n </c.Header>\n <c.Content>\n {{#if this.view.connection}}\n <p>Attempt\n {{this.view.connection.attempt}}{{#if this.view.connection.session}}, session\n {{this.view.connection.session}}{{/if}}</p>\n {{/if}}\n <h3>Transitions</h3>\n <ol>\n {{#each this.view.history as |t|}}\n <li data-test-dovetail-inspector-transition>{{t.event}}: {{t.from}} → {{t.to}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ol>\n <h3>Rooms</h3>\n <ul>\n {{#each this.view.rooms as |r|}}\n <li data-test-dovetail-inspector-room data-holders={{r.holders}}>{{roomText\n r.room\n r.cursor\n r.holders\n }}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n <Card @size='sm' as |c|>\n <c.Header>\n <c.Title>Queue</c.Title>\n <c.Action><Badge @variant='secondary'>{{if this.view.sync this.view.sync.queued 0}}\n queued</Badge></c.Action>\n </c.Header>\n <c.Content>\n <h3>Dead letters</h3>\n <ul>\n {{#each this.view.sync.deadLetters as |letter|}}\n <li data-test-dovetail-inspector-dead-letter>{{describeRefusal letter}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n <h3>Ledger errors</h3>\n <ul>\n {{#each this.view.sync.errors as |error|}}\n <li data-test-dovetail-inspector-error>{{describeRefusal error}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n <Card @size='sm' as |c|>\n <c.Header><c.Title>Presence</c.Title></c.Header>\n <c.Content>\n <ul>\n {{#each this.view.presence as |p|}}\n {{#each p.peers as |peer|}}\n <li data-test-dovetail-inspector-peer>{{peerText p.room peer}}</li>\n {{/each}}\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n <Card @size='sm' as |c|>\n <c.Header><c.Title>Documents</c.Title></c.Header>\n <c.Content>\n <ul>\n {{#each this.view.docs as |d|}}\n <li data-test-dovetail-inspector-doc>{{docText d.room d.doc d.synced}}</li>\n {{else}}\n <li>None</li>\n {{/each}}\n </ul>\n </c.Content>\n </Card>\n </section>\n </template>\n}\n"],"names":["InspectorModel","g","prototype","tracked","i","constructor","sources","connection","dovetail","sync","state","push","onChange","presence","readPresence","map","room","p","peers","subscribe","docs","readDocs","doc","synced","onSyncChange","#follow","followed","Set","read","rooms","has","add","onJoin","readConnection","cursor","holders","log","transitionLog","limit","now","history","entries","stop","onStateChange","onMessage","onHoldersChange","queueMicrotask","destroy","splice","describeOp","op","ref","type","id","data","document","Array","isArray","length","describeRefusal","refusal","first","errors","status","detail","title","roomText","undefined","peerText","peer","user","name","docText","DovetailInspector","Component","model","owner","args","snapshot","registerDestructor","view","setComponentTemplate","precompileTemplate","strictMode","scope","Card","Badge"],"mappings":";;;;;;;;;AAAA;AACA;AAwEA;AACO,MAAMA,cAAc,CAA8B;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,YAAA,EAAA,CACtDC,OAAO,CAAA,CAAA;AAAA;EAAA,WAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,YAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CACPC,OAAO,CAAA,EAAA,YAAA;AAAA,MAAA,OAA4C,EAAE;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,QAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,OAAA,EAAA,CACrDC,OAAO,CAAA,EAAA,YAAA;AAAA,MAAA,OAAmC,EAAE;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,MAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,MAAA,EAAA,CAC5CC,OAAO,CAAA,CAAA;AAAA;EAAA,KAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,UAAA,EAAA,CACPC,OAAO,CAAA,EAAA,YAAA;AAAA,M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Ke,MAAMkD,iBAAA,SAA0BC,SAAA,CAAU;EAC9CC,KAAA;AAETtE,EAAAA,WAAAA,CAAYuE,KAAY,EAAEC,IAAwC,EAAE;AAClE,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;IACb,IAAIA,IAAA,CAAKC,QAAQ,EAAE;AACnB,IAAA,MAAMH,KAAA,GAAQ,IAAI3E,cAAA,CAAe6E,IAAA,CAAA;IACjC,IAAI,CAACF,KAAK,GAAGA,KAAA;IACbI,kBAAA,CAAmB,IAAI,EAAE,MAAMJ,KAAA,CAAM5B,OAAO,EAAA,CAAA;AAC9C,EAAA;EAEA,IAAIiC,OAA0B;IAC5B,OAAO,IAAI,CAACH,IAAI,CAACC,QAAQ,IAAI,IAAI,CAACH,KAAK;AACzC,EAAA;EAEA,IAAIjE,KAAAA,GAAgB;IAClB,OAAO,IAAI,CAACsE,IAAI,CAACzE,UAAU,EAAEG,KAAA,IAAS,MAAA;AACxC,EAAA;AAEA,EAAA;IAAAuE,oBAAA,CAAAC,kBAAA,CAAA,2nFAAA,EA4FA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,KAAA;QAAApB,QAAA;QAAAP,eAAA;QAAAS,QAAA;AAAAI,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,93 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-ts/inspector",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A Switchyard inspector panel for the Dovetail connection, queue and rooms.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Joe Gaudet <joe@joegaudet.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/joegaudet/dovetail.git",
|
|
10
|
+
"directory": "packages/inspector"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://joegaudet.com/dovetail/",
|
|
13
|
+
"bugs": "https://github.com/joegaudet/dovetail/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"ember-addon",
|
|
16
|
+
"ember",
|
|
17
|
+
"realtime",
|
|
18
|
+
"offline",
|
|
19
|
+
"sync"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./declarations/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./addon-main.js": "./addon-main.cjs"
|
|
27
|
+
},
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
"*": {
|
|
30
|
+
"*": [
|
|
31
|
+
"declarations/*"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"addon-main.cjs",
|
|
37
|
+
"declarations",
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md",
|
|
40
|
+
"CHANGELOG.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@dovetail-ts/core": "1.0.1",
|
|
45
|
+
"@dovetail-ts/integrations": "1.0.1",
|
|
46
|
+
"@ember-joinery/ember": "^1.0.1",
|
|
47
|
+
"@embroider/addon-shim": "^1.10.3",
|
|
48
|
+
"@switchyard-ts/core": "0.5.0",
|
|
49
|
+
"@switchyard-ts/ember": "0.5.0",
|
|
50
|
+
"@switchyard-ts/graph": "0.5.0",
|
|
51
|
+
"decorator-transforms": "^2.4.0",
|
|
52
|
+
"ember-resources": "^7.1.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@glimmer/component": ">= 2.0.0",
|
|
56
|
+
"ember-source": ">= 6.12.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@babel/core": "^7.29.7",
|
|
60
|
+
"@babel/plugin-transform-typescript": "^7.29.7",
|
|
61
|
+
"@babel/runtime": "^7.29.7",
|
|
62
|
+
"@ember/library-tsconfig": "^3.0.0",
|
|
63
|
+
"@embroider/addon-dev": "^8.4.2",
|
|
64
|
+
"@glimmer/component": "^2.2.1",
|
|
65
|
+
"@glimmer/tracking": "^1.1.2",
|
|
66
|
+
"@glint/ember-tsc": "^1.14.2",
|
|
67
|
+
"@glint/template": "^1.9.0",
|
|
68
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
69
|
+
"babel-plugin-ember-template-compilation": "^4.0.1",
|
|
70
|
+
"ember-source": "~7.3.0",
|
|
71
|
+
"rollup": "^4.64.6",
|
|
72
|
+
"typescript": "~6.0.3"
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"access": "public"
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=22.12.0"
|
|
79
|
+
},
|
|
80
|
+
"ember": {
|
|
81
|
+
"edition": "octane"
|
|
82
|
+
},
|
|
83
|
+
"ember-addon": {
|
|
84
|
+
"version": 2,
|
|
85
|
+
"type": "addon",
|
|
86
|
+
"main": "addon-main.cjs"
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build": "rm -rf declarations && rollup --config",
|
|
90
|
+
"start": "rm -rf declarations && rollup --config --watch",
|
|
91
|
+
"typecheck": "ember-tsc --noEmit && ember-tsc --noEmit -p tests/tsconfig.json"
|
|
92
|
+
}
|
|
6
93
|
}
|