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 CHANGED
@@ -1,24 +1,14 @@
1
1
  # dignity.js
2
2
 
3
- <p align="center">
4
- <img src="https://raw.githubusercontent.com/jose-compu/dignity.js/refs/heads/main/docs/assets/dignity-logo.svg" alt="dignity.js logo" width="860" />
5
- </p>
6
-
7
- <p align="center">
8
- <img src="https://img.shields.io/badge/dignity.js-decentralized%20object%20api-5B7FFF?style=for-the-badge" alt="dignity.js" />
9
- <img src="https://img.shields.io/badge/browser-first-00C2A8?style=for-the-badge" alt="browser-first" />
10
- <img src="https://img.shields.io/badge/security-default%20on-111827?style=for-the-badge" alt="security default on" />
11
- </p>
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
+ ![dignity.js logo](https://raw.githubusercontent.com/jose-compu/dignity.js/refs/heads/main/docs/assets/dignity-logo.png)
4
+
5
+ [![docs](https://img.shields.io/badge/docs-online-5B7FFF)](https://jose-compu.github.io/dignity.js/)
6
+ [![npm version](https://img.shields.io/npm/v/dignity.js?color=cb3837&label=npm)](https://www.npmjs.com/package/dignity.js)
7
+ [![npm downloads](https://img.shields.io/npm/dm/dignity.js?color=blue)](https://www.npmjs.com/package/dignity.js)
8
+ [![CI](https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml/badge.svg)](https://github.com/jose-compu/dignity.js/actions/workflows/ci.yml)
9
+ ![tests](https://img.shields.io/badge/tests-150%2B%20passing-brightgreen)
10
+ ![coverage](https://img.shields.io/badge/coverage-99%25-brightgreen)
11
+ ![license](https://img.shields.io/badge/license-Apache%202.0-black)
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 <pre>{JSON.stringify({ status, games, peers }, null, 2)}</pre>;
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
- ```html
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.1 — REST-like P2P object API for decentralized JavaScript applications." />
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.1</span>
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.1 ·
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>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dignity.js",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "REST-like object API over peer-to-peer replication",
5
5
  "resources": {
6
6
  "collections/{collection}/{id}": {
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "dignity.js",
3
- "version": "0.5.1",
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",