Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
- name: Install wasm-pack (CI)
# CI installs wasm-pack using jetli/wasm-pack-action; local developers should install via `cargo install wasm-pack`
uses: jetli/wasm-pack-action@v0.4.0
- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -85,7 +86,8 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
- name: Install wasm-pack (CI)
# CI installs wasm-pack using jetli/wasm-pack-action; local developers should install via `cargo install wasm-pack`
uses: jetli/wasm-pack-action@v0.4.0
- name: Install dependencies
run: npm ci
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,24 @@ npm run preview

To work on the Rust simulation engine:

1. Ensure you have Rust and `wasm-pack` installed.
2. Run the WASM build in watch mode:
1. Ensure you have Rust installed (see https://rustup.rs).
2. Install `wasm-pack` (recommended via `cargo`):
```bash
cargo install wasm-pack
wasm-pack --version
```
Or run the included checker:
```bash
npm run check:wasm-pack
```
3. Run the WASM build in watch mode:
```bash
npm run dev:wasm:watch
```
This runs concurrently with `npm run dev` if you use the main start script.

> Note: If you see an "Unsupported platform" error during `npm install` (common on Windows ARM64), installing `wasm-pack` via `cargo install wasm-pack` or building in WSL/x64 avoids the failing npm postinstall step that downloads a prebuilt binary.

## 🧪 Testing

We maintain a high standard of code quality with comprehensive test coverage.
Expand Down
10 changes: 10 additions & 0 deletions docs/rust-wasm-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@ cargo install cargo-watch --locked
cargo install wasm-pack
```

- Verify `wasm-pack` is available:

```bash
wasm-pack --version
# or
npm run check:wasm-pack
```

Start dev server with live WASM rebuilds:

```bash
npm ci
npm run dev
```

> Note: If you encounter an "Unsupported platform" error during `npm install` (for example on Windows ARM64), installing `wasm-pack` via `cargo install wasm-pack` or using an x64 environment (WSL/x64, VM) avoids the failing npm postinstall that attempts to download a prebuilt binary.

What that does:

- `dev` runs `concurrently` which starts `cargo watch` to rebuild the WASM into `src/gen` on Rust changes, and runs `vite` for the web dev server.
Expand Down
Loading
Loading