silvery 0.4.3 → 0.6.0
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 +11 -11
- package/package.json +4 -8
- package/src/index.ts +2 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Ink-compatible React renderer for terminals — same `Box`, `Text`, `useInput` API you know. Plus everything you wish Ink had.
|
|
6
6
|
|
|
7
|
-
> **
|
|
7
|
+
> **Work in progress.** APIs may change. Feedback welcome.
|
|
8
8
|
|
|
9
9
|
```console
|
|
10
10
|
$ npm install silvery react
|
|
@@ -33,11 +33,11 @@ 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` compatibility layer for
|
|
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
37
|
|
|
38
38
|
### Better
|
|
39
39
|
|
|
40
|
-
- **Smaller install** —
|
|
40
|
+
- **Smaller install** — <500 KB gzipped (Ink 6 pulls 16MB into node_modules)
|
|
41
41
|
- **Pure TypeScript, zero native deps** — no WASM, no build steps — works on Alpine, CI, Docker, everywhere
|
|
42
42
|
- **Incremental rendering** — per-node dirty tracking, [~100x faster interactive updates](tests/perf/render.bench.ts)
|
|
43
43
|
- **Responsive layout** — `useContentRect()` returns actual dimensions synchronously during render
|
|
@@ -46,17 +46,16 @@ await render(<Counter />).run()
|
|
|
46
46
|
- **Theme system** — 38 palettes, semantic design/color tokens (`$primary`, `$error`), auto-detects terminal colors
|
|
47
47
|
- **30+ components** — TextInput, TextArea, SelectList, VirtualList, Table, Tabs, CommandPalette, ModalDialog, Toast, and more
|
|
48
48
|
- **Focus system** — scoped focus, arrow-key directional nav, click-to-focus
|
|
49
|
-
- **Extremely composable** — use as just a renderer (`render`), add a runtime (`run`), or build full apps
|
|
49
|
+
- **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
|
|
50
50
|
- **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
51
|
|
|
52
52
|
## Packages
|
|
53
53
|
|
|
54
|
-
| Package
|
|
55
|
-
|
|
|
56
|
-
| `silvery`
|
|
57
|
-
| `@silvery/test` | Testing utilities and locators
|
|
58
|
-
| `@silvery/ink`
|
|
59
|
-
| `@silvery/tea` | Optional [TEA](https://guide.elm-lang.org/architecture/) state management for complex apps |
|
|
54
|
+
| Package | Description |
|
|
55
|
+
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
56
|
+
| [`silvery`](https://github.com/beorn/silvery) | Components, hooks, renderer — the one package you need |
|
|
57
|
+
| [`@silvery/test`](https://github.com/beorn/silvery/tree/main/packages/test) | Testing utilities and locators |
|
|
58
|
+
| [`@silvery/ink`](https://github.com/beorn/silvery/tree/main/packages/ink) | Ink compatibility layer — migrate existing Ink apps with minimal changes |
|
|
60
59
|
|
|
61
60
|
## Ecosystem
|
|
62
61
|
|
|
@@ -65,12 +64,13 @@ await render(<Counter />).run()
|
|
|
65
64
|
| [Termless](https://termless.dev) | Headless terminal testing — like Playwright for terminal apps |
|
|
66
65
|
| [Flexily](https://beorn.github.io/flexily) | Pure JS flexbox layout engine (Yoga-compatible, zero WASM) |
|
|
67
66
|
| [Loggily](https://beorn.github.io/loggily) | Debug + structured logging + tracing |
|
|
67
|
+
| [terminfo.dev](https://terminfo.dev) | Terminal feature support database, powered by Termless |
|
|
68
68
|
|
|
69
69
|
## Coming
|
|
70
70
|
|
|
71
71
|
- **Renderers** — Canvas 2D, Web DOM (experimental today, production later)
|
|
72
72
|
- **Frameworks** — Svelte, Solid.js, Vue adapters
|
|
73
|
-
- **@silvery/
|
|
73
|
+
- **@silvery/create** — Structured state management with commands, keybindings, effects-as-data
|
|
74
74
|
|
|
75
75
|
**Runtimes:** Bun >= 1.0 and Node.js >= 18. CLI (`silvery` command) requires Bun.
|
|
76
76
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silvery",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React terminal UI renderer for complex interactive apps
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "React terminal UI renderer for complex interactive apps \u2014 layout-aware rendering, flexbox, scrolling, and incremental updates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ansi",
|
|
7
7
|
"chalk",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/beorn/silvery/issues"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
|
-
"author": "
|
|
28
|
+
"author": "Bj\u00f8rn Stabell <bjorn@stabell.org>",
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "https://github.com/beorn/silvery.git"
|
|
@@ -69,9 +69,6 @@
|
|
|
69
69
|
"docs:dev": "vitepress dev docs",
|
|
70
70
|
"docs:build": "vitepress build docs",
|
|
71
71
|
"docs:preview": "vitepress preview docs",
|
|
72
|
-
"changeset": "changeset",
|
|
73
|
-
"version": "changeset version",
|
|
74
|
-
"release": "changeset publish",
|
|
75
72
|
"theme": "bun packages/theme/src/cli.ts",
|
|
76
73
|
"demo": "bun examples/cli.ts",
|
|
77
74
|
"compat": "bun packages/ink/scripts/compat-check.ts",
|
|
@@ -87,7 +84,6 @@
|
|
|
87
84
|
"zustand": "^5.0.11"
|
|
88
85
|
},
|
|
89
86
|
"devDependencies": {
|
|
90
|
-
"@changesets/cli": "^2.27.0",
|
|
91
87
|
"@types/bun": "^1.1.0",
|
|
92
88
|
"@types/react": "^19.0.0",
|
|
93
89
|
"@xterm/addon-fit": "^0.11.0",
|
|
@@ -112,4 +108,4 @@
|
|
|
112
108
|
"bun": ">=1.0",
|
|
113
109
|
"node": ">=23.6.0"
|
|
114
110
|
}
|
|
115
|
-
}
|
|
111
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -7,8 +7,9 @@ export const VERSION = "0.0.1"
|
|
|
7
7
|
export * from "@silvery/ag-react"
|
|
8
8
|
|
|
9
9
|
import type { ReactElement } from "react"
|
|
10
|
-
import { render as reactRender, type RenderOptions
|
|
10
|
+
import { render as reactRender, type RenderOptions } from "@silvery/ag-react"
|
|
11
11
|
import type { Term } from "@silvery/ag-react"
|
|
12
|
+
import type { TermDef } from "@silvery/ag/types"
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Render a React element to the terminal.
|