@utoo/web 1.2.0-rc.8 → 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 -12
  2. package/esm/{8f0451c2e61477918e02.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 +9 -9
  14. package/esm/utoo/index.js +75 -75
  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,27 +1,27 @@
1
+ /**
2
+ * @param {number} worker_id
3
+ * @returns {Promise<WasmTaskMessage>}
4
+ */
5
+ export function recvTaskMessageInWorker(worker_id: number): Promise<WasmTaskMessage>;
1
6
  /**
2
7
  * @param {any} message
3
8
  * @returns {Promise<void>}
4
9
  */
5
10
  export function sendTaskMessage(message: any): Promise<void>;
6
11
  /**
7
- * @param {number} worker_id
8
- * @returns {Promise<WasmTaskMessage>}
12
+ * @param {string} filter
9
13
  */
10
- export function recvTaskMessageInWorker(worker_id: number): Promise<WasmTaskMessage>;
14
+ export function init_log_filter(filter: string): void;
11
15
  export function init_pack(): void;
12
16
  /**
13
- * @param {string} filter
17
+ * @param {number} worker_id
14
18
  */
15
- export function init_log_filter(filter: string): void;
19
+ export function workerCreated(worker_id: number): void;
16
20
  /**
17
21
  * @param {Function} creator
18
22
  * @param {Function} terminator
19
23
  */
20
24
  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
@@ -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,12 +268,14 @@ export function init_log_filter(filter) {
271
268
  const len0 = WASM_VECTOR_LEN;
272
269
  wasm.init_log_filter(ptr0, len0);
273
270
  }
274
- /**
275
- * @param {Function} creator
276
- * @param {Function} terminator
277
- */
278
- export function registerWorkerScheduler(creator, terminator) {
279
- wasm.registerWorkerScheduler(addHeapObject(creator), addHeapObject(terminator));
271
+ export function init_pack() {
272
+ wasm.init_pack();
273
+ }
274
+ function passArray8ToWasm0(arg, malloc) {
275
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
276
+ getUint8ArrayMemory0().set(arg, ptr / 1);
277
+ WASM_VECTOR_LEN = arg.length;
278
+ return ptr;
280
279
  }
281
280
  /**
282
281
  * @param {number} worker_id
@@ -284,11 +283,12 @@ export function registerWorkerScheduler(creator, terminator) {
284
283
  export function workerCreated(worker_id) {
285
284
  wasm.workerCreated(worker_id);
286
285
  }
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;
286
+ /**
287
+ * @param {Function} creator
288
+ * @param {Function} terminator
289
+ */
290
+ export function registerWorkerScheduler(creator, terminator) {
291
+ wasm.registerWorkerScheduler(addHeapObject(creator), addHeapObject(terminator));
292
292
  }
293
293
  /**
294
294
  * Entry point for web workers
@@ -297,15 +297,9 @@ function passArray8ToWasm0(arg, malloc) {
297
297
  export function wasm_thread_entry_point(ptr) {
298
298
  wasm.wasm_thread_entry_point(ptr);
299
299
  }
300
- function __wbg_adapter_6(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_16(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_25(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_c9e2f89f142062e6 = 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));
@@ -1347,7 +1347,7 @@ function __wbg_get_imports() {
1347
1347
  return addHeapObject(ret);
1348
1348
  }, arguments);
1349
1349
  };
1350
- imports.wbg.__wbg_new_d2e51de36a0e4764 = function (arg0) {
1350
+ imports.wbg.__wbg_new_aa308f983e021414 = function (arg0) {
1351
1351
  const ret = new FileSystemObserver(getObject(arg0));
1352
1352
  return addHeapObject(ret);
1353
1353
  };
@@ -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_a0978eb3d8eeac7a = 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_e5d23d3c74d6be58 = 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_3a1cc4daad3e7e08 = 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_71184712a0bdfe7d = 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,14 +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_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);
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);
1754
1749
  return addHeapObject(ret);
1755
1750
  };
1756
1751
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
@@ -1758,11 +1753,31 @@ function __wbg_get_imports() {
1758
1753
  const ret = getStringFromWasm0(arg0, arg1);
1759
1754
  return addHeapObject(ret);
1760
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
+ };
1761
1771
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
1762
1772
  // Cast intrinsic for `U64 -> Externref`.
1763
1773
  const ret = BigInt.asUintN(64, arg0);
1764
1774
  return addHeapObject(ret);
1765
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
+ };
1766
1781
  imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
1767
1782
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1768
1783
  wasm.__wbindgen_export_4(arg0, arg1 * 4, 4);
@@ -1777,34 +1792,19 @@ function __wbg_get_imports() {
1777
1792
  const ret = v0;
1778
1793
  return addHeapObject(ret);
1779
1794
  };
1780
- imports.wbg.__wbindgen_cast_7b3678bd8e0fb80b = function (arg0, arg1) {
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`.
1782
- const ret = makeMutClosure(arg0, arg1, 8626, __wbg_adapter_6);
1783
- return addHeapObject(ret);
1784
- };
1785
- imports.wbg.__wbindgen_cast_884165a22f3e9702 = function (arg0, arg1) {
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`.
1787
- const ret = makeMutClosure(arg0, arg1, 8626, __wbg_adapter_6);
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_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);
1798
- return addHeapObject(ret);
1799
- };
1800
1800
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
1801
1801
  // Cast intrinsic for `F64 -> Externref`.
1802
1802
  const ret = arg0;
1803
1803
  return addHeapObject(ret);
1804
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);
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
1808
  return addHeapObject(ret);
1809
1809
  };
1810
1810
  imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
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.8",
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