One binary. One port. All your micro-apps.
Native Zig dev server and CLI toolkit for wu-framework microfrontend applications. Replaces N Vite dev servers with a single process -- one binary that discovers, compiles, and serves every micro-app through a unified HTTP server.
.wu-cache/), 73-138x speedup on warm restartexports, module, main fields with conditions)react -> /@modules/react)import './style.css' injects into DOM at runtime)wu create)npm install -g @wu-framework/cli
Then use it anywhere:
wu create my-project
cd my-project
wu dev
If you prefer to build from source (requires Zig 0.15.2+):
git clone https://github.com/LuisPadre25/wu-cli.git
cd wu-cli
zig build
./zig-out/bin/wu create my-project
| Command | Description |
|---|---|
wu dev |
Start native dev server (default) or Vite processes (--vite) |
wu build |
Build all micro-apps in parallel |
wu create |
Interactive project scaffolding (name, frameworks, install) |
wu add <framework> <name> |
Add a new micro-app to an existing project |
wu info |
Show project configuration and status |
wu serve |
Production server (coming soon) |
wu-cli reads a wu.config.json file at the project root. Example:
{
"shell": {
"dir": "shell",
"port": 4321,
"framework": "astro"
},
"apps": [
{
"name": "dashboard",
"dir": "mf-hero",
"framework": "svelte",
"port": 5002
},
{
"name": "orders",
"dir": "mf-eventlab",
"framework": "react",
"port": 5005
}
]
}
Alternatively, wu-cli auto-discovers micro-apps by scanning subdirectories for the presence of both vite.config.js and package.json. No configuration file is required for basic usage.
src/
commands/ CLI command handlers (dev, build, create, add, info, serve)
runtime/ Dev server core
config/ Configuration loading and validation
| Module | Purpose |
|---|---|
| dev_server.zig | Thread-per-connection HTTP server with keep-alive and static file serving |
| http_parser.zig | SIMD HTTP/1.1 request parser (16 bytes/cycle vectorized header scanning) |
| resolve.zig | NPM module resolution in pure Zig (zero Node.js dependency) |
| transform.zig | TypeScript erasure + bare-specifier import rewriting (line-preserving) |
| jsx_transform.zig | Native JSX to createElement transformation (React/Preact, ~0-2ms) |
| compile.zig | Three-tier framework compilation with persistent daemon process |
| cache.zig | Two-level mtime-based cache (in-memory 256 entries + disk .wu-cache/) |
| ws_protocol.zig | WebSocket RFC 6455 implementation (frame parsing, masking, handshake) |
| mime.zig | MIME type detection by file extension |
.jsx/.tsx (React/Preact) ----> Native Zig JSX ----> JS (~0-2ms)
.jsx/.tsx (Solid) ----> Compiler Daemon ----> JS (~10-50ms)
.svelte ----> Compiler Daemon ----> JS (~10-50ms)
.vue ----> Compiler Daemon ----> JS (~10-50ms)
.ts (Angular) ----> esbuild bundle ----> JS (~10-50ms)
.ts ----> TS Strip ----> JS (~0-1ms)
.js (Alpine/HTMX/etc) ----> passthrough ----> JS (~0ms)
The three tiers are tried in order. Native Zig handles React and Preact JSX with zero external processes. The Compiler Daemon keeps a long-running Node.js process for frameworks that require their own compilers (Svelte, Vue, Solid). If the daemon is unavailable, a one-shot node -e fallback is used.
Cache hits bypass all tiers entirely: the mtime of the source file is compared against the cached entry, and the cached output is served directly (~3ms).
| Framework | Extensions | Compile Tier | Native JSX |
|---|---|---|---|
| React | .jsx, .tsx | Native Zig | Yes |
| Preact | .jsx, .tsx | Native Zig | Yes |
| Vue | .vue | Daemon / Node | -- |
| Svelte | .svelte | Daemon / Node | -- |
| Solid.js | .jsx, .tsx | Daemon / Node | -- |
| Angular | .ts | esbuild bundle | -- |
| Lit | .ts, .js | TS strip only | -- |
| Alpine.js | .js | Passthrough | -- |
| Stencil | .js | Passthrough | -- |
| HTMX | .js | Passthrough | -- |
| Stimulus | .js | Passthrough | -- |
| Vanilla | .js, .ts | TS strip only | -- |
npm install -g @wu-framework/cli)MIT
Luis Garcia -- Creator of wu-framework
See CONTRIBUTING.md for development workflow and guidelines.