Skip to content

Commit f1ca4b4

Browse files
committed
chore: follow up repo hygiene cleanup
1 parent 74771ae commit f1ca4b4

36 files changed

Lines changed: 446 additions & 183 deletions

File tree

.claude/skills/rezi-create-screen/SKILL.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,29 @@ Use this skill when:
2929

3030
1. **Create screen file** at `src/screens/{screen-name}.ts`:
3131
```typescript
32+
import type { VNode } from "@rezi-ui/core";
3233
import { ui } from "@rezi-ui/core";
33-
import type { AppState } from "../state.js";
34+
import type { AppState } from "../types.js";
3435

35-
export function MyScreen(state: AppState) {
36+
type ScreenHandlers = Readonly<{
37+
onPrimaryAction: () => void;
38+
}>;
39+
40+
export function renderMyScreen(_state: AppState, handlers: ScreenHandlers): VNode {
3641
return ui.page({
3742
p: 1,
3843
gap: 1,
3944
header: ui.header({ title: "Screen Title" }),
4045
body: ui.column({ gap: 1 }, [
41-
// screen content
46+
ui.text("Screen content"),
47+
ui.actions([
48+
ui.button({
49+
id: "my-screen-action",
50+
label: "Go",
51+
intent: "primary",
52+
onPress: handlers.onPrimaryAction,
53+
}),
54+
]),
4255
]),
4356
});
4457
}
@@ -87,13 +100,26 @@ Use this skill when:
87100

88101
4. **If using router**, add a route definition (see `rezi-routing` skill)
89102

90-
5. **Add keybindings** for screen-specific actions in the app's key handler
103+
5. **Add keybindings** for screen-specific actions in `src/helpers/keybindings.ts` or your route command resolver
104+
105+
6. **Wire into `src/main.ts`** via a view builder or route factory:
106+
```typescript
107+
app.view((state) =>
108+
renderMyScreen(state, {
109+
onPrimaryAction: () => dispatch({ type: "open-my-screen" }),
110+
}),
111+
);
112+
```
91113

92-
6. **Wire into main** via router or view switch:
114+
For routed apps, add the screen to `src/screens/index.ts`:
93115
```typescript
94-
view: (state) => {
95-
if (state.screen === "my-screen") return MyScreen(state);
96-
return HomeScreen(state);
116+
{
117+
id: "my-screen",
118+
title: "My Screen",
119+
screen: (_params, context) =>
120+
renderMyScreen(context.state, {
121+
onPrimaryAction: () => deps.dispatch({ type: "open-my-screen" }),
122+
}),
97123
}
98124
```
99125

.codex/skills/rezi-create-screen/SKILL.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,29 @@ Use this skill when:
2929

3030
1. **Create screen file** at `src/screens/{screen-name}.ts`:
3131
```typescript
32+
import type { VNode } from "@rezi-ui/core";
3233
import { ui } from "@rezi-ui/core";
33-
import type { AppState } from "../state.js";
34+
import type { AppState } from "../types.js";
3435

35-
export function MyScreen(state: AppState) {
36+
type ScreenHandlers = Readonly<{
37+
onPrimaryAction: () => void;
38+
}>;
39+
40+
export function renderMyScreen(_state: AppState, handlers: ScreenHandlers): VNode {
3641
return ui.page({
3742
p: 1,
3843
gap: 1,
3944
header: ui.header({ title: "Screen Title" }),
4045
body: ui.column({ gap: 1 }, [
41-
// screen content
46+
ui.text("Screen content"),
47+
ui.actions([
48+
ui.button({
49+
id: "my-screen-action",
50+
label: "Go",
51+
intent: "primary",
52+
onPress: handlers.onPrimaryAction,
53+
}),
54+
]),
4255
]),
4356
});
4457
}
@@ -87,13 +100,26 @@ Use this skill when:
87100

88101
4. **If using router**, add a route definition (see `rezi-routing` skill)
89102

90-
5. **Add keybindings** for screen-specific actions in the app's key handler
103+
5. **Add keybindings** for screen-specific actions in `src/helpers/keybindings.ts` or your route command resolver
104+
105+
6. **Wire into `src/main.ts`** via a view builder or route factory:
106+
```typescript
107+
app.view((state) =>
108+
renderMyScreen(state, {
109+
onPrimaryAction: () => dispatch({ type: "open-my-screen" }),
110+
}),
111+
);
112+
```
91113

92-
6. **Wire into main** via router or view switch:
114+
For routed apps, add the screen to `src/screens/index.ts`:
93115
```typescript
94-
view: (state) => {
95-
if (state.screen === "my-screen") return MyScreen(state);
96-
return HomeScreen(state);
116+
{
117+
id: "my-screen",
118+
title: "My Screen",
119+
screen: (_params, context) =>
120+
renderMyScreen(context.state, {
121+
onPrimaryAction: () => deps.dispatch({ type: "open-my-screen" }),
122+
}),
97123
}
98124
```
99125

.codex/skills/rezi-perf-profiling/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
name: rezi-perf-profiling
33
description: Profile and optimize Rezi app performance. Use when app feels slow, frames drop, or render phases take too long.
4+
user-invocable: true
5+
allowed-tools: Read, Glob, Grep, Bash(REZI_PERF=1 *), Bash(npx tsx packages/bench/*)
6+
argument-hint: "[performance-concern]"
7+
metadata:
8+
short-description: Performance profiling
49
---
510

611
## When to use

.codex/skills/rezi-routing/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
name: rezi-routing
33
description: Add routing with guards and nested outlets to a Rezi app. Use when building multi-page/screen TUI applications.
4+
user-invocable: true
5+
allowed-tools: Read, Glob, Grep, Edit, Write
6+
argument-hint: "[route-name]"
7+
metadata:
8+
short-description: Add routing
49
---
510

611
## When to use

.gitignore

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ vite.config.ts.timestamp-*
142142
# Docs (MkDocs)
143143
.venv-docs/
144144

145-
# Native addon build artifacts
145+
# Bench and release artifacts
146+
.artifacts/
147+
benchmarks/local-*
146148
packages/native/target/
147149
packages/native/*.node
148150

@@ -160,27 +162,13 @@ Thumbs.db
160162
*.key
161163
credentials.json
162164

163-
# Demo benchmark artifacts
164-
packages/demo/benchmarks/
165-
166165
# Bench artifacts
167-
packages/bench/results/
168-
packages/bench/ratatui/target/
166+
packages/bench/ratatui-bench/target/
169167
benchmarks/native/ratatui-bench/target/
170168

171169
# Local investigation artifacts
172170
Screens/
173171
debug-traces/
174172
isolate-*.log
175173
CODEX_*.md
176-
.last_perf_dir
177-
.last_perf_pack
178-
.last_perf_pack_full
179-
.last_perf_pack_quick
180174
*.cpuprofile
181-
packages/bench/bubbletea-bench/.bin/
182-
183-
# Ink compat benchmark artifacts (runner output)
184-
results/ink-bench_*/
185-
results/verify_*/
186-
results/verify_*.json

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Repository examples:
2222
- `examples/hello-counter`
2323
- `examples/raw-draw-demo`
2424
- `examples/gallery`
25-
- `examples/regression-dashboard`
25+
- `examples/regression-dashboard` (validation surface for layout/render/input regressions)
2626

2727
## Canonical References
2828

@@ -176,4 +176,4 @@ Project-level skills are mirrored for Claude and Codex.
176176
| Perf Profiling | `.claude/skills/rezi-perf-profiling/` | `.codex/skills/rezi-perf-profiling/` |
177177
| Routing | `.claude/skills/rezi-routing/` | `.codex/skills/rezi-routing/` |
178178

179-
Keep these files aligned when the repo structure or recommended workflows change.
179+
Keep these files aligned, including YAML frontmatter and path examples, when the repo structure or recommended workflows change.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
> **Status: pre-alpha.** Rezi is under active development. Public APIs, native ABI details, and behavior may change between releases. It is not yet recommended for production workloads.
44
5-
Rezi is a TypeScript framework for building terminal user interfaces on Node.js and Bun. It provides a declarative widget API, deterministic input and rendering behavior, and a native-backed rendering pipeline through the Zireael engine written in C.
5+
Rezi is a TypeScript framework for building terminal user interfaces on Node.js and Bun. It provides a declarative widget API, deterministic input and rendering behavior, and a native-backed rendering pipeline through the [Zireael engine](https://github.com/RtlZeroMemory/Zireael) written in C.
66

7-
https://github.com/RtlZeroMemory/Zireael
8-
9-
**Links:** [Website](https://rezitui.dev/) · [Docs](https://rezitui.dev/docs/) · [Quickstart](https://rezitui.dev/docs/getting-started/quickstart/) · [Widgets](https://rezitui.dev/docs/widgets/) · [Benchmarks](https://rezitui.dev/docs/benchmarks/)
7+
**Links:** [Website](https://rezitui.dev/) · [Docs](https://rezitui.dev/) · [Quickstart](https://rezitui.dev/getting-started/quickstart/) · [Widgets](https://rezitui.dev/widgets/) · [Benchmarks](https://rezitui.dev/benchmarks/)
108

119
## What Rezi Is For
1210

biome.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
"files": {
8080
"ignore": [
8181
".venv-docs/**",
82+
".artifacts/**",
8283
"out/**",
84+
"benchmarks/local-*/**",
8385
"**/dist/**",
8486
"**/node_modules/**",
8587
"**/target/**",

docs/api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The hosted API reference is available at the documentation site under `/api/refe
1515
Generate the API documentation locally:
1616

1717
```bash
18+
npm run build
1819
npm run docs:api
1920
```
2021

@@ -23,6 +24,7 @@ The output is written to `out/typedoc/index.html`.
2324
Alternatively, build the complete documentation site:
2425

2526
```bash
27+
npm run build
2628
npm run docs:build
2729
```
2830

docs/dev/build.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ npm run build
6060

6161
This runs `tsc -b` (TypeScript project build mode) across the root project
6262
references: `packages/create-rezi`, `packages/core`, `packages/node`,
63-
`packages/testkit`, `packages/jsx`, and `examples/*`. Packages like
64-
`@rezi-ui/native` and `@rezi-ui/bench` are built separately.
63+
`packages/testkit`, `packages/jsx`, and the current example apps
64+
(`examples/gallery`, `examples/hello-counter`, `examples/raw-draw-demo`, and
65+
`examples/regression-dashboard`). Packages like `@rezi-ui/native` and
66+
`@rezi-ui/bench` are built separately.
6567

6668
TypeScript build mode is incremental, so subsequent builds after the first are
6769
fast -- only changed files and their dependents are recompiled.
@@ -74,8 +76,10 @@ packages/node/dist/
7476
packages/jsx/dist/
7577
packages/testkit/dist/
7678
packages/create-rezi/dist/
79+
examples/gallery/dist/
7780
examples/hello-counter/dist/
7881
examples/raw-draw-demo/dist/
82+
examples/regression-dashboard/dist/
7983
```
8084

8185
### Incremental Rebuilds
@@ -102,6 +106,33 @@ This runs `tsc -b --pretty false` for the same root project references with
102106
colorized output disabled for easier log parsing. It produces the same `.js`
103107
and `.d.ts` output as `npm run build`.
104108

109+
For the full CI project graph, including `packages/bench`, run:
110+
111+
```bash
112+
npm run typecheck:ci
113+
```
114+
115+
`typecheck:ci` uses `tsconfig.ci.json`, which extends the root graph with the
116+
benchmark package for release/CI parity checks.
117+
118+
## Benchmark Package Build
119+
120+
The benchmark runner is compiled outside the root `tsc -b` graph. Build it
121+
explicitly with:
122+
123+
```bash
124+
npm run bench:build
125+
```
126+
127+
This runs the `@rezi-ui/bench` project-reference graph and writes the runner to
128+
`packages/bench/dist/`.
129+
130+
The root benchmark entry points (`npm run bench`, `npm run bench:rezi`,
131+
`npm run bench:ci`, `npm run bench:terminal:rigorous`, and
132+
`npm run bench:all:rigorous`) invoke this automatically via `pre*` scripts, so
133+
they work from a clean checkout after `npm ci` without a separate manual
134+
`npx tsc -b packages/bench`.
135+
105136
## Native Addon Build
106137

107138
The native addon (`@rezi-ui/native`) wraps the Zireael C engine via napi-rs.
@@ -196,7 +227,7 @@ git submodule update --init --recursive
196227
If TypeScript reports errors that do not match the source, delete build caches:
197228

198229
```bash
199-
rm -rf packages/*/dist packages/*/.tsbuildinfo
230+
rm -rf packages/*/dist examples/*/dist packages/*/tsconfig.tsbuildinfo examples/*/tsconfig.tsbuildinfo
200231
npm run build
201232
```
202233

0 commit comments

Comments
 (0)