@evolu/web 1.0.1-preview.6 → 2.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.
@@ -1,3 +1,4 @@
1
1
  import { EvoluDeps } from "@evolu/common/evolu";
2
+ export declare const localAuth: import("@evolu/common").LocalAuth;
2
3
  export declare const evoluWebDeps: EvoluDeps;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Evolu/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,SAAS,EACV,MAAM,qBAAqB,CAAC;AAiB7B,eAAO,MAAM,YAAY,EAAE,SAU1B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Evolu/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,SAAS,EACV,MAAM,qBAAqB,CAAC;AAiB7B,eAAO,MAAM,SAAS,mCAGpB,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,SAM1B,CAAC"}
@@ -7,14 +7,14 @@ const symmetricCrypto = createSymmetricCrypto({ randomBytes });
7
7
  const createDbWorker = (name) => createSharedWebWorker(name, () => new Worker(new URL("Db.worker.js", import.meta.url), {
8
8
  type: "module",
9
9
  }));
10
+ export const localAuth = createLocalAuth({
11
+ randomBytes,
12
+ secureStorage: createWebAuthnStore({ randomBytes, symmetricCrypto }),
13
+ });
10
14
  export const evoluWebDeps = {
11
15
  console: createConsole(),
12
16
  createDbWorker,
13
17
  randomBytes: createRandomBytes(),
14
- localAuth: createLocalAuth({
15
- randomBytes,
16
- secureStorage: createWebAuthnStore({ randomBytes, symmetricCrypto }),
17
- }),
18
18
  reloadApp,
19
19
  time: createTime(),
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WasmSqliteDriver.d.ts","sourceRoot":"","sources":["../../src/WasmSqliteDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAInB,MAAM,eAAe,CAAC;AAgBvB,eAAO,MAAM,sBAAsB,EAAE,kBAuFpC,CAAC"}
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 { constVoid, createPreparedStatementsCache, bytesToHex, } from "@evolu/common";
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: constVoid,
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.1-preview.6",
3
+ "version": "2.0.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": "6.0.1-preview.20",
40
+ "@evolu/common": "7.0.0",
41
41
  "@evolu/tsconfig": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
44
- "@evolu/common": "^6.0.1-preview.20"
44
+ "@evolu/common": "^7.0.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -27,14 +27,15 @@ const createDbWorker: CreateDbWorker = (name) =>
27
27
  }),
28
28
  );
29
29
 
30
+ export const localAuth = createLocalAuth({
31
+ randomBytes,
32
+ secureStorage: createWebAuthnStore({ randomBytes, symmetricCrypto }),
33
+ });
34
+
30
35
  export const evoluWebDeps: EvoluDeps = {
31
36
  console: createConsole(),
32
37
  createDbWorker,
33
38
  randomBytes: createRandomBytes(),
34
- localAuth: createLocalAuth({
35
- randomBytes,
36
- secureStorage: createWebAuthnStore({ randomBytes, symmetricCrypto }),
37
- }),
38
39
  reloadApp,
39
40
  time: createTime(),
40
41
  };
@@ -1,21 +1,28 @@
1
1
  import {
2
- constVoid,
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: constVoid,
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.