@evolu/common 7.4.0 → 8.0.0-next.0
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 +4 -61
- package/dist/src/Array.d.ts +343 -102
- package/dist/src/Array.d.ts.map +1 -1
- package/dist/src/Array.js +181 -85
- package/dist/src/Assert.d.ts +57 -11
- package/dist/src/Assert.d.ts.map +1 -1
- package/dist/src/Assert.js +47 -11
- package/dist/src/BigInt.d.ts +6 -1
- package/dist/src/BigInt.d.ts.map +1 -1
- package/dist/src/BigInt.js +5 -0
- package/dist/src/Brand.d.ts +40 -12
- package/dist/src/Brand.d.ts.map +1 -1
- package/dist/src/Brand.js +5 -0
- package/dist/src/Buffer.d.ts +6 -1
- package/dist/src/Buffer.d.ts.map +1 -1
- package/dist/src/Buffer.js +7 -2
- package/dist/src/Cache.d.ts +10 -2
- package/dist/src/Cache.d.ts.map +1 -1
- package/dist/src/Cache.js +6 -0
- package/dist/src/Callbacks.d.ts +10 -7
- package/dist/src/Callbacks.d.ts.map +1 -1
- package/dist/src/Callbacks.js +23 -13
- package/dist/src/Console.d.ts +361 -69
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +217 -117
- package/dist/src/Crypto.d.ts +70 -21
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +72 -27
- package/dist/src/Eq.d.ts +22 -2
- package/dist/src/Eq.d.ts.map +1 -1
- package/dist/src/Eq.js +21 -1
- package/dist/src/Error.d.ts +23 -12
- package/dist/src/Error.d.ts.map +1 -1
- package/dist/src/Error.js +27 -11
- package/dist/src/Function.d.ts +128 -56
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Function.js +118 -14
- package/dist/src/Identicon.d.ts +5 -0
- package/dist/src/Identicon.d.ts.map +1 -1
- package/dist/src/Identicon.js +6 -1
- package/dist/src/Lookup.d.ts +160 -0
- package/dist/src/Lookup.d.ts.map +1 -0
- package/dist/src/Lookup.js +192 -0
- package/dist/src/Microtask.d.ts +21 -0
- package/dist/src/Microtask.d.ts.map +1 -0
- package/dist/src/Microtask.js +37 -0
- package/dist/src/Number.d.ts +18 -4
- package/dist/src/Number.d.ts.map +1 -1
- package/dist/src/Number.js +23 -1
- package/dist/src/Object.d.ts +110 -5
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +108 -5
- package/dist/src/Option.d.ts +58 -0
- package/dist/src/Option.d.ts.map +1 -0
- package/dist/src/Option.js +43 -0
- package/dist/src/Order.d.ts +5 -0
- package/dist/src/Order.d.ts.map +1 -1
- package/dist/src/Order.js +8 -3
- package/dist/src/Platform.d.ts +36 -2
- package/dist/src/Platform.d.ts.map +1 -1
- package/dist/src/Platform.js +10 -6
- package/dist/src/Polyfills.d.ts +27 -0
- package/dist/src/Polyfills.d.ts.map +1 -0
- package/dist/src/Polyfills.js +299 -0
- package/dist/src/Random.d.ts +18 -7
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/Random.js +9 -7
- package/dist/src/Redacted.d.ts +7 -4
- package/dist/src/Redacted.d.ts.map +1 -1
- package/dist/src/Redacted.js +5 -0
- package/dist/src/Ref.d.ts +31 -16
- package/dist/src/Ref.d.ts.map +1 -1
- package/dist/src/Ref.js +35 -7
- package/dist/src/RefCount.d.ts +62 -0
- package/dist/src/RefCount.d.ts.map +1 -0
- package/dist/src/RefCount.js +83 -0
- package/dist/src/Relation.d.ts +84 -29
- package/dist/src/Relation.d.ts.map +1 -1
- package/dist/src/Relation.js +83 -105
- package/dist/src/Resource.d.ts +263 -0
- package/dist/src/Resource.d.ts.map +1 -0
- package/dist/src/Resource.js +389 -0
- package/dist/src/Result.d.ts +390 -374
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +142 -70
- package/dist/src/Schedule.d.ts +953 -0
- package/dist/src/Schedule.d.ts.map +1 -0
- package/dist/src/Schedule.js +1199 -0
- package/dist/src/Set.d.ts +181 -0
- package/dist/src/Set.d.ts.map +1 -0
- package/dist/src/Set.js +137 -0
- package/dist/src/Skiplist.d.ts +6 -1
- package/dist/src/Skiplist.d.ts.map +1 -1
- package/dist/src/Skiplist.js +5 -0
- package/dist/src/Sqlite.d.ts +160 -60
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +290 -190
- package/dist/src/Store.d.ts +36 -28
- package/dist/src/Store.d.ts.map +1 -1
- package/dist/src/Store.js +55 -15
- package/dist/src/String.d.ts +5 -0
- package/dist/src/String.d.ts.map +1 -1
- package/dist/src/String.js +5 -0
- package/dist/src/Task.d.ts +2263 -423
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +1488 -348
- package/dist/src/Test.d.ts +122 -0
- package/dist/src/Test.d.ts.map +1 -0
- package/dist/src/Test.js +66 -0
- package/dist/src/Time.d.ts +201 -48
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +190 -86
- package/dist/src/Tracer.d.ts +48 -0
- package/dist/src/Tracer.d.ts.map +1 -0
- package/dist/src/Tracer.js +6 -0
- package/dist/src/Type.d.ts +582 -209
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +362 -240
- package/dist/src/Types.d.ts +160 -6
- package/dist/src/Types.d.ts.map +1 -1
- package/dist/src/Types.js +22 -2
- package/dist/src/WebSocket.d.ts +113 -58
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +210 -118
- package/dist/src/Worker.d.ts +245 -60
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +220 -64
- package/dist/src/index.d.ts +25 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -3
- package/dist/src/local-first/Db.d.ts +24 -213
- package/dist/src/local-first/Db.d.ts.map +1 -1
- package/dist/src/local-first/Db.js +622 -293
- package/dist/src/local-first/Error.d.ts +12 -0
- package/dist/src/local-first/Error.d.ts.map +1 -0
- package/dist/src/local-first/Error.js +6 -0
- package/dist/src/local-first/Evolu.d.ts +330 -285
- package/dist/src/local-first/Evolu.d.ts.map +1 -1
- package/dist/src/local-first/Evolu.js +472 -402
- package/dist/src/local-first/LocalAuth.d.ts +10 -10
- package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
- package/dist/src/local-first/LocalAuth.js +6 -1
- package/dist/src/local-first/Owner.d.ts +70 -27
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +27 -14
- package/dist/src/local-first/Protocol.d.ts +58 -50
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +253 -155
- package/dist/src/local-first/Query.d.ts +133 -43
- package/dist/src/local-first/Query.d.ts.map +1 -1
- package/dist/src/local-first/Query.js +139 -90
- package/dist/src/local-first/Relay.d.ts +18 -38
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Relay.js +59 -171
- package/dist/src/local-first/Schema.d.ts +139 -144
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Schema.js +78 -163
- package/dist/src/local-first/Shared.d.ts +125 -0
- package/dist/src/local-first/Shared.d.ts.map +1 -0
- package/dist/src/local-first/Shared.js +569 -0
- package/dist/src/local-first/Storage.d.ts +50 -53
- package/dist/src/local-first/Storage.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +121 -173
- package/dist/src/local-first/Timestamp.d.ts +28 -35
- package/dist/src/local-first/Timestamp.d.ts.map +1 -1
- package/dist/src/local-first/Timestamp.js +24 -25
- package/dist/src/local-first/index.d.ts +2 -15
- package/dist/src/local-first/index.d.ts.map +1 -1
- package/dist/src/local-first/index.js +2 -15
- package/package.json +36 -26
- package/src/Array.ts +467 -106
- package/src/Assert.ts +87 -12
- package/src/BigInt.ts +7 -1
- package/src/Brand.ts +41 -12
- package/src/Buffer.ts +10 -4
- package/src/Cache.ts +11 -2
- package/src/Callbacks.ts +33 -23
- package/src/Console.ts +567 -178
- package/src/Crypto.ts +111 -62
- package/src/Eq.ts +30 -3
- package/src/Error.ts +50 -34
- package/src/Function.ts +140 -68
- package/src/Identicon.ts +7 -1
- package/src/Lookup.ts +415 -0
- package/src/Microtask.ts +58 -0
- package/src/Number.ts +40 -7
- package/src/Object.ts +155 -16
- package/src/Option.ts +74 -0
- package/src/Order.ts +11 -3
- package/src/Platform.ts +43 -7
- package/src/Polyfills.ts +465 -0
- package/src/Random.ts +25 -11
- package/src/Redacted.ts +8 -4
- package/src/Ref.ts +72 -21
- package/src/RefCount.ts +170 -0
- package/src/Relation.ts +188 -136
- package/src/Resource.ts +864 -0
- package/src/Result.ts +548 -381
- package/src/Schedule.ts +1471 -0
- package/src/Set.ts +247 -0
- package/src/Skiplist.ts +7 -1
- package/src/Sqlite.ts +409 -304
- package/src/Store.ts +94 -48
- package/src/String.ts +6 -0
- package/src/Task.ts +3685 -740
- package/src/Test.ts +162 -0
- package/src/Time.ts +348 -145
- package/src/Tracer.ts +54 -0
- package/src/Type.ts +1064 -630
- package/src/Types.ts +202 -7
- package/src/WebSocket.ts +311 -178
- package/src/Worker.ts +527 -147
- package/src/index.ts +74 -3
- package/src/local-first/Db.ts +871 -597
- package/src/local-first/Error.ts +17 -0
- package/src/local-first/Evolu.ts +884 -823
- package/src/local-first/LocalAuth.ts +10 -10
- package/src/local-first/Owner.ts +94 -42
- package/src/local-first/Protocol.ts +440 -303
- package/src/local-first/Query.ts +243 -194
- package/src/local-first/Relay.ts +91 -252
- package/src/local-first/Schema.ts +284 -394
- package/src/local-first/Shared.ts +932 -0
- package/src/local-first/Storage.ts +209 -282
- package/src/local-first/Timestamp.ts +38 -45
- package/src/local-first/index.ts +2 -16
- package/LICENSE +0 -21
- package/dist/src/Instances.d.ts +0 -34
- package/dist/src/Instances.d.ts.map +0 -1
- package/dist/src/Instances.js +0 -44
- package/dist/src/Resources.d.ts +0 -118
- package/dist/src/Resources.d.ts.map +0 -1
- package/dist/src/Resources.js +0 -197
- package/dist/src/local-first/Platform.d.ts +0 -25
- package/dist/src/local-first/Platform.d.ts.map +0 -1
- package/dist/src/local-first/Platform.js +0 -1
- package/dist/src/local-first/Public.d.ts +0 -22
- package/dist/src/local-first/Public.d.ts.map +0 -1
- package/dist/src/local-first/Public.js +0 -15
- package/dist/src/local-first/PublicKysely.d.ts +0 -148
- package/dist/src/local-first/PublicKysely.d.ts.map +0 -1
- package/dist/src/local-first/PublicKysely.js +0 -184
- package/dist/src/local-first/Sync.d.ts +0 -112
- package/dist/src/local-first/Sync.d.ts.map +0 -1
- package/dist/src/local-first/Sync.js +0 -529
- package/src/Instances.ts +0 -90
- package/src/Resources.ts +0 -367
- package/src/local-first/Platform.ts +0 -27
- package/src/local-first/Public.ts +0 -42
- package/src/local-first/PublicKysely.ts +0 -239
- package/src/local-first/Sync.ts +0 -960
|
@@ -1,25 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hybrid logical clock timestamps for CRDT ordering.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { bytesToHex } from "../Buffer.js";
|
|
2
7
|
import { createEqObject, eqNumber, eqString } from "../Eq.js";
|
|
3
8
|
import { increment } from "../Number.js";
|
|
4
9
|
import { orderUint8Array } from "../Order.js";
|
|
5
10
|
import { err, ok } from "../Result.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* This limit is enforced to prevent data corruption. If a device's clock
|
|
14
|
-
* exceeds this range, Evolu will stop saving data until the clock is
|
|
15
|
-
* corrected.
|
|
16
|
-
*
|
|
17
|
-
* `new Date(281474976710654).toString()` = Tue Aug 02 10889 07:31:49
|
|
18
|
-
*/
|
|
19
|
-
export const Millis = brand("Millis", lessThanOrEqualTo(281474976710655 - 1)(NonNegativeInt));
|
|
20
|
-
export const minMillis = 0;
|
|
21
|
-
export const maxMillis = (281474976710655 - 1);
|
|
22
|
-
export const Counter = brand("Counter", lessThanOrEqualTo(65535)(NonNegativeInt));
|
|
11
|
+
import { Millis, minMillis } from "../Time.js";
|
|
12
|
+
import { brand, length, lessThanOrEqualTo, NonNegativeInt, object, regex, String, Uint8Array, } from "../Type.js";
|
|
13
|
+
/** Default value for {@link TimestampConfig.maxDrift}. */
|
|
14
|
+
export const defaultTimestampMaxDrift = 5 * 60 * 1000;
|
|
15
|
+
export const Counter = /*#__PURE__*/ brand("Counter",
|
|
16
|
+
/*#__PURE__*/ lessThanOrEqualTo(65535)(NonNegativeInt));
|
|
23
17
|
export const minCounter = 0;
|
|
24
18
|
export const maxCounter = 65535;
|
|
25
19
|
/**
|
|
@@ -47,7 +41,7 @@ export const maxCounter = 65535;
|
|
|
47
41
|
* yet they will think they are synced. This is extremely rare and can be
|
|
48
42
|
* resolved by resetting one device to generate a new NodeId.
|
|
49
43
|
*/
|
|
50
|
-
export const NodeId = regex("NodeId", /^[a-f0-9]{16}$/)(String);
|
|
44
|
+
export const NodeId = /*#__PURE__*/ regex("NodeId", /^[a-f0-9]{16}$/)(String);
|
|
51
45
|
export const minNodeId = "0000000000000000";
|
|
52
46
|
export const maxNodeId = "ffffffffffffffff";
|
|
53
47
|
/**
|
|
@@ -56,7 +50,7 @@ export const maxNodeId = "ffffffffffffffff";
|
|
|
56
50
|
* Timestamps serve as globally unique, causally ordered identifiers for CRDT
|
|
57
51
|
* messages in Evolu's sync protocol.
|
|
58
52
|
*
|
|
59
|
-
*
|
|
53
|
+
* ## Why Hybrid Logical Clocks
|
|
60
54
|
*
|
|
61
55
|
* Evolu uses Hybrid Logical Clocks (HLC), which combine physical time (millis)
|
|
62
56
|
* with a logical counter. This hybrid approach preserves causality like logical
|
|
@@ -81,14 +75,14 @@ export const maxNodeId = "ffffffffffffffff";
|
|
|
81
75
|
* configuration protects against buggy clocks and prevents problematic
|
|
82
76
|
* future-dated entries from propagating through the network.
|
|
83
77
|
*
|
|
84
|
-
*
|
|
78
|
+
* ## References
|
|
85
79
|
*
|
|
86
80
|
* - https://muratbuffalo.blogspot.com/2014/07/hybrid-logical-clocks.html
|
|
87
81
|
* - https://sergeiturukin.com/2017/06/26/hybrid-logical-clocks.html
|
|
88
82
|
* - https://jaredforsyth.com/posts/hybrid-logical-clocks/
|
|
89
83
|
* - https://willowprotocol.org/more/timestamps_really/index.html
|
|
90
84
|
*
|
|
91
|
-
*
|
|
85
|
+
* ## Privacy Considerations
|
|
92
86
|
*
|
|
93
87
|
* Timestamps are metadata visible to relays and collaborators. While it can be
|
|
94
88
|
* considered a privacy leak, let us explain why it's necessary, and how to
|
|
@@ -105,14 +99,18 @@ export const maxNodeId = "ffffffffffffffff";
|
|
|
105
99
|
* 2. Periodically and randomly flush messages to sync tables
|
|
106
100
|
*
|
|
107
101
|
* **Trade-off:** It breaks real-time collaboration.
|
|
102
|
+
*
|
|
103
|
+
* Another technique is generating fake random activity (dummy messages) to mask
|
|
104
|
+
* real usage patterns. This preserves real-time collaboration but increases
|
|
105
|
+
* storage and bandwidth usage.
|
|
108
106
|
*/
|
|
109
|
-
export const Timestamp = object({
|
|
107
|
+
export const Timestamp = /*#__PURE__*/ object({
|
|
110
108
|
millis: Millis,
|
|
111
109
|
counter: Counter,
|
|
112
110
|
nodeId: NodeId,
|
|
113
111
|
});
|
|
114
112
|
/** Equality function for comparing {@link Timestamp}. */
|
|
115
|
-
export const eqTimestamp = createEqObject({
|
|
113
|
+
export const eqTimestamp = /*#__PURE__*/ createEqObject({
|
|
116
114
|
millis: eqNumber,
|
|
117
115
|
counter: eqNumber,
|
|
118
116
|
nodeId: eqString,
|
|
@@ -177,8 +175,9 @@ export const receiveTimestamp = (deps) => (local, remote) => {
|
|
|
177
175
|
});
|
|
178
176
|
};
|
|
179
177
|
/** Sortable bytes representation of {@link Timestamp}. */
|
|
180
|
-
export const TimestampBytes = brand("TimestampBytes",
|
|
181
|
-
|
|
178
|
+
export const TimestampBytes = /*#__PURE__*/ brand("TimestampBytes",
|
|
179
|
+
/*#__PURE__*/ length(16)(Uint8Array));
|
|
180
|
+
export const timestampBytesLength = /*#__PURE__*/ NonNegativeInt.orThrow(16);
|
|
182
181
|
export const timestampToTimestampBytes = (timestamp) => {
|
|
183
182
|
const { millis, counter, nodeId } = timestamp;
|
|
184
183
|
// 6 bytes for millis, 2 bytes for counter, 8 bytes for nodeId.
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal local-first modules re-exported from "@evolu/common/local-first"
|
|
3
|
-
*
|
|
4
|
-
* These exports expose the internal building blocks of Evolu's local-first
|
|
5
|
-
* implementation (Db, Relay, Sync, Query, Storage, Timestamp, etc.). They are
|
|
6
|
-
* primarily intended for use within Evolu packages and for advanced use-cases
|
|
7
|
-
* that require direct access to local-first internals.
|
|
8
|
-
*
|
|
9
|
-
* Public consumers should us top-level exports from `@evolu/common` unless you
|
|
10
|
-
* have a specific need to import these internals.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
1
|
export * from "./Db.js";
|
|
2
|
+
export * from "./Error.js";
|
|
15
3
|
export * from "./Evolu.js";
|
|
16
4
|
export * from "./Owner.js";
|
|
17
|
-
export * from "./Platform.js";
|
|
18
5
|
export * from "./Protocol.js";
|
|
19
6
|
export * from "./Query.js";
|
|
20
7
|
export * from "./Relay.js";
|
|
21
8
|
export * from "./Schema.js";
|
|
9
|
+
export * from "./Shared.js";
|
|
22
10
|
export * from "./Storage.js";
|
|
23
|
-
export * from "./Sync.js";
|
|
24
11
|
export * from "./Timestamp.js";
|
|
25
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/local-first/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/local-first/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal local-first modules re-exported from "@evolu/common/local-first"
|
|
3
|
-
*
|
|
4
|
-
* These exports expose the internal building blocks of Evolu's local-first
|
|
5
|
-
* implementation (Db, Relay, Sync, Query, Storage, Timestamp, etc.). They are
|
|
6
|
-
* primarily intended for use within Evolu packages and for advanced use-cases
|
|
7
|
-
* that require direct access to local-first internals.
|
|
8
|
-
*
|
|
9
|
-
* Public consumers should us top-level exports from `@evolu/common` unless you
|
|
10
|
-
* have a specific need to import these internals.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
1
|
export * from "./Db.js";
|
|
2
|
+
export * from "./Error.js";
|
|
15
3
|
export * from "./Evolu.js";
|
|
16
4
|
export * from "./Owner.js";
|
|
17
|
-
export * from "./Platform.js";
|
|
18
5
|
export * from "./Protocol.js";
|
|
19
6
|
export * from "./Query.js";
|
|
20
7
|
export * from "./Relay.js";
|
|
21
8
|
export * from "./Schema.js";
|
|
9
|
+
export * from "./Shared.js";
|
|
22
10
|
export * from "./Storage.js";
|
|
23
|
-
export * from "./Sync.js";
|
|
24
11
|
export * from "./Timestamp.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-next.0",
|
|
4
4
|
"description": "TypeScript library and local-first platform",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -23,15 +23,27 @@
|
|
|
23
23
|
"types": "./dist/src/index.d.ts",
|
|
24
24
|
"import": "./dist/src/index.js",
|
|
25
25
|
"browser": "./dist/src/index.js",
|
|
26
|
-
"react-native": "./dist/src/index.js"
|
|
26
|
+
"react-native": "./dist/src/index.js",
|
|
27
|
+
"default": "./dist/src/index.js"
|
|
27
28
|
},
|
|
28
29
|
"./local-first": {
|
|
29
30
|
"types": "./dist/src/local-first/index.d.ts",
|
|
30
|
-
"import": "./dist/src/local-first/index.js"
|
|
31
|
+
"import": "./dist/src/local-first/index.js",
|
|
32
|
+
"default": "./dist/src/local-first/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./polyfills": {
|
|
35
|
+
"types": "./dist/src/Polyfills.d.ts",
|
|
36
|
+
"import": "./dist/src/Polyfills.js",
|
|
37
|
+
"browser": "./dist/src/Polyfills.js",
|
|
38
|
+
"react-native": "./dist/src/Polyfills.js",
|
|
39
|
+
"default": "./dist/src/Polyfills.js"
|
|
31
40
|
}
|
|
32
41
|
},
|
|
33
42
|
"typesVersions": {
|
|
34
43
|
"*": {
|
|
44
|
+
"polyfills": [
|
|
45
|
+
"./dist/src/Polyfills.d.ts"
|
|
46
|
+
],
|
|
35
47
|
"local-first": [
|
|
36
48
|
"./dist/src/local-first/index.d.ts"
|
|
37
49
|
]
|
|
@@ -42,39 +54,37 @@
|
|
|
42
54
|
"src/**",
|
|
43
55
|
"README.md"
|
|
44
56
|
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc --build tsconfig.build.json",
|
|
59
|
+
"prepack": "npm run build",
|
|
60
|
+
"format": "prettier --write \"src/*.{ts,tsx,md}\""
|
|
61
|
+
},
|
|
45
62
|
"dependencies": {
|
|
46
|
-
"@noble/ciphers": "^2.
|
|
47
|
-
"@noble/hashes": "^2.0.
|
|
48
|
-
"@scure/bip39": "^2.0.
|
|
49
|
-
"kysely": "^0.28.
|
|
50
|
-
"msgpackr": "^1.11.
|
|
63
|
+
"@noble/ciphers": "^2.1.1",
|
|
64
|
+
"@noble/hashes": "^2.0.1",
|
|
65
|
+
"@scure/bip39": "^2.0.1",
|
|
66
|
+
"kysely": "^0.28.15",
|
|
67
|
+
"msgpackr": "^1.11.8",
|
|
51
68
|
"random": "^5.4.1"
|
|
52
69
|
},
|
|
53
70
|
"devDependencies": {
|
|
54
71
|
"@bokuweb/zstd-wasm": "0.0.27",
|
|
72
|
+
"@evolu/typescript-config": "*",
|
|
55
73
|
"@types/better-sqlite3": "^7.6.13",
|
|
56
74
|
"@types/ws": "^8.18.1",
|
|
57
|
-
"better-sqlite3": "^12.
|
|
58
|
-
"fast-check": "^4.
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
75
|
+
"better-sqlite3": "^12.6.2",
|
|
76
|
+
"fast-check": "^4.5.3",
|
|
77
|
+
"playwright": "^1.58.1",
|
|
78
|
+
"typescript": "^5.9.3",
|
|
79
|
+
"webpack": "^5.98.0",
|
|
80
|
+
"ws": "^8.19.0",
|
|
81
|
+
"zod": "^4.3.6"
|
|
63
82
|
},
|
|
64
83
|
"publishConfig": {
|
|
65
84
|
"access": "public"
|
|
66
85
|
},
|
|
67
86
|
"engines": {
|
|
68
|
-
"node": ">=
|
|
87
|
+
"node": ">=24.0.0"
|
|
69
88
|
},
|
|
70
|
-
"sideEffects":
|
|
71
|
-
|
|
72
|
-
"dev": "tsc --watch",
|
|
73
|
-
"build": "rimraf dist && tsc",
|
|
74
|
-
"test": "vitest run --disableConsoleIntercept",
|
|
75
|
-
"test:watch": "vitest --disableConsoleIntercept",
|
|
76
|
-
"clean": "rimraf .turbo node_modules dist",
|
|
77
|
-
"format": "prettier --write \"src/*.{ts,tsx,md}\"",
|
|
78
|
-
"bench": "vitest bench"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
89
|
+
"sideEffects": false
|
|
90
|
+
}
|