wasm-wizard
v0.1.4
Published
A CLI tool that makes WebAssembly Component Model ridiculously easy to use π§ββοΈ
Maintainers
Readme
π§ββοΈ WASM Wizard
A CLI tool that makes WebAssembly Component Model ridiculously easy to use
Why WASM Wizard?
WebAssembly Component Model is the future of portable, composable software. But the tooling is complex and the learning curve is steep. WASM Wizard solves this by providing:
- ποΈ Project scaffolding with battle-tested templates
- β‘ Smart build optimization and size reduction
- π Component composition and linking made simple
- π οΈ Developer-friendly tooling with hot reload
- π Component analysis and performance insights
Quick Start
Install via npm (recommended)
npm install -g wasm-wizardInstall via cargo
cargo install wasm-wizardCreate your first component
# Create a new Rust component
wasm-wizard new my-component --language rust
# Or create a JavaScript component
wasm-wizard new my-js-component --language javascript
# Or TypeScript
wasm-wizard new my-ts-component --language typescript
# Or create a minimal demo (no language needed)
wasm-wizard new my-demo --template minimalBuild and optimize
cd my-component
wasm-wizard build --optimizeStart development server
wasm-wizard dev --hot-reloadπ Minimal Template - 7x Performance in <12KB
The minimal template creates ultra-lightweight demos that prove WebAssembly's performance:
wasm-wizard new perf-demo --template minimal
cd perf-demo
python3 -m http.serverFeatures:
- β Real WebAssembly bytecode embedded in HTML
- β 7x+ performance gains vs naive JavaScript
- β Total file size under 12KB
- β Zero dependencies, zero build steps
- β Perfect for demos and proof-of-concepts
Features
ποΈ Project Scaffolding
Create new WebAssembly components with opinionated, production-ready templates:
wasm-wizard new my-component --template basic --language rustAvailable templates:
minimal- Ultra-lightweight <12KB demo with 7x performancebasic- Simple component with common patternshttp- HTTP service componentcrypto- Cryptographic utilitiesdata- Data processing component
Supported languages:
- Rust (primary)
- JavaScript/TypeScript
- Go (coming soon)
- Python (coming soon)
β‘ Smart Build Optimization
Build and optimize your components with intelligent defaults:
# Build with optimization
wasm-wizard build --optimize
# Target specific size
wasm-wizard optimize my-component.wasm --size 50kb
# Experimental optimizations
wasm-wizard optimize my-component.wasm --experimentalπ Component Composition
Compose multiple components into a single, optimized component:
wasm-wizard compose auth.wasm storage.wasm api.wasm --output app.wasmπ οΈ Developer Experience
- Hot reload development server
- Automatic toolchain management
- Component health checks
- Language bindings generation
# Start dev server with hot reload
wasm-wizard dev --hot-reload
# Install all required tools
wasm-wizard install --all
# Check component health
wasm-wizard check --fix
# Generate JavaScript bindings
wasm-wizard bindings my-component.wasm --language javascriptπ Component Analysis
Get insights into your components:
wasm-wizard analyze my-component.wasm --detailedCommands
| Command | Description |
|---------|-------------|
| new | Create a new WASM component project |
| build | Build and optimize WASM components |
| compose | Compose multiple components |
| optimize | Optimize existing WASM components |
| dev | Start development server |
| install | Install toolchain dependencies |
| check | Health check for components |
| bindings | Generate language bindings |
| analyze | Analyze component performance |
Configuration
WASM Wizard uses a wasm-wizard.toml file for project configuration:
[project]
name = "my-component"
language = "rust"
template = "basic"
version = "0.1.0"
[build]
target = "wasm32-wasip1"
optimization_level = 3
strip_debug = true
[dev]
port = 8080
hot_reload = true
watch_paths = ["src/**/*", "wit/**/*"]
[composition]
output_format = "component"
enable_optimization = trueReal-World Examples
Microservice Architecture
# Create individual services
wasm-wizard new auth-service --template http
wasm-wizard new user-service --template http
wasm-wizard new payment-service --template http
# Build each service
wasm-wizard build --optimize
# Compose into a single deployment
wasm-wizard compose auth.wasm user.wasm payment.wasm --output app.wasmData Processing Pipeline
# Create data processing components
wasm-wizard new data-ingestion --template data
wasm-wizard new data-transform --template data
wasm-wizard new data-export --template data
# Compose the pipeline
wasm-wizard compose ingestion.wasm transform.wasm export.wasm --output pipeline.wasmPerformance
WASM Wizard optimizes for both developer experience and runtime performance:
- 50-80% size reduction through smart optimization
- Sub-second builds with incremental compilation
- Hot reload in under 100ms
- Zero-copy composition for large components
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Inspiration
Built for the Fireship community to make WebAssembly accessible to everyone. Special thanks to the Bytecode Alliance for their work on the Component Model.
Made with π§ββοΈ by the WebAssembly community
