@utoo/web 0.0.1-alpha.40 → 0.0.1-alpha.42

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,4 +1,4 @@
1
- import { ProjectEndpoint } from "./type";
1
+ import { PackFile, ProjectEndpoint } from "./type";
2
2
  export declare class ForkedProject implements ProjectEndpoint {
3
3
  private endpoint;
4
4
  constructor(port: MessagePort);
@@ -19,4 +19,6 @@ export declare class ForkedProject implements ProjectEndpoint {
19
19
  rmdir(path: string, options?: {
20
20
  recursive?: boolean;
21
21
  }): Promise<void>;
22
+ gzip(files: PackFile[]): Promise<Uint8Array>;
23
+ sigMd5(content: Uint8Array): Promise<string>;
22
24
  }
@@ -31,4 +31,10 @@ export class ForkedProject {
31
31
  async rmdir(path, options) {
32
32
  return await this.endpoint.rmdir(path, options);
33
33
  }
34
+ async gzip(files) {
35
+ return await this.endpoint.gzip(files);
36
+ }
37
+ async sigMd5(content) {
38
+ return await this.endpoint.sigMd5(content);
39
+ }
34
40
  }
package/esm/project.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BuildOutput, Dirent, ProjectEndpoint, ProjectOptions } from "./type";
1
+ import { BuildOutput, Dirent, PackFile, ProjectEndpoint, ProjectOptions } from "./type";
2
2
  export declare class Project implements ProjectEndpoint {
3
3
  #private;
4
4
  private serviceWorkerOptions?;
@@ -24,5 +24,7 @@ export declare class Project implements ProjectEndpoint {
24
24
  rmdir(path: string, options?: {
25
25
  recursive?: boolean;
26
26
  }): Promise<void>;
27
+ gzip(files: PackFile[]): Promise<Uint8Array>;
28
+ sigMd5(content: Uint8Array): Promise<string>;
27
29
  static fork(channel: MessageChannel, eventSource?: Client | DedicatedWorkerGlobalScope): ProjectEndpoint;
28
30
  }
package/esm/project.js CHANGED
@@ -102,6 +102,14 @@ export class Project {
102
102
  await __classPrivateFieldGet(this, _Project_mount, "f");
103
103
  return await this.remote.rmdir(path, options);
104
104
  }
105
+ async gzip(files) {
106
+ await __classPrivateFieldGet(this, _Project_mount, "f");
107
+ return await this.remote.gzip(files);
108
+ }
109
+ async sigMd5(content) {
110
+ await __classPrivateFieldGet(this, _Project_mount, "f");
111
+ return await this.remote.sigMd5(content);
112
+ }
105
113
  static fork(channel, eventSource) {
106
114
  (eventSource || self).postMessage(Fork, {
107
115
  transfer: [channel.port2],
@@ -6,6 +6,12 @@ let _promise = new Promise((resolve) => {
6
6
  });
7
7
  let _projectEndpoint;
8
8
  let _serviceWorkerScope;
9
+ self.addEventListener("install", (event) => {
10
+ event.waitUntil(self.skipWaiting());
11
+ });
12
+ self.addEventListener("activate", (event) => {
13
+ event.waitUntil(self.clients.claim());
14
+ });
9
15
  self.addEventListener("message", (event) => {
10
16
  if (event.data && event.data[ServiceWorkerHandShake] === true) {
11
17
  _serviceWorkerScope = event.data.scope;
package/esm/type.d.ts CHANGED
@@ -14,6 +14,10 @@ export declare class Dirent {
14
14
  export interface BuildOutput {
15
15
  issues: Issue[];
16
16
  }
17
+ export interface PackFile {
18
+ path: string;
19
+ content: Uint8Array;
20
+ }
17
21
  export interface ProjectEndpoint {
18
22
  install: (packageLock: string, maxConcurrentDownloads?: number) => Promise<void>;
19
23
  build: () => Promise<BuildOutput>;
@@ -33,6 +37,8 @@ export interface ProjectEndpoint {
33
37
  recursive?: boolean;
34
38
  }): Promise<void>;
35
39
  copyFile(src: string, dst: string): Promise<void>;
40
+ gzip: (files: PackFile[]) => Promise<Uint8Array>;
41
+ sigMd5: (content: Uint8Array) => Promise<string>;
36
42
  }
37
43
  export interface ProjectOptions {
38
44
  cwd: string;
@@ -90,6 +90,13 @@ export class Project {
90
90
  * @returns {string}
91
91
  */
92
92
  get cwd(): string;
93
+ /**
94
+ * Create a tar.gz archive and return bytes (no file I/O)
95
+ * This is useful for main thread execution without OPFS access
96
+ * @param {any} files
97
+ * @returns {Uint8Array}
98
+ */
99
+ gzip(files: any): Uint8Array;
93
100
  /**
94
101
  * @param {string} path
95
102
  * @returns {Promise<Uint8Array>}
@@ -111,6 +118,12 @@ export class Project {
111
118
  * @returns {Promise<void>}
112
119
  */
113
120
  install(package_lock: string, max_concurrent_downloads?: number | null): Promise<void>;
121
+ /**
122
+ * Calculate MD5 hash of byte content
123
+ * @param {Uint8Array} content
124
+ * @returns {string}
125
+ */
126
+ sigMd5(content: Uint8Array): string;
114
127
  /**
115
128
  * @param {string} path
116
129
  * @returns {Promise<Metadata>}
package/esm/utoo/index.js CHANGED
@@ -208,15 +208,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
208
208
  CLOSURE_DTORS.register(real, state, state);
209
209
  return real;
210
210
  }
211
- function getArrayJsValueFromWasm0(ptr, len) {
212
- ptr = ptr >>> 0;
213
- const mem = getDataViewMemory0();
214
- const result = [];
215
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
216
- result.push(takeObject(mem.getUint32(i, true)));
217
- }
218
- return result;
219
- }
220
211
  function makeClosure(arg0, arg1, dtor, f) {
221
212
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
222
213
  const real = (...args) => {
@@ -239,6 +230,15 @@ function makeClosure(arg0, arg1, dtor, f) {
239
230
  CLOSURE_DTORS.register(real, state, state);
240
231
  return real;
241
232
  }
233
+ function getArrayJsValueFromWasm0(ptr, len) {
234
+ ptr = ptr >>> 0;
235
+ const mem = getDataViewMemory0();
236
+ const result = [];
237
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
238
+ result.push(takeObject(mem.getUint32(i, true)));
239
+ }
240
+ return result;
241
+ }
242
242
  export function init_pack() {
243
243
  wasm.init_pack();
244
244
  }
@@ -255,13 +255,13 @@ function passArray8ToWasm0(arg, malloc) {
255
255
  export function wasm_thread_entry_point(ptr) {
256
256
  wasm.wasm_thread_entry_point(ptr);
257
257
  }
258
- function __wbg_adapter_4(arg0, arg1) {
258
+ function __wbg_adapter_6(arg0, arg1) {
259
259
  wasm.__wbindgen_export_6(arg0, arg1);
260
260
  }
261
- function __wbg_adapter_9(arg0, arg1, arg2) {
261
+ function __wbg_adapter_13(arg0, arg1, arg2) {
262
262
  wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
263
263
  }
264
- function __wbg_adapter_12(arg0, arg1, arg2) {
264
+ function __wbg_adapter_28(arg0, arg1, arg2) {
265
265
  wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2));
266
266
  }
267
267
  let stack_pointer = 128;
@@ -271,7 +271,7 @@ function addBorrowedObject(obj) {
271
271
  heap[--stack_pointer] = obj;
272
272
  return stack_pointer;
273
273
  }
274
- function __wbg_adapter_23(arg0, arg1, arg2) {
274
+ function __wbg_adapter_31(arg0, arg1, arg2) {
275
275
  try {
276
276
  wasm.__wbindgen_export_9(arg0, arg1, addBorrowedObject(arg2));
277
277
  }
@@ -279,7 +279,7 @@ function __wbg_adapter_23(arg0, arg1, arg2) {
279
279
  heap[stack_pointer++] = undefined;
280
280
  }
281
281
  }
282
- function __wbg_adapter_92(arg0, arg1, arg2, arg3) {
282
+ function __wbg_adapter_102(arg0, arg1, arg2, arg3) {
283
283
  wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
284
284
  }
285
285
  const __wbindgen_enum_DirEntryType = ["file", "directory"];
@@ -529,6 +529,28 @@ export class Project {
529
529
  ProjectFinalization.register(this, this.__wbg_ptr, this);
530
530
  return this;
531
531
  }
532
+ /**
533
+ * Create a tar.gz archive and return bytes (no file I/O)
534
+ * This is useful for main thread execution without OPFS access
535
+ * @param {any} files
536
+ * @returns {Uint8Array}
537
+ */
538
+ gzip(files) {
539
+ try {
540
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
541
+ wasm.project_gzip(retptr, this.__wbg_ptr, addHeapObject(files));
542
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
543
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
544
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
545
+ if (r2) {
546
+ throw takeObject(r1);
547
+ }
548
+ return takeObject(r0);
549
+ }
550
+ finally {
551
+ wasm.__wbindgen_add_to_stack_pointer(16);
552
+ }
553
+ }
532
554
  /**
533
555
  * @param {string} path
534
556
  * @returns {Promise<Uint8Array>}
@@ -570,6 +592,30 @@ export class Project {
570
592
  const ret = wasm.project_install(this.__wbg_ptr, ptr0, len0, isLikeNone(max_concurrent_downloads) ? 0x100000001 : (max_concurrent_downloads) >>> 0);
571
593
  return takeObject(ret);
572
594
  }
595
+ /**
596
+ * Calculate MD5 hash of byte content
597
+ * @param {Uint8Array} content
598
+ * @returns {string}
599
+ */
600
+ sigMd5(content) {
601
+ let deferred2_0;
602
+ let deferred2_1;
603
+ try {
604
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
605
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
606
+ const len0 = WASM_VECTOR_LEN;
607
+ wasm.project_sigMd5(retptr, this.__wbg_ptr, ptr0, len0);
608
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
609
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
610
+ deferred2_0 = r0;
611
+ deferred2_1 = r1;
612
+ return getStringFromWasm0(r0, r1);
613
+ }
614
+ finally {
615
+ wasm.__wbindgen_add_to_stack_pointer(16);
616
+ wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
617
+ }
618
+ }
573
619
  /**
574
620
  * @param {string} path
575
621
  * @returns {Promise<Metadata>}
@@ -643,6 +689,10 @@ function __wbg_get_imports() {
643
689
  const ret = Error(getStringFromWasm0(arg0, arg1));
644
690
  return addHeapObject(ret);
645
691
  };
692
+ imports.wbg.__wbg_Number_998bea33bd87c3e0 = function (arg0) {
693
+ const ret = Number(getObject(arg0));
694
+ return ret;
695
+ };
646
696
  imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
647
697
  const ret = String(getObject(arg1));
648
698
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
@@ -807,6 +857,10 @@ function __wbg_get_imports() {
807
857
  return addHeapObject(ret);
808
858
  }, arguments);
809
859
  };
860
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
861
+ const ret = getObject(arg0)[getObject(arg1)];
862
+ return addHeapObject(ret);
863
+ };
810
864
  imports.wbg.__wbg_has_b89e451f638123e3 = function () {
811
865
  return handleError(function (arg0, arg1) {
812
866
  const ret = Reflect.has(getObject(arg0), getObject(arg1));
@@ -823,6 +877,17 @@ function __wbg_get_imports() {
823
877
  imports.wbg.__wbg_info_6cf68c1a86a92f6a = function (arg0) {
824
878
  console.info(getObject(arg0));
825
879
  };
880
+ imports.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function (arg0) {
881
+ let result;
882
+ try {
883
+ result = getObject(arg0) instanceof ArrayBuffer;
884
+ }
885
+ catch (_) {
886
+ result = false;
887
+ }
888
+ const ret = result;
889
+ return ret;
890
+ };
826
891
  imports.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_a054a9af652220ba = function (arg0) {
827
892
  let result;
828
893
  try {
@@ -867,6 +932,25 @@ function __wbg_get_imports() {
867
932
  const ret = result;
868
933
  return ret;
869
934
  };
935
+ imports.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function (arg0) {
936
+ let result;
937
+ try {
938
+ result = getObject(arg0) instanceof Uint8Array;
939
+ }
940
+ catch (_) {
941
+ result = false;
942
+ }
943
+ const ret = result;
944
+ return ret;
945
+ };
946
+ imports.wbg.__wbg_isArray_030cce220591fb41 = function (arg0) {
947
+ const ret = Array.isArray(getObject(arg0));
948
+ return ret;
949
+ };
950
+ imports.wbg.__wbg_isSafeInteger_1c0d1af5542e102a = function (arg0) {
951
+ const ret = Number.isSafeInteger(getObject(arg0));
952
+ return ret;
953
+ };
870
954
  imports.wbg.__wbg_iterator_f370b34483c71a1c = function () {
871
955
  const ret = Symbol.iterator;
872
956
  return addHeapObject(ret);
@@ -924,7 +1008,7 @@ function __wbg_get_imports() {
924
1008
  const a = state0.a;
925
1009
  state0.a = 0;
926
1010
  try {
927
- return __wbg_adapter_92(a, state0.b, arg0, arg1);
1011
+ return __wbg_adapter_102(a, state0.b, arg0, arg1);
928
1012
  }
929
1013
  finally {
930
1014
  state0.a = a;
@@ -1027,6 +1111,10 @@ function __wbg_get_imports() {
1027
1111
  const ret = getObject(arg0).now();
1028
1112
  return ret;
1029
1113
  };
1114
+ imports.wbg.__wbg_now_1e80617bcee43265 = function () {
1115
+ const ret = Date.now();
1116
+ return ret;
1117
+ };
1030
1118
  imports.wbg.__wbg_observe_a98641e2bc5e6a17 = function (arg0, arg1, arg2) {
1031
1119
  const ret = getObject(arg0).observe(getObject(arg1), getObject(arg2));
1032
1120
  return addHeapObject(ret);
@@ -1272,6 +1360,11 @@ function __wbg_get_imports() {
1272
1360
  imports.wbg.__wbg_warn_e2ada06313f92f09 = function (arg0) {
1273
1361
  console.warn(getObject(arg0));
1274
1362
  };
1363
+ imports.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function (arg0) {
1364
+ const v = getObject(arg0);
1365
+ const ret = typeof (v) === 'boolean' ? v : undefined;
1366
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1367
+ };
1275
1368
  imports.wbg.__wbg_wbindgencbdrop_eb10308566512b88 = function (arg0) {
1276
1369
  const obj = getObject(arg0).original;
1277
1370
  if (obj.cnt-- == 1) {
@@ -1288,6 +1381,10 @@ function __wbg_get_imports() {
1288
1381
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1289
1382
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1290
1383
  };
1384
+ imports.wbg.__wbg_wbindgenin_d7a1ee10933d2d55 = function (arg0, arg1) {
1385
+ const ret = getObject(arg0) in getObject(arg1);
1386
+ return ret;
1387
+ };
1291
1388
  imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function (arg0) {
1292
1389
  const ret = typeof (getObject(arg0)) === 'function';
1293
1390
  return ret;
@@ -1309,6 +1406,10 @@ function __wbg_get_imports() {
1309
1406
  const ret = getObject(arg0) === undefined;
1310
1407
  return ret;
1311
1408
  };
1409
+ imports.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function (arg0, arg1) {
1410
+ const ret = getObject(arg0) == getObject(arg1);
1411
+ return ret;
1412
+ };
1312
1413
  imports.wbg.__wbg_wbindgenmemory_d84da70f7c42d172 = function () {
1313
1414
  const ret = wasm.memory;
1314
1415
  return addHeapObject(ret);
@@ -1349,19 +1450,19 @@ function __wbg_get_imports() {
1349
1450
  return ret;
1350
1451
  }, arguments);
1351
1452
  };
1352
- imports.wbg.__wbindgen_cast_089f9f7ff7a05c34 = function (arg0, arg1) {
1353
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8792, function: Function { arguments: [Externref], shim_idx: 8793, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1354
- const ret = makeMutClosure(arg0, arg1, 8792, __wbg_adapter_12);
1453
+ imports.wbg.__wbindgen_cast_0c320b257d5729ef = function (arg0, arg1) {
1454
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8790, function: Function { arguments: [Externref], shim_idx: 8791, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1455
+ const ret = makeMutClosure(arg0, arg1, 8790, __wbg_adapter_13);
1355
1456
  return addHeapObject(ret);
1356
1457
  };
1357
- imports.wbg.__wbindgen_cast_0fa6bc778e36759b = function (arg0, arg1) {
1358
- // Cast intrinsic for `Closure(Closure { dtor_idx: 610, function: Function { arguments: [], shim_idx: 611, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1359
- const ret = makeMutClosure(arg0, arg1, 610, __wbg_adapter_4);
1458
+ imports.wbg.__wbindgen_cast_1ca0782ec1faf942 = function (arg0, arg1) {
1459
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 604, function: Function { arguments: [], shim_idx: 605, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1460
+ const ret = makeMutClosure(arg0, arg1, 604, __wbg_adapter_6);
1360
1461
  return addHeapObject(ret);
1361
1462
  };
1362
- imports.wbg.__wbindgen_cast_21aa834240a50280 = function (arg0, arg1) {
1363
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8792, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8793, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1364
- const ret = makeMutClosure(arg0, arg1, 8792, __wbg_adapter_12);
1463
+ imports.wbg.__wbindgen_cast_2177ad1b5237c27d = function (arg0, arg1) {
1464
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9057, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 9058, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1465
+ const ret = makeClosure(arg0, arg1, 9057, __wbg_adapter_28);
1365
1466
  return addHeapObject(ret);
1366
1467
  };
1367
1468
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
@@ -1369,6 +1470,11 @@ function __wbg_get_imports() {
1369
1470
  const ret = getStringFromWasm0(arg0, arg1);
1370
1471
  return addHeapObject(ret);
1371
1472
  };
1473
+ imports.wbg.__wbindgen_cast_435ac46f814eb59d = function (arg0, arg1) {
1474
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9057, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 9071, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1475
+ const ret = makeMutClosure(arg0, arg1, 9057, __wbg_adapter_31);
1476
+ return addHeapObject(ret);
1477
+ };
1372
1478
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
1373
1479
  // Cast intrinsic for `U64 -> Externref`.
1374
1480
  const ret = BigInt.asUintN(64, arg0);
@@ -1388,19 +1494,24 @@ function __wbg_get_imports() {
1388
1494
  const ret = v0;
1389
1495
  return addHeapObject(ret);
1390
1496
  };
1497
+ imports.wbg.__wbindgen_cast_81b97833e4f67b93 = function (arg0, arg1) {
1498
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8790, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8791, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1499
+ const ret = makeMutClosure(arg0, arg1, 8790, __wbg_adapter_13);
1500
+ return addHeapObject(ret);
1501
+ };
1502
+ imports.wbg.__wbindgen_cast_94a667b84282b0c6 = function (arg0, arg1) {
1503
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9073, function: Function { arguments: [], shim_idx: 605, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1504
+ const ret = makeMutClosure(arg0, arg1, 9073, __wbg_adapter_6);
1505
+ return addHeapObject(ret);
1506
+ };
1391
1507
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function (arg0) {
1392
1508
  // Cast intrinsic for `I64 -> Externref`.
1393
1509
  const ret = arg0;
1394
1510
  return addHeapObject(ret);
1395
1511
  };
1396
- imports.wbg.__wbindgen_cast_ac061a975f6fe616 = function (arg0, arg1) {
1397
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9059, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 9068, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1398
- const ret = makeMutClosure(arg0, arg1, 9059, __wbg_adapter_23);
1399
- return addHeapObject(ret);
1400
- };
1401
- imports.wbg.__wbindgen_cast_d2a79abcd9dd4a4f = function (arg0, arg1) {
1402
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9059, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 9060, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1403
- const ret = makeClosure(arg0, arg1, 9059, __wbg_adapter_9);
1512
+ imports.wbg.__wbindgen_cast_b2281badc9fff679 = function (arg0, arg1) {
1513
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8790, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 8791, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1514
+ const ret = makeMutClosure(arg0, arg1, 8790, __wbg_adapter_13);
1404
1515
  return addHeapObject(ret);
1405
1516
  };
1406
1517
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
@@ -1408,16 +1519,6 @@ function __wbg_get_imports() {
1408
1519
  const ret = arg0;
1409
1520
  return addHeapObject(ret);
1410
1521
  };
1411
- imports.wbg.__wbindgen_cast_e08369719eaa749a = function (arg0, arg1) {
1412
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8792, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 8793, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1413
- const ret = makeMutClosure(arg0, arg1, 8792, __wbg_adapter_12);
1414
- return addHeapObject(ret);
1415
- };
1416
- imports.wbg.__wbindgen_cast_e241456a1a2ffbf2 = function (arg0, arg1) {
1417
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9070, function: Function { arguments: [], shim_idx: 611, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1418
- const ret = makeMutClosure(arg0, arg1, 9070, __wbg_adapter_4);
1419
- return addHeapObject(ret);
1420
- };
1421
1522
  imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
1422
1523
  const val = `onmessage = function (ev) {
1423
1524
  let [ia, index, value] = ev.data;
Binary file
package/esm/worker.js CHANGED
@@ -99,6 +99,14 @@ const projectEndpoint = {
99
99
  await this.wasmInit;
100
100
  return await this.projectInternal.removeDir(path, !!(options === null || options === void 0 ? void 0 : options.recursive));
101
101
  },
102
+ async gzip(files) {
103
+ await this.wasmInit;
104
+ return await this.projectInternal.gzip(files);
105
+ },
106
+ async sigMd5(content) {
107
+ await this.wasmInit;
108
+ return await this.projectInternal.sigMd5(content);
109
+ },
102
110
  };
103
111
  const ConnectedPorts = new Set();
104
112
  self.addEventListener("message", (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/web",
3
- "version": "0.0.1-alpha.40",
3
+ "version": "0.0.1-alpha.42",
4
4
  "module": "esm/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "files": [