@wu-framework/cli
v0.2.5
Published
Lightning-fast micro-frontend CLI — scaffold, develop, and build multi-framework apps
Downloads
404
Maintainers
Readme
Native Zig CLI and dev server for wu-framework microfrontend applications. Replaces N Vite dev servers with a single process -- one binary that discovers, compiles, builds, and serves every micro-app through a unified HTTP server.
What's New in v0.2.0
- Production build pipeline --
wu buildcompiles all micro-apps via Vite in parallel and generates a production shell with theme support - Production server --
wu serveserves the builtdist/folder with proper static file serving and clean Ctrl+C shutdown - Event-driven mounting -- production shell uses
wu:app:readyevents instead ofawait import(), eliminating Vite code-splitting deadlocks - Theme system -- generated shells and app templates use CSS custom properties (
--surface,--text,--border, etc.) for dark/light theme propagation - wu-framework.com design tokens -- shells use the official design system: Indigo
#6366f1, Teal#14b8a6, Zinc palette, Inter font, backdrop blur - 13 theme-aware app templates -- all framework templates (React, Vue, Svelte, Solid, Preact, Lit, Angular, Alpine, Qwik, Stencil, HTMX, Stimulus, Vanilla) respond to shell theme changes
- Responsive production shell -- topbar with backdrop blur, sidebar with framework badges, loading spinners, mobile hamburger menu
- Correct Vite entry detection --
findEntryFromHtml()parses Vite's generatedindex.htmlto find the real entry point instead of picking the first JS file
Features
- Native HTTP dev server with SIMD-accelerated request parsing (16 bytes/cycle)
- Three-tier compilation: Native Zig JSX (0-2ms) -> Compiler Daemon (10-50ms) -> Node fallback (200-400ms)
- Two-level cache: in-memory (256 entries) + persistent disk (
.wu-cache/), 73-138x speedup on warm restart - NPM module resolution in pure Zig (package.json
exports,module,mainfields with conditions) - TypeScript stripping and bare-specifier import rewriting (
react->/@modules/react) - CSS-as-module imports (
import './style.css'injects into DOM at runtime) - WebSocket (RFC 6455) + SSE-based HMR with 300ms file-watcher polling
- HTTP keep-alive for connection reuse across requests
- Interactive project scaffolding (
wu create) with 13 framework choices - Auto-discovery of micro-apps from directory structure (no config required)
- Production build with parallel Vite compilation and optimized shell generation
- Production server with static file serving
Install
npm install -g @wu-framework/cliThen use it anywhere:
wu create my-project # Interactive scaffolding
cd my-project
wu dev # Start dev server on one port
wu build # Build for production
wu serve # Serve production buildBuild 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-projectCommands
| Command | Description |
|---------|-------------|
| wu dev | Start native dev server (default) or Vite processes (--vite) |
| wu build | Build all micro-apps via Vite in parallel, generate production shell |
| wu serve | Serve the production dist/ folder |
| wu create | Interactive project scaffolding (name, frameworks, npm install) |
| wu add <framework> <name> | Add a new micro-app to an existing project |
| wu info | Show project configuration and status |
wu create
Interactive guided scaffolding:
$ wu create my-store
Wu CLI v0.2.0
Creating a new Wu project...
Project name: my-store
Add micro-apps:
App name: products
Framework: vue
App name: orders
Framework: react
(empty to finish)
Generated:
shell/ HTML shell with sidebar navigation
mf-products/ Vue 3 micro-app
mf-orders/ React micro-app
wu.config.json Project configuration
Installing dependencies...
Done!wu build
Builds each micro-app with Vite in parallel and generates a production-ready shell:
$ wu build
Wu CLI v0.2.0
Building 4 micro-apps for production...
+ shell (static)
+ dashboard 3.1s
+ orders 2.8s
+ products 3.4s
+ settings 4.2s
+ wu-manifest.json (4 apps)
+ dist/index.html (production shell)
+ Build complete: 4 app(s) -> dist/ (5.8s)wu serve
Serves the built dist/ folder:
$ wu serve
Wu CLI v0.2.0
Serving production build from dist/
Local: http://localhost:3000/
Press Ctrl+C to stopConfiguration
wu-cli reads a wu.config.json file at the project root:
{
"name": "my-store",
"version": "0.2.0",
"shell": {
"dir": "shell",
"port": 4321,
"framework": "html"
},
"apps": [
{
"name": "dashboard",
"dir": "mf-hero",
"framework": "svelte",
"port": 5002
},
{
"name": "orders",
"dir": "mf-eventlab",
"framework": "react",
"port": 5005
}
],
"proxy": {
"port": 3000,
"open_browser": true
}
}Alternatively, wu-cli auto-discovers micro-apps by scanning subdirectories for vite.config.js + package.json. No configuration file is required for basic usage.
Architecture
wu-cli/
src/
commands/ CLI command handlers
dev.zig Native dev server orchestration
build.zig Production build pipeline (Vite + shell generation)
serve.zig Production static file server
create.zig Interactive project scaffolding
add.zig Add micro-app to existing project
info.zig Project status display
templates/ 13 framework app component templates
runtime/ Dev server core
dev_server.zig Thread-per-connection HTTP server with keep-alive
http_parser.zig SIMD HTTP/1.1 parser (16 bytes/cycle)
resolve.zig NPM module resolution (exports, module, main)
transform.zig TS stripping + bare-specifier rewriting
jsx_transform.zig Native JSX -> createElement (React/Preact)
compile.zig Three-tier compilation with persistent daemon
cache.zig Two-level mtime cache (memory + disk)
ws_protocol.zig WebSocket RFC 6455 (frame parsing, masking)
mime.zig MIME type detection
config/ Configuration loading and validationCompilation Pipeline
.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: source mtime is compared against the cached entry, and cached output is served directly (~3ms).
Supported Frameworks
| 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 | -- | | Qwik | .jsx | Passthrough | -- | | Stencil | .js | Passthrough | -- | | HTMX | .js | Passthrough | -- | | Stimulus | .js | Passthrough | -- | | Vanilla | .js, .ts | TS strip only | -- |
Theme System
Generated shells and app templates support dark/light theme switching via CSS custom properties:
| Variable | Dark | Light | Purpose |
|----------|------|-------|---------|
| --bg | #09090b | #fafafa | Page background |
| --surface | #111113 | #ffffff | Card/panel background |
| --border | #27272a | #d4d4d8 | Borders |
| --text | #fafafa | #09090b | Primary text |
| --text2 | #a1a1aa | #52525b | Secondary text |
| --text-muted | #3f3f46 | #a1a1aa | Muted/label text |
| --accent | #6366f1 | #6366f1 | Brand accent (Indigo) |
| --teal | #14b8a6 | #14b8a6 | Status/success accent |
All 13 app templates use var(--surface, #111) etc. with fallback defaults, so they work both inside a themed shell and standalone.
Requirements
- Node.js 16+ -- for installing via npm
- Node.js 18+ -- needed at runtime for Svelte, Vue, and Solid compilation (React/Preact use native Zig JSX)
- Zig 0.15.2+ -- only needed if building from source
Project Stats
- 22 Zig source files, ~3000 lines of runtime code
- 13 framework app component templates (embedded at compile time)
- ~250-460KB release binary per platform (Windows, Linux, macOS x64/arm64)
- Zero external Zig dependencies
- Single-process architecture replaces 12+ simultaneous Vite dev servers
- Part of the wu-framework microfrontend platform
License
MIT
Author
Luis Garcia -- Creator of wu-framework
2026 Wu Framework
