silvery 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Silvery
1
+ # Silvery — React for modern terminal apps
2
2
 
3
- **React for modern terminal apps.**
3
+ **Powerful apps. Polished UIs. Proudly terminal.**
4
4
 
5
- Ink-compatible React renderer with an atomic rendering pipeline. Same `Box`, `Text`, `useInput` API you know. 99% Ink 7.0 compatible, 2.5–5.2× faster on mounted workloads, bundle-parity with Ink+Yoga. Plus everything you wish Ink had.
5
+ Ink-compatible React renderer for interactive terminal apps. Same `Box`, `Text`, `useInput` API you know.
6
6
 
7
7
  > **Work in progress.** APIs may change. Feedback welcome.
8
8
 
@@ -33,43 +33,56 @@ await render(<Counter />).run()
33
33
 
34
34
  - **React 18 + 19** — hooks, refs, effects, suspense — all works
35
35
  - **Flexbox layout** — `Box` with `flexDirection`, `padding`, `gap`, `flexGrow`, just like Ink
36
- - **Ink/Chalk compatible** — same component model, [`@silvery/ink`](https://github.com/beorn/silvery/tree/main/packages/ink) compatibility layer for migrating existing Ink applications
37
-
38
- ### Better
39
-
40
- - **Atomic rendering pipeline** — layout runs before render (no two-pass flash), cell-level buffer diff (no line redraws), synchronized frame output via DEC mode 2026 (no tearing). A class of rendering bugs architecturally impossible: no flicker, no component dropout on scroll, no half-updated frames
41
- - **2.5–5.2× faster than Ink 7.0 on mounted workloads** wins all 16 benchmark scenarios. Only changed cells emit to the terminal; incremental output is 28–192× smaller than full redraw. Run `bun run bench` in the repo to reproduce
42
- - **Bundle parity with Ink+Yoga** — 114.9 KB gzipped runtime vs Ink+Yoga's 116.6 KB (0.99× tied). Pure TypeScript, no WASM, zero native deps works on Alpine, CI, Docker, everywhere
43
- - **Responsive layout** — `useBoxRect()` returns actual dimensions synchronously during render
44
- - **Dynamic scrollback** — live React zone at the bottom, completed items graduate to terminal-owned scrollback. Cmd+F works natively. The thing Claude Code spent six months trying to retrofit into Ink
45
- - **Scrollable containers** — `overflow="scroll"` with automatic measurement and clipping
46
- - **99% Ink 7.0 compatible** — 918+/931 Ink tests pass on silvery's compat layer. Drop-in migration via `@silvery/ink`
47
- - **Theme system** — 38 palettes, semantic design/color tokens (`$primary`, `$error`), auto-detects terminal colors
48
- - **30+ components** — TextInput, TextArea, SelectList, ListView, Table, TreeView, Console, Tabs, CommandPalette, ModalDialog, Toast, and more
49
- - **Focus system** — scoped focus, arrow-key directional nav, click-to-focus
36
+ - **Ink/Chalk compatible** — [`@silvery/ink`](https://silvery.dev/guide/silvery-vs-ink) and `@silvery/chalk` drop-in compat layers. 99% of Ink's + 100% of Chalk's test suites pass. See the [full feature comparison](https://silvery.dev/guide/silvery-vs-ink)
37
+
38
+ ### Shiny new stuff
39
+
40
+ - **[Layout-first rendering](https://silvery.dev/guide/silvery-vs-ink#responsive-layout)** `useBoxRect()` returns actual dimensions during render. No post-render measurement, no two-pass layout cycle. Enables `overflow="scroll"`, `position="sticky"`, and ANSI-aware compositing with color blending
41
+ - **[Dynamic scrollback](https://silvery.dev/examples/scrollback)** live React zone at the bottom, completed items graduate to terminal-owned scrollback. Cmd+F and text selection work natively. Inline mode gets fullscreen-level performance; fullscreen mode gets inline-level UX (app-managed scrollback). No hard split between the two
42
+ - **Pure TypeScript, zero native deps** — no WASM, no build steps. Works on Alpine, CI, Docker, everywhere
43
+ - **[Ink-compatible](https://silvery.dev/guide/silvery-vs-ink#compatibility)** — 918/931 Ink 7.0 tests pass on silvery's compat layer. Drop-in migration via [`@silvery/ink`](https://silvery.dev/guide/silvery-vs-ink). See the [full feature comparison](https://silvery.dev/guide/silvery-vs-ink)
44
+ - **[Theme system](https://silvery.dev/guide/styling)** — 38 palettes, semantic design/color tokens (`$primary`, `$error`), auto-detects terminal colors
45
+ - **[45+ components](https://silvery.dev/guides/components)** — TextInput, TextArea, SelectList, ListView, Table, TreeView, Console, Tabs, CommandPalette, ModalDialog, Toast, and more
46
+ - **[Focus system](https://silvery.dev/guide/silvery-vs-ink#focus-system)** — scoped focus, arrow-key directional nav, click-to-focus
50
47
  - **Text selection** — mouse drag, word/line selection, `userSelect` boundaries, Alt+drag override. Works out of the box with `withDomEvents()`
51
48
  - **Find** — `Ctrl+F` buffer search with match highlighting and `n`/`N` navigation. Works out of the box with `withFocus()`
52
49
  - **Copy-mode** — `Esc, v` for vim-style keyboard-driven text selection and yanking
53
50
  - **Drag-and-drop** — mouse drag with hit testing, automatic via `withDomEvents()`
54
- - **Extremely composable** — use as just a renderer (`render`), add a runtime (`run`), or build full apps with any React state library (useState, Zustand, Jotai, Redux). Swap terminal backends (real TTY, headless, xterm.js emulator) for testing. Embed silvery components in existing CLIs. Use the layout engine standalone. Render to terminal, or (experimental) Canvas, or DOM
55
- - **Most complete terminal protocol support** — 100+ escape sequences, all auto-negotiated: 12 OSC (hyperlinks, clipboard, palette, text sizing, semantic prompts, notifications), 35+ CSI (cursor, mouse modes, paste, focus, sync output, device queries), 50+ SGR (6 underline styles, underline colors, truecolor, 256-color), full Kitty keyboard (5 flags), full SGR mouse (any-event, drag, wheel)
51
+ - **Extremely composable** — use as just a renderer (`render`), add a runtime (`run`), or build full apps with any React state library (useState, Zustand, Jotai, Redux). Swap terminal backends (real TTY, headless, xterm.js emulator) for [testing](https://silvery.dev/guide/testing). Embed silvery components in existing CLIs. Use the layout engine standalone. Render to terminal, or (experimental) Canvas, or DOM
52
+ - **[Terminal protocol support](https://silvery.dev/guide/silvery-vs-ink#terminal-protocol-coverage)** — 100+ escape sequences, all auto-negotiated: 12 OSC (hyperlinks, clipboard, palette, text sizing, semantic prompts, notifications), 35+ CSI (cursor, mouse modes, paste, focus, sync output, device queries), 50+ SGR (6 underline styles, underline colors, truecolor, 256-color), full Kitty keyboard (5 flags), full SGR mouse (any-event, drag, wheel)
53
+ - **[Incremental rendering](https://silvery.dev/guide/silvery-vs-ink#performance-size)** — cell-level dirty tracking, only changed cells emit to the terminal. Works in inline mode with native scrollback, not just fullscreen
54
+
55
+ ### Why Silvery?
56
+
57
+ Silvery grew out of building a complex terminal app — a multi-pane workspace with thousands of nodes. Components needed to know their size during render. Updates needed to be fast. Scroll containers, mouse events, focus scopes, and Playwright-style testing needed to just work. What started as a renderer grew into a layout engine, then 45+ components, theming, testing infrastructure, and eventually a framework.
58
+
59
+ Along the way, three principles emerged. Take the best from the web, stay true to the terminal, and raise the bar for developer ergonomics, architecture composability, and performance.
60
+
61
+ [The Silvery Way](https://silvery.dev/guide/the-silvery-way) · [Silvery vs Ink](https://silvery.dev/guide/silvery-vs-ink) · [About](https://silvery.dev/about)
56
62
 
57
63
  ## Packages
58
64
 
59
- | Package | Description |
60
- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
61
- | [`silvery`](https://github.com/beorn/silvery) | Components, hooks, renderer — the one package you need |
62
- | [`@silvery/test`](https://github.com/beorn/silvery/tree/main/packages/test) | Testing utilities and locators |
63
- | [`@silvery/ink`](https://github.com/beorn/silvery/tree/main/packages/ink) | Ink compatibility layer migrate existing Ink apps with minimal changes |
65
+ | Package | Description |
66
+ | --------------------------------- | ----------------------------------------------------------------- |
67
+ | `silvery` | Components, hooks, renderer — the one package you need |
68
+ | `@silvery/ink` / `@silvery/chalk` | Ink compatibility 918/931 Ink 7.0 tests, 32/32 Chalk tests |
69
+ | `@silvery/test` | Playwright-style testinglocators, `press()`, buffer assertions |
70
+ | `@silvery/create` | Composable app builder — `pipe()` providers |
71
+ | `@silvery/theme` | 38 palettes, semantic tokens, auto-detect |
72
+ | `@silvery/commander` | **Beautiful CLIs for free** — help renders through Silvery itself |
73
+ | `@silvery/headless` | Pure state machines — portable, no React |
74
+ | `@silvery/ansi` | Terminal primitives — styling, SGR, detection |
64
75
 
65
76
  ## Ecosystem
66
77
 
67
- | Project | What |
68
- | ------------------------------------------ | ------------------------------------------------------------- |
69
- | [Termless](https://termless.dev) | Headless terminal testing — like Playwright for terminal apps |
70
- | [Flexily](https://beorn.github.io/flexily) | Pure JS flexbox layout engine (Yoga-compatible, zero WASM) |
71
- | [Loggily](https://beorn.github.io/loggily) | Debug + structured logging + tracing |
72
- | [terminfo.dev](https://terminfo.dev) | Terminal feature support database, powered by Termless |
78
+ Standalone projects Silvery builds on — each stands on its own:
79
+
80
+ | Project | What |
81
+ | -------------------------------------- | ----------------------------------------------------------------------- |
82
+ | [Flexily](https://beorn.codes/flexily) | Pure JS flexbox layout engine (Yoga-compatible, 2.5× faster, zero WASM) |
83
+ | [Termless](https://termless.dev) | Headless terminal testing like Playwright for terminal apps |
84
+ | [terminfo.dev](https://terminfo.dev) | Terminal feature compatibility database (161 features, 19 terminals) |
85
+ | [Loggily](https://beorn.codes/loggily) | Structured logging + tracing + metrics |
73
86
 
74
87
  ## Coming
75
88
 
@@ -79,6 +92,10 @@ await render(<Counter />).run()
79
92
 
80
93
  **Runtimes:** Bun >= 1.0 and Node.js >= 18. CLI (`silvery` command) requires Bun.
81
94
 
95
+ ## Inspirations
96
+
97
+ Silvery builds on ideas from [Ink](https://github.com/vadimdemedes/ink) (React for terminals), [Ratatui](https://ratatui.rs/) (cell-level buffer model), [SlateJS](https://www.slatejs.org/) (plugin composition, operations-as-data), [The Elm Architecture](https://guide.elm-lang.org/architecture/) / [BubbleTea](https://github.com/charmbracelet/bubbletea) (TEA state machines), the CSS/Web platform (flexbox, container queries, DOM events, focus scopes), [VS Code](https://code.visualstudio.com/) (command palette, keybindings), [Playwright](https://playwright.dev/) (locator-based testing), [ProseMirror](https://prosemirror.net/) (selection model), [Blessed](https://github.com/chjj/blessed) (rich terminal UIs in JS), and [Textual](https://textual.textualize.io/) (CSS-like terminal theming).
98
+
82
99
  ## License
83
100
 
84
101
  MIT