This short guide shows quick ways to speed up the Rust edit/build/test loop for this workspace.
- Node.js
>= 20 pnpm>= 10- Rust toolchain via
rustup
-
Run only the package you care about (fast):
cargo check -p elata-rppg(very fast, compile-only)cargo test -p elata-rppg --lib -j $BUILD_JOBS(run only rppg library tests in parallel)
-
Prefer
cargo checkfor most iterations andcargo testwhen you need to run tests.
- Install
sccacheon macOS:brew install sccacheor follow platform instructions. - Verify it's working:
sccache --show-statsexport RUSTC_WRAPPER=$(which sccache)(add to your shell profile)
run.shcallsensure_sccacheand will setRUSTC_WRAPPER=sccacheautomatically if available.
- Save and reuse
targetacross runs/branches to avoid recompiling crate dependencies:export CARGO_TARGET_DIR=~/.cache/elata/cargo-target
- Configure your CI to cache that folder between runs.
- This repository provides conservative
[profile.dev]and[profile.test]settings inCargo.tomlto enable incremental builds and multiple codegen units. - These help reduce rebuild time at the cost of a slightly different dev binary than
--release.
- Build web artifacts (debug):
./run.sh dev [eeg|rppg|all] - Build web artifacts (release):
./run.sh build [eeg|rppg|all] - Generate bindings only:
./run.sh bindings [release|debug] - Run the in-repo rPPG demo:
./run.sh demo rppg - Run the in-repo EEG demo:
./run.sh demo eeg - Run the native HAL example:
./run.sh demo hal - Run full workspace + web package tests:
./run.sh test - Preview the Mintlify docs site in
elata-docs/(defaults tomint dev --no-open):./run.sh docs
Use the repo demos when you are developing the SDK itself, checking generated artifacts, or debugging package integration inside this monorepo.
./run.sh demo rppg- runs
packages/rppg-webdemo asset generation - copies the built demo to a temporary directory
- serves that directory on
PORT, default8080 - supports
KEEP_TMP=1if you want to inspect the served files after exit
- runs
./run.sh demo eeg- builds
elata-eeg-wasm - runs
wasm-bindgen - syncs artifacts into
packages/eeg-web - serves
eeg-demo/onPORT, default4173 - supports
EEG_DEMO_BLE=1to also buildpackages/eeg-web-ble - supports
EEG_DEMO_BLE_TEST=1to run BLE tests during that flow
- builds
./run.sh demo hal- runs the Rust HAL example directly
Examples:
PORT=9000 ./run.sh demo rppg
KEEP_TMP=1 ./run.sh demo rppg
PORT=5000 EEG_DEMO_BLE=1 ./run.sh demo eeg
EEG_DEMO_BLE=1 EEG_DEMO_BLE_TEST=1 ./run.sh demo eeg
./run.sh demo halIf you are validating the consumer experience instead of the repo-development
surface, use create-elata-demo rather than these in-repo demos.
- If you add heavy dependencies to
elata-rppgtests, test compile times will increase; keep dependencies minimal for unit tests. - Consider adding selective feature flags for dev/test to reduce dependency compile footprint.