dignity.js 0.5.1 → 0.5.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 +12 -21
- package/docs/index.html +3 -3
- package/docs/openapi-like.json +1 -1
- package/package.json +16 -3
- package/docs/chess/assets/chess-app.js +0 -58022
- package/docs/chess/assets/chess-app.js.map +0 -7
- package/docs/chess/assets/chess.css +0 -584
- package/docs/chess/favicon.ico +0 -0
- package/docs/chess/index.html +0 -16
- package/docs/chess/src/App.jsx +0 -128
- package/docs/chess/src/components/Board3D.jsx +0 -364
- package/docs/chess/src/components/GameView.jsx +0 -847
- package/docs/chess/src/components/JoinGate.jsx +0 -68
- package/docs/chess/src/components/LinkPanel.jsx +0 -132
- package/docs/chess/src/components/Lobby.jsx +0 -154
- package/docs/chess/src/components/MovePanel.jsx +0 -123
- package/docs/chess/src/lib/audio.js +0 -50
- package/docs/chess/src/lib/dignitySetup.js +0 -42
- package/docs/chess/src/lib/links.js +0 -124
- package/docs/chess/src/lib/localGames.js +0 -160
- package/docs/chess/src/lib/p2pDebug.js +0 -192
- package/docs/chess/src/main.jsx +0 -5
package/README.md
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
# dignity.js
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<p align="center">
|
|
14
|
-
<a href="https://jose-compu.github.io/dignity.js/"><img src="https://img.shields.io/badge/docs-online-5B7FFF" alt="documentation"></a>
|
|
15
|
-
<a href="https://www.npmjs.com/package/dignity.js"><img src="https://img.shields.io/npm/v/dignity.js?color=cb3837&label=npm" alt="npm version"></a>
|
|
16
|
-
<a href="https://www.npmjs.com/package/dignity.js"><img src="https://img.shields.io/npm/dm/dignity.js?color=blue" alt="npm downloads"></a>
|
|
17
|
-
<a href="https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml"><img src="https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
18
|
-
<img src="https://img.shields.io/badge/tests-150%2B%20passing-brightgreen" alt="tests passing">
|
|
19
|
-
<img src="https://img.shields.io/badge/coverage-99%25-brightgreen" alt="coverage">
|
|
20
|
-
<img src="https://img.shields.io/badge/license-Apache%202.0-black" alt="license">
|
|
21
|
-
</p>
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://jose-compu.github.io/dignity.js/)
|
|
6
|
+
[](https://www.npmjs.com/package/dignity.js)
|
|
7
|
+
[](https://www.npmjs.com/package/dignity.js)
|
|
8
|
+
[](https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml)
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
22
12
|
|
|
23
13
|
REST-like P2P object API for decentralized JavaScript applications.
|
|
24
14
|
|
|
@@ -193,6 +183,7 @@ await persistence.attach(node);
|
|
|
193
183
|
Optional React integration (`react >= 18` peer dependency):
|
|
194
184
|
|
|
195
185
|
```js
|
|
186
|
+
import { createElement } from 'react';
|
|
196
187
|
import { useDignity, useCollection, usePeers } from 'dignity.js/react';
|
|
197
188
|
|
|
198
189
|
function Room() {
|
|
@@ -200,7 +191,7 @@ function Room() {
|
|
|
200
191
|
const games = useCollection(node, 'games');
|
|
201
192
|
const peers = usePeers(node, 'room:chess', { includeSelf: false });
|
|
202
193
|
|
|
203
|
-
return
|
|
194
|
+
return createElement('pre', null, JSON.stringify({ status, games, peers }, null, 2));
|
|
204
195
|
}
|
|
205
196
|
```
|
|
206
197
|
|
|
@@ -208,7 +199,7 @@ function Room() {
|
|
|
208
199
|
|
|
209
200
|
The published npm package includes pre-built bundles (IIFE, ESM, CJS) generated at publish time. The `dist/` folder is not checked into the repository.
|
|
210
201
|
|
|
211
|
-
```
|
|
202
|
+
```text
|
|
212
203
|
<script src="https://unpkg.com/dignity.js/dist/dignity.min.js"></script>
|
|
213
204
|
<script>
|
|
214
205
|
const { DignityP2P } = DignityJS;
|
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.5.
|
|
6
|
+
<meta name="description" content="dignity.js v0.5.2 — 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.5.
|
|
19
|
+
<span class="site-header__version">v0.5.2</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>
|
|
@@ -625,7 +625,7 @@ npm run example:chess</code></pre>
|
|
|
625
625
|
|
|
626
626
|
<footer class="site-footer">
|
|
627
627
|
<p>
|
|
628
|
-
dignity.js v0.5.
|
|
628
|
+
dignity.js v0.5.2 ·
|
|
629
629
|
<a href="https://github.com/jose-compu/dignity.js/blob/main/LICENSE">Apache 2.0</a> ·
|
|
630
630
|
<a href="https://github.com/jose-compu/dignity.js">GitHub</a> ·
|
|
631
631
|
<a href="https://www.npmjs.com/package/dignity.js">npm</a>
|
package/docs/openapi-like.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dignity.js",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "P2P object API for decentralized JavaScript applications",
|
|
5
|
+
"homepage": "https://jose-compu.github.io/dignity.js/",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jose-compu/dignity.js.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/jose-compu/dignity.js/issues"
|
|
12
|
+
},
|
|
5
13
|
"main": "dist/dignity.cjs.js",
|
|
6
14
|
"module": "dist/dignity.esm.js",
|
|
7
15
|
"browser": "dist/dignity.esm.js",
|
|
@@ -20,16 +28,21 @@
|
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
"files": [
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE",
|
|
23
33
|
"dist",
|
|
24
34
|
"src",
|
|
25
|
-
"docs",
|
|
35
|
+
"docs/index.html",
|
|
36
|
+
"docs/openapi-like.json",
|
|
37
|
+
"docs/favicon.ico",
|
|
38
|
+
"docs/assets",
|
|
26
39
|
"examples"
|
|
27
40
|
],
|
|
28
41
|
"scripts": {
|
|
29
42
|
"test": "jest --coverage",
|
|
30
43
|
"test:unit": "jest tests/unit --runInBand",
|
|
31
44
|
"test:cloudflare-live": "RUN_CLOUDFLARE_LIVE_TESTS=1 jest tests/integration/cloudflare-signaling-live.test.js --runInBand",
|
|
32
|
-
"test:pow-calibrate": "jest tests/unit/sloth-vdf-timing.test.js --runInBand",
|
|
45
|
+
"test:pow-calibrate": "RUN_POW_CALIBRATE=1 jest tests/unit/sloth-vdf-timing.test.js --runInBand --coverage=false",
|
|
33
46
|
"build": "node scripts/build.js",
|
|
34
47
|
"build:chess": "node scripts/build-chess-demo.js",
|
|
35
48
|
"docs:favicon": "node scripts/generate-favicon.js",
|