@vitest-agent/ui 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dispatcher/helpers.js +2 -2
- package/dispatcher/ink-helpers.js +2 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/render-ink/StreamApp.js +5 -3
package/dispatcher/helpers.js
CHANGED
|
@@ -169,10 +169,10 @@ const buildTableSeparator = () => {
|
|
|
169
169
|
return `${"-".repeat(TABLE_COL_FILE)}|---------|---------|---------|---------|-------------------`;
|
|
170
170
|
};
|
|
171
171
|
const buildTableHeader = () => {
|
|
172
|
-
return ` ${"File".padEnd(
|
|
172
|
+
return ` ${"File".padEnd(59)}| % Stmts | % Branch| % Funcs | % Lines | Uncovered Line #s`;
|
|
173
173
|
};
|
|
174
174
|
const buildTableRow = (file) => {
|
|
175
|
-
return `${` ${truncate(file.file,
|
|
175
|
+
return `${` ${truncate(file.file, 58).padEnd(59)}`}|${pctCell(file.summary.statements)}|${pctCell(file.summary.branches)}|${pctCell(file.summary.functions)}|${pctCell(file.summary.lines)}|${` ${file.uncoveredLines}`}`;
|
|
176
176
|
};
|
|
177
177
|
const pctCell = (n) => {
|
|
178
178
|
const text = `${Math.round(n)}`;
|
|
@@ -17,9 +17,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
* color to the leading status glyph on each line.
|
|
18
18
|
*/
|
|
19
19
|
const renderAgentStringAsInk = (agentString) => {
|
|
20
|
+
const lines = agentString.split("\n");
|
|
20
21
|
return /* @__PURE__ */ jsx(Box, {
|
|
21
22
|
flexDirection: "column",
|
|
22
|
-
children:
|
|
23
|
+
children: lines.map((line, idx) => /* @__PURE__ */ jsx(Text, { children: colorize(line) }, `${idx}-${line}`))
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
26
|
const PASS_GLYPH = "✓";
|
package/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import { ActionSeverity, CoverageFile, CoverageGap, CoverageMetric, CoverageRend
|
|
|
33
33
|
*
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
const CURRENT_UI_VERSION = "2.0.
|
|
36
|
+
const CURRENT_UI_VERSION = "2.0.11";
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
39
|
export { ActionSeverity, CURRENT_UI_VERSION, CountColumns, CoverageBlock, CoverageFile, CoverageGap, CoverageMetric, CoverageRenderState, DURATION_CELL_WIDTH, FailureRecord, FailureSection, FailuresSection, ModuleHeader, ModuleRecord, ProjectRow, RenderState, RenderTotals, RunEvent, RunEventChannel, RunEventChannelLive, SPINNER_FRAMES, SPINNER_FRAME_MS, SUITE_LOAD_FAILURE_LABEL, StatusIcon, StreamApp, SuggestedActionRecord, SuggestedActions, TagColumns, TestRecord, TestRow, TrendLine, accumulateUntilFinished, buildFooter, classifyOutcome, classifyRunShape, dispatch, dispatchInk, dispatcherTable, dominantClassification, forEachRenderState, formatDisplayDuration, initialRenderState, publish, publishAll, reduceRenderState, reduceRenderStateAll, renderAgent, renderStateStream, spinnerFrame, spinnerFrameForTime, subscribeRaw, synthesizeFromAgentReport, synthesizeRunEvents, tagUnion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared event-sourced renderer for vitest-agent. React Ink view for humans, plain-string view for agents, both fed by the same reducer over a RunEvent stream.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"./package.json": "./package.json"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@vitest-agent/sdk": "2.0.
|
|
42
|
+
"@vitest-agent/sdk": "2.0.11",
|
|
43
43
|
"effect": "4.0.0-beta.101"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
package/render-ink/StreamApp.js
CHANGED
|
@@ -449,7 +449,7 @@ const liveRegion = (state, shape, nowMs, frame) => {
|
|
|
449
449
|
const StreamApp = ({ state, frameIndex, nowMs }) => {
|
|
450
450
|
const now = nowMs ?? Date.now();
|
|
451
451
|
const frame = spinnerFrame(frameIndex);
|
|
452
|
-
const
|
|
452
|
+
const projects = groupByProject(state).map((g) => {
|
|
453
453
|
const c = sumCounts(g.modules);
|
|
454
454
|
return {
|
|
455
455
|
name: g.name,
|
|
@@ -458,10 +458,12 @@ const StreamApp = ({ state, frameIndex, nowMs }) => {
|
|
|
458
458
|
skipCount: c.skipCount,
|
|
459
459
|
durationMs: 0
|
|
460
460
|
};
|
|
461
|
-
})
|
|
461
|
+
});
|
|
462
|
+
const shape = classifyRunShape(state, projects);
|
|
463
|
+
const liveContent = liveRegion(state, shape, now, frame);
|
|
462
464
|
return /* @__PURE__ */ jsx(Box, {
|
|
463
465
|
flexDirection: "column",
|
|
464
|
-
children:
|
|
466
|
+
children: liveContent
|
|
465
467
|
});
|
|
466
468
|
};
|
|
467
469
|
|