Skip to content

Comments

Generic bin stubs, vitest watch mode, streaming API, and platform shim fixes#6

Merged
petrbrzek merged 4 commits intomainfrom
feature/vitest-xterm-watch-mode
Feb 12, 2026
Merged

Generic bin stubs, vitest watch mode, streaming API, and platform shim fixes#6
petrbrzek merged 4 commits intomainfrom
feature/vitest-xterm-watch-mode

Conversation

@petrbrzek
Copy link
Contributor

@petrbrzek petrbrzek commented Feb 11, 2026

Summary

  • Generic bin stubs: npm install reads each package's bin field and creates executable scripts in /node_modules/.bin/. CLI tools like vitest, eslint, tsc, etc. work automatically — no custom commands needed.
  • Streaming container.run() API with onStdout/onStderr callbacks and AbortController signal for long-running commands
  • container.sendInput() sends stdin data to running processes (emits both data and keypress events for readline compatibility)
  • Watch mode restart pattern: vitest caches modules internally (Vite's ModuleRunner), so file changes trigger a full abort + re-launch for fresh module evaluation
  • Removed custom vitest command (vitest-command.ts deleted) — vitest now runs through the generic bin stub + node command like any other CLI tool
  • Platform shim fixes: Object.defineProperty globalThis patch, Runtime.clearCache() in-place fix, VFS adapter executable mode for .bin/ files
  • New shims: rollup, fs.realpathSync.native, fs.createReadStream/createWriteStream, path.delimiter, path.win32, process.getuid()/getgid()/umask(), util.deprecate()
  • xterm.js terminal in vitest demo with native ANSI color rendering
  • README updated with CLI tools, streaming output, and API reference docs
  • CHANGELOG + version bump to 0.2.12

Test plan

  • All 2164 unit tests pass (npm run test:run)
  • All 5 vitest demo E2E tests pass including watch mode restart test
  • Manual: npm install vitest creates /node_modules/.bin/vitest
  • Manual: vitest run executes through bin stub → node command → real vitest
  • Manual: watch mode checkbox starts watching, editing + saving restarts vitest with fresh results
  • Manual: failing test edits show failure output, reverting shows pass

🤖 Generated with Claude Code

petrbrzek and others added 2 commits February 11, 2026 22:06
- container.run() API for executing shell commands (npm run, npm test, etc.)
- Real vitest test execution using @vitest/expect assertions
- Vitest watch mode with VFS file watchers and auto-rerun
- Streaming container.run() with onStdout/onStderr/signal options
- xterm.js terminal with ANSI color rendering in vitest demo
- Save button and Cmd+S/Ctrl+S support in editor
- npm scripts demo and vitest testing demo pages
- Docs updates for streaming API and watch mode
- E2E tests for npm scripts and vitest demos
- Unit tests for npm run, vitest run, and vitest command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…im fixes

- Generic bin stubs: npm install creates /node_modules/.bin/ scripts from package bin fields
- Streaming container.run() with onStdout/onStderr/signal (AbortController) support
- container.sendInput() for stdin to running processes (data + keypress events)
- Watch mode restart pattern: abort + re-launch vitest on file save (Vite caches modules)
- Object.defineProperty patch forces configurable: true on globalThis properties
- VFS adapter returns 0o755 mode for .bin/ files (just-bash executability check)
- Runtime.clearCache() now clears in-place instead of replacing the object
- New shims: rollup, fs.realpathSync.native, fs.createReadStream/WriteStream
- New process methods: getuid(), getgid(), umask()
- path.delimiter, path.win32, util.deprecate()
- Removed custom vitest command — vitest runs through generic bin stub + node
- Updated README with CLI tools, streaming, and API reference docs
- Updated CHANGELOG and bumped version to 0.2.12

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@petrbrzek petrbrzek changed the title Add vitest testing, xterm.js terminal, and watch mode Generic bin stubs, vitest watch mode, streaming API, and platform shim fixes Feb 12, 2026
petrbrzek and others added 2 commits February 12, 2026 13:05
- Object.defineProperty override: use `object` return type with cast
- _activeProcessStdin.emit: accept variadic args for keypress events
- Process interface: add optional `send` and `connected` for IPC support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

🟢 Node.js Compatibility: 98%

Status Count
✅ Passed 1232
❌ Failed
⏭️ Skipped 25
Modules tested
  • path - Path manipulation
  • buffer - Binary data handling
  • stream - Readable/Writable streams
  • url - URL parsing
  • events - EventEmitter
  • fs - File system operations
  • util - Utility functions

@petrbrzek petrbrzek merged commit 91aaea8 into main Feb 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant