@utoo/web 1.2.0-rc.6 → 1.2.0-rc.8
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/README.md +53 -0
- package/esm/{fe3ccd485f4eb7cd1a1e.wasm → 8f0451c2e61477918e02.wasm} +0 -0
- package/esm/internalProject.js +4 -1
- package/esm/loaderWorker.js +1 -1
- package/esm/project.js +6 -2
- package/esm/sabcom.d.ts +15 -4
- package/esm/sabcom.js +75 -56
- package/esm/utoo/index.d.ts +4 -4
- package/esm/utoo/index.js +40 -40
- package/esm/utoo/index_bg.wasm +0 -0
- package/package.json +5 -6
package/esm/project.js
CHANGED
|
@@ -81,6 +81,9 @@ export class Project {
|
|
|
81
81
|
}
|
|
82
82
|
async writeFile(path, content, encoding) {
|
|
83
83
|
await __classPrivateFieldGet(this, _Project_mount, "f");
|
|
84
|
+
if (content instanceof Uint8Array) {
|
|
85
|
+
return await this.remote.writeFile(path, comlink.transfer(content, [content.buffer]), encoding);
|
|
86
|
+
}
|
|
84
87
|
return await this.remote.writeFile(path, content, encoding);
|
|
85
88
|
}
|
|
86
89
|
async copyFile(src, dst) {
|
|
@@ -111,11 +114,12 @@ export class Project {
|
|
|
111
114
|
}
|
|
112
115
|
async gzip(files) {
|
|
113
116
|
await __classPrivateFieldGet(this, _Project_mount, "f");
|
|
114
|
-
|
|
117
|
+
const buffers = files.map((f) => f.content.buffer);
|
|
118
|
+
return await this.remote.gzip(comlink.transfer(files, buffers));
|
|
115
119
|
}
|
|
116
120
|
async sigMd5(content) {
|
|
117
121
|
await __classPrivateFieldGet(this, _Project_mount, "f");
|
|
118
|
-
return await this.remote.sigMd5(content);
|
|
122
|
+
return await this.remote.sigMd5(comlink.transfer(content, [content.buffer]));
|
|
119
123
|
}
|
|
120
124
|
static fork(channel, eventSource) {
|
|
121
125
|
(eventSource || self).postMessage(Fork, {
|
package/esm/sabcom.d.ts
CHANGED
|
@@ -12,11 +12,15 @@ export declare const SAB_OP_COPY_FILE = 7;
|
|
|
12
12
|
export declare const SAB_OP_STAT = 8;
|
|
13
13
|
export declare const STAT_TYPE_FILE = 0;
|
|
14
14
|
export declare const STAT_TYPE_DIR = 1;
|
|
15
|
+
export declare const SAB_INDEX_STATE = 0;
|
|
16
|
+
export declare const SAB_INDEX_OP = 1;
|
|
17
|
+
export declare const SAB_INDEX_DATA_LEN = 2;
|
|
18
|
+
export declare const SAB_DATA_OFFSET = 12;
|
|
15
19
|
export declare class SabComHost {
|
|
16
20
|
private sab;
|
|
17
21
|
private int32;
|
|
18
22
|
private uint8;
|
|
19
|
-
|
|
23
|
+
private dataView;
|
|
20
24
|
constructor(sab: SharedArrayBuffer);
|
|
21
25
|
readRequest(): {
|
|
22
26
|
op: number;
|
|
@@ -24,17 +28,24 @@ export declare class SabComHost {
|
|
|
24
28
|
};
|
|
25
29
|
writeResponse(data: Uint8Array | string): void;
|
|
26
30
|
writeError(message: string): void;
|
|
27
|
-
|
|
31
|
+
writeStat(type: number, size: bigint, atimeMs: number, mtimeMs: number, ctimeMs: number, birthtimeMs: number): void;
|
|
28
32
|
}
|
|
29
33
|
export declare class SabComClient {
|
|
30
34
|
private sab;
|
|
31
35
|
private notifyHost;
|
|
32
36
|
private int32;
|
|
33
37
|
private uint8;
|
|
34
|
-
|
|
38
|
+
private dataView;
|
|
35
39
|
constructor(sab: SharedArrayBuffer, notifyHost: () => void);
|
|
36
40
|
call(op: number, data: string): Uint8Array<ArrayBuffer>;
|
|
37
|
-
callStat(path: string):
|
|
41
|
+
callStat(path: string): {
|
|
42
|
+
type: number;
|
|
43
|
+
size: bigint;
|
|
44
|
+
atimeMs: number;
|
|
45
|
+
mtimeMs: number;
|
|
46
|
+
ctimeMs: number;
|
|
47
|
+
birthtimeMs: number;
|
|
48
|
+
};
|
|
38
49
|
}
|
|
39
50
|
export interface SabFileSystem {
|
|
40
51
|
read(path: string): Promise<Uint8Array>;
|
package/esm/sabcom.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BigUint64, BufferBackedObject, Float64, Uint8, } from "buffer-backed-object";
|
|
2
1
|
export const SAB_STATE_IDLE = 0;
|
|
3
2
|
export const SAB_STATE_REQUEST = 1;
|
|
4
3
|
export const SAB_STATE_RESPONSE = 2;
|
|
@@ -13,14 +12,24 @@ export const SAB_OP_COPY_FILE = 7;
|
|
|
13
12
|
export const SAB_OP_STAT = 8;
|
|
14
13
|
export const STAT_TYPE_FILE = 0;
|
|
15
14
|
export const STAT_TYPE_DIR = 1;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
export const SAB_INDEX_STATE = 0;
|
|
16
|
+
export const SAB_INDEX_OP = 1;
|
|
17
|
+
export const SAB_INDEX_DATA_LEN = 2;
|
|
18
|
+
export const SAB_DATA_OFFSET = 12;
|
|
19
|
+
// Stat struct layout (starts at byte 12)
|
|
20
|
+
// type: Uint8 (1 byte) -> offset 0
|
|
21
|
+
// padding: 7 bytes
|
|
22
|
+
// size: BigUint64 (8 bytes) -> offset 8
|
|
23
|
+
// atimeMs: Float64 (8 bytes) -> offset 16
|
|
24
|
+
// mtimeMs: Float64 (8 bytes) -> offset 24
|
|
25
|
+
// ctimeMs: Float64 (8 bytes) -> offset 32
|
|
26
|
+
// birthtimeMs: Float64 (8 bytes) -> offset 40
|
|
27
|
+
const STAT_OFFSET_TYPE = 0;
|
|
28
|
+
const STAT_OFFSET_SIZE = 8;
|
|
29
|
+
const STAT_OFFSET_ATIME = 16;
|
|
30
|
+
const STAT_OFFSET_MTIME = 24;
|
|
31
|
+
const STAT_OFFSET_CTIME = 32;
|
|
32
|
+
const STAT_OFFSET_BIRTHTIME = 40;
|
|
24
33
|
// Layout:
|
|
25
34
|
// 0: State (Int32)
|
|
26
35
|
// 1: Op (Int32)
|
|
@@ -31,14 +40,12 @@ export class SabComHost {
|
|
|
31
40
|
this.sab = sab;
|
|
32
41
|
this.int32 = new Int32Array(sab);
|
|
33
42
|
this.uint8 = new Uint8Array(sab);
|
|
34
|
-
this.
|
|
35
|
-
byteOffset: 12,
|
|
36
|
-
});
|
|
43
|
+
this.dataView = new DataView(sab);
|
|
37
44
|
}
|
|
38
45
|
readRequest() {
|
|
39
|
-
const op = this.int32[
|
|
40
|
-
const len = this.int32[
|
|
41
|
-
const data = new TextDecoder().decode(this.uint8.slice(
|
|
46
|
+
const op = this.int32[SAB_INDEX_OP];
|
|
47
|
+
const len = this.int32[SAB_INDEX_DATA_LEN];
|
|
48
|
+
const data = new TextDecoder().decode(this.uint8.slice(SAB_DATA_OFFSET, SAB_DATA_OFFSET + len));
|
|
42
49
|
return { op, data };
|
|
43
50
|
}
|
|
44
51
|
writeResponse(data) {
|
|
@@ -46,21 +53,28 @@ export class SabComHost {
|
|
|
46
53
|
data = new TextEncoder().encode(data);
|
|
47
54
|
}
|
|
48
55
|
// TODO: Check size overflow
|
|
49
|
-
this.int32[
|
|
50
|
-
this.uint8.set(data,
|
|
51
|
-
Atomics.store(this.int32,
|
|
52
|
-
Atomics.notify(this.int32,
|
|
56
|
+
this.int32[SAB_INDEX_DATA_LEN] = data.length;
|
|
57
|
+
this.uint8.set(data, SAB_DATA_OFFSET);
|
|
58
|
+
Atomics.store(this.int32, SAB_INDEX_STATE, SAB_STATE_RESPONSE);
|
|
59
|
+
Atomics.notify(this.int32, SAB_INDEX_STATE);
|
|
53
60
|
}
|
|
54
61
|
writeError(message) {
|
|
55
62
|
const data = new TextEncoder().encode(message);
|
|
56
|
-
this.int32[
|
|
57
|
-
this.uint8.set(data,
|
|
58
|
-
Atomics.store(this.int32,
|
|
59
|
-
Atomics.notify(this.int32,
|
|
63
|
+
this.int32[SAB_INDEX_DATA_LEN] = data.length;
|
|
64
|
+
this.uint8.set(data, SAB_DATA_OFFSET);
|
|
65
|
+
Atomics.store(this.int32, SAB_INDEX_STATE, SAB_STATE_ERROR);
|
|
66
|
+
Atomics.notify(this.int32, SAB_INDEX_STATE);
|
|
60
67
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
writeStat(type, size, atimeMs, mtimeMs, ctimeMs, birthtimeMs) {
|
|
69
|
+
const base = SAB_DATA_OFFSET;
|
|
70
|
+
this.dataView.setUint8(base + STAT_OFFSET_TYPE, type);
|
|
71
|
+
this.dataView.setBigUint64(base + STAT_OFFSET_SIZE, size, true);
|
|
72
|
+
this.dataView.setFloat64(base + STAT_OFFSET_ATIME, atimeMs, true);
|
|
73
|
+
this.dataView.setFloat64(base + STAT_OFFSET_MTIME, mtimeMs, true);
|
|
74
|
+
this.dataView.setFloat64(base + STAT_OFFSET_CTIME, ctimeMs, true);
|
|
75
|
+
this.dataView.setFloat64(base + STAT_OFFSET_BIRTHTIME, birthtimeMs, true);
|
|
76
|
+
Atomics.store(this.int32, SAB_INDEX_STATE, SAB_STATE_RESPONSE);
|
|
77
|
+
Atomics.notify(this.int32, SAB_INDEX_STATE);
|
|
64
78
|
}
|
|
65
79
|
}
|
|
66
80
|
export class SabComClient {
|
|
@@ -69,42 +83,48 @@ export class SabComClient {
|
|
|
69
83
|
this.notifyHost = notifyHost;
|
|
70
84
|
this.int32 = new Int32Array(sab);
|
|
71
85
|
this.uint8 = new Uint8Array(sab);
|
|
72
|
-
this.
|
|
73
|
-
byteOffset: 12,
|
|
74
|
-
});
|
|
86
|
+
this.dataView = new DataView(sab);
|
|
75
87
|
}
|
|
76
88
|
call(op, data) {
|
|
77
89
|
const encoded = new TextEncoder().encode(data);
|
|
78
|
-
this.int32[
|
|
79
|
-
this.int32[
|
|
80
|
-
this.uint8.set(encoded,
|
|
81
|
-
Atomics.store(this.int32,
|
|
90
|
+
this.int32[SAB_INDEX_OP] = op;
|
|
91
|
+
this.int32[SAB_INDEX_DATA_LEN] = encoded.length;
|
|
92
|
+
this.uint8.set(encoded, SAB_DATA_OFFSET);
|
|
93
|
+
Atomics.store(this.int32, SAB_INDEX_STATE, SAB_STATE_REQUEST);
|
|
82
94
|
this.notifyHost();
|
|
83
|
-
Atomics.wait(this.int32,
|
|
84
|
-
const state = Atomics.load(this.int32,
|
|
95
|
+
Atomics.wait(this.int32, SAB_INDEX_STATE, SAB_STATE_REQUEST);
|
|
96
|
+
const state = Atomics.load(this.int32, SAB_INDEX_STATE);
|
|
85
97
|
if (state === SAB_STATE_ERROR) {
|
|
86
|
-
const len = this.int32[
|
|
87
|
-
const msg = new TextDecoder().decode(this.uint8.slice(
|
|
98
|
+
const len = this.int32[SAB_INDEX_DATA_LEN];
|
|
99
|
+
const msg = new TextDecoder().decode(this.uint8.slice(SAB_DATA_OFFSET, SAB_DATA_OFFSET + len));
|
|
88
100
|
throw new Error(msg);
|
|
89
101
|
}
|
|
90
|
-
const len = this.int32[
|
|
91
|
-
return this.uint8.slice(
|
|
102
|
+
const len = this.int32[SAB_INDEX_DATA_LEN];
|
|
103
|
+
return this.uint8.slice(SAB_DATA_OFFSET, SAB_DATA_OFFSET + len);
|
|
92
104
|
}
|
|
93
105
|
callStat(path) {
|
|
94
106
|
const encoded = new TextEncoder().encode(path);
|
|
95
|
-
this.int32[
|
|
96
|
-
this.int32[
|
|
97
|
-
this.uint8.set(encoded,
|
|
98
|
-
Atomics.store(this.int32,
|
|
107
|
+
this.int32[SAB_INDEX_OP] = SAB_OP_STAT;
|
|
108
|
+
this.int32[SAB_INDEX_DATA_LEN] = encoded.length;
|
|
109
|
+
this.uint8.set(encoded, SAB_DATA_OFFSET);
|
|
110
|
+
Atomics.store(this.int32, SAB_INDEX_STATE, SAB_STATE_REQUEST);
|
|
99
111
|
this.notifyHost();
|
|
100
|
-
Atomics.wait(this.int32,
|
|
101
|
-
const state = Atomics.load(this.int32,
|
|
112
|
+
Atomics.wait(this.int32, SAB_INDEX_STATE, SAB_STATE_REQUEST);
|
|
113
|
+
const state = Atomics.load(this.int32, SAB_INDEX_STATE);
|
|
102
114
|
if (state === SAB_STATE_ERROR) {
|
|
103
|
-
const len = this.int32[
|
|
104
|
-
const msg = new TextDecoder().decode(this.uint8.slice(
|
|
115
|
+
const len = this.int32[SAB_INDEX_DATA_LEN];
|
|
116
|
+
const msg = new TextDecoder().decode(this.uint8.slice(SAB_DATA_OFFSET, SAB_DATA_OFFSET + len));
|
|
105
117
|
throw new Error(msg);
|
|
106
118
|
}
|
|
107
|
-
|
|
119
|
+
const base = SAB_DATA_OFFSET;
|
|
120
|
+
return {
|
|
121
|
+
type: this.dataView.getUint8(base + STAT_OFFSET_TYPE),
|
|
122
|
+
size: this.dataView.getBigUint64(base + STAT_OFFSET_SIZE, true),
|
|
123
|
+
atimeMs: this.dataView.getFloat64(base + STAT_OFFSET_ATIME, true),
|
|
124
|
+
mtimeMs: this.dataView.getFloat64(base + STAT_OFFSET_MTIME, true),
|
|
125
|
+
ctimeMs: this.dataView.getFloat64(base + STAT_OFFSET_CTIME, true),
|
|
126
|
+
birthtimeMs: this.dataView.getFloat64(base + STAT_OFFSET_BIRTHTIME, true),
|
|
127
|
+
};
|
|
108
128
|
}
|
|
109
129
|
}
|
|
110
130
|
export const handleSabRequest = async (sabHost, fs) => {
|
|
@@ -165,14 +185,13 @@ export const handleSabRequest = async (sabHost, fs) => {
|
|
|
165
185
|
const json = metadata.toJSON
|
|
166
186
|
? metadata.toJSON()
|
|
167
187
|
: metadata;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
sabHost.
|
|
175
|
-
sabHost.writeStatResponse();
|
|
188
|
+
const type = json.type === "directory" ? STAT_TYPE_DIR : STAT_TYPE_FILE;
|
|
189
|
+
const size = BigInt(json.file_size || 0);
|
|
190
|
+
const atimeMs = Number(json.atimeMs || 0);
|
|
191
|
+
const mtimeMs = Number(json.mtimeMs || 0);
|
|
192
|
+
const ctimeMs = Number(json.ctimeMs || 0);
|
|
193
|
+
const birthtimeMs = Number(json.birthtimeMs || 0);
|
|
194
|
+
sabHost.writeStat(type, size, atimeMs, mtimeMs, ctimeMs, birthtimeMs);
|
|
176
195
|
}
|
|
177
196
|
else {
|
|
178
197
|
sabHost.writeError("Unknown op");
|
package/esm/utoo/index.d.ts
CHANGED
|
@@ -13,15 +13,15 @@ export function init_pack(): void;
|
|
|
13
13
|
* @param {string} filter
|
|
14
14
|
*/
|
|
15
15
|
export function init_log_filter(filter: string): void;
|
|
16
|
-
/**
|
|
17
|
-
* @param {number} worker_id
|
|
18
|
-
*/
|
|
19
|
-
export function workerCreated(worker_id: number): void;
|
|
20
16
|
/**
|
|
21
17
|
* @param {Function} creator
|
|
22
18
|
* @param {Function} terminator
|
|
23
19
|
*/
|
|
24
20
|
export function registerWorkerScheduler(creator: Function, terminator: Function): void;
|
|
21
|
+
/**
|
|
22
|
+
* @param {number} worker_id
|
|
23
|
+
*/
|
|
24
|
+
export function workerCreated(worker_id: number): void;
|
|
25
25
|
/**
|
|
26
26
|
* Entry point for web workers
|
|
27
27
|
* @param {number} ptr
|
package/esm/utoo/index.js
CHANGED
|
@@ -271,11 +271,12 @@ export function init_log_filter(filter) {
|
|
|
271
271
|
const len0 = WASM_VECTOR_LEN;
|
|
272
272
|
wasm.init_log_filter(ptr0, len0);
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
274
|
+
/**
|
|
275
|
+
* @param {Function} creator
|
|
276
|
+
* @param {Function} terminator
|
|
277
|
+
*/
|
|
278
|
+
export function registerWorkerScheduler(creator, terminator) {
|
|
279
|
+
wasm.registerWorkerScheduler(addHeapObject(creator), addHeapObject(terminator));
|
|
279
280
|
}
|
|
280
281
|
/**
|
|
281
282
|
* @param {number} worker_id
|
|
@@ -283,12 +284,11 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
283
284
|
export function workerCreated(worker_id) {
|
|
284
285
|
wasm.workerCreated(worker_id);
|
|
285
286
|
}
|
|
286
|
-
|
|
287
|
-
*
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
wasm.registerWorkerScheduler(addHeapObject(creator), addHeapObject(terminator));
|
|
287
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
288
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
289
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
290
|
+
WASM_VECTOR_LEN = arg.length;
|
|
291
|
+
return ptr;
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Entry point for web workers
|
|
@@ -297,13 +297,13 @@ export function registerWorkerScheduler(creator, terminator) {
|
|
|
297
297
|
export function wasm_thread_entry_point(ptr) {
|
|
298
298
|
wasm.wasm_thread_entry_point(ptr);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function __wbg_adapter_6(arg0, arg1, arg2) {
|
|
301
301
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function __wbg_adapter_11(arg0, arg1) {
|
|
304
304
|
wasm.__wbindgen_export_7(arg0, arg1);
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function __wbg_adapter_16(arg0, arg1, arg2) {
|
|
307
307
|
wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2));
|
|
308
308
|
}
|
|
309
309
|
let stack_pointer = 128;
|
|
@@ -313,7 +313,7 @@ function addBorrowedObject(obj) {
|
|
|
313
313
|
heap[--stack_pointer] = obj;
|
|
314
314
|
return stack_pointer;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function __wbg_adapter_25(arg0, arg1, arg2) {
|
|
317
317
|
try {
|
|
318
318
|
wasm.__wbindgen_export_9(arg0, arg1, addBorrowedObject(arg2));
|
|
319
319
|
}
|
|
@@ -1046,7 +1046,7 @@ function __wbg_get_imports() {
|
|
|
1046
1046
|
return addHeapObject(ret);
|
|
1047
1047
|
}, arguments);
|
|
1048
1048
|
};
|
|
1049
|
-
imports.wbg.
|
|
1049
|
+
imports.wbg.__wbg_changedHandle_c9e2f89f142062e6 = function (arg0) {
|
|
1050
1050
|
const ret = getObject(arg0).changedHandle;
|
|
1051
1051
|
return addHeapObject(ret);
|
|
1052
1052
|
};
|
|
@@ -1327,10 +1327,6 @@ function __wbg_get_imports() {
|
|
|
1327
1327
|
const ret = new Map();
|
|
1328
1328
|
return addHeapObject(ret);
|
|
1329
1329
|
};
|
|
1330
|
-
imports.wbg.__wbg_new_61e1f224687df92d = function (arg0) {
|
|
1331
|
-
const ret = new FileSystemObserver(getObject(arg0));
|
|
1332
|
-
return addHeapObject(ret);
|
|
1333
|
-
};
|
|
1334
1330
|
imports.wbg.__wbg_new_638ebfaedbf32a5e = function (arg0) {
|
|
1335
1331
|
const ret = new Uint8Array(getObject(arg0));
|
|
1336
1332
|
return addHeapObject(ret);
|
|
@@ -1351,6 +1347,10 @@ function __wbg_get_imports() {
|
|
|
1351
1347
|
return addHeapObject(ret);
|
|
1352
1348
|
}, arguments);
|
|
1353
1349
|
};
|
|
1350
|
+
imports.wbg.__wbg_new_d2e51de36a0e4764 = function (arg0) {
|
|
1351
|
+
const ret = new FileSystemObserver(getObject(arg0));
|
|
1352
|
+
return addHeapObject(ret);
|
|
1353
|
+
};
|
|
1354
1354
|
imports.wbg.__wbg_new_f6e53210afea8e45 = function () {
|
|
1355
1355
|
return handleError(function () {
|
|
1356
1356
|
const ret = new Headers();
|
|
@@ -1411,7 +1411,7 @@ function __wbg_get_imports() {
|
|
|
1411
1411
|
const ret = Date.now();
|
|
1412
1412
|
return ret;
|
|
1413
1413
|
};
|
|
1414
|
-
imports.wbg.
|
|
1414
|
+
imports.wbg.__wbg_observe_a0978eb3d8eeac7a = function (arg0, arg1, arg2) {
|
|
1415
1415
|
const ret = getObject(arg0).observe(getObject(arg1), getObject(arg2));
|
|
1416
1416
|
return addHeapObject(ret);
|
|
1417
1417
|
};
|
|
@@ -1463,7 +1463,7 @@ function __wbg_get_imports() {
|
|
|
1463
1463
|
return ret;
|
|
1464
1464
|
}, arguments);
|
|
1465
1465
|
};
|
|
1466
|
-
imports.wbg.
|
|
1466
|
+
imports.wbg.__wbg_relativePathComponents_e5d23d3c74d6be58 = function (arg0) {
|
|
1467
1467
|
const ret = getObject(arg0).relativePathComponents;
|
|
1468
1468
|
return addHeapObject(ret);
|
|
1469
1469
|
};
|
|
@@ -1531,7 +1531,7 @@ function __wbg_get_imports() {
|
|
|
1531
1531
|
imports.wbg.__wbg_setrecursive_072599988d5f7e8d = function (arg0, arg1) {
|
|
1532
1532
|
getObject(arg0).recursive = arg1 !== 0;
|
|
1533
1533
|
};
|
|
1534
|
-
imports.wbg.
|
|
1534
|
+
imports.wbg.__wbg_setrecursive_3a1cc4daad3e7e08 = function (arg0, arg1) {
|
|
1535
1535
|
getObject(arg0).recursive = arg1 !== 0;
|
|
1536
1536
|
};
|
|
1537
1537
|
imports.wbg.__wbg_setsignal_8c45ad1247a74809 = function (arg0, arg1) {
|
|
@@ -1612,7 +1612,7 @@ function __wbg_get_imports() {
|
|
|
1612
1612
|
getObject(arg0).truncate(arg1 >>> 0);
|
|
1613
1613
|
}, arguments);
|
|
1614
1614
|
};
|
|
1615
|
-
imports.wbg.
|
|
1615
|
+
imports.wbg.__wbg_type_71184712a0bdfe7d = function (arg0) {
|
|
1616
1616
|
const ret = getObject(arg0).type;
|
|
1617
1617
|
return (__wbindgen_enum_FileSystemChangeRecordType.indexOf(ret) + 1 || 7) - 1;
|
|
1618
1618
|
};
|
|
@@ -1745,7 +1745,12 @@ function __wbg_get_imports() {
|
|
|
1745
1745
|
};
|
|
1746
1746
|
imports.wbg.__wbindgen_cast_0ca71f183bd17ba7 = function (arg0, arg1) {
|
|
1747
1747
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8631, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 8632, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1748
|
-
const ret = makeMutClosure(arg0, arg1, 8631,
|
|
1748
|
+
const ret = makeMutClosure(arg0, arg1, 8631, __wbg_adapter_25);
|
|
1749
|
+
return addHeapObject(ret);
|
|
1750
|
+
};
|
|
1751
|
+
imports.wbg.__wbindgen_cast_13db378acd3080f2 = function (arg0, arg1) {
|
|
1752
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8626, function: Function { arguments: [], shim_idx: 615, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1753
|
+
const ret = makeMutClosure(arg0, arg1, 8626, __wbg_adapter_11);
|
|
1749
1754
|
return addHeapObject(ret);
|
|
1750
1755
|
};
|
|
1751
1756
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
|
|
@@ -1774,17 +1779,12 @@ function __wbg_get_imports() {
|
|
|
1774
1779
|
};
|
|
1775
1780
|
imports.wbg.__wbindgen_cast_7b3678bd8e0fb80b = function (arg0, arg1) {
|
|
1776
1781
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8626, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8627, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1777
|
-
const ret = makeMutClosure(arg0, arg1, 8626,
|
|
1782
|
+
const ret = makeMutClosure(arg0, arg1, 8626, __wbg_adapter_6);
|
|
1778
1783
|
return addHeapObject(ret);
|
|
1779
1784
|
};
|
|
1780
1785
|
imports.wbg.__wbindgen_cast_884165a22f3e9702 = function (arg0, arg1) {
|
|
1781
1786
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 8626, function: Function { arguments: [Externref], shim_idx: 8627, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1782
|
-
const ret = makeMutClosure(arg0, arg1, 8626,
|
|
1783
|
-
return addHeapObject(ret);
|
|
1784
|
-
};
|
|
1785
|
-
imports.wbg.__wbindgen_cast_8b2c5f11dff5b9ba = function (arg0, arg1) {
|
|
1786
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 8626, function: Function { arguments: [], shim_idx: 599, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1787
|
-
const ret = makeMutClosure(arg0, arg1, 8626, __wbg_adapter_9);
|
|
1787
|
+
const ret = makeMutClosure(arg0, arg1, 8626, __wbg_adapter_6);
|
|
1788
1788
|
return addHeapObject(ret);
|
|
1789
1789
|
};
|
|
1790
1790
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function (arg0) {
|
|
@@ -1792,14 +1792,9 @@ function __wbg_get_imports() {
|
|
|
1792
1792
|
const ret = arg0;
|
|
1793
1793
|
return addHeapObject(ret);
|
|
1794
1794
|
};
|
|
1795
|
-
imports.wbg.
|
|
1796
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1797
|
-
const ret =
|
|
1798
|
-
return addHeapObject(ret);
|
|
1799
|
-
};
|
|
1800
|
-
imports.wbg.__wbindgen_cast_a5ee8c63b746891b = function (arg0, arg1) {
|
|
1801
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 598, function: Function { arguments: [], shim_idx: 599, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1802
|
-
const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_9);
|
|
1795
|
+
imports.wbg.__wbindgen_cast_9bbbede3cf028e02 = function (arg0, arg1) {
|
|
1796
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 614, function: Function { arguments: [], shim_idx: 615, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1797
|
+
const ret = makeMutClosure(arg0, arg1, 614, __wbg_adapter_11);
|
|
1803
1798
|
return addHeapObject(ret);
|
|
1804
1799
|
};
|
|
1805
1800
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
|
|
@@ -1807,6 +1802,11 @@ function __wbg_get_imports() {
|
|
|
1807
1802
|
const ret = arg0;
|
|
1808
1803
|
return addHeapObject(ret);
|
|
1809
1804
|
};
|
|
1805
|
+
imports.wbg.__wbindgen_cast_dc9e1191bb955710 = function (arg0, arg1) {
|
|
1806
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8617, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8618, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
1807
|
+
const ret = makeClosure(arg0, arg1, 8617, __wbg_adapter_16);
|
|
1808
|
+
return addHeapObject(ret);
|
|
1809
|
+
};
|
|
1810
1810
|
imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
|
|
1811
1811
|
const val = `onmessage = function (ev) {
|
|
1812
1812
|
let [ia, index, value] = ev.data;
|
package/esm/utoo/index_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utoo/web",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.8",
|
|
4
4
|
"module": "esm/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -13,19 +13,17 @@
|
|
|
13
13
|
"bindgen-dev": "wasm-bindgen ../../target/wasm32-unknown-unknown/wasm-dev/utoo_wasm.wasm --out-dir src/utoo --out-name index --target web --debug --keep-debug --no-demangle",
|
|
14
14
|
"bindgen-build": "wasm-bindgen ../../target/wasm32-unknown-unknown/release/utoo_wasm.wasm --out-dir src/utoo --out-name index --target web",
|
|
15
15
|
"bindgen-build:local": "wasm-bindgen ../../target/wasm32-unknown-unknown/release-local/utoo_wasm.wasm --out-dir src/utoo --out-name index --target web",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"dev": "npm run build-wasm -- --profile wasm-dev && npm run bindgen-dev && npm run tsc && npm run build-loaderWorker && cp src/utoo/index_bg.wasm esm/utoo",
|
|
16
|
+
"tsc": "rm -rf esm && tsc -p ./tsconfig.build.json",
|
|
17
|
+
"dev": "npm run build-wasm -- --profile wasm-dev && npm run bindgen-dev && npx turbo run tsc --filter=@utoo/web && npm run build-loaderWorker && cp src/utoo/index_bg.wasm esm/utoo",
|
|
19
18
|
"dev:pm": "npm run build-wasm:pm -- --profile wasm-dev && npm run bindgen-dev && npm run tsc && cp src/utoo/index_bg.wasm esm/utoo",
|
|
20
19
|
"wasm-opt": "wasm-opt src/utoo/index_bg.wasm -o esm/utoo/index_bg.wasm --enable-threads --enable-bulk-memory --enable-nontrapping-float-to-int -Oz",
|
|
21
20
|
"build": "npm run build-wasm -- --release && npm run bindgen-build && npm run tsc && npm run build-loaderWorker && npm run wasm-opt",
|
|
22
21
|
"build:local": "npm run build-wasm -- --profile release-local && npm run bindgen-build:local && npm run tsc && npm run build-loaderWorker && cp src/utoo/index_bg.wasm esm/utoo",
|
|
23
22
|
"build-loaderWorker": "node cli/umd.js -e ./src/webpackLoaders/worker.ts -o ./esm/loaderWorker.js -t webworker",
|
|
24
|
-
"prepublishOnly": "
|
|
23
|
+
"prepublishOnly": "turbo run build --filter=@utoo/web"
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
26
|
"@utoo/pack-shared": "^0.0.7",
|
|
28
|
-
"buffer-backed-object": "^1.0.1",
|
|
29
27
|
"comlink": "^4.4.2",
|
|
30
28
|
"micromatch": "^4.0.8",
|
|
31
29
|
"systemjs": "^6.15.1"
|
|
@@ -33,6 +31,7 @@
|
|
|
33
31
|
"devDependencies": {
|
|
34
32
|
"@types/micromatch": "^4.0.8",
|
|
35
33
|
"@types/systemjs": "^6.15.1",
|
|
34
|
+
"binaryen": "^125.0.0",
|
|
36
35
|
"node-stdlib-browser": "^1.3.1",
|
|
37
36
|
"ts-loader": "^9.5.2",
|
|
38
37
|
"typescript": "^5.8.3",
|