@evolu/common 8.0.0-next.4 → 8.0.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/dist/src/Array.d.ts +279 -173
- package/dist/src/Array.d.ts.map +1 -1
- package/dist/src/Array.js +105 -101
- package/dist/src/Assert.d.ts +44 -44
- package/dist/src/Assert.d.ts.map +1 -1
- package/dist/src/Assert.js +44 -32
- package/dist/src/BigInt.d.ts +6 -3
- package/dist/src/BigInt.d.ts.map +1 -1
- package/dist/src/BigInt.js +5 -2
- package/dist/src/Brand.d.ts +27 -40
- package/dist/src/Brand.d.ts.map +1 -1
- package/dist/src/Buffer.d.ts +27 -11
- package/dist/src/Buffer.d.ts.map +1 -1
- package/dist/src/Cache.d.ts +9 -4
- package/dist/src/Cache.d.ts.map +1 -1
- package/dist/src/Cache.js +8 -3
- package/dist/src/Callbacks.d.ts +30 -19
- package/dist/src/Callbacks.d.ts.map +1 -1
- package/dist/src/Console.d.ts +145 -66
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +91 -43
- package/dist/src/Crypto.d.ts +85 -42
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +44 -20
- package/dist/src/Eq.d.ts +87 -21
- package/dist/src/Eq.d.ts.map +1 -1
- package/dist/src/Eq.js +67 -19
- package/dist/src/Error.d.ts +5 -3
- package/dist/src/Error.d.ts.map +1 -1
- package/dist/src/Error.js +16 -0
- package/dist/src/Function.d.ts +119 -58
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Function.js +86 -43
- package/dist/src/Http.d.ts +394 -0
- package/dist/src/Http.d.ts.map +1 -0
- package/dist/src/Http.js +102 -0
- package/dist/src/Identicon.d.ts +16 -7
- package/dist/src/Identicon.d.ts.map +1 -1
- package/dist/src/Identicon.js +14 -5
- package/dist/src/LeakDetector.d.ts +88 -0
- package/dist/src/LeakDetector.d.ts.map +1 -0
- package/dist/src/LeakDetector.js +86 -0
- package/dist/src/LockManager.d.ts +18 -9
- package/dist/src/LockManager.d.ts.map +1 -1
- package/dist/src/LockManager.js +7 -8
- package/dist/src/Lookup.d.ts +43 -13
- package/dist/src/Lookup.d.ts.map +1 -1
- package/dist/src/Lookup.js +28 -8
- package/dist/src/Microtask.d.ts +1 -1
- package/dist/src/Microtask.d.ts.map +1 -1
- package/dist/src/Microtask.js +3 -7
- package/dist/src/Number.d.ts +49 -13
- package/dist/src/Number.d.ts.map +1 -1
- package/dist/src/Number.js +34 -5
- package/dist/src/Object.d.ts +160 -40
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +92 -46
- package/dist/src/Option.d.ts +10 -7
- package/dist/src/Option.d.ts.map +1 -1
- package/dist/src/Option.js +9 -6
- package/dist/src/Order.d.ts +21 -21
- package/dist/src/Order.d.ts.map +1 -1
- package/dist/src/Order.js +18 -21
- package/dist/src/Platform.d.ts +31 -0
- package/dist/src/Platform.d.ts.map +1 -1
- package/dist/src/Platform.js +98 -0
- package/dist/src/Random.d.ts +32 -17
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/Random.js +12 -8
- package/dist/src/Redacted.d.ts +43 -29
- package/dist/src/Redacted.d.ts.map +1 -1
- package/dist/src/Redacted.js +14 -3
- package/dist/src/Ref.d.ts +11 -3
- package/dist/src/Ref.d.ts.map +1 -1
- package/dist/src/Ref.js +2 -2
- package/dist/src/RefCount.d.ts +2 -6
- package/dist/src/RefCount.d.ts.map +1 -1
- package/dist/src/RefCount.js +33 -90
- package/dist/src/Relation.d.ts +70 -5
- package/dist/src/Relation.d.ts.map +1 -1
- package/dist/src/Relation.js +77 -2
- package/dist/src/Resource.d.ts +590 -155
- package/dist/src/Resource.d.ts.map +1 -1
- package/dist/src/Resource.js +592 -343
- package/dist/src/Result.d.ts +838 -191
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +163 -102
- package/dist/src/Schedule.d.ts +684 -231
- package/dist/src/Schedule.d.ts.map +1 -1
- package/dist/src/Schedule.js +766 -295
- package/dist/src/Set.d.ts +89 -40
- package/dist/src/Set.d.ts.map +1 -1
- package/dist/src/Set.js +50 -29
- package/dist/src/Sqlite.d.ts +29 -72
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +41 -46
- package/dist/src/StackTrace.d.ts +40 -0
- package/dist/src/StackTrace.d.ts.map +1 -0
- package/dist/src/StackTrace.js +140 -0
- package/dist/src/Store.d.ts +5 -4
- package/dist/src/Store.d.ts.map +1 -1
- package/dist/src/Store.js +5 -4
- package/dist/src/String.d.ts +7 -1
- package/dist/src/String.d.ts.map +1 -1
- package/dist/src/String.js +20 -7
- package/dist/src/Task.d.ts +3572 -1770
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +1879 -1274
- package/dist/src/Test.d.ts +17 -125
- package/dist/src/Test.d.ts.map +1 -1
- package/dist/src/Test.js +17 -68
- package/dist/src/Time.d.ts +108 -49
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +172 -73
- package/dist/src/Type.d.ts +3542 -1926
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +3070 -1784
- package/dist/src/Types.d.ts +200 -108
- package/dist/src/Types.d.ts.map +1 -1
- package/dist/src/Types.js +39 -8
- package/dist/src/WebSocket.d.ts +48 -23
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +15 -6
- package/dist/src/Worker.d.ts +94 -36
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +58 -24
- package/dist/src/index.d.ts +55 -52
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/intl/cs.d.ts +94 -0
- package/dist/src/intl/cs.d.ts.map +1 -0
- package/dist/src/intl/cs.js +220 -0
- package/dist/src/intl/index.d.ts +7 -0
- package/dist/src/intl/index.d.ts.map +1 -0
- package/dist/src/intl/index.js +6 -0
- package/dist/src/local-first/Db.d.ts +12 -8
- package/dist/src/local-first/Db.d.ts.map +1 -1
- package/dist/src/local-first/Db.js +109 -132
- package/dist/src/local-first/Error.d.ts +4 -4
- package/dist/src/local-first/Evolu.d.ts +338 -92
- package/dist/src/local-first/Evolu.d.ts.map +1 -1
- package/dist/src/local-first/Evolu.js +47 -55
- package/dist/src/local-first/LocalAuth.d.ts +4 -4
- package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
- package/dist/src/local-first/Owner.d.ts +61 -24
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +45 -8
- package/dist/src/local-first/Protocol.d.ts +44 -31
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +36 -13
- package/dist/src/local-first/Query.d.ts +147 -62
- package/dist/src/local-first/Query.d.ts.map +1 -1
- package/dist/src/local-first/Query.js +112 -58
- package/dist/src/local-first/Relay.d.ts +44 -14
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Schema.d.ts +92 -41
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Schema.js +25 -8
- package/dist/src/local-first/Shared.d.ts +23 -21
- package/dist/src/local-first/Shared.d.ts.map +1 -1
- package/dist/src/local-first/Shared.js +100 -57
- package/dist/src/local-first/Storage.d.ts +53 -32
- package/dist/src/local-first/Storage.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +194 -234
- package/dist/src/local-first/Timestamp.d.ts +21 -21
- package/dist/src/local-first/Timestamp.d.ts.map +1 -1
- package/dist/src/local-first/Timestamp.js +2 -2
- package/dist/src/local-first/index.d.ts +11 -11
- package/package.json +14 -13
- package/src/Array.ts +306 -205
- package/src/Assert.ts +54 -69
- package/src/BigInt.ts +6 -3
- package/src/Brand.ts +27 -40
- package/src/Buffer.ts +28 -12
- package/src/Cache.ts +9 -4
- package/src/Callbacks.ts +30 -19
- package/src/Console.ts +156 -84
- package/src/Crypto.ts +83 -41
- package/src/Eq.ts +95 -22
- package/src/Error.ts +8 -4
- package/src/Function.ts +167 -59
- package/src/Http.ts +549 -0
- package/src/Identicon.ts +16 -7
- package/src/LeakDetector.ts +182 -0
- package/src/LockManager.ts +43 -39
- package/src/Lookup.ts +62 -28
- package/src/Microtask.ts +19 -23
- package/src/Number.ts +64 -12
- package/src/Object.ts +173 -49
- package/src/Option.ts +10 -7
- package/src/Order.ts +23 -21
- package/src/Platform.ts +136 -0
- package/src/Polyfills.ts +6 -12
- package/src/Random.ts +32 -19
- package/src/Redacted.ts +44 -30
- package/src/Ref.ts +14 -6
- package/src/RefCount.ts +38 -80
- package/src/Relation.ts +202 -10
- package/src/Resource.ts +1199 -591
- package/src/Result.ts +930 -271
- package/src/Schedule.ts +859 -343
- package/src/Set.ts +89 -40
- package/src/Sqlite.ts +144 -138
- package/src/StackTrace.ts +230 -0
- package/src/Store.ts +8 -7
- package/src/String.ts +22 -5
- package/src/Task.ts +5101 -2832
- package/src/Test.ts +20 -168
- package/src/Time.ts +293 -90
- package/src/Type.ts +10034 -4117
- package/src/Types.ts +227 -110
- package/src/WebSocket.ts +64 -36
- package/src/Worker.ts +180 -72
- package/src/index.ts +55 -52
- package/src/intl/cs.ts +388 -0
- package/src/intl/index.ts +7 -0
- package/src/local-first/Db.ts +152 -179
- package/src/local-first/Error.ts +4 -4
- package/src/local-first/Evolu.ts +495 -250
- package/src/local-first/LocalAuth.ts +6 -12
- package/src/local-first/Owner.ts +58 -21
- package/src/local-first/Protocol.ts +49 -31
- package/src/local-first/Query.ts +146 -61
- package/src/local-first/Relay.ts +51 -21
- package/src/local-first/Schema.ts +109 -51
- package/src/local-first/Shared.ts +266 -226
- package/src/local-first/Storage.ts +266 -264
- package/src/local-first/Timestamp.ts +25 -18
- package/src/local-first/index.ts +11 -11
- package/dist/src/Skiplist.d.ts +0 -28
- package/dist/src/Skiplist.d.ts.map +0 -1
- package/dist/src/Skiplist.js +0 -64
- package/dist/src/Tracer.d.ts +0 -48
- package/dist/src/Tracer.d.ts.map +0 -1
- package/dist/src/Tracer.js +0 -6
- package/src/Skiplist.ts +0 -108
- package/src/Tracer.ts +0 -54
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { RandomBytesDep } from "../Crypto.
|
|
7
|
-
import type { Order } from "../Order.
|
|
8
|
-
import type { Result } from "../Result.
|
|
9
|
-
import type { TimeDep } from "../Time.
|
|
10
|
-
import { Millis } from "../Time.
|
|
11
|
-
import type
|
|
6
|
+
import type { RandomBytesDep } from "../Crypto.ts";
|
|
7
|
+
import type { Order } from "../Order.ts";
|
|
8
|
+
import type { Result } from "../Result.ts";
|
|
9
|
+
import type { TimeDep } from "../Time.ts";
|
|
10
|
+
import { Millis } from "../Time.ts";
|
|
11
|
+
import { type DateIso, type InferType, type ObjectType, type Typed } from "../Type.ts";
|
|
12
12
|
export interface TimestampConfig {
|
|
13
13
|
/**
|
|
14
14
|
* Maximum physical clock drift allowed in ms.
|
|
@@ -31,8 +31,8 @@ export interface TimestampCounterOverflowError extends Typed<"TimestampCounterOv
|
|
|
31
31
|
}
|
|
32
32
|
export interface TimestampTimeOutOfRangeError extends Typed<"TimestampTimeOutOfRangeError"> {
|
|
33
33
|
}
|
|
34
|
-
export declare const Counter: import("../Type.
|
|
35
|
-
export type Counter = typeof Counter.
|
|
34
|
+
export declare const Counter: import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").Type<"Number", number, number, import("../Type.ts").TypeOfError<"Number">, null, import("../Type.ts").TypeOfError<"Number">, never, number, true>, "NonNaN", import("../Type.ts").NonNaNError>, "Finite", import("../Type.ts").FiniteError>, "Int", import("../Type.ts").IntError>, "NonNegative", import("../Type.ts").NonNegativeError>, "LessThanOrEqualTo65535", import("../Type.ts").LessThanOrEqualToError<65535>>, "Counter", never>;
|
|
35
|
+
export type Counter = typeof Counter.Output;
|
|
36
36
|
export declare const minCounter: Counter;
|
|
37
37
|
export declare const maxCounter: Counter;
|
|
38
38
|
/**
|
|
@@ -60,8 +60,8 @@ export declare const maxCounter: Counter;
|
|
|
60
60
|
* yet they will think they are synced. This is extremely rare and can be
|
|
61
61
|
* resolved by resetting one device to generate a new NodeId.
|
|
62
62
|
*/
|
|
63
|
-
export declare const NodeId: import("../Type.
|
|
64
|
-
export type NodeId = typeof NodeId.
|
|
63
|
+
export declare const NodeId: import("../Type.ts").BrandType<import("../Type.ts").Type<"String", string, string, import("../Type.ts").TypeOfError<"String">, null, import("../Type.ts").TypeOfError<"String">, never, string, true>, "NodeId", import("../Type.ts").RegexError<"NodeId">>;
|
|
64
|
+
export type NodeId = typeof NodeId.Output;
|
|
65
65
|
export declare const minNodeId: NodeId;
|
|
66
66
|
export declare const maxNodeId: NodeId;
|
|
67
67
|
/**
|
|
@@ -124,27 +124,27 @@ export declare const maxNodeId: NodeId;
|
|
|
124
124
|
* real usage patterns. This preserves real-time collaboration but increases
|
|
125
125
|
* storage and bandwidth usage.
|
|
126
126
|
*/
|
|
127
|
-
export declare const Timestamp:
|
|
128
|
-
millis:
|
|
129
|
-
counter:
|
|
130
|
-
nodeId:
|
|
127
|
+
export declare const Timestamp: ObjectType<{
|
|
128
|
+
readonly millis: typeof Millis;
|
|
129
|
+
readonly counter: typeof Counter;
|
|
130
|
+
readonly nodeId: typeof NodeId;
|
|
131
131
|
}>;
|
|
132
132
|
export interface Timestamp extends InferType<typeof Timestamp> {
|
|
133
133
|
}
|
|
134
134
|
/** Equality function for comparing {@link Timestamp}. */
|
|
135
|
-
export declare const eqTimestamp: import("../Eq.
|
|
136
|
-
readonly
|
|
137
|
-
readonly
|
|
138
|
-
readonly nodeId: string & import("../Brand.
|
|
135
|
+
export declare const eqTimestamp: import("../Eq.ts").Eq<{
|
|
136
|
+
readonly counter: number & import("../Brand.ts").Brand<"NonNaN"> & import("../Brand.ts").Brand<"Finite"> & import("../Brand.ts").Brand<"Int"> & import("../Brand.ts").Brand<"NonNegative"> & import("../Brand.ts").Brand<"LessThanOrEqualTo65535"> & import("../Brand.ts").Brand<"Counter">;
|
|
137
|
+
readonly millis: number & import("../Brand.ts").Brand<"NonNaN"> & import("../Brand.ts").Brand<"Finite"> & import("../Brand.ts").Brand<"Int"> & import("../Brand.ts").Brand<"NonNegative"> & import("../Brand.ts").Brand<"LessThan281474976710655"> & import("../Brand.ts").Brand<"Millis">;
|
|
138
|
+
readonly nodeId: string & import("../Brand.ts").Brand<"NodeId">;
|
|
139
139
|
}>;
|
|
140
140
|
export declare const createTimestamp: ({ millis, counter, nodeId, }?: Partial<Timestamp>) => Timestamp;
|
|
141
141
|
export declare const createInitialTimestamp: (deps: RandomBytesDep) => Timestamp;
|
|
142
142
|
export declare const sendTimestamp: (deps: TimeDep & TimestampConfigDep) => (timestamp: Timestamp) => Result<Timestamp, TimestampDriftError | TimestampCounterOverflowError | TimestampTimeOutOfRangeError>;
|
|
143
143
|
export declare const receiveTimestamp: (deps: TimeDep & TimestampConfigDep) => (local: Timestamp, remote: Timestamp) => Result<Timestamp, TimestampDriftError | TimestampCounterOverflowError | TimestampTimeOutOfRangeError>;
|
|
144
144
|
/** Sortable bytes representation of {@link Timestamp}. */
|
|
145
|
-
export declare const TimestampBytes: import("../Type.
|
|
146
|
-
export type TimestampBytes = typeof TimestampBytes.
|
|
147
|
-
export declare const timestampBytesLength: number & import("../Brand.
|
|
145
|
+
export declare const TimestampBytes: import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").Type<"Uint8Array", Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, import("../Type.ts").ObjectTagError<"Uint8Array">, null, import("../Type.ts").ObjectTagError<"Uint8Array">, never, Uint8Array<ArrayBufferLike>, true>, "Length16", import("../Type.ts").LengthError<16>>, "TimestampBytes", never>;
|
|
146
|
+
export type TimestampBytes = typeof TimestampBytes.Output;
|
|
147
|
+
export declare const timestampBytesLength: number & import("../Brand.ts").Brand<"NonNaN"> & import("../Brand.ts").Brand<"Finite"> & import("../Brand.ts").Brand<"Int"> & import("../Brand.ts").Brand<"NonNegative">;
|
|
148
148
|
export declare const timestampToTimestampBytes: (timestamp: Timestamp) => TimestampBytes;
|
|
149
149
|
export declare const timestampBytesToTimestamp: (timestamp: TimestampBytes) => Timestamp;
|
|
150
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timestamp.d.ts","sourceRoot":"","sources":["../../../src/local-first/Timestamp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAa,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Timestamp.d.ts","sourceRoot":"","sources":["../../../src/local-first/Timestamp.ts"],"names":[],"mappings":"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"}
|
|
@@ -121,7 +121,7 @@ export const createInitialTimestamp = (deps) => {
|
|
|
121
121
|
return createTimestamp({ nodeId });
|
|
122
122
|
};
|
|
123
123
|
const getNextMillis = (deps) => (millis) => {
|
|
124
|
-
const now = Millis.
|
|
124
|
+
const now = Millis.fromUnknown(deps.time.now());
|
|
125
125
|
if (!now.ok) {
|
|
126
126
|
return err({ type: "TimestampTimeOutOfRangeError" });
|
|
127
127
|
}
|
|
@@ -135,7 +135,7 @@ const getNextMillis = (deps) => (millis) => {
|
|
|
135
135
|
: ok(next);
|
|
136
136
|
};
|
|
137
137
|
const incrementCounter = (counter) => {
|
|
138
|
-
const next = Counter.
|
|
138
|
+
const next = Counter.fromUnknown(increment(counter));
|
|
139
139
|
if (!next.ok)
|
|
140
140
|
return err({ type: "TimestampCounterOverflowError" });
|
|
141
141
|
return ok(next.value);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./Db.
|
|
2
|
-
export * from "./Error.
|
|
3
|
-
export * from "./Evolu.
|
|
4
|
-
export * from "./Owner.
|
|
5
|
-
export * from "./Protocol.
|
|
6
|
-
export * from "./Query.
|
|
7
|
-
export * from "./Relay.
|
|
8
|
-
export * from "./Schema.
|
|
9
|
-
export * from "./Shared.
|
|
10
|
-
export * from "./Storage.
|
|
11
|
-
export * from "./Timestamp.
|
|
1
|
+
export * from "./Db.ts";
|
|
2
|
+
export * from "./Error.ts";
|
|
3
|
+
export * from "./Evolu.ts";
|
|
4
|
+
export * from "./Owner.ts";
|
|
5
|
+
export * from "./Protocol.ts";
|
|
6
|
+
export * from "./Query.ts";
|
|
7
|
+
export * from "./Relay.ts";
|
|
8
|
+
export * from "./Schema.ts";
|
|
9
|
+
export * from "./Shared.ts";
|
|
10
|
+
export * from "./Storage.ts";
|
|
11
|
+
export * from "./Timestamp.ts";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/common",
|
|
3
|
-
"version": "8.0.0
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "TypeScript library and local-first platform",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"react-native": "./dist/src/index.js",
|
|
30
30
|
"default": "./dist/src/index.js"
|
|
31
31
|
},
|
|
32
|
+
"./intl": {
|
|
33
|
+
"types": "./dist/src/intl/index.d.ts",
|
|
34
|
+
"import": "./dist/src/intl/index.js",
|
|
35
|
+
"default": "./dist/src/intl/index.js"
|
|
36
|
+
},
|
|
32
37
|
"./local-first": {
|
|
33
38
|
"types": "./dist/src/local-first/index.d.ts",
|
|
34
39
|
"import": "./dist/src/local-first/index.js",
|
|
@@ -47,6 +52,9 @@
|
|
|
47
52
|
"polyfills": [
|
|
48
53
|
"./dist/src/Polyfills.d.ts"
|
|
49
54
|
],
|
|
55
|
+
"intl": [
|
|
56
|
+
"./dist/src/intl/index.d.ts"
|
|
57
|
+
],
|
|
50
58
|
"local-first": [
|
|
51
59
|
"./dist/src/local-first/index.d.ts"
|
|
52
60
|
]
|
|
@@ -61,22 +69,15 @@
|
|
|
61
69
|
"@noble/ciphers": "^2.1.1",
|
|
62
70
|
"@noble/hashes": "^2.0.1",
|
|
63
71
|
"@scure/bip39": "^2.0.1",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
72
|
+
"@standard-schema/spec": "^1.1.0",
|
|
73
|
+
"kysely": "^0.29.4",
|
|
74
|
+
"msgpackr": "^2.0.5",
|
|
66
75
|
"random": "^5.4.1"
|
|
67
76
|
},
|
|
68
77
|
"devDependencies": {
|
|
69
|
-
"@bokuweb/zstd-wasm": "0.0.27",
|
|
70
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
71
78
|
"@types/node": "^24.10.9",
|
|
72
|
-
"@
|
|
73
|
-
"
|
|
74
|
-
"fast-check": "^4.5.3",
|
|
75
|
-
"playwright": "^1.58.1",
|
|
76
|
-
"typescript": "^6",
|
|
77
|
-
"webpack": "^5.98.0",
|
|
78
|
-
"ws": "^8.19.0",
|
|
79
|
-
"zod": "^4.3.6",
|
|
79
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
80
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
80
81
|
"@evolu/typescript-config": "0.0.2"
|
|
81
82
|
},
|
|
82
83
|
"publishConfig": {
|