@utoo/web 0.0.1-alpha.28 → 0.0.1-alpha.29

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.
@@ -3,7 +3,7 @@ export declare class ForkedProject implements ProjectEndpoint {
3
3
  private endpoint;
4
4
  constructor(port: MessagePort);
5
5
  install(packageLock: string): Promise<void>;
6
- build(): Promise<void>;
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>;
9
9
  copyFile(src: string, dst: string): Promise<void>;
package/esm/project.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Dirent, ProjectEndpoint, ProjectOptions } from "./type";
1
+ import { BuildOutput, Dirent, ProjectEndpoint, ProjectOptions } from "./type";
2
2
  export declare class Project implements ProjectEndpoint {
3
3
  #private;
4
4
  private serviceWorkerOptions?;
@@ -8,7 +8,7 @@ export declare class Project implements ProjectEndpoint {
8
8
  installServiceWorker(): Promise<void>;
9
9
  mount(): Promise<void>;
10
10
  install(packageLock: string): Promise<void>;
11
- build(): Promise<void>;
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>;
14
14
  copyFile(src: string, dst: string): Promise<void>;
package/esm/project.js CHANGED
@@ -10,6 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
12
  var _Project_mount;
13
+ import { handleIssues } from "@utoo/pack-shared";
13
14
  import * as comlink from "comlink";
14
15
  import { ForkedProject } from "./forkedProject";
15
16
  import { installServiceWorker } from "./installServiceWorker";
@@ -67,7 +68,9 @@ export class Project {
67
68
  }
68
69
  async build() {
69
70
  await __classPrivateFieldGet(this, _Project_mount, "f");
70
- return await this.remote.build();
71
+ const res = await this.remote.build();
72
+ handleIssues(res.issues, false);
73
+ return res;
71
74
  }
72
75
  async readFile(path, encoding) {
73
76
  await __classPrivateFieldGet(this, _Project_mount, "f");
package/esm/type.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Issue } from "@utoo/pack-shared";
1
2
  import { DirEntryType } from "./utoo";
2
3
  export interface RawDirent {
3
4
  name: string;
@@ -10,9 +11,12 @@ export declare class Dirent {
10
11
  isDirectory(): boolean;
11
12
  isFile(): boolean;
12
13
  }
14
+ export interface BuildOutput {
15
+ issues: Issue[];
16
+ }
13
17
  export interface ProjectEndpoint {
14
18
  install: (packageLock: string) => Promise<void>;
15
- build: () => Promise<void>;
19
+ build: () => Promise<BuildOutput>;
16
20
  readFile(path: string): Promise<Uint8Array>;
17
21
  readFile(path: string, encoding?: "utf8"): Promise<string>;
18
22
  writeFile(path: string, content: string | Uint8Array, encoding?: "utf8"): Promise<void>;
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,11 +255,14 @@ 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) {
258
+ function __wbg_adapter_4(arg0, arg1, arg2) {
259
259
  wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
260
260
  }
261
- function __wbg_adapter_19(arg0, arg1, arg2) {
262
- wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
261
+ function __wbg_adapter_9(arg0, arg1) {
262
+ wasm.__wbindgen_export_7(arg0, arg1);
263
+ }
264
+ function __wbg_adapter_20(arg0, arg1, arg2) {
265
+ wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2));
263
266
  }
264
267
  let stack_pointer = 128;
265
268
  function addBorrowedObject(obj) {
@@ -268,17 +271,14 @@ function addBorrowedObject(obj) {
268
271
  heap[--stack_pointer] = obj;
269
272
  return stack_pointer;
270
273
  }
271
- function __wbg_adapter_22(arg0, arg1, arg2) {
274
+ function __wbg_adapter_29(arg0, arg1, arg2) {
272
275
  try {
273
- wasm.__wbindgen_export_8(arg0, arg1, addBorrowedObject(arg2));
276
+ wasm.__wbindgen_export_9(arg0, arg1, addBorrowedObject(arg2));
274
277
  }
275
278
  finally {
276
279
  heap[stack_pointer++] = undefined;
277
280
  }
278
281
  }
279
- function __wbg_adapter_25(arg0, arg1) {
280
- wasm.__wbindgen_export_9(arg0, arg1);
281
- }
282
282
  function __wbg_adapter_92(arg0, arg1, arg2, arg3) {
283
283
  wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
284
284
  }
@@ -1339,14 +1339,14 @@ function __wbg_get_imports() {
1339
1339
  return ret;
1340
1340
  }, arguments);
1341
1341
  };
1342
- imports.wbg.__wbindgen_cast_0e8130195cfa0680 = function (arg0, arg1) {
1343
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1993, function: Function { arguments: [], shim_idx: 1994, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1344
- const ret = makeMutClosure(arg0, arg1, 1993, __wbg_adapter_25);
1342
+ imports.wbg.__wbindgen_cast_025aed27710c2518 = function (arg0, arg1) {
1343
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9056, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 9065, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1344
+ const ret = makeMutClosure(arg0, arg1, 9056, __wbg_adapter_29);
1345
1345
  return addHeapObject(ret);
1346
1346
  };
1347
- imports.wbg.__wbindgen_cast_2177ad1b5237c27d = function (arg0, arg1) {
1348
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9057, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 9058, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1349
- const ret = makeClosure(arg0, arg1, 9057, __wbg_adapter_19);
1347
+ imports.wbg.__wbindgen_cast_0e8130195cfa0680 = function (arg0, arg1) {
1348
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1993, function: Function { arguments: [], shim_idx: 1994, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1349
+ const ret = makeMutClosure(arg0, arg1, 1993, __wbg_adapter_9);
1350
1350
  return addHeapObject(ret);
1351
1351
  };
1352
1352
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
@@ -1359,14 +1359,14 @@ function __wbg_get_imports() {
1359
1359
  const ret = BigInt.asUintN(64, arg0);
1360
1360
  return addHeapObject(ret);
1361
1361
  };
1362
- imports.wbg.__wbindgen_cast_5faeeb1264fca73f = function (arg0, arg1) {
1363
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9057, function: Function { arguments: [Ref(NamedExternref("MessageEvent"))], shim_idx: 9066, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1364
- const ret = makeMutClosure(arg0, arg1, 9057, __wbg_adapter_22);
1362
+ imports.wbg.__wbindgen_cast_4abc855908e61529 = function (arg0, arg1) {
1363
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9067, function: Function { arguments: [], shim_idx: 1994, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1364
+ const ret = makeMutClosure(arg0, arg1, 9067, __wbg_adapter_9);
1365
1365
  return addHeapObject(ret);
1366
1366
  };
1367
1367
  imports.wbg.__wbindgen_cast_68a31acf4586c97f = function (arg0, arg1) {
1368
1368
  // Cast intrinsic for `Closure(Closure { dtor_idx: 8789, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 8790, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1369
- const ret = makeMutClosure(arg0, arg1, 8789, __wbg_adapter_6);
1369
+ const ret = makeMutClosure(arg0, arg1, 8789, __wbg_adapter_4);
1370
1370
  return addHeapObject(ret);
1371
1371
  };
1372
1372
  imports.wbg.__wbindgen_cast_76322aab70622876 = function (arg0, arg1) {
@@ -1390,17 +1390,12 @@ function __wbg_get_imports() {
1390
1390
  };
1391
1391
  imports.wbg.__wbindgen_cast_a01a04b45c08d0e8 = function (arg0, arg1) {
1392
1392
  // Cast intrinsic for `Closure(Closure { dtor_idx: 8789, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 8790, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1393
- const ret = makeMutClosure(arg0, arg1, 8789, __wbg_adapter_6);
1394
- return addHeapObject(ret);
1395
- };
1396
- imports.wbg.__wbindgen_cast_bd9009ad0b299646 = function (arg0, arg1) {
1397
- // Cast intrinsic for `Closure(Closure { dtor_idx: 9068, function: Function { arguments: [], shim_idx: 1994, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1398
- const ret = makeMutClosure(arg0, arg1, 9068, __wbg_adapter_25);
1393
+ const ret = makeMutClosure(arg0, arg1, 8789, __wbg_adapter_4);
1399
1394
  return addHeapObject(ret);
1400
1395
  };
1401
1396
  imports.wbg.__wbindgen_cast_c0785ac30e0427e1 = function (arg0, arg1) {
1402
1397
  // Cast intrinsic for `Closure(Closure { dtor_idx: 8789, function: Function { arguments: [Externref], shim_idx: 8790, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1403
- const ret = makeMutClosure(arg0, arg1, 8789, __wbg_adapter_6);
1398
+ const ret = makeMutClosure(arg0, arg1, 8789, __wbg_adapter_4);
1404
1399
  return addHeapObject(ret);
1405
1400
  };
1406
1401
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
@@ -1408,6 +1403,11 @@ function __wbg_get_imports() {
1408
1403
  const ret = arg0;
1409
1404
  return addHeapObject(ret);
1410
1405
  };
1406
+ imports.wbg.__wbindgen_cast_ec0f8eccb37f735c = function (arg0, arg1) {
1407
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 9056, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 9057, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1408
+ const ret = makeClosure(arg0, arg1, 9056, __wbg_adapter_20);
1409
+ return addHeapObject(ret);
1410
+ };
1411
1411
  imports.wbg.__wbindgen_link_dd5153a359f2e504 = function (arg0) {
1412
1412
  const val = `onmessage = function (ev) {
1413
1413
  let [ia, index, value] = ev.data;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/web",
3
- "version": "0.0.1-alpha.28",
3
+ "version": "0.0.1-alpha.29",
4
4
  "module": "esm/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "files": [
@@ -13,6 +13,7 @@
13
13
  "bindgen-dev": "wasm-bindgen ../../target/wasm32-unknown-unknown/wasm-dev/utoo_wasm.wasm --out-dir src/utoo --out-name index --target web --debug --keep-debug --no-demangle",
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
+ "pretsc": "npm run build --workspace @utoo/pack-shared",
16
17
  "tsc": "rm -rf esm && tsc -p ./tsconfig.json",
17
18
  "dev": "npm run build-wasm -- --profile wasm-dev && npm run bindgen-dev && npm run tsc && cp src/utoo/index_bg.wasm esm/utoo",
18
19
  "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",
@@ -22,7 +23,8 @@
22
23
  "prepublishOnly": "npm run build"
23
24
  },
24
25
  "dependencies": {
25
- "comlink": "^4.4.2"
26
+ "comlink": "^4.4.2",
27
+ "@utoo/pack-shared": "^0.0.4"
26
28
  },
27
29
  "devDependencies": {
28
30
  "typescript": "^5.8.3"