@utoo/web 0.0.1-alpha.37 → 0.0.1-alpha.38

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.
@@ -2,7 +2,7 @@ import { ProjectEndpoint } from "./type";
2
2
  export declare class ForkedProject implements ProjectEndpoint {
3
3
  private endpoint;
4
4
  constructor(port: MessagePort);
5
- install(packageLock: string): Promise<void>;
5
+ install(packageLock: string, maxConcurrentDownloads?: number): Promise<void>;
6
6
  build(): Promise<import("./type").BuildOutput>;
7
7
  readFile(path: string, encoding?: "utf8"): Promise<any>;
8
8
  writeFile(path: string, content: string | Uint8Array, encoding?: "utf8"): Promise<void>;
@@ -4,8 +4,8 @@ export class ForkedProject {
4
4
  var _a;
5
5
  (_a = this.endpoint) !== null && _a !== void 0 ? _a : (this.endpoint = comlink.wrap(port));
6
6
  }
7
- async install(packageLock) {
8
- return await this.endpoint.install(packageLock);
7
+ async install(packageLock, maxConcurrentDownloads) {
8
+ return await this.endpoint.install(packageLock, maxConcurrentDownloads);
9
9
  }
10
10
  async build() {
11
11
  return await this.endpoint.build();
package/esm/project.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare class Project implements ProjectEndpoint {
7
7
  private connectWorker;
8
8
  installServiceWorker(): Promise<void>;
9
9
  mount(): Promise<void>;
10
- install(packageLock: string): Promise<void>;
10
+ install(packageLock: string, maxConcurrentDownloads?: number): Promise<void>;
11
11
  build(): Promise<BuildOutput>;
12
12
  readFile(path: string, encoding?: "utf8"): Promise<any>;
13
13
  writeFile(path: string, content: string | Uint8Array, encoding?: "utf8"): Promise<void>;
package/esm/project.js CHANGED
@@ -63,9 +63,9 @@ export class Project {
63
63
  async mount() {
64
64
  return await __classPrivateFieldGet(this, _Project_mount, "f");
65
65
  }
66
- async install(packageLock) {
66
+ async install(packageLock, maxConcurrentDownloads) {
67
67
  await __classPrivateFieldGet(this, _Project_mount, "f");
68
- return await this.remote.install(packageLock);
68
+ return await this.remote.install(packageLock, maxConcurrentDownloads);
69
69
  }
70
70
  async build() {
71
71
  await __classPrivateFieldGet(this, _Project_mount, "f");
package/esm/type.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface BuildOutput {
15
15
  issues: Issue[];
16
16
  }
17
17
  export interface ProjectEndpoint {
18
- install: (packageLock: string) => Promise<void>;
18
+ install: (packageLock: string, maxConcurrentDownloads?: number) => Promise<void>;
19
19
  build: () => Promise<BuildOutput>;
20
20
  readFile(path: string): Promise<Uint8Array>;
21
21
  readFile(path: string, encoding?: "utf8"): Promise<string>;
@@ -107,9 +107,10 @@ export class Project {
107
107
  write(path: string, content: Uint8Array): Promise<void>;
108
108
  /**
109
109
  * @param {string} package_lock
110
+ * @param {number | null} [max_concurrent_downloads]
110
111
  * @returns {Promise<void>}
111
112
  */
112
- install(package_lock: string): Promise<void>;
113
+ install(package_lock: string, max_concurrent_downloads?: number | null): Promise<void>;
113
114
  /**
114
115
  * @param {string} path
115
116
  * @returns {Promise<Metadata>}
package/esm/utoo/index.js CHANGED
@@ -208,6 +208,15 @@ 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
+ }
211
220
  function makeClosure(arg0, arg1, dtor, f) {
212
221
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
213
222
  const real = (...args) => {
@@ -230,15 +239,6 @@ function makeClosure(arg0, arg1, dtor, f) {
230
239
  CLOSURE_DTORS.register(real, state, state);
231
240
  return real;
232
241
  }
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,6 +255,9 @@ 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_6(arg0, arg1, arg2) {
259
+ wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
260
+ }
258
261
  let stack_pointer = 128;
259
262
  function addBorrowedObject(obj) {
260
263
  if (stack_pointer == 1)
@@ -262,22 +265,19 @@ function addBorrowedObject(obj) {
262
265
  heap[--stack_pointer] = obj;
263
266
  return stack_pointer;
264
267
  }
265
- function __wbg_adapter_8(arg0, arg1, arg2) {
268
+ function __wbg_adapter_9(arg0, arg1, arg2) {
266
269
  try {
267
- wasm.__wbindgen_export_6(arg0, arg1, addBorrowedObject(arg2));
270
+ wasm.__wbindgen_export_7(arg0, arg1, addBorrowedObject(arg2));
268
271
  }
269
272
  finally {
270
273
  heap[stack_pointer++] = undefined;
271
274
  }
272
275
  }
273
- function __wbg_adapter_11(arg0, arg1) {
274
- wasm.__wbindgen_export_7(arg0, arg1);
275
- }
276
- function __wbg_adapter_16(arg0, arg1, arg2) {
276
+ function __wbg_adapter_18(arg0, arg1, arg2) {
277
277
  wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2));
278
278
  }
279
- function __wbg_adapter_23(arg0, arg1, arg2) {
280
- wasm.__wbindgen_export_9(arg0, arg1, addHeapObject(arg2));
279
+ function __wbg_adapter_23(arg0, arg1) {
280
+ wasm.__wbindgen_export_9(arg0, arg1);
281
281
  }
282
282
  function __wbg_adapter_92(arg0, arg1, arg2, arg3) {
283
283
  wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
@@ -561,12 +561,13 @@ export class Project {
561
561
  }
562
562
  /**
563
563
  * @param {string} package_lock
564
+ * @param {number | null} [max_concurrent_downloads]
564
565
  * @returns {Promise<void>}
565
566
  */
566
- install(package_lock) {
567
+ install(package_lock, max_concurrent_downloads) {
567
568
  const ptr0 = passStringToWasm0(package_lock, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
568
569
  const len0 = WASM_VECTOR_LEN;
569
- const ret = wasm.project_install(this.__wbg_ptr, ptr0, len0);
570
+ const ret = wasm.project_install(this.__wbg_ptr, ptr0, len0, isLikeNone(max_concurrent_downloads) ? 0x100000001 : (max_concurrent_downloads) >>> 0);
570
571
  return takeObject(ret);
571
572
  }
572
573
  /**
@@ -1348,9 +1349,9 @@ function __wbg_get_imports() {
1348
1349
  return ret;
1349
1350
  }, arguments);
1350
1351
  };
1351
- imports.wbg.__wbindgen_cast_0f100a735c4920db = function (arg0, arg1) {
1352
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8794, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 8795, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1353
- const ret = makeMutClosure(arg0, arg1, 8794, __wbg_adapter_16);
1352
+ imports.wbg.__wbindgen_cast_0fa6bc778e36759b = function (arg0, arg1) {
1353
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 610, function: Function { arguments: [], shim_idx: 611, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1354
+ const ret = makeMutClosure(arg0, arg1, 610, __wbg_adapter_23);
1354
1355
  return addHeapObject(ret);
1355
1356
  };
1356
1357
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
@@ -1358,24 +1359,14 @@ function __wbg_get_imports() {
1358
1359
  const ret = getStringFromWasm0(arg0, arg1);
1359
1360
  return addHeapObject(ret);
1360
1361
  };
1361
- imports.wbg.__wbindgen_cast_349f2f0d319f2e1c = function (arg0, arg1) {
1362
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8794, function: Function { arguments: [Externref], shim_idx: 8795, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1363
- const ret = makeMutClosure(arg0, arg1, 8794, __wbg_adapter_16);
1364
- return addHeapObject(ret);
1365
- };
1366
1362
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
1367
1363
  // Cast intrinsic for `U64 -> Externref`.
1368
1364
  const ret = BigInt.asUintN(64, arg0);
1369
1365
  return addHeapObject(ret);
1370
1366
  };
1371
- imports.wbg.__wbindgen_cast_631793fd2186b3cf = function (arg0, arg1) {
1372
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9063, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 9064, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1373
- const ret = makeClosure(arg0, arg1, 9063, __wbg_adapter_23);
1374
- return addHeapObject(ret);
1375
- };
1376
- imports.wbg.__wbindgen_cast_64031a50bc0c5042 = function (arg0, arg1) {
1377
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9074, function: Function { arguments: [], shim_idx: 621, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1378
- const ret = makeMutClosure(arg0, arg1, 9074, __wbg_adapter_11);
1367
+ imports.wbg.__wbindgen_cast_53cee94be1b4fb3e = function (arg0, arg1) {
1368
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8798, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 8799, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1369
+ const ret = makeMutClosure(arg0, arg1, 8798, __wbg_adapter_6);
1379
1370
  return addHeapObject(ret);
1380
1371
  };
1381
1372
  imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
@@ -1392,14 +1383,29 @@ function __wbg_get_imports() {
1392
1383
  const ret = v0;
1393
1384
  return addHeapObject(ret);
1394
1385
  };
1386
+ imports.wbg.__wbindgen_cast_77d64c9ca30913b0 = function (arg0, arg1) {
1387
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9076, function: Function { arguments: [], shim_idx: 611, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1388
+ const ret = makeMutClosure(arg0, arg1, 9076, __wbg_adapter_23);
1389
+ return addHeapObject(ret);
1390
+ };
1391
+ imports.wbg.__wbindgen_cast_825af389dca3f1f2 = function (arg0, arg1) {
1392
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9065, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 9074, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1393
+ const ret = makeMutClosure(arg0, arg1, 9065, __wbg_adapter_9);
1394
+ return addHeapObject(ret);
1395
+ };
1396
+ imports.wbg.__wbindgen_cast_94f0e9bba4cd221c = function (arg0, arg1) {
1397
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8798, function: Function { arguments: [Externref], shim_idx: 8799, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1398
+ const ret = makeMutClosure(arg0, arg1, 8798, __wbg_adapter_6);
1399
+ return addHeapObject(ret);
1400
+ };
1395
1401
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function (arg0) {
1396
1402
  // Cast intrinsic for `I64 -> Externref`.
1397
1403
  const ret = arg0;
1398
1404
  return addHeapObject(ret);
1399
1405
  };
1400
- imports.wbg.__wbindgen_cast_aa86286f6e9d676e = function (arg0, arg1) {
1401
- // Cast intrinsic for `Closure(Closure { dtor_idx: 620, function: Function { arguments: [], shim_idx: 621, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1402
- const ret = makeMutClosure(arg0, arg1, 620, __wbg_adapter_11);
1406
+ imports.wbg.__wbindgen_cast_c33e49d357e1ea8e = function (arg0, arg1) {
1407
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9065, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 9066, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1408
+ const ret = makeClosure(arg0, arg1, 9065, __wbg_adapter_18);
1403
1409
  return addHeapObject(ret);
1404
1410
  };
1405
1411
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
@@ -1407,14 +1413,9 @@ function __wbg_get_imports() {
1407
1413
  const ret = arg0;
1408
1414
  return addHeapObject(ret);
1409
1415
  };
1410
- imports.wbg.__wbindgen_cast_e61e3b1a31545f58 = function (arg0, arg1) {
1411
- // Cast intrinsic for `Closure(Closure { dtor_idx: 8794, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8795, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1412
- const ret = makeMutClosure(arg0, arg1, 8794, __wbg_adapter_16);
1413
- return addHeapObject(ret);
1414
- };
1415
- imports.wbg.__wbindgen_cast_f7cd87a7af04d859 = function (arg0, arg1) {
1416
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9063, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 9072, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1417
- const ret = makeMutClosure(arg0, arg1, 9063, __wbg_adapter_8);
1416
+ imports.wbg.__wbindgen_cast_e68759fde1fb8044 = function (arg0, arg1) {
1417
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8798, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8799, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1418
+ const ret = makeMutClosure(arg0, arg1, 8798, __wbg_adapter_6);
1418
1419
  return addHeapObject(ret);
1419
1420
  };
1420
1421
  imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
Binary file
package/esm/worker.js CHANGED
@@ -24,9 +24,9 @@ const projectEndpoint = {
24
24
  this.projectInternal = new ProjectInternal(cwd, finalThreadWorkerUrl);
25
25
  return;
26
26
  },
27
- async install(packageLock) {
27
+ async install(packageLock, maxConcurrentDownloads) {
28
28
  await this.wasmInit;
29
- await this.projectInternal.install(packageLock);
29
+ await this.projectInternal.install(packageLock, maxConcurrentDownloads);
30
30
  return;
31
31
  },
32
32
  async build() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/web",
3
- "version": "0.0.1-alpha.37",
3
+ "version": "0.0.1-alpha.38",
4
4
  "module": "esm/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "files": [