Replace textual-serve with direct xterm.js 6.0 bundle
- Add package.json with @xterm/xterm 6.0 and all addons - Create terminal.ts client with WebSocket protocol support - Bundle with Bun (bun run build -> terminal.js) - Remove textual-serve dependency from pyproject.toml - Remove canvas monkey-patch workaround (no longer needed) - Add scrollback support (configurable via data-scrollback) - Update static file routing to serve from /static/ - Add Makefile targets: bundle, bundle-watch, bundle-clean - Update tests for new static path structure Benefits: - Full control over xterm.js configuration - Scrollback history now works (default 1000 lines) - Custom font family without workarounds - Smaller footprint (no unused Roboto Mono fonts) - Latest xterm.js 6.0 features available
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
.PHONY: help install install-dev lint format test coverage check clean
|
||||
.PHONY: help install install-dev lint format test coverage check clean bundle bundle-watch bundle-clean
|
||||
|
||||
PYTHON ?= python3
|
||||
PIP ?= $(PYTHON) -m pip
|
||||
|
||||
help:
|
||||
@echo "Targets: install install-dev lint format test coverage check clean"
|
||||
@echo "Frontend: bundle bundle-watch bundle-clean"
|
||||
|
||||
install:
|
||||
$(PIP) install -e .
|
||||
@@ -29,3 +30,16 @@ check: lint coverage
|
||||
|
||||
clean:
|
||||
rm -rf .pytest_cache .coverage htmlcov .ruff_cache
|
||||
|
||||
# Frontend build targets (requires Bun: https://bun.sh)
|
||||
node_modules: package.json
|
||||
bun install
|
||||
|
||||
bundle: node_modules
|
||||
bun run build
|
||||
|
||||
bundle-watch: node_modules
|
||||
bun run watch
|
||||
|
||||
bundle-clean:
|
||||
rm -rf node_modules bun.lockb src/textual_webterm/static/js/terminal.js
|
||||
|
||||
Reference in New Issue
Block a user