Commit 261c567
feat: improve task runner summary with compact one-liners (#171)
## Summary
Replace the verbose full execution summary with compact one-liners for
normal runs, with `--verbose` flag for full summary and `--last-details`
to view the last run's saved summary from a JSON file.
### Behavior
| Command | Behavior |
|---|---|
| `vp run task` | Run task, **compact** summary |
| `vp run -v task` | Run task, **full** summary |
| `vp run --last-details` | Read saved JSON, display full summary |
### Compact summary rules
- Single task + not cache hit → no summary at all
- Single task + cache hit → `[vp run] cache hit, {duration} saved.`
- Multi-task → `[vp run] {hits}/{total} cache hit ({rate}%), {duration}
saved. (Run 'vp run --verbose' for full details)`
### Key design decisions
- **Structured data, not formatted strings**: all display formatting
happens at render time from `LastRunSummary`
- **Enums for invalid states**: `--last-details` is exclusive at the
type level via `Command::RunLastDetails` variant
- **Single rendering path**: always generate `LastRunSummary`, then
render compact or full from it
- **Atomic writes**: `last-summary.json` written to `.tmp` then
`fs::rename`
- **Write callback**: reporter decoupled from file paths via `Box<dyn
FnOnce(&LastRunSummary)>`
- **Direct TaskSummary construction**: leaf reporter builds
`TaskSummary` in `finish()` instead of collecting intermediate
`ExecutionInfo`
### Snapshot proof
Includes a commit adding `--verbose` to all e2e tests followed by its
revert, proving the full summary output is correct and unchanged. The
e2e tests exercise the compact summary path by default.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3d1554b commit 261c567
File tree
87 files changed
+1526
-1913
lines changed- crates
- vite_task_bin
- src
- tests/e2e_snapshots/fixtures
- associate-existing-cache/snapshots
- builtin-different-cwd
- snapshots
- builtin-non-zero-exit
- snapshots
- cache-disabled/snapshots
- cache-miss-command-change/snapshots
- cache-miss-reasons/snapshots
- cache-subcommand/snapshots
- colon-in-name/snapshots
- e2e-env-test/snapshots
- e2e-lint-cache
- snapshots
- exec-api/snapshots
- exit-codes/snapshots
- individual-cache-for-adt-args/snapshots
- individual-cache-for-envs/snapshots
- lint-dot-git
- snapshots
- replay-logs-chronological-order/snapshots
- signal-exit/snapshots
- stdin-inheritance/snapshots
- stdio-detection/snapshots
- stdio-graph-criteria/snapshots
- summary-output
- packages
- a
- b
- snapshots
- task-list/snapshots
- task-no-trailing-newline/snapshots
- task-select-truncate/snapshots
- task-select/snapshots
- topological-execution-order/snapshots
- vite-task-smoke/snapshots
- vite_task_plan/tests/plan_snapshots
- vite_task/src
- cli
- session
- cache
- reporter
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
87 files changed
+1526
-1913
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
35 | 47 | | |
36 | 48 | | |
37 | 49 | | |
38 | | - | |
| 50 | + | |
39 | 51 | | |
40 | 52 | | |
41 | | - | |
| 53 | + | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
45 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
46 | 62 | | |
47 | 63 | | |
48 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
49 | 70 | | |
50 | 71 | | |
51 | 72 | | |
| |||
57 | 78 | | |
58 | 79 | | |
59 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
60 | 143 | | |
61 | 144 | | |
62 | 145 | | |
| |||
69 | 152 | | |
70 | 153 | | |
71 | 154 | | |
72 | | - | |
| 155 | + | |
73 | 156 | | |
74 | 157 | | |
75 | 158 | | |
| |||
82 | 165 | | |
83 | 166 | | |
84 | 167 | | |
85 | | - | |
| 168 | + | |
86 | 169 | | |
87 | 170 | | |
88 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | | - | |
47 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
48 | 84 | | |
49 | 85 | | |
50 | 86 | | |
| |||
180 | 216 | | |
181 | 217 | | |
182 | 218 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 219 | + | |
283 | 220 | | |
284 | 221 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments