Commit 0e9d243
committed
refactor(config): auto-update agent instructions, never create new files (#1027)
## Summary
- `vp config` no longer creates new agent files or prompts for agent selection
- Silently updates existing files that contain Vite+ markers (`<!--VITE PLUS START-->`) when content is outdated
- Same behavior for `prepare` lifecycle, interactive, and non-interactive modes
- Skipped with `--hooks-only`
- Delete `config/agent.ts` and its tests (superseded by shared `utils/agent.ts`)
## Behavior
| Scenario | Action |
|----------|--------|
| No agent files | No writes |
| Agent files exist, no Vite+ markers | No writes |
| Vite+ markers, content up to date | No writes |
| Vite+ markers, content outdated | Update marked section silently |
| `--hooks-only` | Skip agent update |
## Test plan
- [x] `pnpm -F vite-plus snap-test-global command-config` — all 9 tests pass
- [x] `pnpm -F vite-plus snap-test` — all tests pass
- [x] New snap test: `command-config-update-agents` — verifies outdated markers are updated, user content preserved
- [x] New snap test: `command-config-no-agent-writes` — verifies no writes when no markers, no new files created1 parent fb7cc34 commit 0e9d243
14 files changed
Lines changed: 108 additions & 340 deletions
File tree
- packages/cli
- snap-tests-global
- command-config-no-agent-writes
- command-config-update-agents
- snap-tests/command-run-with-vp-config
- src
- config
- __tests__
- utils
- rfcs
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 0 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 5 | | |
21 | 6 | | |
22 | 7 | | |
| |||
This file was deleted.
0 commit comments