feat(test): PTY-based interactive CLI snapshot tests#2052
Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
fefbe9d to
e6ed290
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9b7db0e78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d9bd36a53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b1294289f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ce35c142f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23a5d0b7f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f046797698
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfad895b80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7660d0533f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df5abf79ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df5abf79ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b750991666
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab99aad510
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 222abdcc73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c060a5d7e1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
3780383 to
4f8f1d5
Compare
94a3433 to
b62a903
Compare
Merge activity
|
Implements the RFC included in this PR as `rfcs/interactive-snapshot-tests.md`. - `crates/vite_cli_snapshots`: PTY-based CLI snapshot suite (libtest-mimic). Every step runs in a real pseudo-terminal with vt100 grid capture; interactive steps script keystrokes synchronized on OSC 8 milestones; snapshots are Markdown with real pass/fail semantics (`UPDATE_SNAPSHOTS=1` to accept, `.md.new` plus unified diff on mismatch). Built on the pty_terminal/snapshot_test crates from vite-task at the already-pinned rev. - One fixture tree replaces the local/global split: each case declares `vp = "local" | "global" | ["local", "global"]`; the parity matrix already caught real drift between the two help outputs. Per-case `VP_HOME`/`HOME`/npm-prefix isolation removes `serial` and the bootstrap byte-match requirement; `seed-runtime` symlinks a provisioned managed runtime; failure flow is shell-like with line boundaries (`continue-on-failure`). - `vpt` test multitool (vtt-aligned subcommands plus `json-edit`, `chmod`, `probe`) so fixtures run without a shell and behave identically on every platform. - `tool migrate-snap-tests <dir> --vp <flavor> [filter]`: one-click migration of old `steps.json` cases with a report; TODO-free conversions auto-remove the legacy dir. Migrated so far: the four `check-pass*` cases, `cli-helper-message` (local + global merged into one fixture), and `build-vite-env`. - `packages/prompts`: milestone emission for `select`/`confirm`/`text`, gated on `VP_EMIT_MILESTONES=1`, byte-identical to the vite-task protocol; render output unchanged when disabled. - CI: dedicated `CLI snapshot test` jobs for Linux, macOS, and Windows (Windows runs a cross-compiled nextest archive, no Rust toolchain on the runner); snapshot-baseline-only changes still trigger CI despite the markdown filters. - Entry points: `just snapshot-test [filter]`, `just snapshot-test-global` (no JS build needed), `pnpm snapshot-test`. Contributor docs: `crates/vite_cli_snapshots/tests/cli_snapshots/README.md`. Validation: 14 snapshot trials plus redaction/migrator/prompt unit suites pass in compare mode on all three CI platforms. Follow-ups per the RFC phasing: `local-registry` case support, remaining prompt components (multiselect, password, spinner), migration batches, legacy runner removal.
b62a903 to
603140d
Compare
## Summary Refresh the root `AGENTS.md` guidance to match the current repository structure and test workflow. - Remove stale references to the deleted `packages/test` package and document that `vite-plus/test*` is now generated from upstream Vitest shims in `packages/cli`. - Update the repository map with current crates and package ownership. - Clarify that new CLI snapshot coverage should use the PTY-based runner introduced in #2052, while legacy snap-test trees are migration-only. - Update validation guidance and references for the current snapshot test commands.
…xes (#2081) Release vite-plus v0.2.3: config extraction, create, and `vp run` reliability fixes. A patch release that restores static config extraction for projects importing `defineConfig` from `vite`, fixes `vp create` for org templates on registries that strip custom package fields, cleans up terminal output after Ctrl-C during `vp run`, and updates bundled Vite to 8.1.3. ### Highlights - **Custom `VP_HOME` is honored on every run**: the global `vp` now respects a user-set `VP_HOME` for its home directory instead of falling back to `~/.vite-plus`, and persists it in the generated env files, so a custom install location no longer produces multiple instances or unusable packages ([#2029](#2029)), by @liangmiQwQ ### Features - Upgrade bundled Vite from `8.1.2` to `8.1.3` (inlined CSS after the shebang line, CSS preload for nested dynamic imports, SSR stacktrace column fix) ([#2042](#2042)), by @voidzero-guard[bot] ### Fixes & Enhancements - `vp run` no longer misreads a `vite.config.ts` when its `defineConfig` comes from a preset or a custom wrapper instead of `vite-plus` or `vite`. Such configs are now evaluated at runtime rather than assumed to be Vite+'s own, so projects that use them no longer wrongly report `Task "build" not found` ([#2060](#2060), [#2075](#2075)), by @liangmiQwQ and @fengmk2 - Killing a `vp run` task with Ctrl-C no longer leaves odd OSC escape sequences in the terminal; `vp` defers its own Ctrl-C handling until the child process exits ([#2079](#2079)), by @forehalo - `vp migrate`: rewriting a `package.json` prettier script now emits a single `--check`, so scripts that combined `--check` with `--list-different` / `-l` / `-c` no longer produce a duplicated `vp fmt --check --check` ([#2044](#2044)), by @shulaoda - `vp create @org:name`: read the org template catalog (`createConfig`) from the published tarball when the registry (e.g. GitHub Packages) strips custom fields from packument metadata ([#2063](#2063)), by @hiro-daikin - `vp run`: missing env vars requested through `@voidzero-dev/vite-task-client` now return `undefined` instead of `null`, preserving Vite production `NODE_ENV` semantics when builds run through `vp run` ([vite-task#508](voidzero-dev/vite-task#508), via [#2076](#2076)), by @wan9chi ### Refactor - `static_config`: drop the unreachable `vite.config.json` branch ([#2045](#2045)), and remove unused exported CLI helpers ([#2046](#2046)), by @shulaoda ### Docs - Update the announcement links and callout for the beta release ([#2027](#2027)), remove the stale `Dockerfile.alpine` comment ([#2068](#2068)), by @fengmk2 - Add the missing `pnpm-workspace.yaml` to the docs Dockerfile ([#2059](#2059)), by @wan-kong - Refresh the root agent guide ([#2072](#2072)), by @jong-kyung ### Chore - Cross-compile Windows tests and CLI binaries on Linux with cargo-xwin ([#1824](#1824)), install local vite-plus builds through a local npm registry ([#2021](#2021)), fast docs format check for docs-only PRs ([#2028](#2028)), pack local dirs for the registry bridge instead of pkg.pr.new ([#2038](#2038)), remove the stale create workflow updater ([#2061](#2061)), and add PTY-based interactive CLI snapshot tests ([#2052](#2052)), by @fengmk2 - Cache `vp run` output for docs builds ([#2006](#2006)), by @wan9chi - Remove legacy completion cleanup ([#2050](#2050)), by @nekomoyi - Update the crate-ci/typos action ([#2039](#2039)) and GitHub Actions ([#2055](#2055), [#1905](#1905)), by @renovate[bot] - Refresh the Node.js release keyring ([#2058](#2058)) and the docs trusted-stack stats ([#2064](#2064)), by @voidzero-guard[bot] ### Bundled Versions | Tool | Version | Source | | --- | --- | --- | | vite | `8.1.3` | [`578ffb8`](vitejs/vite@578ffb8) | | rolldown | `1.1.4` | [`6cbd233`](rolldown/rolldown@6cbd233) | | tsdown | `0.22.3` | [npm](https://npmx.dev/package/tsdown/v/0.22.3) | | vitest | `4.1.9` | [npm](https://npmx.dev/package/vitest/v/4.1.9) | | oxlint | `1.72.0` | [npm](https://npmx.dev/package/oxlint/v/1.72.0) | | oxlint-tsgolint | `0.24.0` | [npm](https://npmx.dev/package/oxlint-tsgolint/v/0.24.0) | | oxfmt | `0.57.0` | [npm](https://npmx.dev/package/oxfmt/v/0.57.0) | ### Upgrade ```bash vp upgrade ``` ### New Contributors @wan-kong and @hiro-daikin made their first contributions. **Full Changelog**: v0.2.2...v0.2.3 --- Merging this PR will trigger the release workflow. --------- Co-authored-by: voidzero-guard[bot] <278573678+voidzero-guard[bot]@users.noreply.github.com> Co-authored-by: wan9chi <dk4rest@gmail.com>

Implements the RFC included in this PR as
rfcs/interactive-snapshot-tests.md.crates/vite_cli_snapshots: PTY-based CLI snapshot suite (libtest-mimic). Every step runs in a real pseudo-terminal with vt100 grid capture; interactive steps script keystrokes synchronized on OSC 8 milestones; snapshots are Markdown with real pass/fail semantics (UPDATE_SNAPSHOTS=1to accept,.md.newplus unified diff on mismatch). Built on the pty_terminal/snapshot_test crates from vite-task at the already-pinned rev.vp = "local" | "global" | ["local", "global"]; the parity matrix already caught real drift between the two help outputs. Per-caseVP_HOME/HOME/npm-prefix isolation removesserialand the bootstrap byte-match requirement;seed-runtimesymlinks a provisioned managed runtime; failure flow is shell-like with line boundaries (continue-on-failure).vpttest multitool (vtt-aligned subcommands plusjson-edit,chmod,probe) so fixtures run without a shell and behave identically on every platform.tool migrate-snap-tests <dir> --vp <flavor> [filter]: one-click migration of oldsteps.jsoncases with a report; TODO-free conversions auto-remove the legacy dir. Migrated so far: the fourcheck-pass*cases,cli-helper-message(local + global merged into one fixture), andbuild-vite-env.packages/prompts: milestone emission forselect/confirm/text, gated onVP_EMIT_MILESTONES=1, byte-identical to the vite-task protocol; render output unchanged when disabled.CLI snapshot testjobs for Linux, macOS, and Windows (Windows runs a cross-compiled nextest archive, no Rust toolchain on the runner); snapshot-baseline-only changes still trigger CI despite the markdown filters.just snapshot-test [filter],just snapshot-test-global(no JS build needed),pnpm snapshot-test. Contributor docs:crates/vite_cli_snapshots/tests/cli_snapshots/README.md.Validation: 14 snapshot trials plus redaction/migrator/prompt unit suites pass in compare mode on all three CI platforms.
Follow-ups per the RFC phasing:
local-registrycase support, remaining prompt components (multiselect, password, spinner), migration batches, legacy runner removal.