Commit Graph

19 Commits

Author SHA1 Message Date
Yunfei He ca25ccd96e fix(paint): continuous backgroundColor across wrapped text lines
- Wrap each text line with applyChalk(bgProps) after wrapText so
  background color is reapplied on every wrapped line (wrap-ansi
  doesn't carry ANSI state across line breaks)
- Add wrapped-text backgroundColor regression test
- Fix typo: color=" cyan" → color="cyan" in example
- Add FORCE_COLOR=3 debugging tip to AGENTS.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:31:00 +08:00
Yunfei He e62c802829 fix(paint): continuous backgroundColor with borders
- Fill background inside border area only (not under border chars)
  so border placeLine doesn't overwrite background ANSI codes
- Pad text lines to full layout width when inheritedBg is set
  so background extends past text content to fill the row

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:24:36 +08:00
Yunfei He 8e6c4c5c2b fix(paint): backgroundColor now visible with borders and text
Root causes:
- drawBorder wrote plain characters, overwriting fillBackground's ANSI codes
- renderTextWithInlineStyles spread node.props over inherited bg, but
  undefined props from Vue clobbered the inherited backgroundColor
- Child text nodes did not inherit backgroundColor from parent Box

Fixes:
- drawBorder applies backgroundColor (and borderColor) to border chars
- Filter out undefined props before merging in renderTextWithInlineStyles
- Pass inheritedBg through the paint tree to text nodes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:11:54 +08:00
Yunfei He ddac248d26 fix(runtime): set Static yoga node to display:none in dynamic layout
Static content is rendered via paintIsolated (separate channel), but its
yoga node was still participating in the dynamic frame layout calculation,
adding blank lines equal to the Static content height between the last
Static item and the dynamic content below.

Setting display:none on the Static yoga node removes it from the dynamic
layout. paintIsolated is unaffected — it reparents children into a
temporary yoga tree.
2026-05-24 23:16:58 +08:00
Yunfei He 15cf216291 fix(cli): add prepublishOnly to ensure build before publish
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 23:04:56 +08:00
Yunfei He b834a87529 fix(runtime): clear dynamic frame before flushing static content
flushStatic() writes directly to stdout, but log-update tracks cursor
position for in-place re-rendering. Without clearing log-update first,
the static content gets overwritten when the dynamic frame re-renders.

Adds a regression test that verifies the clear sequence appears before
static content in non-debug mode.
2026-05-24 23:00:05 +08:00
Yunfei He ae33947c37 chore: prepare v0.0.1 release
- Bump all packages to 0.0.1
- Add publishConfig.access: public to @vue-tui/cli
- Disable tsgo for dts generation (missing native-preview dep)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 22:58:29 +08:00
Yunfei He d98bbb6369 chore: remove unused apps/website and packages/utils
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:41:13 +08:00
Yunfei He 625aa138f1 fix(cli): clean terminal output for TUI apps
- Silence Vite server logs (logLevel: 'silent')
- Intercept console.log/info/warn/error/debug in child process to
  suppress [vite] and [Vue warn] noise from HMR client
- Add 3s startup grace period to ignore initial reload requests
  (prevents double-spawn on first WS connection)
- Clear screen before spawning child process

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:39:28 +08:00
Yunfei He d31e8b7a65 fix(cli): clear screen before spawning child process
Prevents Vite startup logs and connection messages from mixing
with the TUI app's output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:23:26 +08:00
Yunfei He 020fd0d85a feat: add basic-jsx and basic-template examples
- basic-jsx: Counter + Clock with defineComponent() + JSX
- basic-template: Counter + Clock with .vue SFC + <template>
- Both demonstrate HMR via vue-tui dev
- Fix vite-plugin: strip build.lib and external config for bundledDev,
  add node builtins resolveId to prevent browser-external shimming
- Remove old hmr-demo example (superseded by basic-template)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 21:21:08 +08:00
Yunfei He e8ef31814a feat: add hmr-demo example with Vue SFC HMR
- Counter + Clock components demonstrating component-level HMR
- Fix hmr-loader: use project-root file:// URL prefix so Node's
  bare specifier resolution finds node_modules
- Fix hmr-loader: export hooks directly instead of inline data URL
- Fix process-manager: register loader via data URL + register()
  pointing to the file (matches spike pattern)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 20:48:52 +08:00
Yunfei He 81a640f3ba feat(runtime): add HMR event bridge, DevOverlay, and dev mode wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 20:01:07 +08:00
Yunfei He d319e77540 feat(cli): add orchestrator and CLI entry point
Create dev.ts orchestrator wiring Vite dev server, bundle extractor, and
process manager together with HMR reload and crash-recovery logic.
Replace index.ts placeholder with full CLI entry supporting `vue-tui dev [entry]`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 19:57:47 +08:00
Yunfei He 2b7d1250f4 feat(cli): scaffold @vue-tui/cli package with all modules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 19:55:46 +08:00
Yunfei He a7f7d9957d feat(runtime-tests): integration test suite
21 test files covering components, composables, focus, lifecycle,
and scheduler through the public render() API.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 18:13:53 +08:00
Yunfei He 71c517b79f feat(testing): test harness for @vue-tui/runtime
Provides render() for integration testing — async with auto-flush,
trimmed frames, fake terminal with resize(), stdin.write() with
auto-flush, and auto-cleanup via afterEach.

Exports: render, cleanup, RenderResult, RenderOptions, Terminal

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 18:13:47 +08:00
Yunfei He ff82f6e064 feat(runtime): Vue terminal renderer with Ink-aligned API
Custom Vue 3 renderer for terminal UIs, built on yoga-layout for
flexbox and chalk for styling.

Components: Box, Text, Newline, Spacer, Static, Transform
Composables: useExit, useInput, useFocus, useFocusManager,
  useStdin, useStdout, useStderr, useTerminalSize
Entry: createApp(root) → app.mount(options) → app.waitUntilExit()
Focus: Ink-aligned Tab/Shift+Tab/Escape with Focusable[] ring
Internal subpath: @vue-tui/runtime/internal (yogaNodeTracker)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 18:13:33 +08:00
Yunfei He def33588e3 chore: monorepo scaffold and shared config
Workspace setup with pnpm, Vite+, and shared TypeScript config.
Includes @vue-tui/utils and AGENTS.md project conventions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 18:13:22 +08:00