@utoo/web 1.2.0-rc.1 → 1.2.0-rc.10
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 +55 -0
- package/esm/{aa0ad15d2a587c43406f.wasm → a0a815481b4ff49f8961.wasm} +0 -0
- package/esm/index.d.ts +3 -2
- package/esm/index.js +3 -2
- package/esm/loaderWorker.js +1 -1
- package/esm/loaderWorker.js.LICENSE.txt +0 -21
- package/esm/{forkedProject.d.ts → project/ForkedProject.d.ts} +5 -3
- package/esm/{forkedProject.js → project/ForkedProject.js} +8 -0
- package/esm/{internalProject.d.ts → project/InternalProject.d.ts} +4 -3
- package/esm/project/InternalProject.js +132 -0
- package/esm/{project.d.ts → project/Project.d.ts} +3 -1
- package/esm/{project.js → project/Project.js} +19 -6
- package/esm/serviceWorker.js +4 -3
- package/esm/{type.d.ts → types.d.ts} +43 -0
- package/esm/types.js +56 -0
- package/esm/utils/sabcom.d.ts +61 -0
- package/esm/utils/sabcom.js +203 -0
- package/esm/utoo/index.d.ts +73 -38
- package/esm/utoo/index.js +165 -141
- package/esm/utoo/index_bg.wasm +0 -0
- package/esm/webpackLoaders/{worker/cjs.js → cjs.js} +65 -41
- package/esm/webpackLoaders/loaderWorkerPool.d.ts +2 -0
- package/esm/webpackLoaders/loaderWorkerPool.js +90 -0
- package/esm/webpackLoaders/polyfills/fsPolyfill.d.ts +78 -0
- package/esm/webpackLoaders/{worker/polyfills → polyfills}/fsPolyfill.js +154 -191
- package/esm/webpackLoaders/polyfills/fsPromisesPolyfill.d.ts +26 -0
- package/esm/webpackLoaders/polyfills/fsPromisesPolyfill.js +112 -0
- package/esm/webpackLoaders/{worker/polyfills → polyfills}/nodePolyFills.d.ts +0 -2
- package/esm/webpackLoaders/{worker/polyfills → polyfills}/nodePolyFills.js +4 -3
- package/esm/webpackLoaders/{worker/type.d.ts → types.d.ts} +1 -0
- package/esm/webpackLoaders/{worker/index.js → worker.js} +8 -3
- package/esm/worker.js +2 -2
- package/package.json +14 -13
- package/esm/internalProject.js +0 -110
- package/esm/loaderWorkerPool.d.ts +0 -3
- package/esm/loaderWorkerPool.js +0 -125
- package/esm/sabcom.d.ts +0 -31
- package/esm/sabcom.js +0 -71
- package/esm/type.js +0 -12
- package/esm/webpackLoaders/loaders/less-loader/index.d.ts +0 -3
- package/esm/webpackLoaders/loaders/less-loader/index.js +0 -103
- package/esm/webpackLoaders/loaders/less-loader/options.json +0 -67
- package/esm/webpackLoaders/loaders/less-loader/utils.d.ts +0 -14
- package/esm/webpackLoaders/loaders/less-loader/utils.js +0 -217
- package/esm/webpackLoaders/worker/polyfills/fastGlobPolyfill.d.ts +0 -2
- package/esm/webpackLoaders/worker/polyfills/fastGlobPolyfill.js +0 -48
- package/esm/webpackLoaders/worker/polyfills/fsPolyfill.d.ts +0 -124
- package/esm/webpackLoaders/worker/polyfills/fsPromisesPolyfill.d.ts +0 -9
- package/esm/webpackLoaders/worker/polyfills/fsPromisesPolyfill.js +0 -9
- /package/esm/{installServiceWorker.d.ts → utils/installServiceWorker.d.ts} +0 -0
- /package/esm/{installServiceWorker.js → utils/installServiceWorker.js} +0 -0
- /package/esm/{message.d.ts → utils/message.d.ts} +0 -0
- /package/esm/{message.js → utils/message.js} +0 -0
- /package/esm/webpackLoaders/{worker/cjs.d.ts → cjs.d.ts} +0 -0
- /package/esm/webpackLoaders/{worker/polyfills → polyfills}/workerThreadsPolyfill.d.ts +0 -0
- /package/esm/webpackLoaders/{worker/polyfills → polyfills}/workerThreadsPolyfill.js +0 -0
- /package/esm/webpackLoaders/{worker/type.js → types.js} +0 -0
- /package/esm/webpackLoaders/{worker/index.d.ts → worker.d.ts} +0 -0
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;
|
|
@@ -244,14 +244,6 @@ function _assertClass(instance, 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,22 +252,31 @@ export function recvTaskMessageInWorker(worker_id) {
|
|
|
260
252
|
const ret = wasm.recvTaskMessageInWorker(worker_id);
|
|
261
253
|
return takeObject(ret);
|
|
262
254
|
}
|
|
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);
|
|
262
|
+
}
|
|
263
263
|
export function init_pack() {
|
|
264
264
|
wasm.init_pack();
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
267
|
* @param {string} filter
|
|
268
268
|
*/
|
|
269
|
-
export function
|
|
269
|
+
export function initLogFilter(filter) {
|
|
270
270
|
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
271
271
|
const len0 = WASM_VECTOR_LEN;
|
|
272
|
-
wasm.
|
|
272
|
+
wasm.initLogFilter(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
|
|
@@ -300,6 +300,9 @@ export function wasm_thread_entry_point(ptr) {
|
|
|
300
300
|
function __wbg_adapter_4(arg0, arg1, arg2) {
|
|
301
301
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
302
302
|
}
|
|
303
|
+
function __wbg_adapter_9(arg0, arg1) {
|
|
304
|
+
wasm.__wbindgen_export_7(arg0, arg1);
|
|
305
|
+
}
|
|
303
306
|
let stack_pointer = 128;
|
|
304
307
|
function addBorrowedObject(obj) {
|
|
305
308
|
if (stack_pointer == 1)
|
|
@@ -307,18 +310,15 @@ function addBorrowedObject(obj) {
|
|
|
307
310
|
heap[--stack_pointer] = obj;
|
|
308
311
|
return stack_pointer;
|
|
309
312
|
}
|
|
310
|
-
function
|
|
313
|
+
function __wbg_adapter_18(arg0, arg1, arg2) {
|
|
311
314
|
try {
|
|
312
|
-
wasm.
|
|
315
|
+
wasm.__wbindgen_export_8(arg0, arg1, addBorrowedObject(arg2));
|
|
313
316
|
}
|
|
314
317
|
finally {
|
|
315
318
|
heap[stack_pointer++] = undefined;
|
|
316
319
|
}
|
|
317
320
|
}
|
|
318
|
-
function
|
|
319
|
-
wasm.__wbindgen_export_8(arg0, arg1);
|
|
320
|
-
}
|
|
321
|
-
function __wbg_adapter_25(arg0, arg1, arg2) {
|
|
321
|
+
function __wbg_adapter_27(arg0, arg1, arg2) {
|
|
322
322
|
wasm.__wbindgen_export_9(arg0, arg1, addHeapObject(arg2));
|
|
323
323
|
}
|
|
324
324
|
function __wbg_adapter_94(arg0, arg1, arg2, arg3) {
|
|
@@ -441,7 +441,10 @@ export class Metadata {
|
|
|
441
441
|
return obj;
|
|
442
442
|
}
|
|
443
443
|
toJSON() {
|
|
444
|
-
return {
|
|
444
|
+
return {
|
|
445
|
+
type: this.type,
|
|
446
|
+
file_size: this.file_size,
|
|
447
|
+
};
|
|
445
448
|
}
|
|
446
449
|
toString() {
|
|
447
450
|
return JSON.stringify(this);
|
|
@@ -456,6 +459,32 @@ export class Metadata {
|
|
|
456
459
|
const ptr = this.__destroy_into_raw();
|
|
457
460
|
wasm.__wbg_metadata_free(ptr, 0);
|
|
458
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* @returns {DirEntryType}
|
|
464
|
+
*/
|
|
465
|
+
get type() {
|
|
466
|
+
const ret = wasm.__wbg_get_metadata_type(this.__wbg_ptr);
|
|
467
|
+
return __wbindgen_enum_DirEntryType[ret];
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* @param {DirEntryType} arg0
|
|
471
|
+
*/
|
|
472
|
+
set type(arg0) {
|
|
473
|
+
wasm.__wbg_set_metadata_type(this.__wbg_ptr, (__wbindgen_enum_DirEntryType.indexOf(arg0) + 1 || 3) - 1);
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* @returns {bigint}
|
|
477
|
+
*/
|
|
478
|
+
get file_size() {
|
|
479
|
+
const ret = wasm.__wbg_get_metadata_file_size(this.__wbg_ptr);
|
|
480
|
+
return BigInt.asUintN(64, ret);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* @param {bigint} arg0
|
|
484
|
+
*/
|
|
485
|
+
set file_size(arg0) {
|
|
486
|
+
wasm.__wbg_set_metadata_file_size(this.__wbg_ptr, arg0);
|
|
487
|
+
}
|
|
459
488
|
}
|
|
460
489
|
if (Symbol.dispose)
|
|
461
490
|
Metadata.prototype[Symbol.dispose] = Metadata.prototype.free;
|
|
@@ -477,10 +506,10 @@ export class Project {
|
|
|
477
506
|
* @param {string} path
|
|
478
507
|
* @returns {Promise<void>}
|
|
479
508
|
*/
|
|
480
|
-
createDir(path) {
|
|
509
|
+
static createDir(path) {
|
|
481
510
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
482
511
|
const len0 = WASM_VECTOR_LEN;
|
|
483
|
-
const ret = wasm.project_createDir(
|
|
512
|
+
const ret = wasm.project_createDir(ptr0, len0);
|
|
484
513
|
return takeObject(ret);
|
|
485
514
|
}
|
|
486
515
|
/**
|
|
@@ -488,20 +517,20 @@ export class Project {
|
|
|
488
517
|
* @param {boolean} recursive
|
|
489
518
|
* @returns {Promise<void>}
|
|
490
519
|
*/
|
|
491
|
-
removeDir(path, recursive) {
|
|
520
|
+
static removeDir(path, recursive) {
|
|
492
521
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
493
522
|
const len0 = WASM_VECTOR_LEN;
|
|
494
|
-
const ret = wasm.project_removeDir(
|
|
523
|
+
const ret = wasm.project_removeDir(ptr0, len0, recursive);
|
|
495
524
|
return takeObject(ret);
|
|
496
525
|
}
|
|
497
526
|
/**
|
|
498
527
|
* @param {string} path
|
|
499
528
|
* @returns {Promise<void>}
|
|
500
529
|
*/
|
|
501
|
-
removeFile(path) {
|
|
530
|
+
static removeFile(path) {
|
|
502
531
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
503
532
|
const len0 = WASM_VECTOR_LEN;
|
|
504
|
-
const ret = wasm.project_removeFile(
|
|
533
|
+
const ret = wasm.project_removeFile(ptr0, len0);
|
|
505
534
|
return takeObject(ret);
|
|
506
535
|
}
|
|
507
536
|
/**
|
|
@@ -509,43 +538,43 @@ export class Project {
|
|
|
509
538
|
* @param {string} content
|
|
510
539
|
* @returns {Promise<void>}
|
|
511
540
|
*/
|
|
512
|
-
writeString(path, content) {
|
|
541
|
+
static writeString(path, content) {
|
|
513
542
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
514
543
|
const len0 = WASM_VECTOR_LEN;
|
|
515
544
|
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
516
545
|
const len1 = WASM_VECTOR_LEN;
|
|
517
|
-
const ret = wasm.project_writeString(
|
|
546
|
+
const ret = wasm.project_writeString(ptr0, len0, ptr1, len1);
|
|
518
547
|
return takeObject(ret);
|
|
519
548
|
}
|
|
520
549
|
/**
|
|
521
550
|
* @param {string} path
|
|
522
551
|
* @returns {Promise<void>}
|
|
523
552
|
*/
|
|
524
|
-
createDirAll(path) {
|
|
553
|
+
static createDirAll(path) {
|
|
525
554
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
526
555
|
const len0 = WASM_VECTOR_LEN;
|
|
527
|
-
const ret = wasm.project_createDirAll(
|
|
556
|
+
const ret = wasm.project_createDirAll(ptr0, len0);
|
|
528
557
|
return takeObject(ret);
|
|
529
558
|
}
|
|
530
559
|
/**
|
|
531
560
|
* @param {string} path
|
|
532
561
|
* @returns {Promise<string>}
|
|
533
562
|
*/
|
|
534
|
-
readToString(path) {
|
|
563
|
+
static readToString(path) {
|
|
535
564
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
536
565
|
const len0 = WASM_VECTOR_LEN;
|
|
537
|
-
const ret = wasm.project_readToString(
|
|
566
|
+
const ret = wasm.project_readToString(ptr0, len0);
|
|
538
567
|
return takeObject(ret);
|
|
539
568
|
}
|
|
540
569
|
/**
|
|
541
570
|
* @returns {string}
|
|
542
571
|
*/
|
|
543
|
-
get cwd() {
|
|
572
|
+
static get cwd() {
|
|
544
573
|
let deferred1_0;
|
|
545
574
|
let deferred1_1;
|
|
546
575
|
try {
|
|
547
576
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
548
|
-
wasm.project_cwd(retptr
|
|
577
|
+
wasm.project_cwd(retptr);
|
|
549
578
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
550
579
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
551
580
|
deferred1_0 = r0;
|
|
@@ -558,56 +587,56 @@ export class Project {
|
|
|
558
587
|
}
|
|
559
588
|
}
|
|
560
589
|
/**
|
|
561
|
-
*
|
|
562
|
-
*
|
|
590
|
+
* Generate package-lock.json by resolving dependencies.
|
|
591
|
+
*
|
|
592
|
+
* # Arguments
|
|
593
|
+
* * `registry` - Optional registry URL. If None, uses npmmirror.
|
|
594
|
+
* - "https://registry.npmmirror.com" - supports semver queries (faster)
|
|
595
|
+
* - "https://registry.npmjs.org" - official npm registry (slower, fetches full manifest)
|
|
596
|
+
* * `concurrency` - Optional concurrency limit (defaults to 20)
|
|
597
|
+
* @param {string | null} [registry]
|
|
598
|
+
* @param {number | null} [concurrency]
|
|
599
|
+
* @returns {Promise<string>}
|
|
563
600
|
*/
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
const ret = wasm.project_new(ptr0, len0, ptr1, len1);
|
|
570
|
-
this.__wbg_ptr = ret >>> 0;
|
|
571
|
-
ProjectFinalization.register(this, this.__wbg_ptr, this);
|
|
572
|
-
return this;
|
|
601
|
+
static deps(registry, concurrency) {
|
|
602
|
+
var ptr0 = isLikeNone(registry) ? 0 : passStringToWasm0(registry, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
603
|
+
var len0 = WASM_VECTOR_LEN;
|
|
604
|
+
const ret = wasm.project_deps(ptr0, len0, isLikeNone(concurrency) ? 0x100000001 : (concurrency) >>> 0);
|
|
605
|
+
return takeObject(ret);
|
|
573
606
|
}
|
|
574
607
|
/**
|
|
575
608
|
* Create a tar.gz archive and return bytes (no file I/O)
|
|
576
609
|
* This is useful for main thread execution without OPFS access
|
|
577
610
|
* @param {any} files
|
|
578
|
-
* @returns {Uint8Array}
|
|
611
|
+
* @returns {Promise<Uint8Array>}
|
|
579
612
|
*/
|
|
580
|
-
gzip(files) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}
|
|
592
|
-
finally {
|
|
593
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
594
|
-
}
|
|
613
|
+
static gzip(files) {
|
|
614
|
+
const ret = wasm.project_gzip(addHeapObject(files));
|
|
615
|
+
return takeObject(ret);
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* @param {string} thread_url
|
|
619
|
+
*/
|
|
620
|
+
static init(thread_url) {
|
|
621
|
+
const ptr0 = passStringToWasm0(thread_url, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
622
|
+
const len0 = WASM_VECTOR_LEN;
|
|
623
|
+
wasm.project_init(ptr0, len0);
|
|
595
624
|
}
|
|
596
625
|
/**
|
|
597
626
|
* @param {string} path
|
|
598
627
|
* @returns {Promise<Uint8Array>}
|
|
599
628
|
*/
|
|
600
|
-
read(path) {
|
|
629
|
+
static read(path) {
|
|
601
630
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
602
631
|
const len0 = WASM_VECTOR_LEN;
|
|
603
|
-
const ret = wasm.project_read(
|
|
632
|
+
const ret = wasm.project_read(ptr0, len0);
|
|
604
633
|
return takeObject(ret);
|
|
605
634
|
}
|
|
606
635
|
/**
|
|
607
636
|
* @returns {Promise<any>}
|
|
608
637
|
*/
|
|
609
|
-
build() {
|
|
610
|
-
const ret = wasm.project_build(
|
|
638
|
+
static build() {
|
|
639
|
+
const ret = wasm.project_build();
|
|
611
640
|
return takeObject(ret);
|
|
612
641
|
}
|
|
613
642
|
/**
|
|
@@ -615,12 +644,12 @@ export class Project {
|
|
|
615
644
|
* @param {Uint8Array} content
|
|
616
645
|
* @returns {Promise<void>}
|
|
617
646
|
*/
|
|
618
|
-
write(path, content) {
|
|
647
|
+
static write(path, content) {
|
|
619
648
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
620
649
|
const len0 = WASM_VECTOR_LEN;
|
|
621
650
|
const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
|
|
622
651
|
const len1 = WASM_VECTOR_LEN;
|
|
623
|
-
const ret = wasm.project_write(
|
|
652
|
+
const ret = wasm.project_write(ptr0, len0, ptr1, len1);
|
|
624
653
|
return takeObject(ret);
|
|
625
654
|
}
|
|
626
655
|
/**
|
|
@@ -628,54 +657,49 @@ export class Project {
|
|
|
628
657
|
* @param {number | null} [max_concurrent_downloads]
|
|
629
658
|
* @returns {Promise<void>}
|
|
630
659
|
*/
|
|
631
|
-
install(package_lock, max_concurrent_downloads) {
|
|
660
|
+
static install(package_lock, max_concurrent_downloads) {
|
|
632
661
|
const ptr0 = passStringToWasm0(package_lock, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
633
662
|
const len0 = WASM_VECTOR_LEN;
|
|
634
|
-
const ret = wasm.project_install(
|
|
663
|
+
const ret = wasm.project_install(ptr0, len0, isLikeNone(max_concurrent_downloads) ? 0x100000001 : (max_concurrent_downloads) >>> 0);
|
|
635
664
|
return takeObject(ret);
|
|
636
665
|
}
|
|
637
666
|
/**
|
|
638
|
-
*
|
|
667
|
+
* @param {string} path
|
|
668
|
+
*/
|
|
669
|
+
static setCwd(path) {
|
|
670
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
671
|
+
const len0 = WASM_VECTOR_LEN;
|
|
672
|
+
wasm.project_setCwd(ptr0, len0);
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Calculate MD5 hash of byte content (async for better thread scheduling)
|
|
639
676
|
* @param {Uint8Array} content
|
|
640
|
-
* @returns {string}
|
|
677
|
+
* @returns {Promise<string>}
|
|
641
678
|
*/
|
|
642
|
-
sigMd5(content) {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
|
|
648
|
-
const len0 = WASM_VECTOR_LEN;
|
|
649
|
-
wasm.project_sigMd5(retptr, this.__wbg_ptr, ptr0, len0);
|
|
650
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
651
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
652
|
-
deferred2_0 = r0;
|
|
653
|
-
deferred2_1 = r1;
|
|
654
|
-
return getStringFromWasm0(r0, r1);
|
|
655
|
-
}
|
|
656
|
-
finally {
|
|
657
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
658
|
-
wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
|
|
659
|
-
}
|
|
679
|
+
static sigMd5(content) {
|
|
680
|
+
const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
|
|
681
|
+
const len0 = WASM_VECTOR_LEN;
|
|
682
|
+
const ret = wasm.project_sigMd5(ptr0, len0);
|
|
683
|
+
return takeObject(ret);
|
|
660
684
|
}
|
|
661
685
|
/**
|
|
662
686
|
* @param {string} path
|
|
663
687
|
* @returns {Promise<Metadata>}
|
|
664
688
|
*/
|
|
665
|
-
metadata(path) {
|
|
689
|
+
static metadata(path) {
|
|
666
690
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
667
691
|
const len0 = WASM_VECTOR_LEN;
|
|
668
|
-
const ret = wasm.project_metadata(
|
|
692
|
+
const ret = wasm.project_metadata(ptr0, len0);
|
|
669
693
|
return takeObject(ret);
|
|
670
694
|
}
|
|
671
695
|
/**
|
|
672
696
|
* @param {string} path
|
|
673
697
|
* @returns {Promise<DirEntry[]>}
|
|
674
698
|
*/
|
|
675
|
-
readDir(path) {
|
|
699
|
+
static readDir(path) {
|
|
676
700
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
677
701
|
const len0 = WASM_VECTOR_LEN;
|
|
678
|
-
const ret = wasm.project_readDir(
|
|
702
|
+
const ret = wasm.project_readDir(ptr0, len0);
|
|
679
703
|
return takeObject(ret);
|
|
680
704
|
}
|
|
681
705
|
/**
|
|
@@ -683,12 +707,12 @@ export class Project {
|
|
|
683
707
|
* @param {string} dst
|
|
684
708
|
* @returns {Promise<void>}
|
|
685
709
|
*/
|
|
686
|
-
copyFile(src, dst) {
|
|
710
|
+
static copyFile(src, dst) {
|
|
687
711
|
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
688
712
|
const len0 = WASM_VECTOR_LEN;
|
|
689
713
|
const ptr1 = passStringToWasm0(dst, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
690
714
|
const len1 = WASM_VECTOR_LEN;
|
|
691
|
-
const ret = wasm.project_copyFile(
|
|
715
|
+
const ret = wasm.project_copyFile(ptr0, len0, ptr1, len1);
|
|
692
716
|
return takeObject(ret);
|
|
693
717
|
}
|
|
694
718
|
}
|
|
@@ -1015,9 +1039,9 @@ function __wbg_get_imports() {
|
|
|
1015
1039
|
return addHeapObject(ret);
|
|
1016
1040
|
}, arguments);
|
|
1017
1041
|
};
|
|
1018
|
-
imports.wbg.
|
|
1042
|
+
imports.wbg.__wbg_changedHandle_8ffec3b429cf1dbb = function (arg0) {
|
|
1019
1043
|
const ret = getObject(arg0).changedHandle;
|
|
1020
|
-
return addHeapObject(ret);
|
|
1044
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1021
1045
|
};
|
|
1022
1046
|
imports.wbg.__wbg_clearTimeout_7a42b49784aea641 = function (arg0) {
|
|
1023
1047
|
const ret = clearTimeout(takeObject(arg0));
|
|
@@ -1296,10 +1320,6 @@ function __wbg_get_imports() {
|
|
|
1296
1320
|
const ret = new Map();
|
|
1297
1321
|
return addHeapObject(ret);
|
|
1298
1322
|
};
|
|
1299
|
-
imports.wbg.__wbg_new_61e1f224687df92d = function (arg0) {
|
|
1300
|
-
const ret = new FileSystemObserver(getObject(arg0));
|
|
1301
|
-
return addHeapObject(ret);
|
|
1302
|
-
};
|
|
1303
1323
|
imports.wbg.__wbg_new_638ebfaedbf32a5e = function (arg0) {
|
|
1304
1324
|
const ret = new Uint8Array(getObject(arg0));
|
|
1305
1325
|
return addHeapObject(ret);
|
|
@@ -1320,6 +1340,10 @@ function __wbg_get_imports() {
|
|
|
1320
1340
|
return addHeapObject(ret);
|
|
1321
1341
|
}, arguments);
|
|
1322
1342
|
};
|
|
1343
|
+
imports.wbg.__wbg_new_aa308f983e021414 = function (arg0) {
|
|
1344
|
+
const ret = new FileSystemObserver(getObject(arg0));
|
|
1345
|
+
return addHeapObject(ret);
|
|
1346
|
+
};
|
|
1323
1347
|
imports.wbg.__wbg_new_f6e53210afea8e45 = function () {
|
|
1324
1348
|
return handleError(function () {
|
|
1325
1349
|
const ret = new Headers();
|
|
@@ -1380,7 +1404,7 @@ function __wbg_get_imports() {
|
|
|
1380
1404
|
const ret = Date.now();
|
|
1381
1405
|
return ret;
|
|
1382
1406
|
};
|
|
1383
|
-
imports.wbg.
|
|
1407
|
+
imports.wbg.__wbg_observe_d35dc74a40256f14 = function (arg0, arg1, arg2) {
|
|
1384
1408
|
const ret = getObject(arg0).observe(getObject(arg1), getObject(arg2));
|
|
1385
1409
|
return addHeapObject(ret);
|
|
1386
1410
|
};
|
|
@@ -1432,7 +1456,7 @@ function __wbg_get_imports() {
|
|
|
1432
1456
|
return ret;
|
|
1433
1457
|
}, arguments);
|
|
1434
1458
|
};
|
|
1435
|
-
imports.wbg.
|
|
1459
|
+
imports.wbg.__wbg_relativePathComponents_e83421748ca55913 = function (arg0) {
|
|
1436
1460
|
const ret = getObject(arg0).relativePathComponents;
|
|
1437
1461
|
return addHeapObject(ret);
|
|
1438
1462
|
};
|
|
@@ -1500,7 +1524,7 @@ function __wbg_get_imports() {
|
|
|
1500
1524
|
imports.wbg.__wbg_setrecursive_072599988d5f7e8d = function (arg0, arg1) {
|
|
1501
1525
|
getObject(arg0).recursive = arg1 !== 0;
|
|
1502
1526
|
};
|
|
1503
|
-
imports.wbg.
|
|
1527
|
+
imports.wbg.__wbg_setrecursive_2b2b8ba6100007aa = function (arg0, arg1) {
|
|
1504
1528
|
getObject(arg0).recursive = arg1 !== 0;
|
|
1505
1529
|
};
|
|
1506
1530
|
imports.wbg.__wbg_setsignal_8c45ad1247a74809 = function (arg0, arg1) {
|
|
@@ -1581,7 +1605,7 @@ function __wbg_get_imports() {
|
|
|
1581
1605
|
getObject(arg0).truncate(arg1 >>> 0);
|
|
1582
1606
|
}, arguments);
|
|
1583
1607
|
};
|
|
1584
|
-
imports.wbg.
|
|
1608
|
+
imports.wbg.__wbg_type_8ed3e3e9b945ec59 = function (arg0) {
|
|
1585
1609
|
const ret = getObject(arg0).type;
|
|
1586
1610
|
return (__wbindgen_enum_FileSystemChangeRecordType.indexOf(ret) + 1 || 7) - 1;
|
|
1587
1611
|
};
|
|
@@ -1712,9 +1736,14 @@ function __wbg_get_imports() {
|
|
|
1712
1736
|
return ret;
|
|
1713
1737
|
}, arguments);
|
|
1714
1738
|
};
|
|
1715
|
-
imports.wbg.
|
|
1716
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1717
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1739
|
+
imports.wbg.__wbindgen_cast_0336f6e3114862a9 = function (arg0, arg1) {
|
|
1740
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8677, function: Function { arguments: [], shim_idx: 1993, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1741
|
+
const ret = makeMutClosure(arg0, arg1, 8677, __wbg_adapter_9);
|
|
1742
|
+
return addHeapObject(ret);
|
|
1743
|
+
};
|
|
1744
|
+
imports.wbg.__wbindgen_cast_1fa25394258c7b5c = function (arg0, arg1) {
|
|
1745
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1992, function: Function { arguments: [], shim_idx: 1993, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1746
|
+
const ret = makeMutClosure(arg0, arg1, 1992, __wbg_adapter_9);
|
|
1718
1747
|
return addHeapObject(ret);
|
|
1719
1748
|
};
|
|
1720
1749
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
|
|
@@ -1722,14 +1751,19 @@ function __wbg_get_imports() {
|
|
|
1722
1751
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1723
1752
|
return addHeapObject(ret);
|
|
1724
1753
|
};
|
|
1754
|
+
imports.wbg.__wbindgen_cast_267b46f6d4f9531c = function (arg0, arg1) {
|
|
1755
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8677, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8678, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1756
|
+
const ret = makeMutClosure(arg0, arg1, 8677, __wbg_adapter_4);
|
|
1757
|
+
return addHeapObject(ret);
|
|
1758
|
+
};
|
|
1725
1759
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
|
|
1726
1760
|
// Cast intrinsic for `U64 -> Externref`.
|
|
1727
1761
|
const ret = BigInt.asUintN(64, arg0);
|
|
1728
1762
|
return addHeapObject(ret);
|
|
1729
1763
|
};
|
|
1730
|
-
imports.wbg.
|
|
1731
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1732
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1764
|
+
imports.wbg.__wbindgen_cast_71a8823e0cdbb969 = function (arg0, arg1) {
|
|
1765
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8677, function: Function { arguments: [Externref], shim_idx: 8678, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1766
|
+
const ret = makeMutClosure(arg0, arg1, 8677, __wbg_adapter_4);
|
|
1733
1767
|
return addHeapObject(ret);
|
|
1734
1768
|
};
|
|
1735
1769
|
imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
|
|
@@ -1739,11 +1773,6 @@ function __wbg_get_imports() {
|
|
|
1739
1773
|
const ret = v0;
|
|
1740
1774
|
return addHeapObject(ret);
|
|
1741
1775
|
};
|
|
1742
|
-
imports.wbg.__wbindgen_cast_77984da3a91be2e9 = function (arg0, arg1) {
|
|
1743
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 8625, function: Function { arguments: [Externref], shim_idx: 8626, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1744
|
-
const ret = makeMutClosure(arg0, arg1, 8625, __wbg_adapter_4);
|
|
1745
|
-
return addHeapObject(ret);
|
|
1746
|
-
};
|
|
1747
1776
|
imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function (arg0, arg1) {
|
|
1748
1777
|
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
1749
1778
|
wasm.__wbindgen_export_4(arg0, arg1 * 1, 1);
|
|
@@ -1751,24 +1780,14 @@ function __wbg_get_imports() {
|
|
|
1751
1780
|
const ret = v0;
|
|
1752
1781
|
return addHeapObject(ret);
|
|
1753
1782
|
};
|
|
1754
|
-
imports.wbg.__wbindgen_cast_8ecade4ce8b126db = function (arg0, arg1) {
|
|
1755
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 8625, function: Function { arguments: [], shim_idx: 604, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1756
|
-
const ret = makeMutClosure(arg0, arg1, 8625, __wbg_adapter_20);
|
|
1757
|
-
return addHeapObject(ret);
|
|
1758
|
-
};
|
|
1759
1783
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function (arg0) {
|
|
1760
1784
|
// Cast intrinsic for `I64 -> Externref`.
|
|
1761
1785
|
const ret = arg0;
|
|
1762
1786
|
return addHeapObject(ret);
|
|
1763
1787
|
};
|
|
1764
|
-
imports.wbg.
|
|
1765
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1766
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1767
|
-
return addHeapObject(ret);
|
|
1768
|
-
};
|
|
1769
|
-
imports.wbg.__wbindgen_cast_cdaa362fcf12456c = function (arg0, arg1) {
|
|
1770
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 8609, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8610, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
1771
|
-
const ret = makeClosure(arg0, arg1, 8609, __wbg_adapter_25);
|
|
1788
|
+
imports.wbg.__wbindgen_cast_b7dc63dcdfc8d728 = function (arg0, arg1) {
|
|
1789
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8682, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 8683, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1790
|
+
const ret = makeMutClosure(arg0, arg1, 8682, __wbg_adapter_18);
|
|
1772
1791
|
return addHeapObject(ret);
|
|
1773
1792
|
};
|
|
1774
1793
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
|
|
@@ -1776,6 +1795,11 @@ function __wbg_get_imports() {
|
|
|
1776
1795
|
const ret = arg0;
|
|
1777
1796
|
return addHeapObject(ret);
|
|
1778
1797
|
};
|
|
1798
|
+
imports.wbg.__wbindgen_cast_ffa04fbd359d627f = function (arg0, arg1) {
|
|
1799
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8661, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8662, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
1800
|
+
const ret = makeClosure(arg0, arg1, 8661, __wbg_adapter_27);
|
|
1801
|
+
return addHeapObject(ret);
|
|
1802
|
+
};
|
|
1779
1803
|
imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
|
|
1780
1804
|
const val = `onmessage = function (ev) {
|
|
1781
1805
|
let [ia, index, value] = ev.data;
|
|
@@ -1800,7 +1824,7 @@ function __wbg_get_imports() {
|
|
|
1800
1824
|
return imports;
|
|
1801
1825
|
}
|
|
1802
1826
|
function __wbg_init_memory(imports, memory) {
|
|
1803
|
-
imports.wbg.memory = memory || new WebAssembly.Memory({ initial: 130, maximum:
|
|
1827
|
+
imports.wbg.memory = memory || new WebAssembly.Memory({ initial: 130, maximum: 65536, shared: true });
|
|
1804
1828
|
}
|
|
1805
1829
|
function __wbg_finalize_init(instance, module, thread_stack_size) {
|
|
1806
1830
|
wasm = instance.exports;
|
package/esm/utoo/index_bg.wasm
CHANGED
|
Binary file
|