xonecas.io
70160
Ce

cel-tui / commit 9dfeaba

chore: prepare 0.6.0 release

xonecas2026-04-10 9dfeaba8123cf39b1791dfd68d66ff97bfa74005 parent d4e7188

9 files changed

README.md+5−5
@@ -80,11 +80,11 @@ Some historical legacy collisions remain impossible to recover once a host has a
8080
8181 ## Packages
8282
83-| Package | Description |
84-| --------------------- | ------------------------------------------------------------------------- |
85-| `@cel-tui/types` | Shared type definitions |
86-| `@cel-tui/core` | Framework engine and primitives |
87-| `@cel-tui/components` | Pre-made components (Button, Spacer, Divider, VDivider, Select, Markdown) |
83+| Package | Description |
84+| --------------------- | ------------------------------------------------------------------------------------------ |
85+| `@cel-tui/types` | Shared type definitions |
86+| `@cel-tui/core` | Framework engine and primitives |
87+| `@cel-tui/components` | Pre-made components (Button, Spacer, Divider, VDivider, Select, Markdown, SyntaxHighlight) |
8888
8989 ## Documentation
9090
bun.lock+15−15
@@ -17,7 +17,7 @@
1717 },
1818 "packages/components": {
1919 "name": "@cel-tui/components",
20- "version": "0.5.0",
20+ "version": "0.6.0",
2121 "dependencies": {
2222 "@cel-tui/core": "workspace:*",
2323 "@cel-tui/types": "workspace:*",
@@ -31,7 +31,7 @@
3131 },
3232 "packages/core": {
3333 "name": "@cel-tui/core",
34- "version": "0.5.0",
34+ "version": "0.6.0",
3535 "dependencies": {
3636 "@cel-tui/types": "workspace:*",
3737 "get-east-asian-width": "^1.5.0",
@@ -42,30 +42,30 @@
4242 },
4343 "packages/types": {
4444 "name": "@cel-tui/types",
45- "version": "0.5.0",
45+ "version": "0.6.0",
4646 "peerDependencies": {
4747 "typescript": ">=5.0.0",
4848 },
4949 },
5050 },
5151 "packages": {
52- "@biomejs/biome": ["@biomejs/biome@2.4.10", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.4.10", "@biomejs/cli-darwin-x64": "2.4.10", "@biomejs/cli-linux-arm64": "2.4.10", "@biomejs/cli-linux-arm64-musl": "2.4.10", "@biomejs/cli-linux-x64": "2.4.10", "@biomejs/cli-linux-x64-musl": "2.4.10", "@biomejs/cli-win32-arm64": "2.4.10", "@biomejs/cli-win32-x64": "2.4.10" }, "bin": { "biome": "bin/biome" } }, "sha512-xxA3AphFQ1geij4JTHXv4EeSTda1IFn22ye9LdyVPoJU19fNVl0uzfEuhsfQ4Yue/0F …
52+ "@biomejs/biome": ["@biomejs/biome@2.4.11", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.4.11", "@biomejs/cli-darwin-x64": "2.4.11", "@biomejs/cli-linux-arm64": "2.4.11", "@biomejs/cli-linux-arm64-musl": "2.4.11", "@biomejs/cli-linux-x64": "2.4.11", "@biomejs/cli-linux-x64-musl": "2.4.11", "@biomejs/cli-win32-arm64": "2.4.11", "@biomejs/cli-win32-x64": "2.4.11" }, "bin": { "biome": "bin/biome" } }, "sha512-nWxHX8tf3Opb/qRgZpBbsTOqOodkbrkJ7S+JxJAruxOReaDPPmPuLBAGQ8vigyUgo0Q …
5353
54- "@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.4.10", "", { "os": "darwin", "cpu": "arm64" }, "sha512-vuzzI1cWqDVzOMIkYyHbKqp+AkQq4K7k+UCXWpkYcY/HDn1UxdsbsfgtVpa40shem8Kax4TLDLlx8kMAecgqiw=="],
54+ "@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.4.11", "", { "os": "darwin", "cpu": "arm64" }, "sha512-wOt+ed+L2dgZanWyL6i29qlXMc088N11optzpo10peayObBaAshbTcxKUchzEMp9QSY8rh5h6VfAFE3WTS1rqg=="],
5555
56- "@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.4.10", "", { "os": "darwin", "cpu": "x64" }, "sha512-14fzASRo+BPotwp7nWULy2W5xeUyFnTaq1V13Etrrxkrih+ez/2QfgFm5Ehtf5vSjtgx/IJycMMpn5kPd5ZNaA=="],
56+ "@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.4.11", "", { "os": "darwin", "cpu": "x64" }, "sha512-gZ6zR8XmZlExfi/Pz/PffmdpWOQ8Qhy7oBztgkR8/ylSRyLwfRPSadmiVCV8WQ8PoJ2MWUy2fgID9zmtgUUJmw=="],
5757
58- "@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.4.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-7MH1CMW5uuxQ/s7FLST63qF8B3Hgu2HRdZ7tA1X1+mk+St4JOuIrqdhIBnnyqeyWJNI+Bww7Es5QZ0wIc1Cmkw=="],
58+ "@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.4.11", "", { "os": "linux", "cpu": "arm64" }, "sha512-avdJaEElXrKceK0va9FkJ4P5ci3N01TGkc6ni3P8l3BElqbOz42Wg2IyX3gbh0ZLEd4HVKEIrmuVu/AMuSeFFA=="],
5959
60- "@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.4.10", "", { "os": "linux", "cpu": "arm64" }, "sha512-WrJY6UuiSD/Dh+nwK2qOTu8kdMDlLV3dLMmychIghHPAysWFq1/DGC1pVZx8POE3ZkzKR3PUUnVrtZfMfaJjyQ=="],
60+ "@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.4.11", "", { "os": "linux", "cpu": "arm64" }, "sha512-+Sbo1OAmlegtdwqFE8iOxFIWLh1B3OEgsuZfBpyyN/kWuqZ8dx9ZEes6zVnDMo+zRHF2wLynRVhoQmV7ohxl2Q=="],
6161
62- "@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.4.10", "", { "os": "linux", "cpu": "x64" }, "sha512-tZLvEEi2u9Xu1zAqRjTcpIDGVtldigVvzug2fTuPG0ME/g8/mXpRPcNgLB22bGn6FvLJpHHnqLnwliOu8xjYrg=="],
62+ "@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.4.11", "", { "os": "linux", "cpu": "x64" }, "sha512-TagWV0iomp5LnEnxWFg4nQO+e52Fow349vaX0Q/PIcX6Zhk4GGBgp3qqZ8PVkpC+cuehRctMf3+6+FgQ8jCEFQ=="],
6363
64- "@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.4.10", "", { "os": "linux", "cpu": "x64" }, "sha512-kDTi3pI6PBN6CiczsWYOyP2zk0IJI08EWEQyDMQWW221rPaaEz6FvjLhnU07KMzLv8q3qSuoB93ua6inSQ55Tw=="],
64+ "@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.4.11", "", { "os": "linux", "cpu": "x64" }, "sha512-bexd2IklK7ZgPhrz6jXzpIL6dEAH9MlJU1xGTrypx+FICxrXUp4CqtwfiuoDKse+UlgAlWtzML3jrMqeEAHEhA=="],
6565
66- "@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.4.10", "", { "os": "win32", "cpu": "arm64" }, "sha512-umwQU6qPzH+ISTf/eHyJ/QoQnJs3V9Vpjz2OjZXe9MVBZ7prgGafMy7yYeRGnlmDAn87AKTF3Q6weLoMGpeqdQ=="],
66+ "@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.4.11", "", { "os": "win32", "cpu": "arm64" }, "sha512-RJhaTnY8byzxDt4bDVb7AFPHkPcjOPK3xBip4ZRTrN3TEfyhjLRm3r3mqknqydgVTB74XG8l4jMLwEACEeihVg=="],
6767
68- "@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.4.10", "", { "os": "win32", "cpu": "x64" }, "sha512-aW/JU5GuyH4uxMrNYpoC2kjaHlyJGLgIa3XkhPEZI0uKhZhJZU8BuEyJmvgzSPQNGozBwWjC972RaNdcJ9KyJg=="],
68+ "@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.4.11", "", { "os": "win32", "cpu": "x64" }, "sha512-A8D3JM/00C2KQgUV3oj8Ba15EHEYwebAGCy5Sf9GAjr5Y3+kJIYOiESoqRDeuRZueuMdCsbLZIUqmPhpYXJE9A=="],
6969
7070 "@cel-tui/components": ["@cel-tui/components@workspace:packages/components"],
7171
@@ -97,7 +97,7 @@
9797
9898 "@types/mdast": ["@types/mdast@4.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA=="],
9999
100- "@types/node": ["@types/node@25.5.2", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-tO4ZIRKNC+MDWV4qKVZe3Ql/woTnmHDr5JD8UI5hn2pwBrHEwOEMZK7WlNb5RKB6EoJ02gwmQS9OrjuFnZYdpg=="],
100+ "@types/node": ["@types/node@25.6.0", "", { "dependencies": { "undici-types": "~7.19.0" } }, "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ=="],
101101
102102 "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
103103
@@ -185,7 +185,7 @@
185185
186186 "oniguruma-to-es": ["oniguruma-to-es@4.3.5", "", { "dependencies": { "oniguruma-parser": "^0.12.1", "regex": "^6.1.0", "regex-recursion": "^6.0.2" } }, "sha512-Zjygswjpsewa0NLTsiizVuMQZbp0MDyM6lIt66OxsF21npUDlzpHi1Mgb/qhQdkb+dWFTzJmFbEWdvZgRho8eQ=="],
187187
188- "prettier": ["prettier@3.8.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="],
188+ "prettier": ["prettier@3.8.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q=="],
189189
190190 "property-information": ["property-information@7.1.0", "", {}, "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ=="],
191191
@@ -219,7 +219,7 @@
219219
220220 "uc.micro": ["uc.micro@2.1.0", "", {}, "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="],
221221
222- "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
222+ "undici-types": ["undici-types@7.19.2", "", {}, "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg=="],
223223
224224 "unist-util-is": ["unist-util-is@6.0.1", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g=="],
225225
docs/skill/cel-tui/SKILL.md+16−1
@@ -5,7 +5,7 @@ license: MIT
55 compatibility: Requires Bun runtime. Best experience on Kitty-compatible terminals and in tmux with `set -s extended-keys on`; uses SGR mouse mode and accepts recoverable legacy key encodings when hosts do not preserve a pure Kitty stream.
66 metadata:
77 author: sacenox
8- version: "0.5.0"
8+ version: "0.6.0"
99 ---
1010
1111 # Building TUIs with cel-tui
@@ -246,6 +246,20 @@ cel.viewport(() =>
246246 mySelect.reset(); // clear filter/highlight programmatically
247247 ```
248248
249+### SyntaxHighlight component
250+
251+```ts
252+import { SyntaxHighlight } from "@cel-tui/components";
253+
254+VStack({ flex: 1, overflow: "scroll", padding: { x: 1 } }, [
255+ SyntaxHighlight(source, "typescript"),
256+]);
257+
258+SyntaxHighlight(source, "javascript", { theme: "dark-plus" });
259+```
260+
261+`SyntaxHighlight(content, language, props?)` renders bundled Shiki languages and aliases into cel-tui primitives. First render may show plain text while Shiki runtime, language, or theme loads; the component re-renders automatically once ready.
262+
249263 ## Gotchas
250264
251265 - **State is external** — the framework has no state. Mutate variables then call `cel.render()`.
@@ -264,6 +278,7 @@ mySelect.reset(); // clear filter/highlight programmatically
264278 - **Kitty-first keyboard input** — the framework enables Kitty level 1 and gets full modifier fidelity when the host preserves it (`alt+x`, `ctrl+plus`, `shift+enter`, etc.). It also normalizes recoverable legacy encodings so common shortcuts keep working in tmux. For best results, use a Kitty-compatible terminal or `tmux` with `set -s extended-keys on`. On older legacy hosts, historically ambiguous collisions such as `ctrl+i` vs `tab` or `ctrl+m` vs `enter` cannot be recovered once the host c …
265279 - **tmux is good for keyboard-driven manual checks** — common `tmux send-keys` paths work for printable chars, `Tab`/`BTab`, `Enter`, `Escape`, arrows, and many `Ctrl+letter` shortcuts. Use exact raw-sequence injection only when you need to target a protocol-specific encoding. Mouse input remains unreliable in tmux and should be verified in a real terminal.
266280 - **Button limitations** — `Button` from `@cel-tui/components` does not forward container sizing props (`width`, `height`, `flex`, `minWidth`, etc.). It supports styling (`fgColor`, `bgColor`, `bold`, etc.), `focusStyle`, `focused`, `onFocus`, `onBlur`, `onKeyPress`, and `padding`. For full layout control, use `HStack` + `Text` directly.
281+- **SyntaxHighlight loads lazily** — first render may show plain text until the Shiki runtime, requested language, and requested theme finish loading. Unsupported language ids also render plain text.
267282
268283 ## Composing Components
269284
docs/skill/cel-tui/references/api.md+30−1
@@ -160,7 +160,15 @@ cel-tui is **Kitty-first** and works well in `tmux` with `set -s extended-keys o
160160 ## Pre-made Components
161161
162162 ```ts
163-import { Spacer, Divider, Button, Select } from "@cel-tui/components";
163+import {
164+ Spacer,
165+ Divider,
166+ Button,
167+ Select,
168+ VDivider,
169+ Markdown,
170+ SyntaxHighlight,
171+} from "@cel-tui/components";
164172
165173 Spacer(); // VStack({ flex: 1 }, [])
166174 Divider(); // Text("─", { repeat: "fill" })
@@ -270,6 +278,27 @@ Markdown(content, {
270278
271279 Streaming works naturally — append chunks and call `cel.render()`. Unclosed blocks are handled gracefully.
272280
281+### SyntaxHighlight (rendered code)
282+
283+Returns a `VStack` — place it directly in a container's children:
284+
285+```ts
286+import { SyntaxHighlight } from "@cel-tui/components";
287+
288+VStack({ flex: 1, overflow: "scroll", padding: { x: 1 } }, [
289+ SyntaxHighlight(code, "typescript"),
290+]);
291+
292+SyntaxHighlight(code, "javascript", { theme: "dark-plus" });
293+```
294+
295+- Signature: `SyntaxHighlight(content, language, props?)`
296+- `language` accepts bundled Shiki language ids and aliases
297+- `props.theme` accepts a bundled Shiki theme name or a custom theme registration object
298+- Uses a terminal-friendly ANSI 16 fallback theme by default
299+- First render may show plain text while the Shiki runtime, language, or theme loads; unsupported languages also render plain text
300+- Append-only updates reuse a small per-language cache, so streaming code output works well
301+
273302 ## Theme
274303
275304 The default theme maps 16 color slots to ANSI palette indices. Custom themes remap to different ANSI indices or 24-bit hex:
docs/skill/cel-tui/references/composing-components.md+1−1
@@ -27,7 +27,7 @@ cel.viewport(() =>
2727 );
2828 ```
2929
30-This is the pattern used by `Button`, `Divider`, and `Spacer`. Prefer it whenever possible — it's simple, testable, and composable.
30+This is the pattern used by `Button`, `Divider`, `Spacer`, `VDivider`, `Markdown`, and `SyntaxHighlight` — stateless functions that derive output from current inputs. Prefer it whenever possible — it's simple, testable, and composable.
3131
3232 ## Stateful components (factory pattern)
3333
packages/components/package.json+2−2
@@ -1,7 +1,7 @@
11 {
22 "name": "@cel-tui/components",
3- "version": "0.5.0",
4- "description": "Pre-made components for cel-tui — Button, Spacer, Divider, VDivider, Select, Markdown",
3+ "version": "0.6.0",
4+ "description": "Pre-made components for cel-tui — Button, Spacer, Divider, VDivider, Select, Markdown, SyntaxHighlight",
55 "type": "module",
66 "module": "src/index.ts",
77 "types": "./src/index.ts",
packages/components/src/index.ts+1−1
@@ -6,7 +6,7 @@
66 *
77 * @example
88 * ```ts
9- * import { Spacer, Divider, VDivider, Button, Select, Markdown } from "@cel-tui/components";
9+ * import { Spacer, Divider, VDivider, Button, Select, Markdown, SyntaxHighlight } from "@cel-tui/components";
1010 *
1111 * HStack({ height: 1 }, [
1212 * Text("Title", { bold: true }),
packages/core/package.json+1−1
@@ -1,6 +1,6 @@
11 {
22 "name": "@cel-tui/core",
3- "version": "0.5.0",
3+ "version": "0.6.0",
44 "description": "Core framework engine for cel-tui — primitives, layout, rendering, input",
55 "type": "module",
66 "module": "src/index.ts",
packages/types/package.json+1−1
@@ -1,6 +1,6 @@
11 {
22 "name": "@cel-tui/types",
3- "version": "0.5.0",
3+ "version": "0.6.0",
44 "description": "Type definitions for cel-tui, a TypeScript TUI framework",
55 "type": "module",
66 "module": "src/index.ts",