@livestore/sqlite-wasm 0.4.0-dev.10 → 0.4.0-dev.12
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":"mod.workerd.d.ts","sourceRoot":"","sources":["../../src/load-wasm/mod.workerd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mod.workerd.d.ts","sourceRoot":"","sources":["../../src/load-wasm/mod.workerd.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,0BAoB3B,CAAA"}
|
|
@@ -2,8 +2,10 @@ import * as WaSqlite from '@livestore/wa-sqlite';
|
|
|
2
2
|
import WaSqliteFactory from '@livestore/wa-sqlite/dist/wa-sqlite.mjs';
|
|
3
3
|
// @ts-expect-error TODO fix types in wa-sqlite
|
|
4
4
|
import wasm from '@livestore/wa-sqlite/dist/wa-sqlite.wasm';
|
|
5
|
+
// Note that it's important that the `workerd` entry is the first one in the `exports` map in the `package.json` file.
|
|
5
6
|
export const loadSqlite3Wasm = async () => {
|
|
6
7
|
// It seems we need to pass in the wasm binary directly for workerd to work
|
|
8
|
+
// This is due to workerd not supporting the same patterns as Vite for automatically loading WASM.
|
|
7
9
|
const module = await WaSqliteFactory({
|
|
8
10
|
instantiateWasm: (info, receiveInstance) => {
|
|
9
11
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.workerd.js","sourceRoot":"","sources":["../../src/load-wasm/mod.workerd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAA;AAChD,OAAO,eAAe,MAAM,yCAAyC,CAAA;AAErE,+CAA+C;AAC/C,OAAO,IAAI,MAAM,0CAA0C,CAAA;AAE3D,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;IACxC,2EAA2E;IAC3E,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC;QACnC,eAAe,E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AC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAA;gBACnD,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;KACF,CAAC,CAAA;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACxC,kCAAkC;IAClC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;IACvB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/sqlite-wasm",
|
|
3
|
-
"version": "0.4.0-dev.
|
|
3
|
+
"version": "0.4.0-dev.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@cloudflare/workers-types": "4.20250923.0",
|
|
33
|
-
"@livestore/common": "0.4.0-dev.
|
|
34
|
-
"@livestore/common-cf": "0.4.0-dev.
|
|
35
|
-
"@livestore/utils": "0.4.0-dev.
|
|
36
|
-
"@livestore/wa-sqlite": "0.4.0-dev.
|
|
33
|
+
"@livestore/common": "0.4.0-dev.12",
|
|
34
|
+
"@livestore/common-cf": "0.4.0-dev.12",
|
|
35
|
+
"@livestore/utils": "0.4.0-dev.12",
|
|
36
|
+
"@livestore/wa-sqlite": "0.4.0-dev.12"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/chrome": "0.1.4",
|
|
40
40
|
"@types/node": "24.5.2",
|
|
41
41
|
"@types/wicg-file-system-access": "^2023.10.6",
|
|
42
42
|
"vitest": "3.2.4",
|
|
43
|
-
"wrangler": "4.
|
|
43
|
+
"wrangler": "4.42.2"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"package.json",
|
|
@@ -4,8 +4,10 @@ import WaSqliteFactory from '@livestore/wa-sqlite/dist/wa-sqlite.mjs'
|
|
|
4
4
|
// @ts-expect-error TODO fix types in wa-sqlite
|
|
5
5
|
import wasm from '@livestore/wa-sqlite/dist/wa-sqlite.wasm'
|
|
6
6
|
|
|
7
|
+
// Note that it's important that the `workerd` entry is the first one in the `exports` map in the `package.json` file.
|
|
7
8
|
export const loadSqlite3Wasm = async () => {
|
|
8
9
|
// It seems we need to pass in the wasm binary directly for workerd to work
|
|
10
|
+
// This is due to workerd not supporting the same patterns as Vite for automatically loading WASM.
|
|
9
11
|
const module = await WaSqliteFactory({
|
|
10
12
|
instantiateWasm: (info: any, receiveInstance: any) => {
|
|
11
13
|
try {
|