You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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.
└── crates/vite_trampoline/ # Windows shim trampoline
42
48
```
43
49
50
+
`packages/test` is no longer tracked. The public test API is `vite-plus/test*`, generated by `packages/cli/build.ts` as shims over upstream `vitest` and `@vitest/browser*` exports.
51
+
44
52
## Where to Start
45
53
46
54
-**JS-backed CLI behavior**: start at `packages/cli/src/bin.ts` and nearby `packages/cli/src/**` files.
@@ -51,10 +59,10 @@ vite-plus/
51
59
-**Static `vite.config.ts` extraction**: start at `crates/vite_static_config/README.md` and `packages/cli/src/resolve-vite-config.ts`.
-**Migrator code (`vp migrate`)**: category modules under `packages/cli/src/migration/migrator/` behind the `migrator.ts` barrel; follow `migrator/README.md` when changing migrator code.
54
-
-**Bundled toolchain surfaces**: start with `packages/core/BUNDLING.md`, `packages/cli/BUNDLING.md`, and `packages/test/BUNDLING.md`.
62
+
-**Bundled toolchain surfaces**: start with `packages/core/BUNDLING.md`and `packages/cli/BUNDLING.md`.
55
63
-**Generated project agent guidance**: `packages/cli/AGENTS.md` and `packages/cli/src/utils/agent.ts`; do not edit these when the task is only to improve root repo guidance.
56
64
-**Product/repo docs**: root contributor docs live at the repo root and the VitePress site under `docs/` (`docs/guide/`, `docs/config/`); generated agent guidance is separate.
57
-
-**CLI output behavior**: inspect the relevant code plus `crates/vite_cli_snapshots/tests/cli_snapshots/` (new PTY snapshot suite; write new cases here) or the legacy `packages/cli/snap-tests/`/`packages/cli/snap-tests-global/`trees.
65
+
-**CLI output behavior**: inspect the relevant code plus `crates/vite_cli_snapshots/tests/cli_snapshots/` (PTY snapshot suite; write new cases here). Legacy `packages/cli/snap-tests/`and`packages/cli/snap-tests-global/`are migration-only.
58
66
-**Interactive CLI testing (prompts, pickers, keystrokes)**: `crates/vite_cli_snapshots/tests/cli_snapshots/README.md` and `rfcs/interactive-snapshot-tests.md`.
59
67
-**Install-testing against the local build**: `packages/tools/src/local-npm-registry.ts` serves the packed checkout behind a real registry interface; used by install snap fixtures (`localVitePlusPackages`), ecosystem e2e (`ecosystem-ci/patch-project.ts`), and local `vp migrate`/`vp create` iteration (see `CONTRIBUTING.md`).
60
68
@@ -65,7 +73,7 @@ vite-plus/
65
73
```bash
66
74
vp dev # Vite dev server
67
75
vp build # Vite + Rolldown build
68
-
vp test# Bundled Vitest
76
+
vp test# Bundled upstream Vitest
69
77
vp lint # Oxlint
70
78
vp fmt # Oxfmt
71
79
vp check # Format/lint/type-check workflow
@@ -77,7 +85,8 @@ vpr build # Shorthand for vp run build
77
85
78
86
Important distinctions:
79
87
80
-
-`vp test` is a built-in command. `vp run test` runs a `package.json` script or `vite.config.ts` run task named `test`.
88
+
-`vp test` is a built-in command that executes upstream Vitest. `vp run test` runs a `package.json` script or `vite.config.ts` run task named `test`.
89
+
- User-facing test imports should stay on `vite-plus/test*`; do not recreate `@voidzero-dev/vite-plus-test`.
81
90
- Existing `package.json` scripts are first-class `vp run <script>` targets and are not cached by default.
82
91
- Define `run.tasks` in `vite.config.ts` when a task needs explicit command config, default caching, dependencies, input tracking, or environment tracking.
83
92
- A task name can come from `package.json` or `vite.config.ts`, but not both.
@@ -108,15 +117,15 @@ Use `pnpm bootstrap-cli` when you need to validate the installed global CLI at `
Use `vp check --fix` only when you intentionally want formatting or lint fixes applied.
122
131
@@ -127,14 +136,15 @@ Use `vp check --fix` only when you intentionally want formatting or lint fixes a
127
136
```bash
128
137
just snapshot-test # build vp, run everything
129
138
just snapshot-test <name-filter>
139
+
just snapshot-test-global <name-filter># skip local flavor when no JS build is available
130
140
UPDATE_SNAPSHOTS=1 just snapshot-test <name-filter># record/accept snapshots
131
141
```
132
142
133
-
Snapshot mismatches fail the run with a unified diff and write `<case>.md.new`; recorded `.md` snapshots are reviewed like code and committed with the fixture. Steps are argv arrays (no shell); use `vpt` subcommands instead of coreutils so cases stay platform-identical.
143
+
Snapshot mismatches fail the run with a unified diff and write `<case>.md.new`; recorded `.md` snapshots are reviewed like code and committed with the fixture. Steps are argv arrays (no shell); use `vpt` subcommands instead of coreutils so cases stay platform-identical. Cases declare `vp = "local" | "global" | ["local", "global"]`; local-flavor cases require a fresh `packages/cli/dist`.
134
144
135
145
### Snap tests (legacy, being migrated)
136
146
137
-
The old trees `packages/cli/snap-tests/` and `packages/cli/snap-tests-global/` still run in CI during the migration but must not receive new cases; convert them with `tool migrate-snap-tests` instead (see the runner README).
147
+
The old trees `packages/cli/snap-tests/` and `packages/cli/snap-tests-global/` still run in CI during the migration but must not receive new cases; convert them with `node packages/tools/src/bin.js migrate-snap-tests ...` instead (see the runner README).
138
148
139
149
```bash
140
150
pnpm -F vite-plus snap-test
@@ -173,7 +183,7 @@ Use the validation matrix above as the source of truth. For behavior-bearing cha
173
183
## Common Pitfalls
174
184
175
185
-**Treating Vite+ as only Vite Task**: Vite Task is integrated, but this repo spans CLI, runtime, package management, bundled packages, create/migrate, docs, and upstream integration.
176
-
-**Looking for local `crates/vite_task`**: it does not exist here. Check `Cargo.toml` for git dependency wiring.
186
+
-**Looking for local `packages/test` or `crates/vite_task`**: neither is tracked here. Check `packages/cli/BUNDLING.md` for test shims and `Cargo.toml` for Vite Task git dependency wiring.
177
187
-**Confusing built-ins with scripts**: `vp test` and `vp run test` can do different things.
178
188
-**Trusting snap-test exit status alone**: always inspect snapshot diffs.
179
189
@@ -203,5 +213,5 @@ Use the validation matrix above as the source of truth. For behavior-bearing cha
0 commit comments