File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2-
32set -Eeuo pipefail
43
4+ # Description:
5+ # Builds the Kimchi WebAssembly (WASM) bindings for Node.js. This script:
6+ # - Compiles the Kimchi proof system’s Node bindings using Dune, generating
7+ # the WebAssembly and JavaScript interface files:
8+ # - `plonk_wasm_bg.wasm` and its TypeScript definitions.
9+ # - `plonk_wasm.js` (the JS interface) and its type declarations.
10+ # - Copies all generated artifacts into `src/bindings/compiled/node_bindings/`.
11+ # - Converts the output files to CommonJS format (`.cjs` / `.d.cts`) for
12+ # compatibility with Node.js environments.
13+ # - Applies automatic fixes to the generated bindings via
14+ # `src/build/fix-wasm-bindings-node.js` to ensure correct runtime behavior.
15+ #
16+ # Usage:
17+ # npm run build:wasm:node
18+
519source ./scripts/lib/ux.sh
620
721setup_script " wasm-node-build" " wasm node build"
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2-
32set -Eeuo pipefail
43
4+ # Description:
5+ # Builds the Kimchi WebAssembly (WASM) bindings for Web (browser) usage. This script:
6+ # - Compiles the Kimchi proof system’s Web bindings using Dune, generating:
7+ # - `plonk_wasm_bg.wasm` (the main WebAssembly module) and its TypeScript definitions.
8+ # - `plonk_wasm.js` (the JavaScript interface) and its type declarations.
9+ # - Copies all generated artifacts into `src/bindings/compiled/web_bindings/`.
10+ # - Optimizes the WebAssembly binary using `wasm-opt` with advanced flags
11+ # (`--detect-features`, `--enable-mutable-globals`, `-O4`) for performance and size reduction.
12+ # - Ensures proper file permissions after optimization.
13+ #
14+ # Note:
15+ # - Requires `wasm-opt` (from Binaryen) to be installed and available in PATH.
16+ #
17+ # Usage:
18+ # npm run build:wasm:web
19+
20+
521source ./scripts/lib/ux.sh
622
723setup_script " wasm-web-build" " wasm web build"
You can’t perform that action at this time.
0 commit comments