Moodbar (Rust)
CLI-first moodbar generator in Rust.
Prerequisites
- Rust toolchain (stable)
make- Node.js (required for
make wasm/ npm package preparation)
Install
Quick Start
# run the full local quality gate
# generate legacy raw moodbar bytes (.mood)
# generate SVG output
# inspect a moodbar file
For installed usage, replace cargo run -p moodbar -- with moodbar.
Advanced Options
Common tuning flags include --normalize-mode, --deterministic-floor, --detection-mode, --frames-per-color, and --band-edges-hz.
Use command help for full details:
Developer Workflow
# core crate fast loop
# full workspace tests
# parity harness (skips when fixtures are absent)
# fmt + clippy -D warnings + tests
# optional watch loop
Batch Mode
Repository Layout
crates/moodbar-core: decode, analysis, normalization, render primitivescrates/moodbar-cli:generate,batch,inspectcommandscrates/moodbar-wasm: WebAssembly JS bindings for browser/Node usageexamples/web-wasm: minimal browser integration exampleexamples/expo-native: minimal Expo/React Native integration exampletests/fixtures/legacy: optional parity fixturesscripts/: helper scripts
WASM Demo (Browser)
# open http://localhost:8000/docs/wasm-demo.html
React Native Package
@moodbar/native ships Expo-compatible native bindings for iOS + Android.
Native artifacts are built with the Cargo mobile-release profile (opt-level=z, lto, strip) to reduce binary size.
# prepare npm metadata/assets
# build iOS xcframework (macOS/Xcode)
# build Android JNI libs (requires Android NDK + cargo-ndk)
CI and Releases
- CI workflow (Rust core):
.github/workflows/rust-ci.yml - CI workflow (WASM package):
.github/workflows/wasm-ci.yml - CI workflow (Native package):
.github/workflows/native-ci.yml - Release prep workflow:
.github/workflows/prepare-release.yml(workflow_dispatch; opens PR that bumpsCargo.tomlversion) - Release artifacts:
.github/workflows/release-build.yml(Linux + macOS) - Artifact naming:
moodbar-<tag>-<target>.tar.gz - npm release workflow:
.github/workflows/publish-wasm-npm.yml(OIDC trusted publishing) - npm release workflow (native):
.github/workflows/publish-native-npm.yml(OIDC trusted publishing)
Publish WASM Package
# build and normalize npm package metadata/files
# reproducibility and package contract checks
# publish manually (maintainer workflow)
Publish Native Package
# build platform artifacts + prepare metadata/files
# validate package contract and dry-run publish
# publish manually (maintainer workflow)