@utoo/web 1.2.0-rc.7 → 1.2.0-rc.9

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.
Files changed (34) hide show
  1. package/README.md +14 -11
  2. package/esm/{b0afc1b3f31b4fb74f6b.wasm → 8f9533ebd1c6543b5d26.wasm} +0 -0
  3. package/esm/index.d.ts +3 -2
  4. package/esm/index.js +3 -2
  5. package/esm/loaderWorker.js +1 -1
  6. package/esm/{forkedProject.d.ts → project/ForkedProject.d.ts} +3 -3
  7. package/esm/{forkedProject.js → project/ForkedProject.js} +1 -1
  8. package/esm/{internalProject.d.ts → project/InternalProject.d.ts} +2 -2
  9. package/esm/{internalProject.js → project/InternalProject.js} +2 -2
  10. package/esm/{project.d.ts → project/Project.d.ts} +1 -1
  11. package/esm/{project.js → project/Project.js} +4 -4
  12. package/esm/serviceWorker.js +2 -2
  13. package/esm/utoo/index.d.ts +6 -6
  14. package/esm/utoo/index.js +69 -69
  15. package/esm/utoo/index_bg.wasm +0 -0
  16. package/esm/webpackLoaders/loaderWorkerPool.d.ts +1 -1
  17. package/esm/webpackLoaders/loaderWorkerPool.js +1 -1
  18. package/esm/webpackLoaders/polyfills/fsPolyfill.d.ts +1 -1
  19. package/esm/webpackLoaders/polyfills/fsPolyfill.js +2 -2
  20. package/esm/webpackLoaders/polyfills/fsPromisesPolyfill.d.ts +1 -1
  21. package/esm/webpackLoaders/polyfills/fsPromisesPolyfill.js +1 -1
  22. package/esm/webpackLoaders/worker.js +1 -1
  23. package/esm/worker.js +2 -2
  24. package/package.json +7 -6
  25. /package/esm/{type.d.ts → types.d.ts} +0 -0
  26. /package/esm/{type.js → types.js} +0 -0
  27. /package/esm/{installServiceWorker.d.ts → utils/installServiceWorker.d.ts} +0 -0
  28. /package/esm/{installServiceWorker.js → utils/installServiceWorker.js} +0 -0
  29. /package/esm/{message.d.ts → utils/message.d.ts} +0 -0
  30. /package/esm/{message.js → utils/message.js} +0 -0
  31. /package/esm/{sabcom.d.ts → utils/sabcom.d.ts} +0 -0
  32. /package/esm/{sabcom.js → utils/sabcom.js} +0 -0
  33. /package/esm/webpackLoaders/{type.d.ts → types.d.ts} +0 -0
  34. /package/esm/webpackLoaders/{type.js → types.js} +0 -0
@@ -1,15 +1,15 @@
1
- import { PackFile, ProjectEndpoint, Stats } from "./type";
1
+ import { PackFile, ProjectEndpoint, Stats } from "../types";
2
2
  export declare class ForkedProject implements ProjectEndpoint {
3
3
  private endpoint;
4
4
  constructor(port: MessagePort);
5
5
  install(packageLock: string, maxConcurrentDownloads?: number): Promise<void>;
6
- build(): Promise<import("./type").BuildOutput>;
6
+ build(): Promise<import("..").BuildOutput>;
7
7
  readFile(path: string, encoding?: "utf8"): Promise<any>;
8
8
  writeFile(path: string, content: string | Uint8Array, encoding?: "utf8"): Promise<void>;
9
9
  copyFile(src: string, dst: string): Promise<void>;
10
10
  readdir(path: string, options?: {
11
11
  recursive?: boolean;
12
- }): Promise<import("./type").Dirent[]>;
12
+ }): Promise<import("..").Dirent[]>;
13
13
  mkdir(path: string, options?: {
14
14
  recursive?: boolean;
15
15
  }): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import * as comlink from "comlink";
