@dxos/hypercore 0.8.3 → 0.8.4-main.1da679c

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/hypercore",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.1da679c",
4
4
  "description": "Hypercore wrapper and utils.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,6 +10,7 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs",
15
16
  "node": "./dist/lib/node-esm/index.mjs"
@@ -28,28 +29,28 @@
28
29
  "sodium-native": "^3.2.0",
29
30
  "sodium-universal": "^3.0.2",
30
31
  "streamx": "^2.12.5",
31
- "@dxos/async": "0.8.3",
32
- "@dxos/codec-protobuf": "0.8.3",
33
- "@dxos/crypto": "0.8.3",
34
- "@dxos/debug": "0.8.3",
35
- "@dxos/invariant": "0.8.3",
36
- "@dxos/keys": "0.8.3",
37
- "@dxos/node-std": "0.8.3",
38
- "@dxos/random-access-storage": "0.8.3",
39
- "@dxos/typings": "0.8.3",
40
- "@dxos/util": "0.8.3"
32
+ "@dxos/async": "0.8.4-main.1da679c",
33
+ "@dxos/crypto": "0.8.4-main.1da679c",
34
+ "@dxos/codec-protobuf": "0.8.4-main.1da679c",
35
+ "@dxos/debug": "0.8.4-main.1da679c",
36
+ "@dxos/invariant": "0.8.4-main.1da679c",
37
+ "@dxos/keys": "0.8.4-main.1da679c",
38
+ "@dxos/node-std": "0.8.4-main.1da679c",
39
+ "@dxos/random-access-storage": "0.8.4-main.1da679c",
40
+ "@dxos/typings": "0.8.4-main.1da679c",
41
+ "@dxos/util": "0.8.4-main.1da679c",
42
+ "@dxos/vendor-hypercore": "0.8.4-main.1da679c"
41
43
  },
42
44
  "devDependencies": {
43
45
  "@types/randombytes": "^2.0.0",
44
46
  "@types/readable-stream": "^2.3.9",
45
- "hypercore": "^9.12.0",
46
47
  "hypercore-protocol": "^8.0.7",
47
48
  "noise-protocol": "3.0.1",
48
49
  "random-access-memory": "^4.1.0",
49
- "@dxos/random": "0.8.3",
50
- "@dxos/tracing": "0.8.3",
51
- "@dxos/util": "0.8.3",
52
- "@dxos/log": "0.8.3"
50
+ "@dxos/log": "0.8.4-main.1da679c",
51
+ "@dxos/tracing": "0.8.4-main.1da679c",
52
+ "@dxos/random": "0.8.4-main.1da679c",
53
+ "@dxos/util": "0.8.4-main.1da679c"
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
package/src/crypto.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import { type AbstractValueEncoding, type Crypto } from 'hypercore';
6
5
  import { callbackify } from 'node:util';
7
6
 
8
7
  import { type Codec, type EncodingOptions } from '@dxos/codec-protobuf';
@@ -10,6 +9,7 @@ import { type Signer, verifySignature } from '@dxos/crypto';
10
9
  import { invariant } from '@dxos/invariant';
11
10
  import { type PublicKey } from '@dxos/keys';
12
11
  import { arrayToBuffer } from '@dxos/util';
12
+ import { type AbstractValueEncoding, type Crypto } from '@dxos/vendor-hypercore/hypercore';
13
13
 
14
14
  /**
15
15
  * Create encoding (e.g., from protobuf codec).
package/src/defaults.ts CHANGED
@@ -2,7 +2,12 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import type { HypercoreOptions, ReadStreamOptions, ReplicationOptions, WriteStreamOptions } from 'hypercore';
5
+ import type {
6
+ HypercoreOptions,
7
+ ReadStreamOptions,
8
+ ReplicationOptions,
9
+ WriteStreamOptions,
10
+ } from '@dxos/vendor-hypercore/hypercore';
6
11
 
7
12
  /**
8
13
  * https://github.com/hypercore-protocol/hypercore/tree/v9.12.0#var-feed--hypercorestorage-key-options
@@ -2,11 +2,10 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import hypercore from 'hypercore';
6
- import type { Hypercore, HypercoreOptions } from 'hypercore';
7
-
8
5
  import { invariant } from '@dxos/invariant';
9
- import { createStorage, type Directory, StorageType } from '@dxos/random-access-storage';
6
+ import { type Directory, StorageType, createStorage } from '@dxos/random-access-storage';
7
+ import hypercore from '@dxos/vendor-hypercore/hypercore';
8
+ import type { Hypercore, HypercoreOptions } from '@dxos/vendor-hypercore/hypercore';
10
9
 
11
10
  import { py } from './util';
12
11
 
@@ -2,8 +2,9 @@
2
2
  // Copyright 2019 DXOS.org
3
3
  //
4
4
 
5
- import { type AbstractValueEncoding } from 'hypercore';
6
5
  import util from 'node:util';
6
+
7
+ import { type AbstractValueEncoding } from 'hypercore';
7
8
  import { describe, expect, test } from 'vitest';
8
9
 
9
10
  import { type Codec } from '@dxos/codec-protobuf';
package/src/index.ts CHANGED
@@ -2,8 +2,13 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- export { default as hypercore } from 'hypercore';
6
- export type { Hypercore, HypercoreOptions, HypercoreProperties, ReadStreamOptions } from 'hypercore';
5
+ export { default as hypercore } from '@dxos/vendor-hypercore/hypercore';
6
+ export type {
7
+ Hypercore,
8
+ HypercoreOptions,
9
+ HypercoreProperties,
10
+ ReadStreamOptions,
11
+ } from '@dxos/vendor-hypercore/hypercore';
7
12
 
8
13
  export * from './crypto';
9
14
  export * from './defaults';
@@ -3,6 +3,7 @@
3
3
  //
4
4
 
5
5
  import util from 'node:util';
6
+
6
7
  import { describe, test } from 'vitest';
7
8
 
8
9
  import { latch } from '@dxos/async';
@@ -4,17 +4,17 @@
4
4
 
5
5
  import { describe, expect, test } from 'vitest';
6
6
 
7
- import { latch, sleep, Trigger } from '@dxos/async';
7
+ import { Trigger, latch, sleep } from '@dxos/async';
8
8
  import { createKeyPair } from '@dxos/crypto';
9
9
  import { log } from '@dxos/log';
10
10
  import { faker } from '@dxos/random';
11
- import { createStorage, StorageType } from '@dxos/random-access-storage';
11
+ import { StorageType, createStorage } from '@dxos/random-access-storage';
12
12
  import { TRACE_PROCESSOR } from '@dxos/tracing';
13
13
  import { range, sum } from '@dxos/util';
14
14
 
15
15
  import { HypercoreFactory } from './hypercore-factory';
16
16
  import { createReadable } from './iterator';
17
- import { batch, createDataItem, type TestDataItem } from './testing';
17
+ import { type TestDataItem, batch, createDataItem } from './testing';
18
18
 
19
19
  const noop = () => {};
20
20
 
@@ -3,6 +3,7 @@
3
3
  //
4
4
 
5
5
  import util from 'node:util';
6
+
6
7
  import { Writable } from 'streamx';
7
8
  import { describe, test } from 'vitest';
8
9