@diodeinc/pcb-zen-wasm 0.3.93 → 0.4.1

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 CHANGED
@@ -8,5 +8,8 @@ The npm package is built and published from [`bin/build-wasm-bundle.sh`](../../b
8
8
  To smoke-test the generated WASM bundle against a `pcb publish` release zip:
9
9
 
10
10
  ```sh
11
- node crates/pcb-zen-wasm/scripts/eval-publish-bundle.mjs --build-wasm --bundle path/to/release.zip
11
+ node crates/pcb-zen-wasm/scripts/eval-publish-bundle.mjs \
12
+ --build-wasm \
13
+ --stdlib path/to/stdlib.tar.zst \
14
+ --bundle path/to/release.zip
12
15
  ```
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Diode Computers, Inc. <founders@diode.computer>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Zen PCB design language",
8
- "version": "0.3.93",
8
+ "version": "0.4.1",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/diodeinc/pcb"
package/pcb_zen_wasm.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Evaluate a Zener module from an in-memory source bundle (WASM binding).
6
6
  */
7
- export function evaluate(bundle_bytes: Uint8Array, main_file: string, inputs_json: string): any;
7
+ export function evaluate(bundle_bytes: Uint8Array, stdlib_tar_zst_bytes: Uint8Array, main_file: string, inputs_json: string): any;
8
8
 
9
9
  export function start(): void;
10
10
 
@@ -12,7 +12,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
12
12
 
13
13
  export interface InitOutput {
14
14
  readonly memory: WebAssembly.Memory;
15
- readonly evaluate: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
15
+ readonly evaluate: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
16
16
  readonly start: () => void;
17
17
  readonly __wbindgen_malloc_command_export: (a: number, b: number) => number;
18
18
  readonly __wbindgen_realloc_command_export: (a: number, b: number, c: number, d: number) => number;
package/pcb_zen_wasm.js CHANGED
@@ -3,18 +3,21 @@
3
3
  /**
4
4
  * Evaluate a Zener module from an in-memory source bundle (WASM binding).
5
5
  * @param {Uint8Array} bundle_bytes
6
+ * @param {Uint8Array} stdlib_tar_zst_bytes
6
7
  * @param {string} main_file
7
8
  * @param {string} inputs_json
8
9
  * @returns {any}
9
10
  */
10
- export function evaluate(bundle_bytes, main_file, inputs_json) {
11
+ export function evaluate(bundle_bytes, stdlib_tar_zst_bytes, main_file, inputs_json) {
11
12
  const ptr0 = passArray8ToWasm0(bundle_bytes, wasm.__wbindgen_malloc_command_export);
12
13
  const len0 = WASM_VECTOR_LEN;
13
- const ptr1 = passStringToWasm0(main_file, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
14
+ const ptr1 = passArray8ToWasm0(stdlib_tar_zst_bytes, wasm.__wbindgen_malloc_command_export);
14
15
  const len1 = WASM_VECTOR_LEN;
15
- const ptr2 = passStringToWasm0(inputs_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
16
+ const ptr2 = passStringToWasm0(main_file, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
16
17
  const len2 = WASM_VECTOR_LEN;
17
- const ret = wasm.evaluate(ptr0, len0, ptr1, len1, ptr2, len2);
18
+ const ptr3 = passStringToWasm0(inputs_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
19
+ const len3 = WASM_VECTOR_LEN;
20
+ const ret = wasm.evaluate(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
18
21
  if (ret[2]) {
19
22
  throw takeFromExternrefTable0(ret[1]);
20
23
  }
Binary file