Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ae75320
refactor: rename fspy_test_utils to subprocess_test and command_execu…
branchseer Jan 31, 2026
2dae705
feat: add Command struct to subprocess_test with explicit fields
branchseer Jan 31, 2026
67bb2a3
feat: add portable-pty support to subprocess_test
branchseer Jan 31, 2026
8424231
add new crate vite_pty
branchseer Jan 31, 2026
d9af9c4
init test
branchseer Jan 31, 2026
bd7e82d
fix: add ctor as dev-dependency for command_for_fn macro users
branchseer Jan 31, 2026
98df43d
add is_terminal test
branchseer Jan 31, 2026
0119142
feat: improve read_until with buffer management
branchseer Jan 31, 2026
aff750f
fix: process data immediately through parser in read_until
branchseer Jan 31, 2026
16f8562
fix: handle expected string spanning read boundaries
branchseer Jan 31, 2026
a7a383d
fix: preserve buffer after read_to_end for subsequent searches
branchseer Jan 31, 2026
639cb56
wip
branchseer Jan 31, 2026
66627c2
refactor: separate read and consume responsibilities
branchseer Jan 31, 2026
619e30c
feat(vite_pty): improve read_until with buffer management
branchseer Jan 31, 2026
99845d1
update
branchseer Jan 31, 2026
64538a0
a
branchseer Jan 31, 2026
fe05060
fix(vite_pty): add EOF handling to read_until
branchseer Jan 31, 2026
5d3e50f
refactor(vite_pty): separate read_to_end and screen_contents
branchseer Jan 31, 2026
a65974f
feat(vite_pty): add resize and write methods to Terminal
branchseer Jan 31, 2026
36dd95d
docs: add cross-platform testing requirements to CLAUDE.md
branchseer Jan 31, 2026
ac72110
feat(vite_pty): add send_ctrl_c method to Terminal
branchseer Feb 1, 2026
7af3c68
feat(vite_pty): return ExitStatus from read_to_end
branchseer Feb 1, 2026
b01f8a4
fix lint issues
branchseer Feb 10, 2026
a9b91ed
feat(vite_task_bin): use vite_pty for e2e snapshot tests
branchseer Feb 10, 2026
24fc9c2
fix(ci): exclude vite_pty from zigbuild tests
branchseer Feb 10, 2026
a9b2257
Revert "fix(ci): exclude vite_pty from zigbuild tests"
branchseer Feb 10, 2026
c585eb6
fix(e2e): remove stdin passthrough test, use channel for timeout
branchseer Feb 10, 2026
6af87ab
fix(vite_pty): drop slave after spawn to signal EOF on child exit
branchseer Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,38 @@ Test fixtures and snapshots:
- resolved program paths, cwd, and env vars
- **E2E**: `crates/vite_task_bin/tests/e2e_snapshots/fixtures/` - needed for testing execution and beyond: caching, output styling

### Cross-Platform Testing

**CRITICAL**: This project must work on both Unix (macOS/Linux) and Windows. For any cross-platform features:

1. **No Platform Skipping**: Skipping tests on either platform is **UNACCEPTABLE**
- Use `#[cfg(unix)]` and `#[cfg(windows)]` for platform-specific code within tests
- Both platforms must execute the test and verify the feature works correctly
- If a feature can't work on a platform, it shouldn't be added

2. **Windows Cross-Testing from macOS**:
```bash
# Test on Windows (aarch64) from macOS via cross-compilation
cargo xtest --builder cargo-xwin --target aarch64-pc-windows-msvc -p <package> --test <test>

# Examples:
cargo xtest --builder cargo-xwin --target aarch64-pc-windows-msvc -p vite_pty --test terminal
cargo xtest --builder cargo-xwin --target aarch64-pc-windows-msvc -p vite_pty --test terminal -- resize_terminal
```

3. **Cross-Platform Test Design Patterns**:
- Use conditional compilation for platform-specific setup/assertions
- Use cross-platform libraries for common operations (e.g., `terminal_size` for terminal dimensions)
- Verify platform-specific behavior works as expected:
- **Unix**: SIGWINCH signals, ioctl, /dev/null, etc.
- **Windows**: ConPTY, GetConsoleScreenBufferInfo, NUL, etc.

4. **Example**: The `vite_pty::resize_terminal` test demonstrates proper cross-platform testing:
- Unix: Installs SIGWINCH handler to verify signal delivery
- Windows: Acknowledges synchronous ConPTY resize behavior
- Both: Query terminal size using cross-platform `terminal_size` crate
- Both: Verify resize actually works and returns correct dimensions

## CLI Usage

```bash
Expand Down Expand Up @@ -102,6 +134,8 @@ just lint-windows # Windows via cargo-xwin

## Code Constraints

### Required Patterns

These patterns are enforced by `.clippy.toml`:

| Instead of | Use |
Expand All @@ -113,6 +147,15 @@ These patterns are enforced by `.clippy.toml`:
| `std::env::current_dir` | `vite_path::current_dir` |
| `.to_lowercase()`/`.to_uppercase()` | `cow_utils` methods |

### Cross-Platform Requirements

**All code must work on both Unix and Windows without platform skipping:**

- Use `#[cfg(unix)]` / `#[cfg(windows)]` for platform-specific implementations
- Always test on both platforms (use `cargo xtest` for Windows cross-compilation)
- Platform differences should be handled gracefully, not skipped
- Document platform-specific behavior in code comments

## Path Type System

- **Type Safety**: All paths use typed `vite_path` instead of `std::path`
Expand Down
Loading