@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 +4 -1
- package/package.json +1 -1
- package/pcb_zen_wasm.d.ts +2 -2
- package/pcb_zen_wasm.js +7 -4
- package/pcb_zen_wasm_bg.wasm +0 -0
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
|
|
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
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 =
|
|
14
|
+
const ptr1 = passArray8ToWasm0(stdlib_tar_zst_bytes, wasm.__wbindgen_malloc_command_export);
|
|
14
15
|
const len1 = WASM_VECTOR_LEN;
|
|
15
|
-
const ptr2 = passStringToWasm0(
|
|
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
|
|
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
|
}
|
package/pcb_zen_wasm_bg.wasm
CHANGED
|
Binary file
|