cojson 0.0.3 → 0.0.5

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,14 +1,15 @@
1
1
  {
2
2
  "name": "cojson",
3
- "module": "src/index.ts",
3
+ "module": "dist/index.js",
4
4
  "types": "src/index.ts",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "version": "0.0.3",
7
+ "version": "0.0.5",
8
8
  "devDependencies": {
9
9
  "@types/jest": "^29.5.3",
10
10
  "@typescript-eslint/eslint-plugin": "^6.2.1",
11
11
  "@typescript-eslint/parser": "^6.2.1",
12
+ "esbuild": "^0.19.0",
12
13
  "eslint": "^8.46.0",
13
14
  "jest": "^29.6.2",
14
15
  "ts-jest": "^29.1.1",
@@ -23,7 +24,8 @@
23
24
  "isomorphic-streams": "https://github.com/sgwilym/isomorphic-streams.git#aa9394781bfc92f8d7c981be7daf8af4b4cd4fae"
24
25
  },
25
26
  "scripts": {
26
- "test": "jest"
27
+ "test": "jest",
28
+ "build": "esbuild `find src \\( -name '*.ts' -o -name '*.tsx' \\)` --platform=node --target=node14 --outdir=dist"
27
29
  },
28
30
  "jest": {
29
31
  "preset": "ts-jest",
package/src/crypto.ts CHANGED
@@ -2,7 +2,7 @@ import { ed25519, x25519 } from "@noble/curves/ed25519";
2
2
  import { xsalsa20_poly1305, xsalsa20 } from "@noble/ciphers/salsa";
3
3
  import { JsonValue } from "./jsonValue";
4
4
  import { base58, base64url } from "@scure/base";
5
- import { default as stableStringify } from "fast-json-stable-stringify";
5
+ import stableStringify from "fast-json-stable-stringify";
6
6
  import { blake3 } from "@noble/hashes/blake3";
7
7
  import { randomBytes } from "@noble/ciphers/webcrypto/utils";
8
8
  import { RawCoValueID, TransactionID } from "./ids";
package/src/index.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { CoValueID, ContentType } from "./contentType";
2
- import type { JsonValue } from "./jsonValue";
3
1
  import {
4
2
  CoValue,
5
3
  agentCredentialFromBytes,
@@ -12,6 +10,11 @@ import {
12
10
  import { LocalNode } from "./node";
13
11
  import { CoMap } from "./contentTypes/coMap";
14
12
 
13
+ import type { AgentCredential } from "./coValue";
14
+ import type { AgentID, SessionID } from "./ids";
15
+ import type { CoValueID, ContentType } from "./contentType";
16
+ import type { JsonValue } from "./jsonValue";
17
+
15
18
  type Value = JsonValue | ContentType;
16
19
 
17
20
  const internals = {
@@ -25,4 +28,12 @@ const internals = {
25
28
 
26
29
  export { LocalNode, CoValue, CoMap, internals };
27
30
 
28
- export type { Value, JsonValue, ContentType, CoValueID };
31
+ export type {
32
+ Value,
33
+ JsonValue,
34
+ ContentType,
35
+ CoValueID,
36
+ AgentCredential,
37
+ SessionID,
38
+ AgentID,
39
+ };