dignity.js 0.8.2 → 0.8.3
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/README.md +5 -2
- package/docs/index.html +119 -6
- package/docs/openapi-like.json +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -519,11 +519,11 @@ npm run docs:dev
|
|
|
519
519
|
|
|
520
520
|
If 4173 is busy, `docs:dev` auto-picks the next free port (4174, 4175, …) and prints the URLs.
|
|
521
521
|
|
|
522
|
-
## Dignity Apps (v0.8.
|
|
522
|
+
## Dignity Apps (v0.8.3+)
|
|
523
523
|
|
|
524
524
|
Self-contained HTML apps in a sandboxed iframe, inspired by [Datasette Apps](https://datasette.io/blog/2026/datasette-apps/). Track: [#100](https://github.com/jose-compu/dignity.js/issues/100).
|
|
525
525
|
|
|
526
|
-
**Threat boundaries (v0.8.2):**
|
|
526
|
+
**Threat boundaries (v0.8.2+, documented in v0.8.3):**
|
|
527
527
|
|
|
528
528
|
- Apps run in an iframe with `sandbox` + immutable CSP — no parent DOM, cookies, or `localStorage`.
|
|
529
529
|
- Data access only via a parent **MessageChannel** bridge; no signing keys or mesh credentials in the iframe.
|
|
@@ -545,6 +545,9 @@ const { ok, manifest } = validateDignityAppManifest({
|
|
|
545
545
|
## Docs and Examples
|
|
546
546
|
|
|
547
547
|
- **Documentation:** [jose-compu.github.io/dignity.js](https://jose-compu.github.io/dignity.js/)
|
|
548
|
+
- **API reference:** [`docs/api-reference.md`](./docs/api-reference.md) (generated from `openapi-like.json`)
|
|
549
|
+
- **Browser compatibility:** [`docs/browser-compatibility.md`](./docs/browser-compatibility.md) (#91)
|
|
550
|
+
- **Benchmarks:** [`docs/benchmarks/results.json`](./docs/benchmarks/results.json) — `npm run benchmark` (#92)
|
|
548
551
|
- Docs site source: `docs/index.html` (local: `npm run docs:dev`)
|
|
549
552
|
- **3D Chess demo:** `docs/chess/` — PeerJS mesh, dual-signed resume links, IndexedDB → [local chess demo](http://127.0.0.1:4173/chess/) when `docs:dev` is running
|
|
550
553
|
- API metadata: `docs/openapi-like.json`
|
package/docs/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<meta name="description" content="dignity.js v0.8.
|
|
6
|
+
<meta name="description" content="dignity.js v0.8.3 — REST-like P2P object API for decentralized JavaScript applications." />
|
|
7
7
|
<title>dignity.js · Documentation</title>
|
|
8
8
|
<link rel="icon" href="./assets/favicon.svg" type="image/svg+xml" />
|
|
9
9
|
<link rel="icon" href="./favicon.ico" sizes="32x32" />
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<a class="site-header__brand" href="#overview">
|
|
17
17
|
<img src="./assets/dignity-logo.svg" alt="" width="344" height="80" />
|
|
18
18
|
<!-- <span>dignity.js</span> -->
|
|
19
|
-
<span class="site-header__version">v0.8.
|
|
19
|
+
<span class="site-header__version">v0.8.3</span>
|
|
20
20
|
</a>
|
|
21
21
|
<div class="site-header__links">
|
|
22
22
|
<a href="https://www.npmjs.com/package/dignity.js" target="_blank" rel="noopener noreferrer">npm</a>
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<a href="./playground/index.html">Playground</a>
|
|
25
25
|
<a href="./chess/index.html">3D Chess</a>
|
|
26
26
|
<a href="./openapi-like.json">API JSON</a>
|
|
27
|
+
<a href="./api-reference.md">API MD</a>
|
|
27
28
|
</div>
|
|
28
29
|
<button class="menu-toggle" type="button" aria-label="Toggle navigation">Menu</button>
|
|
29
30
|
</header>
|
|
@@ -62,6 +63,9 @@
|
|
|
62
63
|
<div class="sidebar__label">Reference</div>
|
|
63
64
|
<nav>
|
|
64
65
|
<a href="#api-reference">API reference</a>
|
|
66
|
+
<a href="./api-reference.md">Full API (Markdown)</a>
|
|
67
|
+
<a href="#browser-compat">Browser compatibility</a>
|
|
68
|
+
<a href="#benchmarks">Benchmarks</a>
|
|
65
69
|
<a href="#events">Events</a>
|
|
66
70
|
<a href="#exports">Package exports</a>
|
|
67
71
|
<a href="#examples">Examples</a>
|
|
@@ -101,6 +105,10 @@
|
|
|
101
105
|
<h3>CQRS PeerGroups (v0.8+)</h3>
|
|
102
106
|
<p>Live + bulk tiers, signed domain events, and <code>DignityQueryReplica</code> read views for massive audiences.</p>
|
|
103
107
|
</article>
|
|
108
|
+
<article class="card">
|
|
109
|
+
<h3>Reference & benchmarks (v0.8.3)</h3>
|
|
110
|
+
<p><a href="./api-reference.md">API reference</a>, <a href="./browser-compatibility.md">browser matrix</a>, and <a href="./benchmarks/results.json">performance numbers</a>.</p>
|
|
111
|
+
</article>
|
|
104
112
|
</div>
|
|
105
113
|
</section>
|
|
106
114
|
|
|
@@ -644,7 +652,8 @@ replica.verifyChain(); // hash-chain consistency</code></pre>
|
|
|
644
652
|
</div>
|
|
645
653
|
|
|
646
654
|
<h3>Roadmap</h3>
|
|
647
|
-
<p><strong>v0.8.
|
|
655
|
+
<p><strong>v0.8.3 (current)</strong> — API reference (#93), browser compatibility matrix (#91), performance benchmarks (#92).</p>
|
|
656
|
+
<p><strong>v0.8.2</strong> — Dignity App manifest validation, sandboxed-apps threat model (#101, #108).</p>
|
|
648
657
|
<p><strong>v0.8.1</strong> — openapi-like.json sync with DignityP2P API.</p>
|
|
649
658
|
<p><strong>v0.8.0</strong> — CQRS tiered PeerGroups, domain events, DignityQueryReplica, hash chains, bulk relay, maxHops 64.</p>
|
|
650
659
|
<p><strong>v0.7.0 (shipped)</strong> — credential-derived keys, identity rotation, PeerGroup hardening, stress harness.</p>
|
|
@@ -908,9 +917,92 @@ const pool = createDefaultSignalingPool({
|
|
|
908
917
|
<p>
|
|
909
918
|
Machine-readable metadata:
|
|
910
919
|
<a href="./openapi-like.json">openapi-like.json</a>
|
|
920
|
+
·
|
|
921
|
+
<a href="./api-reference.md">api-reference.md</a> (generated, #93)
|
|
911
922
|
</p>
|
|
912
923
|
</section>
|
|
913
924
|
|
|
925
|
+
<section id="browser-compat" class="section">
|
|
926
|
+
<h2>Browser compatibility</h2>
|
|
927
|
+
<p>
|
|
928
|
+
dignity.js requires WebRTC, IndexedDB (optional persistence), and Web Crypto in a secure context (HTTPS or localhost).
|
|
929
|
+
CI runs Node.js 18/20/22 only — browser rows reflect manual smoke tests on the playground and chess demo.
|
|
930
|
+
Full matrix: <a href="./browser-compatibility.md">browser-compatibility.md</a> (#91).
|
|
931
|
+
</p>
|
|
932
|
+
<div class="table-wrap">
|
|
933
|
+
<table>
|
|
934
|
+
<thead>
|
|
935
|
+
<tr>
|
|
936
|
+
<th>Browser</th>
|
|
937
|
+
<th>Status</th>
|
|
938
|
+
</tr>
|
|
939
|
+
</thead>
|
|
940
|
+
<tbody>
|
|
941
|
+
<tr><td>Chrome / Chromium</td><td>Supported (primary dev target)</td></tr>
|
|
942
|
+
<tr><td>Firefox</td><td>Supported</td></tr>
|
|
943
|
+
<tr><td>Safari</td><td>Supported with WebRTC / background-tab caveats</td></tr>
|
|
944
|
+
<tr><td>Edge (Chromium)</td><td>Supported</td></tr>
|
|
945
|
+
<tr><td>Node.js 18+</td><td>Supported (in-memory / tests)</td></tr>
|
|
946
|
+
</tbody>
|
|
947
|
+
</table>
|
|
948
|
+
</div>
|
|
949
|
+
</section>
|
|
950
|
+
|
|
951
|
+
<section id="benchmarks" class="section">
|
|
952
|
+
<h2>Performance benchmarks</h2>
|
|
953
|
+
<p>
|
|
954
|
+
Reproducible in-memory gossip latency and IndexedDB hydration numbers (#92).
|
|
955
|
+
Regenerate: <code>npm run benchmark</code> · smoke: <code>npm run benchmark:quick</code>.
|
|
956
|
+
Details: <a href="./benchmarks/README.md">benchmarks/README.md</a>.
|
|
957
|
+
</p>
|
|
958
|
+
<p>Latest checked-in results: <a href="./benchmarks/results.json">benchmarks/results.json</a> (Node in-memory harness; not real WebRTC).</p>
|
|
959
|
+
<div class="table-wrap">
|
|
960
|
+
<table>
|
|
961
|
+
<thead>
|
|
962
|
+
<tr>
|
|
963
|
+
<th>Suite</th>
|
|
964
|
+
<th>Audience / records</th>
|
|
965
|
+
<th>p50</th>
|
|
966
|
+
<th>p90</th>
|
|
967
|
+
<th>p99</th>
|
|
968
|
+
<th>Delivery</th>
|
|
969
|
+
</tr>
|
|
970
|
+
</thead>
|
|
971
|
+
<tbody>
|
|
972
|
+
<tr>
|
|
973
|
+
<td>Gossip epidemic</td>
|
|
974
|
+
<td>100 subscribers</td>
|
|
975
|
+
<td>2 ms</td>
|
|
976
|
+
<td>5 ms</td>
|
|
977
|
+
<td>5 ms</td>
|
|
978
|
+
<td>93%</td>
|
|
979
|
+
</tr>
|
|
980
|
+
<tr>
|
|
981
|
+
<td>CQRS tiered gossip</td>
|
|
982
|
+
<td>50 subs, liveCap 20</td>
|
|
983
|
+
<td>1 ms</td>
|
|
984
|
+
<td>1 ms</td>
|
|
985
|
+
<td>1 ms</td>
|
|
986
|
+
<td>100%</td>
|
|
987
|
+
</tr>
|
|
988
|
+
<tr>
|
|
989
|
+
<td>IndexedDB hydrate</td>
|
|
990
|
+
<td>1,000 records</td>
|
|
991
|
+
<td colspan="3">6 ms total (~0.006 ms/record)</td>
|
|
992
|
+
<td>—</td>
|
|
993
|
+
</tr>
|
|
994
|
+
<tr>
|
|
995
|
+
<td>IndexedDB hydrate</td>
|
|
996
|
+
<td>2,000 records</td>
|
|
997
|
+
<td colspan="3">17 ms total (~0.009 ms/record)</td>
|
|
998
|
+
<td>—</td>
|
|
999
|
+
</tr>
|
|
1000
|
+
</tbody>
|
|
1001
|
+
</table>
|
|
1002
|
+
</div>
|
|
1003
|
+
<p><small>Figures from <code>docs/benchmarks/results.json</code>; re-run locally to refresh after harness changes.</small></p>
|
|
1004
|
+
</section>
|
|
1005
|
+
|
|
914
1006
|
<section id="events" class="section">
|
|
915
1007
|
<h2>Events</h2>
|
|
916
1008
|
<p><code>DignityP2P</code> extends <code>EventEmitter</code>. Common events:</p>
|
|
@@ -1009,9 +1101,24 @@ const pool = createDefaultSignalingPool({
|
|
|
1009
1101
|
</tr>
|
|
1010
1102
|
<tr>
|
|
1011
1103
|
<td><a href="./chess/index.html"><code>docs/chess/</code></a></td>
|
|
1012
|
-
<td>3D browser chess — PeerJS mesh, dual-signed resume links, IndexedDB, React hooks</td>
|
|
1104
|
+
<td>3D browser chess — PeerJS mesh, dual-signed resume links, IndexedDB, React hooks (v0.8.3)</td>
|
|
1013
1105
|
<td><code>npm run build:chess</code> then <code>npm run docs:serve</code></td>
|
|
1014
1106
|
</tr>
|
|
1107
|
+
<tr>
|
|
1108
|
+
<td><a href="./api-reference.md"><code>docs/api-reference.md</code></a></td>
|
|
1109
|
+
<td>Generated API reference from <code>openapi-like.json</code> (#93)</td>
|
|
1110
|
+
<td><code>npm run docs:api-reference</code></td>
|
|
1111
|
+
</tr>
|
|
1112
|
+
<tr>
|
|
1113
|
+
<td><a href="./browser-compatibility.md"><code>docs/browser-compatibility.md</code></a></td>
|
|
1114
|
+
<td>Browser support matrix and platform caveats (#91)</td>
|
|
1115
|
+
<td>—</td>
|
|
1116
|
+
</tr>
|
|
1117
|
+
<tr>
|
|
1118
|
+
<td><a href="./benchmarks/results.json"><code>docs/benchmarks/</code></a></td>
|
|
1119
|
+
<td>Gossip latency and IndexedDB hydration benchmarks (#92)</td>
|
|
1120
|
+
<td><code>npm run benchmark</code></td>
|
|
1121
|
+
</tr>
|
|
1015
1122
|
</tbody>
|
|
1016
1123
|
</table>
|
|
1017
1124
|
</div>
|
|
@@ -1020,7 +1127,7 @@ const pool = createDefaultSignalingPool({
|
|
|
1020
1127
|
<section id="development" class="section">
|
|
1021
1128
|
<h2>Development</h2>
|
|
1022
1129
|
<div class="code-block">
|
|
1023
|
-
<pre><code class="language-bash"># Run tests (
|
|
1130
|
+
<pre><code class="language-bash"># Run tests (291+ passing)
|
|
1024
1131
|
npm test
|
|
1025
1132
|
|
|
1026
1133
|
# PeerGroup + CQRS unit + integration tests
|
|
@@ -1029,6 +1136,12 @@ npm run test:peer-group
|
|
|
1029
1136
|
# Build browser + Node bundles
|
|
1030
1137
|
npm run build
|
|
1031
1138
|
|
|
1139
|
+
# Regenerate API reference markdown (#93)
|
|
1140
|
+
npm run docs:api-reference
|
|
1141
|
+
|
|
1142
|
+
# Run performance benchmarks (#92)
|
|
1143
|
+
npm run benchmark
|
|
1144
|
+
|
|
1032
1145
|
# Serve docs locally
|
|
1033
1146
|
npm run docs:serve
|
|
1034
1147
|
|
|
@@ -1040,7 +1153,7 @@ npm run example:chess</code></pre>
|
|
|
1040
1153
|
|
|
1041
1154
|
<footer class="site-footer">
|
|
1042
1155
|
<p>
|
|
1043
|
-
dignity.js v0.8.
|
|
1156
|
+
dignity.js v0.8.3 ·
|
|
1044
1157
|
<a href="https://github.com/jose-compu/dignity.js/blob/main/LICENSE">Apache 2.0</a> ·
|
|
1045
1158
|
<a href="https://github.com/jose-compu/dignity.js">GitHub</a> ·
|
|
1046
1159
|
<a href="https://www.npmjs.com/package/dignity.js">npm</a>
|
package/docs/openapi-like.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dignity.js",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "P2P object API for decentralized JavaScript applications",
|
|
5
5
|
"homepage": "https://jose-compu.github.io/dignity.js/",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,10 @@
|
|
|
53
53
|
"docs:dev": "node scripts/serve-docs.js",
|
|
54
54
|
"docs:serve": "node scripts/serve-docs.js",
|
|
55
55
|
"docs:stop": "node scripts/stop-docs.js",
|
|
56
|
-
"docs:
|
|
56
|
+
"docs:api-reference": "node scripts/generate-api-reference.js",
|
|
57
|
+
"benchmark": "node scripts/run-benchmarks.js --write docs/benchmarks/results.json",
|
|
58
|
+
"benchmark:quick": "node scripts/run-benchmarks.js --quick",
|
|
59
|
+
"docs:check": "node -e \"const fs=require('fs');['docs/index.html','docs/favicon.ico','docs/api-reference.md','docs/browser-compatibility.md','docs/benchmarks/results.json','docs/playground/index.html','docs/assets/playground.js','docs/assets/playground-demos.js','docs/assets/playground.css','docs/chess/index.html','docs/chess/favicon.ico','docs/assets/favicon.svg','docs/chess/assets/chess-app.js','docs/assets/dignity.esm.js','docs/assets/highlight/highlight.min.js','docs/assets/highlight/github.min.css','docs/assets/highlight/github-dark.min.css'].forEach(p=>fs.accessSync(p));\"",
|
|
57
60
|
"example:tictactoe": "node examples/decentralized-tictactoe.js",
|
|
58
61
|
"example:chess": "node examples/decentralized-chess-lite.js",
|
|
59
62
|
"prepublishOnly": "npm test && npm run build"
|