2
- import { Stats } from "./type";
2
+ import { Stats } from "../types";
3
3
  export class ForkedProject {
4
4
  constructor(port) {
5
5
  var _a;
@@ -1,5 +1,5 @@
1
- import { PackFile, ProjectEndpoint, ProjectOptions, Stats } from "./type";
2
- import initWasm from "./utoo";
1
+ import { PackFile, ProjectEndpoint, ProjectOptions, Stats } from "../types";
2
+ import initWasm from "../utoo";
3
3
  declare class InternalEndpoint implements ProjectEndpoint {
4
4
  wasmInit?: ReturnType<typeof initWasm>;
5
5
  options?: Omit<ProjectOptions, "workerUrl" | "serviceWorker">;
@@ -1,6 +1,6 @@
1
1
  import * as comlink from "comlink";
2
- import initWasm, { init_log_filter, Project as ProjectInternal, } from "./utoo";
3
- import { runLoaderWorkerPool } from "./webpackLoaders/loaderWorkerPool";
2
+ import initWasm, { init_log_filter, Project as ProjectInternal, } from "../utoo";
3
+ import { runLoaderWorkerPool } from "../webpackLoaders/loaderWorkerPool";
4
4
  class InternalEndpoint {
5
5
  constructor() {
6
6
  this.loaderWorkerPoolInitialized = false;
@@ -1,4 +1,4 @@
1
- import { BuildOutput, Dirent, PackFile, ProjectEndpoint, ProjectOptions, ServiceWorkerOptions, Stats } from "./type";
1
+ import { BuildOutput, Dirent, PackFile, ProjectEndpoint, ProjectOptions, ServiceWorkerOptions, Stats } from "../types";
2
2
  export declare class Project implements ProjectEndpoint {
3
3
  #private;
4
4
  private options;
@@ -12,10 +12,10 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
12
12
  var _Project_mount;
13
13
  import { handleIssues } from "@utoo/pack-shared";
14
14
  import * as comlink from "comlink";
15
- import { ForkedProject } from "./forkedProject";
16
- import { installServiceWorker } from "./installServiceWorker";
17
- import { Fork, HandShake } from "./message";
18
- import { Dirent, Stats, } from "./type";
15
+ import { Dirent, Stats, } from "../types";
16
+ import { installServiceWorker } from "../utils/installServiceWorker";
17
+ import { Fork, HandShake } from "../utils/message";
18
+ import { ForkedProject } from "./ForkedProject";
19
19
  let ProjectWorker;
20
20
  const ConnectedPorts = new Set();
21
21
  export class Project {
@@ -1,5 +1,5 @@
1
- import { Project } from ".";
2
- import { ServiceWorkerHandShake } from "./message";
1
+ import { Project } from "./project/Project";
2
+ import { ServiceWorkerHandShake } from "./utils/message";
3
3
  let _resolve;
4
4
  let _promise = new Promise((resolve) => {
5
5
  _resolve = resolve;
@@ -1,18 +1,18 @@
1
- /**
2
- * @param {any} message
3
- * @returns {Promise<void>}
4
- */
5
- export function sendTaskMessage(message: any): Promise<void>;
6
1
  /**
7
2
  * @param {number} worker_id
8
3
  * @returns {Promise<WasmTaskMessage>}
9
4
  */
10
5
  export function recvTaskMessageInWorker(worker_id: number): Promise<WasmTaskMessage>;
11
- export function init_pack(): void;
6
+ /**
7
+ * @param {any} message
8
+ * @returns {Promise<void>}
9
+ */
10
+ export function sendTaskMessage(message: any): Promise<void>;
12
11
  /**
13
12
  * @param {string} filter
14
13
  */
15
14
  export function init_log_filter(filter: string): void;
15
+ export function init_pack(): void;
16
16
  /**
17
17
  * @param {number} worker_id
18
18
  */
package/esm/utoo/index.js CHANGED
@@ -91,6 +91,9 @@ function handleError(f, args) {
91
91
  wasm.__wbindgen_export_3(addHeapObject(e));
92
92
  }
93
93
  }
94
+ function isLikeNone(x) {
95
+ return x === undefined || x === null;
96
+ }
94
97
  function dropObject(idx) {
95
98
  if (idx < 132)
96
99
  return;
@@ -106,9 +109,6 @@ function getArrayU8FromWasm0(ptr, len) {
106
109
  ptr = ptr >>> 0;
107
110
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
108
111
  }
109
- function isLikeNone(x) {
110
- return x === undefined || x === null;
111
- }
112
112
  function debugString(val) {
113
113
  // primitive types
114
114
  const type = typeof val;
@@ -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,19 +230,20 @@ 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
  function _assertClass(instance, klass) {
243
243
  if (!(instance instanceof klass)) {
244
244
  throw new Error(`expected instance of ${klass.name}`);
245
245
  }
246
246
  }
247
- /**
248
- * @param {any} message
249
- * @returns {Promise<void>}
250
- */
251
- export function sendTaskMessage(message) {
252
- const ret = wasm.sendTaskMessage(addHeapObject(message));
253
- return takeObject(ret);
254
- }
255
247
  /**
256
248
  * @param {number} worker_id
257
249
  * @returns {Promise<WasmTaskMessage>}
@@ -260,8 +252,13 @@ export function recvTaskMessageInWorker(worker_id) {
260
252
  const ret = wasm.recvTaskMessageInWorker(worker_id);
261
253
  return takeObject(ret);
262
254
  }
263
- export function init_pack() {
264
- wasm.init_pack();
255
+ /**
256
+ * @param {any} message
257
+ * @returns {Promise<void>}
258
+ */
259
+ export function sendTaskMessage(message) {
260
+ const ret = wasm.sendTaskMessage(addHeapObject(message));
261
+ return takeObject(ret);
265
262
  }
266
263
  /**
267
264
  * @param {string} filter
@@ -271,6 +268,9 @@ export function init_log_filter(filter) {
271
268
  const len0 = WASM_VECTOR_LEN;
272
269
  wasm.init_log_filter(ptr0, len0);
273
270
  }
271
+ export function init_pack() {
272
+ wasm.init_pack();
273
+ }
274
274
  function passArray8ToWasm0(arg, malloc) {
275
275
  const ptr = malloc(arg.length * 1, 1) >>> 0;
276
276
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -297,15 +297,9 @@ 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 __wbg_adapter_4(arg0, arg1, arg2) {
300
+ function __wbg_adapter_12(arg0, arg1, arg2) {
301
301
  wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
302
302
  }
303
- function __wbg_adapter_11(arg0, arg1) {
304
- wasm.__wbindgen_export_7(arg0, arg1);
305
- }
306
- function __wbg_adapter_18(arg0, arg1, arg2) {
307
- wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2));
308
- }
309
303
  let stack_pointer = 128;
310
304
  function addBorrowedObject(obj) {
311
305
  if (stack_pointer == 1)
@@ -313,14 +307,20 @@ function addBorrowedObject(obj) {
313
307
  heap[--stack_pointer] = obj;
314
308
  return stack_pointer;
315
309
  }
316
- function __wbg_adapter_23(arg0, arg1, arg2) {
310
+ function __wbg_adapter_17(arg0, arg1, arg2) {
317
311
  try {
318
- wasm.__wbindgen_export_9(arg0, arg1, addBorrowedObject(arg2));
312
+ wasm.__wbindgen_export_7(arg0, arg1, addBorrowedObject(arg2));
319
313
  }
320
314
  finally {
321
315
  heap[stack_pointer++] = undefined;
322
316
  }
323
317
  }
318
+ function __wbg_adapter_22(arg0, arg1) {
319
+ wasm.__wbindgen_export_8(arg0, arg1);
320
+ }
321
+ function __wbg_adapter_27(arg0, arg1, arg2) {
322
+ wasm.__wbindgen_export_9(arg0, arg1, addHeapObject(arg2));
323
+ }
324
324
  function __wbg_adapter_94(arg0, arg1, arg2, arg3) {
325
325
  wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
326
326
  }
@@ -1046,9 +1046,9 @@ function __wbg_get_imports() {
1046
1046
  return addHeapObject(ret);
1047
1047
  }, arguments);
1048
1048
  };
1049
- imports.wbg.__wbg_changedHandle_9ac6171cf620f861 = function (arg0) {
1049
+ imports.wbg.__wbg_changedHandle_8ffec3b429cf1dbb = function (arg0) {
1050
1050
  const ret = getObject(arg0).changedHandle;
1051
- return addHeapObject(ret);
1051
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1052
1052
  };
1053
1053
  imports.wbg.__wbg_clearTimeout_7a42b49784aea641 = function (arg0) {
1054
1054
  const ret = clearTimeout(takeObject(arg0));
@@ -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_aa308f983e021414 = 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.__wbg_observe_4d40e63195da8748 = function (arg0, arg1, arg2) {
1414
+ imports.wbg.__wbg_observe_d35dc74a40256f14 = 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.__wbg_relativePathComponents_e11d94d1d3b8277c = function (arg0) {
1466
+ imports.wbg.__wbg_relativePathComponents_e83421748ca55913 = 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.__wbg_setrecursive_8266308232855fe7 = function (arg0, arg1) {
1534
+ imports.wbg.__wbg_setrecursive_2b2b8ba6100007aa = 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.__wbg_type_53ab342163438035 = function (arg0) {
1615
+ imports.wbg.__wbg_type_8ed3e3e9b945ec59 = function (arg0) {
1616
1616
  const ret = getObject(arg0).type;
1617
1617
  return (__wbindgen_enum_FileSystemChangeRecordType.indexOf(ret) + 1 || 7) - 1;
1618
1618
  };
@@ -1743,9 +1743,9 @@ function __wbg_get_imports() {
1743
1743
  return ret;
1744
1744
  }, arguments);
1745
1745
  };
1746
- imports.wbg.__wbindgen_cast_0ca71f183bd17ba7 = function (arg0, arg1) {
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, __wbg_adapter_23);
1746
+ imports.wbg.__wbindgen_cast_16cb8cdf5bdf3d2f = function (arg0, arg1) {
1747
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 608, function: Function { arguments: [], shim_idx: 609, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1748
+ const ret = makeMutClosure(arg0, arg1, 608, __wbg_adapter_22);
1749
1749
  return addHeapObject(ret);
1750
1750
  };
1751
1751
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
@@ -1753,11 +1753,31 @@ function __wbg_get_imports() {
1753
1753
  const ret = getStringFromWasm0(arg0, arg1);
1754
1754
  return addHeapObject(ret);
1755
1755
  };
1756
+ imports.wbg.__wbindgen_cast_286fe19a62217061 = function (arg0, arg1) {
1757
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8641, function: Function { arguments: [Externref], shim_idx: 8642, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1758
+ const ret = makeMutClosure(arg0, arg1, 8641, __wbg_adapter_12);
1759
+ return addHeapObject(ret);
1760
+ };
1761
+ imports.wbg.__wbindgen_cast_2e6b786c82a2444b = function (arg0, arg1) {
1762
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8641, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8642, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1763
+ const ret = makeMutClosure(arg0, arg1, 8641, __wbg_adapter_12);
1764
+ return addHeapObject(ret);
1765
+ };
1766
+ imports.wbg.__wbindgen_cast_2f6a6fd4f0631b92 = function (arg0, arg1) {
1767
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8641, function: Function { arguments: [], shim_idx: 609, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1768
+ const ret = makeMutClosure(arg0, arg1, 8641, __wbg_adapter_22);
1769
+ return addHeapObject(ret);
1770
+ };
1756
1771
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
1757
1772
  // Cast intrinsic for `U64 -> Externref`.
1758
1773
  const ret = BigInt.asUintN(64, arg0);
1759
1774
  return addHeapObject(ret);
1760
1775
  };
1776
+ imports.wbg.__wbindgen_cast_5514ffff27ccb093 = function (arg0, arg1) {
1777
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8623, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8624, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1778
+ const ret = makeClosure(arg0, arg1, 8623, __wbg_adapter_27);
1779
+ return addHeapObject(ret);
1780
+ };
1761
1781
  imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
1762
1782
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1763
1783
  wasm.__wbindgen_export_4(arg0, arg1 * 4, 4);
@@ -1772,41 +1792,21 @@ function __wbg_get_imports() {
1772
1792
  const ret = v0;
1773
1793
  return addHeapObject(ret);
1774
1794
  };
1775
- imports.wbg.__wbindgen_cast_7b3678bd8e0fb80b = function (arg0, arg1) {
1776
- // 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, __wbg_adapter_4);
1778
- return addHeapObject(ret);
1779
- };
1780
- imports.wbg.__wbindgen_cast_884165a22f3e9702 = function (arg0, arg1) {
1781
- // 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, __wbg_adapter_4);
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_11);
1788
- return addHeapObject(ret);
1789
- };
1790
1795
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function (arg0) {
1791
1796
  // Cast intrinsic for `I64 -> Externref`.
1792
1797
  const ret = arg0;
1793
1798
  return addHeapObject(ret);
1794
1799
  };
1795
- imports.wbg.__wbindgen_cast_9f714a98b1af7c37 = function (arg0, arg1) {
1796
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8610, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8611, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1797
- const ret = makeClosure(arg0, arg1, 8610, __wbg_adapter_18);
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_11);
1803
- return addHeapObject(ret);
1804
- };
1805
1800
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
1806
1801
  // Cast intrinsic for `F64 -> Externref`.
1807
1802
  const ret = arg0;
1808
1803
  return addHeapObject(ret);
1809
1804
  };
1805
+ imports.wbg.__wbindgen_cast_f66d06ed140fa824 = function (arg0, arg1) {
1806
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8646, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 8647, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1807
+ const ret = makeMutClosure(arg0, arg1, 8646, __wbg_adapter_17);
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;
Binary file
@@ -1,2 +1,2 @@
1
- import { Binding } from "../type";
1
+ import { Binding } from "../types";
2
2
  export declare const runLoaderWorkerPool: (binding: Binding, projectCwd: string, loaderWorkerUrl: string, loadersImportMap?: Record<string, string>) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import * as sabcom from "../sabcom";
1
+ import * as sabcom from "../utils/sabcom";
2
2
  import initWasm, { Project as ProjectInternal, registerWorkerScheduler, workerCreated, } from "../utoo";
3
3
  let nextWorkerId = 0;
4
4
  const loaderWorkers = {};
@@ -1,5 +1,5 @@
1
1
  import { Buffer } from "buffer";
2
- import { Stats } from "../../type";
2
+ import { Stats } from "../../types";
3
3
  import { promises } from "./fsPromisesPolyfill";
4
4
  export declare function readFileSync(path: string, options: any): string | Buffer<any>;
5
5
  export declare function readdirSync(path: string, options?: any): any;
@@ -1,7 +1,7 @@
1
1
  import { Buffer } from "buffer";
2
2
  import path from "path";
3
- import * as sabcom from "../../sabcom";
4
- import { Stats } from "../../type";
3
+ import { Stats } from "../../types";
4
+ import * as sabcom from "../../utils/sabcom";
5
5
  import { promises } from "./fsPromisesPolyfill";
6
6
  function resolvePath(p) {
7
7
  var _a, _b, _c;
@@ -1,4 +1,4 @@
1
- import { Stats } from "../../type";
1
+ import { Stats } from "../../types";
2
2
  export declare const promises: {
3
3
  readFile: (p: string, options?: any) => Promise<any>;
4
4
  writeFile: (p: string, data: string | Uint8Array, options?: any) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { Buffer } from "buffer";
2
2
  import path from "path";
3
- import { Stats } from "../../type";
3
+ import { Stats } from "../../types";
4
4
  function resolvePath(p) {
5
5
  var _a, _b, _c;
6
6
  // @ts-ignore
@@ -1,4 +1,4 @@
1
- import { SabComClient } from "../sabcom";
1
+ import { SabComClient } from "../utils/sabcom";
2
2
  import initWasm, { Project, recvTaskMessageInWorker, sendTaskMessage, workerCreated, } from "../utoo";
3
3
  import { cjs } from "./cjs";
4
4
  const binding = {
package/esm/worker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as comlink from "comlink";
2
- import { internalEndpoint } from "./internalProject";
3
- import { HandShake } from "./message";
2
+ import { internalEndpoint } from "./project/InternalProject";
3
+ import { HandShake } from "./utils/message";
4
4
  const ConnectedPorts = new Set();
5
5
  self.addEventListener("message", (e) => {
6
6
  const port = e.ports[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/web",
3
- "version": "1.2.0-rc.7",
3
+ "version": "1.2.0-rc.9",
4
4
  "module": "esm/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "files": [
@@ -14,22 +14,23 @@
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
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",
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",
17
+ "copy-wasm": "cp src/utoo/index_bg.wasm esm/utoo",
18
+ "build:shared": "npx turbo run build --filter=@utoo/pack-shared",
19
+ "dev": "npm run build-wasm -- --profile wasm-dev && npm run bindgen-dev && npx turbo run tsc --filter=@utoo/web && npm run build-loaderWorker && npm run copy-wasm",
20
+ "dev:pm": "npm run build-wasm:pm -- --profile wasm-dev && npm run bindgen-dev && npm run tsc && npm run copy-wasm",
19
21
  "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",
20
22
  "build": "npm run build-wasm -- --release && npm run bindgen-build && npm run tsc && npm run build-loaderWorker && npm run wasm-opt",
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
+ "build:local": "npm run build-wasm -- --profile release-local && npm run bindgen-build:local && npm run build:shared && npm run tsc && npm run build-loaderWorker && npm run copy-wasm",
22
24
  "build-loaderWorker": "node cli/umd.js -e ./src/webpackLoaders/worker.ts -o ./esm/loaderWorker.js -t webworker",
25
+ "clean": "rm -rf esm src/utoo",
23
26
  "prepublishOnly": "turbo run build --filter=@utoo/web"
24
27
  },
25
28
  "dependencies": {
26
29
  "@utoo/pack-shared": "^0.0.7",
27
30
  "comlink": "^4.4.2",
28
- "micromatch": "^4.0.8",
29
31
  "systemjs": "^6.15.1"
30
32
  },
31
33
  "devDependencies": {
32
- "@types/micromatch": "^4.0.8",
33
34
  "@types/systemjs": "^6.15.1",
34
35
  "binaryen": "^125.0.0",
35
36
  "node-stdlib-browser": "^1.3.1",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes