@evolu/web 1.0.1-preview.7 → 2.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WasmSqliteDriver.d.ts","sourceRoot":"","sources":["../../src/WasmSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"WasmSqliteDriver.d.ts","sourceRoot":"","sources":["../../src/WasmSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAGnB,MAAM,eAAe,CAAC;AAwBvB,eAAO,MAAM,sBAAsB,EAAE,kBAuFpC,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bytesToHex, createPreparedStatementsCache, } from "@evolu/common";
|
|
2
2
|
import sqlite3InitModule from "@evolu/sqlite-wasm";
|
|
3
|
-
// TODO: Do we still need that?
|
|
4
|
-
// https://github.com/sqlite/sqlite-wasm/issues/62
|
|
5
3
|
// @ts-expect-error Missing types.
|
|
6
4
|
globalThis.sqlite3ApiConfig = {
|
|
7
|
-
warn:
|
|
5
|
+
warn: (arg) => {
|
|
6
|
+
// Ignore irrelevant warning.
|
|
7
|
+
// https://github.com/sqlite/sqlite-wasm/issues/62
|
|
8
|
+
if (typeof arg === "string" &&
|
|
9
|
+
arg.startsWith("Ignoring inability to install OPFS sqlite3_vfs"))
|
|
10
|
+
return;
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
console.warn(arg);
|
|
13
|
+
},
|
|
8
14
|
};
|
|
9
15
|
// Init ASAP.
|
|
10
16
|
const sqlite3Promise = sqlite3InitModule();
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
1
|
import { expect, test, vi, beforeEach, afterEach } from "vitest";
|
|
6
2
|
import { createSharedWebWorker } from "../src/SharedWebWorker.js";
|
|
7
3
|
import { SimpleName, wait } from "@evolu/common";
|
|
8
4
|
// Mock BroadcastChannel
|
|
9
5
|
class MockBroadcastChannel {
|
|
10
|
-
name;
|
|
11
6
|
onmessage = null;
|
|
7
|
+
name;
|
|
12
8
|
constructor(name) {
|
|
13
9
|
this.name = name;
|
|
14
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/web",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Evolu for web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"typescript": "^5.9.2",
|
|
38
38
|
"user-agent-data-types": "^0.4.2",
|
|
39
39
|
"vitest": "^4.0.4",
|
|
40
|
-
"@evolu/common": "
|
|
40
|
+
"@evolu/common": "7.1.0",
|
|
41
41
|
"@evolu/tsconfig": "0.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@evolu/common": "^
|
|
44
|
+
"@evolu/common": "^7.1.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
package/src/WasmSqliteDriver.ts
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
bytesToHex,
|
|
3
3
|
createPreparedStatementsCache,
|
|
4
4
|
CreateSqliteDriver,
|
|
5
5
|
SqliteDriver,
|
|
6
6
|
SqliteRow,
|
|
7
|
-
bytesToHex,
|
|
8
7
|
} from "@evolu/common";
|
|
9
8
|
import sqlite3InitModule, {
|
|
10
|
-
PreparedStatement,
|
|
11
9
|
Database,
|
|
10
|
+
PreparedStatement,
|
|
12
11
|
} from "@evolu/sqlite-wasm";
|
|
13
12
|
|
|
14
|
-
// TODO: Do we still need that?
|
|
15
|
-
// https://github.com/sqlite/sqlite-wasm/issues/62
|
|
16
13
|
// @ts-expect-error Missing types.
|
|
17
14
|
globalThis.sqlite3ApiConfig = {
|
|
18
|
-
warn:
|
|
15
|
+
warn: (arg: unknown) => {
|
|
16
|
+
// Ignore irrelevant warning.
|
|
17
|
+
// https://github.com/sqlite/sqlite-wasm/issues/62
|
|
18
|
+
if (
|
|
19
|
+
typeof arg === "string" &&
|
|
20
|
+
arg.startsWith("Ignoring inability to install OPFS sqlite3_vfs")
|
|
21
|
+
)
|
|
22
|
+
return;
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.warn(arg);
|
|
25
|
+
},
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
// Init ASAP.
|