chore(runtime): prepare 0.1.0 public beta release (#205)

Re-applies the 0.1.0 release prep on top of current main. PR #167's branch
(release/runtime-0.1.0) was 35 commits behind main and predated the #173..#204
fix batch (incl. the severe renderer fixes #198/#199), so publishing from it
would have shipped a 0.1.0 missing those fixes.

- version 0.0.3 -> 0.1.0 (runtime only; testing/cli stay 0.0.x)
- add root LICENSE + packages/runtime/LICENSE (MIT)
- add packages/runtime/CHANGELOG.md (0.1.0 public API; ./internal is non-semver)
- npm metadata: author, repository(+directory), homepage, bugs, keywords
- engines.node >=22 -> >=22.18.0 (match the real toolchain floor)
- files: ship LICENSE explicitly alongside dist + CHANGELOG
- README: reframe to public-beta status; fix useCursor (position-based, not
  visibility); add useIsScreenReaderEnabled + renderToString to the API docs

Verified on this branch: build, type-check, lint (0 warnings), and the full test
suite (runtime 1289, cli 364, testing 12, PTY 129) all green. pnpm pack ships
LICENSE + CHANGELOG + dist with 0 literal `catalog:` deps; attw resolves types
green under node16(ESM) + bundler for `.` and `./internal`.

Note: `exports` is auto-generated by `vp pack` (pack.exports: true) as bare
strings; attw confirms types resolve via the sibling .d.mts, so no manual
types condition is added (it would be wiped by the next build anyway).

Supersedes #167.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yunfei He
2026-06-20 00:32:56 +08:00
committed by GitHub
parent c4b001c12f
commit e4f756def2
5 changed files with 147 additions and 19 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Yunfei He
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+51
View File
@@ -0,0 +1,51 @@
# Changelog
All notable changes to `@vue-tui/runtime` are documented here.
This project adheres to [Semantic Versioning](https://semver.org/). While on
`0.x`, minor versions may include breaking changes.
## 0.1.0 - 2026-06-19
First public release of `@vue-tui/runtime` — Vue 3 for the terminal. Build CLI
tools, dashboards, and AI-agent interfaces with `<script setup>` and reactivity,
laid out by real Yoga flexbox (`yoga-layout`, the engine behind Ink and React
Native).
This release covers `@vue-tui/runtime` only; the testing and CLI packages remain
experimental (`0.0.x`). Not recommended for production yet.
### Features
- **Rendering** — `createApp(component).mount(options?)` and a synchronous
`renderToString()`.
- **Components** — `Box`, `Text`, `Newline`, `Spacer`, `Static`, `Transform`.
- **Layout** — Yoga flexbox: direction, wrap, align, justify, gap, padding,
margin, and borders.
- **Input & focus** — `useInput`, `usePaste`, `useFocus`, `useFocusManager`,
`useStdin`.
- **App & environment** — `useApp`, `useStdout`, `useStderr`, `useWindowSize`,
`useIsScreenReaderEnabled`.
- **Layout & cursor** — `useBoxMetrics`, `measureElement`, `useCursor`.
- **Animation** — frame-based `useAnimation`.
- **Accessibility** — a screen-reader linearizer and ARIA roles (18-value
`AriaRole` union).
- **Kitty keyboard protocol** — all 5 progressive-enhancement flags, plus
bracketed paste; `kittyFlags`, `kittyModifiers`, and related types.
- **Authoring** — Vue SFC `<template>`, JSX/TSX, and render functions.
### Built on Ink, adapted to Vue
Modeled on React Ink (pinned to v7.0.4): every Ink component (6) and hook (13)
has a same-named equivalent, with `createApp().mount()` replacing Ink's
`render()`. Parity is verified against real Ink output captured as byte-exact
fixtures (Ink is not a runtime, test, or CI dependency). Where vue-tui differs —
`shallowRef` reactive state, declarative prop resets, `rawMode: 'always'`, and a
few fixes for verified Ink rendering bugs — it's deliberate and documented in the
divergence log. Parity never outranks correctness.
### Internal API (unstable)
The `@vue-tui/runtime/internal` entry point exposes lower-level host-node, Yoga,
and frame-sink internals for tooling (e.g. the test harness). It is **not covered
by semver** and may change in any release.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Yunfei He
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+14 -3
View File
@@ -1,6 +1,6 @@
# @vue-tui/runtime
> **Early stage** — under active development. Bug reports welcome, but not recommended for production use yet.
> **Public beta (0.1)** — the `@vue-tui/runtime` API is entering stabilization: usable and broadly stable, but may still change before 1.0. The CLI and dev tooling remain experimental and may change between releases. Feedback and bug reports are very welcome — they directly shape what we lock down next. Not yet recommended for production use.
Vue 3 terminal renderer with Yoga flexbox layout — build rich TUI apps with the same component model you use on the web.
@@ -69,7 +69,7 @@ useInput((input) => {
## Composables
| Composable | Description |
| -------------------------- | --------------------------------------------------------------------- |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
| `useInput(handler, opts?)` | Keyboard input — `(input, key)` with modifier and arrow key detection |
| `useFocus(opts?)` | Component-level focus — returns `{ isFocused, focus }` |
| `useFocusManager()` | App-level focus — `focusNext()`, `focusPrevious()`, `focus(id)` |
@@ -78,11 +78,12 @@ useInput((input) => {
| `useAnimation(opts?)` | Frame-based animation loop — returns `{ frame, time, delta, reset }` |
| `useBoxMetrics(ref)` | Reactive layout metrics — `{ width, height, left, top, hasMeasured }` |
| `measureElement(node)` | Imperative read of computed `{ width, height }` from a yoga node |
| `useCursor()` | Control terminal cursor visibility |
| `useCursor()` | Position the terminal cursor — returns `setCursorPosition(pos)`; pass `undefined` to hide it |
| `usePaste(handler, opts?)` | Handle clipboard paste events |
| `useStdin()` | Access stdin stream and raw mode control |
| `useStdout()` | Write directly to stdout |
| `useStderr()` | Write directly to stderr |
| `useIsScreenReaderEnabled()` | Reactive `boolean` — whether screen-reader / accessibility mode is active |
## App Lifecycle
@@ -101,6 +102,16 @@ await app.waitUntilExit();
createApp(App).mount({ stdout, stdin, stderr });
```
## Render to String
Render a component to a single output frame without driving a live terminal — useful for snapshots, logging, or non-interactive output:
```ts
import { renderToString } from "@vue-tui/runtime";
const frame = renderToString(App); // synchronous, returns a string
```
## Links
- [vue-tui](https://github.com/vuejs-ai/vue-tui) — monorepo root
+27 -3
View File
@@ -1,10 +1,34 @@
{
"name": "@vue-tui/runtime",
"version": "0.0.3",
"version": "0.1.0",
"description": "Vue 3 terminal renderer with Yoga flexbox layout, inspired by React Ink.",
"keywords": [
"ansi",
"cli",
"console",
"flexbox",
"ink",
"renderer",
"terminal",
"tui",
"vue",
"yoga"
],
"homepage": "https://github.com/vuejs-ai/vue-tui/tree/main/packages/runtime#readme",
"bugs": {
"url": "https://github.com/vuejs-ai/vue-tui/issues"
},
"license": "MIT",
"author": "Yunfei He <i.heyunfei@gmail.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs-ai/vue-tui.git",
"directory": "packages/runtime"
},
"files": [
"dist"
"dist",
"CHANGELOG.md",
"LICENSE"
],
"type": "module",
"exports": {
@@ -54,6 +78,6 @@
"vue": "^3.4.0"
},
"engines": {
"node": ">=22"
"node": ">=22.18.0"
}
}