@utoo/web 1.2.0-rc.9 → 1.2.0
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 +1 -1
- package/esm/{8f9533ebd1c6543b5d26.wasm → cb25445c9f3a2acfc918.wasm} +0 -0
- package/esm/loaderWorker.js +1 -1
- package/esm/project/ForkedProject.d.ts +2 -1
- package/esm/project/ForkedProject.js +4 -1
- package/esm/project/InternalProject.d.ts +2 -1
- package/esm/project/InternalProject.js +11 -8
- package/esm/project/Project.d.ts +2 -1
- package/esm/project/Project.js +7 -4
- package/esm/types.d.ts +5 -0
- package/esm/utoo/index.d.ts +66 -11
- package/esm/utoo/index.js +274 -134
- package/esm/utoo/index_bg.wasm +0 -0
- package/esm/webpackLoaders/cjs.js +4 -32
- package/esm/webpackLoaders/loaderWorkerPool.js +1 -20
- package/esm/webpackLoaders/polyfills/fsPolyfill.js +56 -45
- package/esm/webpackLoaders/types.d.ts +0 -1
- package/esm/webpackLoaders/worker.js +0 -7
- package/package.json +5 -5
- package/esm/utils/sabcom.d.ts +0 -61
- package/esm/utils/sabcom.js +0 -203
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
|
function _assertClass(instance, klass) {
|
|
243
243
|
if (!(instance instanceof klass)) {
|
|
244
244
|
throw new Error(`expected instance of ${klass.name}`);
|
|
@@ -260,35 +260,35 @@ export function sendTaskMessage(message) {
|
|
|
260
260
|
const ret = wasm.sendTaskMessage(addHeapObject(message));
|
|
261
261
|
return takeObject(ret);
|
|
262
262
|
}
|
|
263
|
-
/**
|
|
264
|
-
* @param {string} filter
|
|
265
|
-
*/
|
|
266
|
-
export function init_log_filter(filter) {
|
|
267
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
268
|
-
const len0 = WASM_VECTOR_LEN;
|
|
269
|
-
wasm.init_log_filter(ptr0, len0);
|
|
270
|
-
}
|
|
271
|
-
export function init_pack() {
|
|
272
|
-
wasm.init_pack();
|
|
273
|
-
}
|
|
274
263
|
function passArray8ToWasm0(arg, malloc) {
|
|
275
264
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
276
265
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
277
266
|
WASM_VECTOR_LEN = arg.length;
|
|
278
267
|
return ptr;
|
|
279
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* @param {Function} creator
|
|
271
|
+
* @param {Function} terminator
|
|
272
|
+
*/
|
|
273
|
+
export function registerWorkerScheduler(creator, terminator) {
|
|
274
|
+
wasm.registerWorkerScheduler(addHeapObject(creator), addHeapObject(terminator));
|
|
275
|
+
}
|
|
280
276
|
/**
|
|
281
277
|
* @param {number} worker_id
|
|
282
278
|
*/
|
|
283
279
|
export function workerCreated(worker_id) {
|
|
284
280
|
wasm.workerCreated(worker_id);
|
|
285
281
|
}
|
|
282
|
+
export function init_pack() {
|
|
283
|
+
wasm.init_pack();
|
|
284
|
+
}
|
|
286
285
|
/**
|
|
287
|
-
* @param {
|
|
288
|
-
* @param {Function} terminator
|
|
286
|
+
* @param {string} filter
|
|
289
287
|
*/
|
|
290
|
-
export function
|
|
291
|
-
wasm.
|
|
288
|
+
export function initLogFilter(filter) {
|
|
289
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
290
|
+
const len0 = WASM_VECTOR_LEN;
|
|
291
|
+
wasm.initLogFilter(ptr0, len0);
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Entry point for web workers
|
|
@@ -297,9 +297,12 @@ 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
|
|
300
|
+
function __wbg_adapter_4(arg0, arg1, arg2) {
|
|
301
301
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
302
302
|
}
|
|
303
|
+
function __wbg_adapter_11(arg0, arg1, arg2) {
|
|
304
|
+
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
|
|
305
|
+
}
|
|
303
306
|
let stack_pointer = 128;
|
|
304
307
|
function addBorrowedObject(obj) {
|
|
305
308
|
if (stack_pointer == 1)
|
|
@@ -307,21 +310,18 @@ function addBorrowedObject(obj) {
|
|
|
307
310
|
heap[--stack_pointer] = obj;
|
|
308
311
|
return stack_pointer;
|
|
309
312
|
}
|
|
310
|
-
function
|
|
313
|
+
function __wbg_adapter_16(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.
|
|
320
|
-
}
|
|
321
|
-
function __wbg_adapter_27(arg0, arg1, arg2) {
|
|
322
|
-
wasm.__wbindgen_export_9(arg0, arg1, addHeapObject(arg2));
|
|
321
|
+
function __wbg_adapter_21(arg0, arg1) {
|
|
322
|
+
wasm.__wbindgen_export_9(arg0, arg1);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function __wbg_adapter_90(arg0, arg1, arg2, arg3) {
|
|
325
325
|
wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
326
326
|
}
|
|
327
327
|
const __wbindgen_enum_DirEntryType = ["file", "directory"];
|
|
@@ -523,6 +523,28 @@ export class Project {
|
|
|
523
523
|
const ret = wasm.project_removeDir(ptr0, len0, recursive);
|
|
524
524
|
return takeObject(ret);
|
|
525
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* @param {string} path
|
|
528
|
+
* @param {Uint8Array} content
|
|
529
|
+
*/
|
|
530
|
+
static writeSync(path, content) {
|
|
531
|
+
try {
|
|
532
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
533
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
534
|
+
const len0 = WASM_VECTOR_LEN;
|
|
535
|
+
const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
|
|
536
|
+
const len1 = WASM_VECTOR_LEN;
|
|
537
|
+
wasm.project_writeSync(retptr, ptr0, len0, ptr1, len1);
|
|
538
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
539
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
540
|
+
if (r1) {
|
|
541
|
+
throw takeObject(r0);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
finally {
|
|
545
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
526
548
|
/**
|
|
527
549
|
* @param {string} path
|
|
528
550
|
* @returns {Promise<void>}
|
|
@@ -546,6 +568,75 @@ export class Project {
|
|
|
546
568
|
const ret = wasm.project_writeString(ptr0, len0, ptr1, len1);
|
|
547
569
|
return takeObject(ret);
|
|
548
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* @param {string} path
|
|
573
|
+
* @returns {Metadata}
|
|
574
|
+
*/
|
|
575
|
+
static metadataSync(path) {
|
|
576
|
+
try {
|
|
577
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
578
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
579
|
+
const len0 = WASM_VECTOR_LEN;
|
|
580
|
+
wasm.project_metadataSync(retptr, ptr0, len0);
|
|
581
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
582
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
583
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
584
|
+
if (r2) {
|
|
585
|
+
throw takeObject(r1);
|
|
586
|
+
}
|
|
587
|
+
return Metadata.__wrap(r0);
|
|
588
|
+
}
|
|
589
|
+
finally {
|
|
590
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* @param {string} path
|
|
595
|
+
* @returns {DirEntry[]}
|
|
596
|
+
*/
|
|
597
|
+
static readDirSync(path) {
|
|
598
|
+
try {
|
|
599
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
600
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
601
|
+
const len0 = WASM_VECTOR_LEN;
|
|
602
|
+
wasm.project_readDirSync(retptr, ptr0, len0);
|
|
603
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
604
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
605
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
606
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
607
|
+
if (r3) {
|
|
608
|
+
throw takeObject(r2);
|
|
609
|
+
}
|
|
610
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
611
|
+
wasm.__wbindgen_export_4(r0, r1 * 4, 4);
|
|
612
|
+
return v2;
|
|
613
|
+
}
|
|
614
|
+
finally {
|
|
615
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* @param {string} src
|
|
620
|
+
* @param {string} dst
|
|
621
|
+
*/
|
|
622
|
+
static copyFileSync(src, dst) {
|
|
623
|
+
try {
|
|
624
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
625
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
626
|
+
const len0 = WASM_VECTOR_LEN;
|
|
627
|
+
const ptr1 = passStringToWasm0(dst, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
628
|
+
const len1 = WASM_VECTOR_LEN;
|
|
629
|
+
wasm.project_copyFileSync(retptr, ptr0, len0, ptr1, len1);
|
|
630
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
631
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
632
|
+
if (r1) {
|
|
633
|
+
throw takeObject(r0);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
finally {
|
|
637
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
549
640
|
/**
|
|
550
641
|
* @param {string} path
|
|
551
642
|
* @returns {Promise<void>}
|
|
@@ -566,6 +657,83 @@ export class Project {
|
|
|
566
657
|
const ret = wasm.project_readToString(ptr0, len0);
|
|
567
658
|
return takeObject(ret);
|
|
568
659
|
}
|
|
660
|
+
/**
|
|
661
|
+
* @param {string} path
|
|
662
|
+
*/
|
|
663
|
+
static createDirSync(path) {
|
|
664
|
+
try {
|
|
665
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
666
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
667
|
+
const len0 = WASM_VECTOR_LEN;
|
|
668
|
+
wasm.project_createDirSync(retptr, ptr0, len0);
|
|
669
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
670
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
671
|
+
if (r1) {
|
|
672
|
+
throw takeObject(r0);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
finally {
|
|
676
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* @param {string} path
|
|
681
|
+
* @param {boolean} recursive
|
|
682
|
+
*/
|
|
683
|
+
static removeDirSync(path, recursive) {
|
|
684
|
+
try {
|
|
685
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
686
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
687
|
+
const len0 = WASM_VECTOR_LEN;
|
|
688
|
+
wasm.project_removeDirSync(retptr, ptr0, len0, recursive);
|
|
689
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
690
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
691
|
+
if (r1) {
|
|
692
|
+
throw takeObject(r0);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
finally {
|
|
696
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* @param {string} path
|
|
701
|
+
*/
|
|
702
|
+
static removeFileSync(path) {
|
|
703
|
+
try {
|
|
704
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
705
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
706
|
+
const len0 = WASM_VECTOR_LEN;
|
|
707
|
+
wasm.project_removeFileSync(retptr, ptr0, len0);
|
|
708
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
709
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
710
|
+
if (r1) {
|
|
711
|
+
throw takeObject(r0);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
finally {
|
|
715
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* @param {string} path
|
|
720
|
+
*/
|
|
721
|
+
static createDirAllSync(path) {
|
|
722
|
+
try {
|
|
723
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
724
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
725
|
+
const len0 = WASM_VECTOR_LEN;
|
|
726
|
+
wasm.project_createDirAllSync(retptr, ptr0, len0);
|
|
727
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
728
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
729
|
+
if (r1) {
|
|
730
|
+
throw takeObject(r0);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
finally {
|
|
734
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
569
737
|
/**
|
|
570
738
|
* @returns {string}
|
|
571
739
|
*/
|
|
@@ -586,27 +754,33 @@ export class Project {
|
|
|
586
754
|
wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
|
|
587
755
|
}
|
|
588
756
|
}
|
|
757
|
+
/**
|
|
758
|
+
* Generate package-lock.json by resolving dependencies.
|
|
759
|
+
*
|
|
760
|
+
* # Arguments
|
|
761
|
+
* * `registry` - Optional registry URL. If None, uses npmmirror.
|
|
762
|
+
* - "https://registry.npmmirror.com" - supports semver queries (faster)
|
|
763
|
+
* - "https://registry.npmjs.org" - official npm registry (slower, fetches full manifest)
|
|
764
|
+
* * `concurrency` - Optional concurrency limit (defaults to 20)
|
|
765
|
+
* @param {string | null} [registry]
|
|
766
|
+
* @param {number | null} [concurrency]
|
|
767
|
+
* @returns {Promise<string>}
|
|
768
|
+
*/
|
|
769
|
+
static deps(registry, concurrency) {
|
|
770
|
+
var ptr0 = isLikeNone(registry) ? 0 : passStringToWasm0(registry, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
771
|
+
var len0 = WASM_VECTOR_LEN;
|
|
772
|
+
const ret = wasm.project_deps(ptr0, len0, isLikeNone(concurrency) ? 0x100000001 : (concurrency) >>> 0);
|
|
773
|
+
return takeObject(ret);
|
|
774
|
+
}
|
|
589
775
|
/**
|
|
590
776
|
* Create a tar.gz archive and return bytes (no file I/O)
|
|
591
777
|
* This is useful for main thread execution without OPFS access
|
|
592
778
|
* @param {any} files
|
|
593
|
-
* @returns {Uint8Array}
|
|
779
|
+
* @returns {Promise<Uint8Array>}
|
|
594
780
|
*/
|
|
595
781
|
static gzip(files) {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
wasm.project_gzip(retptr, addHeapObject(files));
|
|
599
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
600
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
601
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
602
|
-
if (r2) {
|
|
603
|
-
throw takeObject(r1);
|
|
604
|
-
}
|
|
605
|
-
return takeObject(r0);
|
|
606
|
-
}
|
|
607
|
-
finally {
|
|
608
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
609
|
-
}
|
|
782
|
+
const ret = wasm.project_gzip(addHeapObject(files));
|
|
783
|
+
return takeObject(ret);
|
|
610
784
|
}
|
|
611
785
|
/**
|
|
612
786
|
* @param {string} thread_url
|
|
@@ -666,28 +840,15 @@ export class Project {
|
|
|
666
840
|
wasm.project_setCwd(ptr0, len0);
|
|
667
841
|
}
|
|
668
842
|
/**
|
|
669
|
-
* Calculate MD5 hash of byte content
|
|
843
|
+
* Calculate MD5 hash of byte content (async for better thread scheduling)
|
|
670
844
|
* @param {Uint8Array} content
|
|
671
|
-
* @returns {string}
|
|
845
|
+
* @returns {Promise<string>}
|
|
672
846
|
*/
|
|
673
847
|
static sigMd5(content) {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
|
|
679
|
-
const len0 = WASM_VECTOR_LEN;
|
|
680
|
-
wasm.project_sigMd5(retptr, ptr0, len0);
|
|
681
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
682
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
683
|
-
deferred2_0 = r0;
|
|
684
|
-
deferred2_1 = r1;
|
|
685
|
-
return getStringFromWasm0(r0, r1);
|
|
686
|
-
}
|
|
687
|
-
finally {
|
|
688
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
689
|
-
wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
|
|
690
|
-
}
|
|
848
|
+
const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export_1);
|
|
849
|
+
const len0 = WASM_VECTOR_LEN;
|
|
850
|
+
const ret = wasm.project_sigMd5(ptr0, len0);
|
|
851
|
+
return takeObject(ret);
|
|
691
852
|
}
|
|
692
853
|
/**
|
|
693
854
|
* @param {string} path
|
|
@@ -722,6 +883,28 @@ export class Project {
|
|
|
722
883
|
const ret = wasm.project_copyFile(ptr0, len0, ptr1, len1);
|
|
723
884
|
return takeObject(ret);
|
|
724
885
|
}
|
|
886
|
+
/**
|
|
887
|
+
* @param {string} path
|
|
888
|
+
* @returns {Uint8Array}
|
|
889
|
+
*/
|
|
890
|
+
static readSync(path) {
|
|
891
|
+
try {
|
|
892
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
893
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
894
|
+
const len0 = WASM_VECTOR_LEN;
|
|
895
|
+
wasm.project_readSync(retptr, ptr0, len0);
|
|
896
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
897
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
898
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
899
|
+
if (r2) {
|
|
900
|
+
throw takeObject(r1);
|
|
901
|
+
}
|
|
902
|
+
return takeObject(r0);
|
|
903
|
+
}
|
|
904
|
+
finally {
|
|
905
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
725
908
|
}
|
|
726
909
|
if (Symbol.dispose)
|
|
727
910
|
Project.prototype[Symbol.dispose] = Project.prototype.free;
|
|
@@ -998,10 +1181,6 @@ function __wbg_get_imports() {
|
|
|
998
1181
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
999
1182
|
return addHeapObject(ret);
|
|
1000
1183
|
};
|
|
1001
|
-
imports.wbg.__wbg_Number_998bea33bd87c3e0 = function (arg0) {
|
|
1002
|
-
const ret = Number(getObject(arg0));
|
|
1003
|
-
return ret;
|
|
1004
|
-
};
|
|
1005
1184
|
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
|
|
1006
1185
|
const ret = String(getObject(arg1));
|
|
1007
1186
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
@@ -1166,10 +1345,6 @@ function __wbg_get_imports() {
|
|
|
1166
1345
|
return addHeapObject(ret);
|
|
1167
1346
|
}, arguments);
|
|
1168
1347
|
};
|
|
1169
|
-
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
|
|
1170
|
-
const ret = getObject(arg0)[getObject(arg1)];
|
|
1171
|
-
return addHeapObject(ret);
|
|
1172
|
-
};
|
|
1173
1348
|
imports.wbg.__wbg_has_b89e451f638123e3 = function () {
|
|
1174
1349
|
return handleError(function (arg0, arg1) {
|
|
1175
1350
|
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
@@ -1186,17 +1361,6 @@ function __wbg_get_imports() {
|
|
|
1186
1361
|
imports.wbg.__wbg_info_6cf68c1a86a92f6a = function (arg0) {
|
|
1187
1362
|
console.info(getObject(arg0));
|
|
1188
1363
|
};
|
|
1189
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function (arg0) {
|
|
1190
|
-
let result;
|
|
1191
|
-
try {
|
|
1192
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1193
|
-
}
|
|
1194
|
-
catch (_) {
|
|
1195
|
-
result = false;
|
|
1196
|
-
}
|
|
1197
|
-
const ret = result;
|
|
1198
|
-
return ret;
|
|
1199
|
-
};
|
|
1200
1364
|
imports.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_a054a9af652220ba = function (arg0) {
|
|
1201
1365
|
let result;
|
|
1202
1366
|
try {
|
|
@@ -1256,10 +1420,6 @@ function __wbg_get_imports() {
|
|
|
1256
1420
|
const ret = Array.isArray(getObject(arg0));
|
|
1257
1421
|
return ret;
|
|
1258
1422
|
};
|
|
1259
|
-
imports.wbg.__wbg_isSafeInteger_1c0d1af5542e102a = function (arg0) {
|
|
1260
|
-
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1261
|
-
return ret;
|
|
1262
|
-
};
|
|
1263
1423
|
imports.wbg.__wbg_iterator_f370b34483c71a1c = function () {
|
|
1264
1424
|
const ret = Symbol.iterator;
|
|
1265
1425
|
return addHeapObject(ret);
|
|
@@ -1310,7 +1470,7 @@ function __wbg_get_imports() {
|
|
|
1310
1470
|
const a = state0.a;
|
|
1311
1471
|
state0.a = 0;
|
|
1312
1472
|
try {
|
|
1313
|
-
return
|
|
1473
|
+
return __wbg_adapter_90(a, state0.b, arg0, arg1);
|
|
1314
1474
|
}
|
|
1315
1475
|
finally {
|
|
1316
1476
|
state0.a = a;
|
|
@@ -1649,11 +1809,6 @@ function __wbg_get_imports() {
|
|
|
1649
1809
|
const ret = WasmTaskMessage.__wrap(arg0);
|
|
1650
1810
|
return addHeapObject(ret);
|
|
1651
1811
|
};
|
|
1652
|
-
imports.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function (arg0) {
|
|
1653
|
-
const v = getObject(arg0);
|
|
1654
|
-
const ret = typeof (v) === 'boolean' ? v : undefined;
|
|
1655
|
-
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1656
|
-
};
|
|
1657
1812
|
imports.wbg.__wbg_wbindgencbdrop_eb10308566512b88 = function (arg0) {
|
|
1658
1813
|
const obj = getObject(arg0).original;
|
|
1659
1814
|
if (obj.cnt-- == 1) {
|
|
@@ -1670,10 +1825,6 @@ function __wbg_get_imports() {
|
|
|
1670
1825
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1671
1826
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1672
1827
|
};
|
|
1673
|
-
imports.wbg.__wbg_wbindgenin_d7a1ee10933d2d55 = function (arg0, arg1) {
|
|
1674
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
1675
|
-
return ret;
|
|
1676
|
-
};
|
|
1677
1828
|
imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function (arg0) {
|
|
1678
1829
|
const ret = typeof (getObject(arg0)) === 'function';
|
|
1679
1830
|
return ret;
|
|
@@ -1691,10 +1842,6 @@ function __wbg_get_imports() {
|
|
|
1691
1842
|
const ret = getObject(arg0) === undefined;
|
|
1692
1843
|
return ret;
|
|
1693
1844
|
};
|
|
1694
|
-
imports.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function (arg0, arg1) {
|
|
1695
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
1696
|
-
return ret;
|
|
1697
|
-
};
|
|
1698
1845
|
imports.wbg.__wbg_wbindgenmemory_d84da70f7c42d172 = function () {
|
|
1699
1846
|
const ret = wasm.memory;
|
|
1700
1847
|
return addHeapObject(ret);
|
|
@@ -1743,29 +1890,19 @@ function __wbg_get_imports() {
|
|
|
1743
1890
|
return ret;
|
|
1744
1891
|
}, arguments);
|
|
1745
1892
|
};
|
|
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
|
-
return addHeapObject(ret);
|
|
1750
|
-
};
|
|
1751
1893
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
|
|
1752
1894
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1753
1895
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1754
1896
|
return addHeapObject(ret);
|
|
1755
1897
|
};
|
|
1756
|
-
imports.wbg.
|
|
1757
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1758
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
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);
|
|
1898
|
+
imports.wbg.__wbindgen_cast_26a7198d906e0da9 = function (arg0, arg1) {
|
|
1899
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1971, function: Function { arguments: [], shim_idx: 1972, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1900
|
+
const ret = makeMutClosure(arg0, arg1, 1971, __wbg_adapter_21);
|
|
1764
1901
|
return addHeapObject(ret);
|
|
1765
1902
|
};
|
|
1766
|
-
imports.wbg.
|
|
1767
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1768
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1903
|
+
imports.wbg.__wbindgen_cast_307879a04c1b4f63 = function (arg0, arg1) {
|
|
1904
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8676, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 8677, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1905
|
+
const ret = makeMutClosure(arg0, arg1, 8676, __wbg_adapter_16);
|
|
1769
1906
|
return addHeapObject(ret);
|
|
1770
1907
|
};
|
|
1771
1908
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function (arg0) {
|
|
@@ -1773,11 +1910,6 @@ function __wbg_get_imports() {
|
|
|
1773
1910
|
const ret = BigInt.asUintN(64, arg0);
|
|
1774
1911
|
return addHeapObject(ret);
|
|
1775
1912
|
};
|
|
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
|
-
};
|
|
1781
1913
|
imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
|
|
1782
1914
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
1783
1915
|
wasm.__wbindgen_export_4(arg0, arg1 * 4, 4);
|
|
@@ -1785,11 +1917,9 @@ function __wbg_get_imports() {
|
|
|
1785
1917
|
const ret = v0;
|
|
1786
1918
|
return addHeapObject(ret);
|
|
1787
1919
|
};
|
|
1788
|
-
imports.wbg.
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
1792
|
-
const ret = v0;
|
|
1920
|
+
imports.wbg.__wbindgen_cast_81c5f8a7071fde96 = function (arg0, arg1) {
|
|
1921
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8671, function: Function { arguments: [Externref], shim_idx: 8672, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1922
|
+
const ret = makeMutClosure(arg0, arg1, 8671, __wbg_adapter_4);
|
|
1793
1923
|
return addHeapObject(ret);
|
|
1794
1924
|
};
|
|
1795
1925
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function (arg0) {
|
|
@@ -1797,14 +1927,24 @@ function __wbg_get_imports() {
|
|
|
1797
1927
|
const ret = arg0;
|
|
1798
1928
|
return addHeapObject(ret);
|
|
1799
1929
|
};
|
|
1930
|
+
imports.wbg.__wbindgen_cast_d53dd3563c4c175e = function (arg0, arg1) {
|
|
1931
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8656, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 8657, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
1932
|
+
const ret = makeClosure(arg0, arg1, 8656, __wbg_adapter_11);
|
|
1933
|
+
return addHeapObject(ret);
|
|
1934
|
+
};
|
|
1935
|
+
imports.wbg.__wbindgen_cast_d5aaf1d5c6b6dfda = function (arg0, arg1) {
|
|
1936
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8671, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8672, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1937
|
+
const ret = makeMutClosure(arg0, arg1, 8671, __wbg_adapter_4);
|
|
1938
|
+
return addHeapObject(ret);
|
|
1939
|
+
};
|
|
1800
1940
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
|
|
1801
1941
|
// Cast intrinsic for `F64 -> Externref`.
|
|
1802
1942
|
const ret = arg0;
|
|
1803
1943
|
return addHeapObject(ret);
|
|
1804
1944
|
};
|
|
1805
|
-
imports.wbg.
|
|
1806
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1807
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1945
|
+
imports.wbg.__wbindgen_cast_dda7104b59aa313f = function (arg0, arg1) {
|
|
1946
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 8671, function: Function { arguments: [], shim_idx: 1972, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1947
|
+
const ret = makeMutClosure(arg0, arg1, 8671, __wbg_adapter_21);
|
|
1808
1948
|
return addHeapObject(ret);
|
|
1809
1949
|
};
|
|
1810
1950
|
imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
|
|
@@ -1831,7 +1971,7 @@ function __wbg_get_imports() {
|
|
|
1831
1971
|
return imports;
|
|
1832
1972
|
}
|
|
1833
1973
|
function __wbg_init_memory(imports, memory) {
|
|
1834
|
-
imports.wbg.memory = memory || new WebAssembly.Memory({ initial:
|
|
1974
|
+
imports.wbg.memory = memory || new WebAssembly.Memory({ initial: 1025, maximum: 65536, shared: true });
|
|
1835
1975
|
}
|
|
1836
1976
|
function __wbg_finalize_init(instance, module, thread_stack_size) {
|
|
1837
1977
|
wasm = instance.exports;
|
package/esm/utoo/index_bg.wasm
CHANGED
|
Binary file
|
|
@@ -7,35 +7,6 @@ const statCache = {};
|
|
|
7
7
|
const pkgJsonCache = {};
|
|
8
8
|
const resolutionCache = {};
|
|
9
9
|
const searchPathsCache = {};
|
|
10
|
-
const statSync = (p) => {
|
|
11
|
-
if (p.includes("node_modules") &&
|
|
12
|
-
Object.prototype.hasOwnProperty.call(statCache, p)) {
|
|
13
|
-
if (statCache[p] === false) {
|
|
14
|
-
throw new Error("ENOENT");
|
|
15
|
-
}
|
|
16
|
-
return statCache[p];
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const res = fs.statSync(p);
|
|
20
|
-
if (p.includes("node_modules"))
|
|
21
|
-
statCache[p] = res;
|
|
22
|
-
return res;
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
if (p.includes("node_modules"))
|
|
26
|
-
statCache[p] = false;
|
|
27
|
-
throw e;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const existsSync = (p) => {
|
|
31
|
-
try {
|
|
32
|
-
statSync(p);
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
10
|
const executeModule = (moduleCode, moduleId, id, importMaps, entrypoint) => {
|
|
40
11
|
if (installedModules[moduleId]) {
|
|
41
12
|
return installedModules[moduleId].exports;
|
|
@@ -108,7 +79,7 @@ const loadModule = (id, context, importMaps, entrypoint) => {
|
|
|
108
79
|
// 1. Resolve
|
|
109
80
|
let resolvedId = id;
|
|
110
81
|
if (id.startsWith(".")) {
|
|
111
|
-
resolvedId = path.
|
|
82
|
+
resolvedId = path.join(context, id);
|
|
112
83
|
}
|
|
113
84
|
// 2. Check Cache (SystemJS)
|
|
114
85
|
let dependency = System.get(resolvedId);
|
|
@@ -259,8 +230,9 @@ const loadModule = (id, context, importMaps, entrypoint) => {
|
|
|
259
230
|
resolutionCache[cacheKey] = moduleId;
|
|
260
231
|
return executeModule(moduleCode, moduleId, id, importMaps, entrypoint);
|
|
261
232
|
}
|
|
262
|
-
|
|
263
|
-
|
|
233
|
+
const error = new Error(`Worker: Dependency ${id} (resolved: ${resolvedId}) not found. Context: ${context}`);
|
|
234
|
+
console.error(error);
|
|
235
|
+
throw error;
|
|
264
236
|
};
|
|
265
237
|
export async function cjs(entrypoint, importMaps) {
|
|
266
238
|
// Clear caches to avoid stale data across runs
|