Packages¶
Rezi is organized as a monorepo with multiple packages, each with distinct responsibilities.
Installation¶
Most applications need only two packages:
Package Overview¶
flowchart TB
App["Your Application"] --> Core
JSX["@rezi-ui/jsx"] -.-> Core
InkCompat["@rezi-ui/ink-compat"] -.-> Core
Core["@rezi-ui/core"] --> Node
Node["@rezi-ui/node"] --> Native
Native["@rezi-ui/native"] --> Engine["Zireael C Engine"]
| Package | Description | npm |
|---|---|---|
| @rezi-ui/core | Widgets, layout, themes, forms, keybindings | npm i @rezi-ui/core |
| @rezi-ui/node | Node.js backend with worker threads | npm i @rezi-ui/node |
| @rezi-ui/native | Native addon (napi-rs + Zireael) | Bundled with node |
| @rezi-ui/ink-compat | Drop-in Ink compatibility layer (React) | npm i @rezi-ui/ink-compat |
| @rezi-ui/jsx | JSX runtime for Rezi widgets | npm i @rezi-ui/jsx |
| @rezi-ui/testkit | Testing utilities and fixtures | npm i -D @rezi-ui/testkit |
| create-rezi | Project scaffolding CLI | npm create rezi |
@rezi-ui/core¶
Runtime-agnostic TypeScript core
The core package is the heart of Rezi. It contains:
- All widget constructors (
ui.text,ui.button,ui.table, etc.) - Layout engine with flexbox-like semantics
- Theme system with six built-in presets
- Form management and validation
- Keybinding parser with chord support
- Focus management utilities
- Binary protocol builders and parsers
Critically, this package has no Node.js-specific dependencies. It can theoretically run in any JavaScript runtime.
@rezi-ui/node¶
Node.js runtime backend
The Node.js backend provides the runtime integration:
- Worker thread management for async rendering
- Event loop integration
- Terminal capability detection
- Debug tracing and performance instrumentation
import { createNodeBackend } from "@rezi-ui/node";
const app = createApp({
backend: createNodeBackend(),
initialState: {},
});
@rezi-ui/native¶
Native addon (N-API + Zireael)
The native package contains the napi-rs binding to the Zireael C rendering engine:
- Terminal I/O with platform-specific optimizations
- Binary protocol handling
- Prebuilt binaries for Linux, macOS, and Windows
This package is automatically installed as a dependency of @rezi-ui/node.
@rezi-ui/testkit¶
Testing utilities
Helper package for testing Rezi applications:
- Mock backends for unit testing
- Test fixtures for protocol testing
- Golden file comparison utilities
create-rezi¶
Project scaffolding CLI
Generate a ready-to-run Rezi app with TypeScript configured and a multi-panel template:
@rezi-ui/ink-compat¶
Ink compatibility layer
Drop-in replacement for Ink imports that runs on Rezi's native rendering engine:
- All 6 Ink components (
Box,Text,Spacer,Newline,Transform,Static) - All 7 Ink hooks (
useInput,useApp,useFocus,useFocusManager,useStdin,useStdout,useStderr) render()function with all standard options
Full documentation → | Migration guide →
@rezi-ui/jsx¶
JSX runtime
Native JSX runtime that maps JSX elements directly to Rezi VNodes (no React required):
Full documentation → | Getting started →
Dependency Flow¶
The package dependency structure enforces a clean separation of concerns:
Application Code (ui.* API or JSX)
│
├─── @rezi-ui/jsx (optional JSX runtime)
├─── @rezi-ui/ink-compat (optional Ink React compat)
│
▼
@rezi-ui/core (No Node APIs)
│
│ used by
▼
@rezi-ui/node (Worker threads, event loop)
│
│ binds to
▼
@rezi-ui/native (C engine via N-API)
│
▼
Zireael C Engine (Terminal rendering)
Versioning¶
All publishable packages share a single version number. This simplifies dependency management and ensures compatibility between packages.
Current versions can be checked in each package's package.json or via npm:
Development Packages¶
The following packages are used for development only and are not published:
| Package | Purpose |
|---|---|
@rezi-ui/bench |
Performance benchmarks |