@evolu/react-native 5.0.4 → 6.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/PlatformLive.d.ts +1 -2
- package/dist/PlatformLive.d.ts.map +1 -1
- package/dist/PlatformLive.js +1 -3
- package/dist/SqliteLive.d.ts.map +1 -1
- package/dist/SqliteLive.js +13 -12
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -16
- package/package.json +9 -9
- package/src/PlatformLive.ts +0 -4
- package/src/SqliteLive.ts +20 -14
- package/src/index.ts +29 -54
package/dist/PlatformLive.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AppState, Bip39,
|
|
1
|
+
import { AppState, Bip39, PlatformName, SyncLock } from "@evolu/common";
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
3
|
export declare const PlatformNameLive: Layer.Layer<PlatformName, never, never>;
|
|
4
|
-
export declare const FlushSyncLive: Layer.Layer<FlushSync, never, never>;
|
|
5
4
|
export declare const SyncLockLive: Layer.Layer<SyncLock, never, never>;
|
|
6
5
|
export declare const AppStateLive: Layer.Layer<AppState, never, never>;
|
|
7
6
|
export declare const Bip39Live: Layer.Layer<Bip39, never, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformLive.d.ts","sourceRoot":"","sources":["../src/PlatformLive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,
|
|
1
|
+
{"version":3,"file":"PlatformLive.d.ts","sourceRoot":"","sources":["../src/PlatformLive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,EAGL,YAAY,EACZ,QAAQ,EACT,MAAM,eAAe,CAAC;AASvB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,eAAO,MAAM,gBAAgB,yCAA8C,CAAC;AAE5E,eAAO,MAAM,YAAY,qCAexB,CAAC;AAEF,eAAO,MAAM,YAAY,qCA4BxB,CAAC;AAEF,eAAO,MAAM,SAAS,kCAYrB,CAAC"}
|
package/dist/PlatformLive.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { AppState, Bip39,
|
|
1
|
+
import { AppState, Bip39, PlatformName, SyncLock, } from "@evolu/common";
|
|
2
2
|
import NetInfo from "@react-native-community/netinfo";
|
|
3
3
|
import { generateMnemonic, mnemonicToSeed, validateMnemonic, } from "@scure/bip39";
|
|
4
4
|
import { wordlist } from "@scure/bip39/wordlists/english";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
|
-
import * as Function from "effect/Function";
|
|
7
6
|
import * as Layer from "effect/Layer";
|
|
8
7
|
import { reloadAsync } from "expo-updates";
|
|
9
8
|
import { DevSettings, AppState as ReactNativeAppState } from "react-native";
|
|
10
9
|
export const PlatformNameLive = Layer.succeed(PlatformName, "react-native");
|
|
11
|
-
export const FlushSyncLive = Layer.succeed(FlushSync, Function.constVoid);
|
|
12
10
|
export const SyncLockLive = Layer.effect(SyncLock, Effect.sync(() => {
|
|
13
11
|
let hasSyncLock = false;
|
|
14
12
|
return SyncLock.of({
|
package/dist/SqliteLive.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqliteLive.d.ts","sourceRoot":"","sources":["../src/SqliteLive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"SqliteLive.d.ts","sourceRoot":"","sources":["../src/SqliteLive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAKP,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAgCtC,eAAO,MAAM,UAAU,mCAAkC,CAAC"}
|
package/dist/SqliteLive.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { Sqlite, ensureSqliteQuery, maybeParseJson, valuesToSqliteValues, } from "@evolu/common";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as SQLite from "expo-sqlite";
|
|
5
|
-
const db = SQLite.
|
|
4
|
+
import * as SQLite from "expo-sqlite/next.js";
|
|
5
|
+
const db = SQLite.openDatabaseSync("evolu1.db");
|
|
6
6
|
const exec = (arg) => Effect.gen(function* (_) {
|
|
7
7
|
const sqliteQuery = ensureSqliteQuery(arg);
|
|
8
8
|
const query = {
|
|
9
9
|
sql: sqliteQuery.sql,
|
|
10
10
|
args: valuesToSqliteValues(sqliteQuery.parameters),
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
const isSelectOrPragma = query.sql.trimStart().toLowerCase().startsWith("select") ||
|
|
13
|
+
query.sql.trimStart().toLowerCase().startsWith("pragma");
|
|
14
|
+
// Expo can log only strings.
|
|
15
|
+
// console.log(JSON.stringify(isSelect), sql);
|
|
16
|
+
if (isSelectOrPragma) {
|
|
17
|
+
const rows = (yield* _(Effect.promise(() => db.getAllAsync(query.sql, query.args))));
|
|
18
|
+
maybeParseJson(rows);
|
|
19
|
+
return { rows, changes: 0 };
|
|
20
|
+
}
|
|
21
|
+
const { changes } = yield* _(Effect.promise(() => db.runAsync(query.sql, query.args)));
|
|
22
|
+
return { rows: [], changes };
|
|
22
23
|
});
|
|
23
24
|
export const SqliteLive = Layer.succeed(Sqlite, { exec });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { InvalidMnemonicError, Mnemonic } from "@evolu/common";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export * from "@evolu/common-react";
|
|
3
|
+
export * from "@evolu/common/public";
|
|
4
|
+
/** Parse a string to {@link Mnemonic}. */
|
|
5
|
+
export declare const parseMnemonic: (mnemonic: string) => Effect.Effect<Mnemonic, InvalidMnemonicError>;
|
|
7
6
|
/**
|
|
8
7
|
* Create Evolu for React Native.
|
|
9
8
|
*
|
|
@@ -21,13 +20,13 @@ export * from "@evolu/common-react";
|
|
|
21
20
|
* const TodoId = id("Todo");
|
|
22
21
|
* type TodoId = S.Schema.To<typeof TodoId>;
|
|
23
22
|
*
|
|
24
|
-
* const TodoTable =
|
|
23
|
+
* const TodoTable = table({
|
|
25
24
|
* id: TodoId,
|
|
26
25
|
* title: NonEmptyString1000,
|
|
27
26
|
* });
|
|
28
27
|
* type TodoTable = S.Schema.To<typeof TodoTable>;
|
|
29
28
|
*
|
|
30
|
-
* const Database =
|
|
29
|
+
* const Database = database({
|
|
31
30
|
* // _todo is local-only table
|
|
32
31
|
* todo: TodoTable,
|
|
33
32
|
* });
|
|
@@ -36,6 +35,5 @@ export * from "@evolu/common-react";
|
|
|
36
35
|
* const evolu = createEvolu(Database);
|
|
37
36
|
*/
|
|
38
37
|
export declare const createEvolu: <From, To extends import("@evolu/common").DatabaseSchema>(schema: import("@effect/schema/Schema").Schema<To, From, never>, config?: Partial<import("@evolu/common").Config> | undefined) => import("@evolu/common").Evolu<To>;
|
|
39
|
-
|
|
40
|
-
export declare const parseMnemonic: (mnemonic: string) => Effect.Effect<Mnemonic, InvalidMnemonicError>;
|
|
38
|
+
export * from "@evolu/common-react";
|
|
41
39
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,oBAAoB,EACpB,QAAQ,EAKT,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAUxC,cAAc,sBAAsB,CAAC;AAErC,0CAA0C;AAC1C,eAAO,MAAM,aAAa,EAAE,CAC1B,QAAQ,EAAE,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,oBAAoB,CAG1C,CAAC;AAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,WAAW,+NAevB,CAAC;AAEF,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { Bip39, DbWorkerLive, EvoluCommonLive, FetchLive, NanoIdLive, SecretBoxLive, SyncWorkerLive, makeCreateEvolu, } from "@evolu/common";
|
|
1
|
+
import { Bip39, DbWorkerLive, EvoluCommonLive, FetchLive, FlushSyncDefaultLive, NanoIdLive, SecretBoxLive, SyncWorkerLive, makeCreateEvolu, } from "@evolu/common";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
|
-
import { AppStateLive, Bip39Live,
|
|
4
|
+
import { AppStateLive, Bip39Live, PlatformNameLive, SyncLockLive, } from "./PlatformLive.js";
|
|
5
5
|
import { SqliteLive } from "./SqliteLive.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// TODO: Recheck after RN 0.73 release.
|
|
10
|
-
export { Id, NonEmptyString1000, PositiveInt, SqliteBoolean, SqliteDate, String, String1000, canUseDom, cast, database, id, table, } from "@evolu/common";
|
|
11
|
-
export { jsonArrayFrom, jsonObjectFrom } from "kysely/helpers/sqlite";
|
|
12
|
-
export * from "@evolu/common-react";
|
|
13
|
-
/** Evolu for native platform. */
|
|
14
|
-
const EvoluNativeLive = EvoluCommonLive.pipe(Layer.provide(Layer.mergeAll(FlushSyncLive, AppStateLive, DbWorkerLive)), Layer.provide(Layer.mergeAll(Bip39Live, NanoIdLive, SqliteLive, SyncWorkerLive)), Layer.provide(Layer.mergeAll(SecretBoxLive, SyncLockLive, FetchLive)));
|
|
6
|
+
export * from "@evolu/common/public";
|
|
7
|
+
/** Parse a string to {@link Mnemonic}. */
|
|
8
|
+
export const parseMnemonic = Bip39.pipe(Effect.provide(Bip39Live), Effect.runSync).parse;
|
|
15
9
|
/**
|
|
16
10
|
* Create Evolu for React Native.
|
|
17
11
|
*
|
|
@@ -29,13 +23,13 @@ const EvoluNativeLive = EvoluCommonLive.pipe(Layer.provide(Layer.mergeAll(FlushS
|
|
|
29
23
|
* const TodoId = id("Todo");
|
|
30
24
|
* type TodoId = S.Schema.To<typeof TodoId>;
|
|
31
25
|
*
|
|
32
|
-
* const TodoTable =
|
|
26
|
+
* const TodoTable = table({
|
|
33
27
|
* id: TodoId,
|
|
34
28
|
* title: NonEmptyString1000,
|
|
35
29
|
* });
|
|
36
30
|
* type TodoTable = S.Schema.To<typeof TodoTable>;
|
|
37
31
|
*
|
|
38
|
-
* const Database =
|
|
32
|
+
* const Database = database({
|
|
39
33
|
* // _todo is local-only table
|
|
40
34
|
* todo: TodoTable,
|
|
41
35
|
* });
|
|
@@ -43,6 +37,5 @@ const EvoluNativeLive = EvoluCommonLive.pipe(Layer.provide(Layer.mergeAll(FlushS
|
|
|
43
37
|
*
|
|
44
38
|
* const evolu = createEvolu(Database);
|
|
45
39
|
*/
|
|
46
|
-
export const createEvolu = makeCreateEvolu(
|
|
47
|
-
|
|
48
|
-
export const parseMnemonic = Bip39.pipe(Effect.provide(Bip39Live), Effect.runSync).parse;
|
|
40
|
+
export const createEvolu = makeCreateEvolu(EvoluCommonLive.pipe(Layer.provide(Layer.mergeAll(FlushSyncDefaultLive, AppStateLive, DbWorkerLive, PlatformNameLive)), Layer.provide(Layer.mergeAll(Bip39Live, NanoIdLive, SqliteLive, SyncWorkerLive)), Layer.provide(Layer.mergeAll(SecretBoxLive, SyncLockLive, FetchLive))));
|
|
41
|
+
export * from "@evolu/common-react";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Evolu for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"expo-updates": "^0.
|
|
34
|
+
"expo-updates": "^0.24.11"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"eslint": "^8.
|
|
38
|
-
"expo": "^
|
|
39
|
-
"expo-sqlite": "~
|
|
40
|
-
"react-native": "0.
|
|
37
|
+
"eslint": "^8.57.0",
|
|
38
|
+
"expo": "^50.0.7",
|
|
39
|
+
"expo-sqlite": "~13.2.2",
|
|
40
|
+
"react-native": "0.73.4",
|
|
41
41
|
"typescript": "^5.3.3",
|
|
42
42
|
"vitest": "^1.3.1",
|
|
43
|
-
"@evolu/common": "3.1.
|
|
44
|
-
"@evolu/common-react": "5.0.
|
|
43
|
+
"@evolu/common": "3.1.7",
|
|
44
|
+
"@evolu/common-react": "5.0.5",
|
|
45
45
|
"@evolu/tsconfig": "0.0.2",
|
|
46
46
|
"eslint-config-evolu": "1.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@evolu/common-react": "^5.0.
|
|
49
|
+
"@evolu/common-react": "^5.0.5",
|
|
50
50
|
"expo": "^49.0.20",
|
|
51
51
|
"expo-sqlite": "~11.3.3",
|
|
52
52
|
"react-native": "^0.72.4"
|
package/src/PlatformLive.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppState,
|
|
3
3
|
Bip39,
|
|
4
|
-
FlushSync,
|
|
5
4
|
InvalidMnemonicError,
|
|
6
5
|
Mnemonic,
|
|
7
6
|
PlatformName,
|
|
@@ -15,15 +14,12 @@ import {
|
|
|
15
14
|
} from "@scure/bip39";
|
|
16
15
|
import { wordlist } from "@scure/bip39/wordlists/english";
|
|
17
16
|
import * as Effect from "effect/Effect";
|
|
18
|
-
import * as Function from "effect/Function";
|
|
19
17
|
import * as Layer from "effect/Layer";
|
|
20
18
|
import { reloadAsync } from "expo-updates";
|
|
21
19
|
import { DevSettings, AppState as ReactNativeAppState } from "react-native";
|
|
22
20
|
|
|
23
21
|
export const PlatformNameLive = Layer.succeed(PlatformName, "react-native");
|
|
24
22
|
|
|
25
|
-
export const FlushSyncLive = Layer.succeed(FlushSync, Function.constVoid);
|
|
26
|
-
|
|
27
23
|
export const SyncLockLive = Layer.effect(
|
|
28
24
|
SyncLock,
|
|
29
25
|
Effect.sync(() => {
|
package/src/SqliteLive.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Sqlite,
|
|
3
|
+
SqliteRow,
|
|
3
4
|
ensureSqliteQuery,
|
|
4
5
|
maybeParseJson,
|
|
5
6
|
valuesToSqliteValues,
|
|
6
7
|
} from "@evolu/common";
|
|
7
8
|
import * as Effect from "effect/Effect";
|
|
8
9
|
import * as Layer from "effect/Layer";
|
|
9
|
-
import * as SQLite from "expo-sqlite";
|
|
10
|
+
import * as SQLite from "expo-sqlite/next.js";
|
|
10
11
|
|
|
11
|
-
const db = SQLite.
|
|
12
|
+
const db = SQLite.openDatabaseSync("evolu1.db");
|
|
12
13
|
|
|
13
14
|
const exec: Sqlite["exec"] = (arg) =>
|
|
14
15
|
Effect.gen(function* (_) {
|
|
@@ -17,19 +18,24 @@ const exec: Sqlite["exec"] = (arg) =>
|
|
|
17
18
|
sql: sqliteQuery.sql,
|
|
18
19
|
args: valuesToSqliteValues(sqliteQuery.parameters),
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
|
|
22
|
+
const isSelectOrPragma =
|
|
23
|
+
query.sql.trimStart().toLowerCase().startsWith("select") ||
|
|
24
|
+
query.sql.trimStart().toLowerCase().startsWith("pragma");
|
|
25
|
+
// Expo can log only strings.
|
|
26
|
+
// console.log(JSON.stringify(isSelect), sql);
|
|
27
|
+
|
|
28
|
+
if (isSelectOrPragma) {
|
|
29
|
+
const rows = (yield* _(
|
|
30
|
+
Effect.promise(() => db.getAllAsync(query.sql, query.args)),
|
|
31
|
+
)) as SqliteRow[];
|
|
32
|
+
maybeParseJson(rows);
|
|
33
|
+
return { rows, changes: 0 };
|
|
34
|
+
}
|
|
35
|
+
const { changes } = yield* _(
|
|
36
|
+
Effect.promise(() => db.runAsync(query.sql, query.args)),
|
|
30
37
|
);
|
|
31
|
-
|
|
32
|
-
return { rows, changes: rowsAffected };
|
|
38
|
+
return { rows: [], changes };
|
|
33
39
|
});
|
|
34
40
|
|
|
35
41
|
export const SqliteLive = Layer.succeed(Sqlite, { exec });
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
DbWorkerLive,
|
|
4
4
|
EvoluCommonLive,
|
|
5
5
|
FetchLive,
|
|
6
|
+
FlushSyncDefaultLive,
|
|
6
7
|
InvalidMnemonicError,
|
|
7
8
|
Mnemonic,
|
|
8
9
|
NanoIdLive,
|
|
@@ -15,55 +16,20 @@ import * as Layer from "effect/Layer";
|
|
|
15
16
|
import {
|
|
16
17
|
AppStateLive,
|
|
17
18
|
Bip39Live,
|
|
18
|
-
|
|
19
|
+
PlatformNameLive,
|
|
19
20
|
SyncLockLive,
|
|
20
21
|
} from "./PlatformLive.js";
|
|
21
22
|
import { SqliteLive } from "./SqliteLive.js";
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
// https://github.com/facebook/metro/issues/1128
|
|
25
|
-
// So we have to export manually.
|
|
26
|
-
// TODO: Recheck after RN 0.73 release.
|
|
27
|
-
export {
|
|
28
|
-
Id,
|
|
29
|
-
NonEmptyString1000,
|
|
30
|
-
PositiveInt,
|
|
31
|
-
SqliteBoolean,
|
|
32
|
-
SqliteDate,
|
|
33
|
-
String,
|
|
34
|
-
String1000,
|
|
35
|
-
canUseDom,
|
|
36
|
-
cast,
|
|
37
|
-
database,
|
|
38
|
-
id,
|
|
39
|
-
table,
|
|
40
|
-
} from "@evolu/common";
|
|
41
|
-
export type {
|
|
42
|
-
EvoluError,
|
|
43
|
-
ExtractRow,
|
|
44
|
-
InvalidMnemonicError,
|
|
45
|
-
Mnemonic,
|
|
46
|
-
NotNull,
|
|
47
|
-
Owner,
|
|
48
|
-
OwnerId,
|
|
49
|
-
QueryResult,
|
|
50
|
-
SyncState,
|
|
51
|
-
Timestamp,
|
|
52
|
-
TimestampError,
|
|
53
|
-
UnexpectedError,
|
|
54
|
-
} from "@evolu/common";
|
|
55
|
-
export { jsonArrayFrom, jsonObjectFrom } from "kysely/helpers/sqlite";
|
|
24
|
+
export * from "@evolu/common/public";
|
|
56
25
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
),
|
|
65
|
-
Layer.provide(Layer.mergeAll(SecretBoxLive, SyncLockLive, FetchLive)),
|
|
66
|
-
);
|
|
26
|
+
/** Parse a string to {@link Mnemonic}. */
|
|
27
|
+
export const parseMnemonic: (
|
|
28
|
+
mnemonic: string,
|
|
29
|
+
) => Effect.Effect<Mnemonic, InvalidMnemonicError> = Bip39.pipe(
|
|
30
|
+
Effect.provide(Bip39Live),
|
|
31
|
+
Effect.runSync,
|
|
32
|
+
).parse;
|
|
67
33
|
|
|
68
34
|
/**
|
|
69
35
|
* Create Evolu for React Native.
|
|
@@ -82,13 +48,13 @@ const EvoluNativeLive = EvoluCommonLive.pipe(
|
|
|
82
48
|
* const TodoId = id("Todo");
|
|
83
49
|
* type TodoId = S.Schema.To<typeof TodoId>;
|
|
84
50
|
*
|
|
85
|
-
* const TodoTable =
|
|
51
|
+
* const TodoTable = table({
|
|
86
52
|
* id: TodoId,
|
|
87
53
|
* title: NonEmptyString1000,
|
|
88
54
|
* });
|
|
89
55
|
* type TodoTable = S.Schema.To<typeof TodoTable>;
|
|
90
56
|
*
|
|
91
|
-
* const Database =
|
|
57
|
+
* const Database = database({
|
|
92
58
|
* // _todo is local-only table
|
|
93
59
|
* todo: TodoTable,
|
|
94
60
|
* });
|
|
@@ -96,12 +62,21 @@ const EvoluNativeLive = EvoluCommonLive.pipe(
|
|
|
96
62
|
*
|
|
97
63
|
* const evolu = createEvolu(Database);
|
|
98
64
|
*/
|
|
99
|
-
export const createEvolu = makeCreateEvolu(
|
|
65
|
+
export const createEvolu = makeCreateEvolu(
|
|
66
|
+
EvoluCommonLive.pipe(
|
|
67
|
+
Layer.provide(
|
|
68
|
+
Layer.mergeAll(
|
|
69
|
+
FlushSyncDefaultLive,
|
|
70
|
+
AppStateLive,
|
|
71
|
+
DbWorkerLive,
|
|
72
|
+
PlatformNameLive,
|
|
73
|
+
),
|
|
74
|
+
),
|
|
75
|
+
Layer.provide(
|
|
76
|
+
Layer.mergeAll(Bip39Live, NanoIdLive, SqliteLive, SyncWorkerLive),
|
|
77
|
+
),
|
|
78
|
+
Layer.provide(Layer.mergeAll(SecretBoxLive, SyncLockLive, FetchLive)),
|
|
79
|
+
),
|
|
80
|
+
);
|
|
100
81
|
|
|
101
|
-
|
|
102
|
-
export const parseMnemonic: (
|
|
103
|
-
mnemonic: string,
|
|
104
|
-
) => Effect.Effect<Mnemonic, InvalidMnemonicError> = Bip39.pipe(
|
|
105
|
-
Effect.provide(Bip39Live),
|
|
106
|
-
Effect.runSync,
|
|
107
|
-
).parse;
|
|
82
|
+
export * from "@evolu/common-react";
|