@vitest-agent/reporter 4.0.1 → 4.1.0

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/liveView.js +10 -7
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -8,7 +8,7 @@ import { DefaultVitestAgentReporter, buildDispatchInputs, renderAgentStringForRe
8
8
  *
9
9
  * @public
10
10
  */
11
- const CURRENT_REPORTER_VERSION = "4.0.1";
11
+ const CURRENT_REPORTER_VERSION = "4.1.0";
12
12
 
13
13
  //#endregion
14
14
  export { CURRENT_REPORTER_VERSION, DefaultVitestAgentReporter, buildDispatchInputs, renderAgentStringForReport, renderHumanStringForReport, resolveCellOptions };
package/liveView.js CHANGED
@@ -1,7 +1,7 @@
1
- import { CliEnv } from "@effected/cli";
1
+ import { CliEnv, Doc } from "@effected/cli";
2
2
  import { CliUi } from "@effected/cli/ui";
3
3
  import { initialRenderState } from "@vitest-agent/sdk";
4
- import { SPINNER_FRAME_MS, StreamApp, reduceRenderState } from "@vitest-agent/ui";
4
+ import { SPINNER_FRAME_MS, StreamApp, reduceRenderState, renderAgent } from "@vitest-agent/ui";
5
5
  import { Cause, Deferred, Effect, Exit, Layer, PubSub, Scope } from "effect";
6
6
  import { createElement } from "react";
7
7
  import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -16,10 +16,12 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
16
16
  * says), redraws on every event and on an 80 ms tick, and commits its final
17
17
  * frame to scrollback at the terminal event (`RunFinished` /
18
18
  * `RunTimedOut`), never clearing the screen. The next run in watch mode
19
- * mounts afresh below it. When the run is not interactive (piped, an agent
20
- * audience, CI) nothing is mounted and, in the `owned` mode, each run's final
21
- * frame is written once to stdout as a string, so a `vitest run | cat` still
22
- * receives the result.
19
+ * mounts afresh below it. When the run is not interactive (piped, CI) nothing
20
+ * is mounted: each run's `final` document is written once to stdout instead,
21
+ * so a `vitest run | cat` still receives the result. That document is the
22
+ * plain report `renderAgent` builds from the same state (header, failures,
23
+ * modules, coverage, suggested actions), each line kept whole; it does not
24
+ * try to reproduce the Ink frame, and drawing it never renders through Ink.
23
25
  *
24
26
  * Lifetime: one scope per live view, held for the reporter's whole life. The
25
27
  * subscription is made in it synchronously, before the factory returns, so
@@ -52,7 +54,8 @@ const liveViewOptions = {
52
54
  isTerminal: (event) => event._tag === "RunFinished" || event._tag === "RunTimedOut",
53
55
  begins: (event, before, after) => event._tag === "RunStarted" || before.phase === "idle" && after.phase !== "idle",
54
56
  mode: "owned",
55
- tickMillis: SPINNER_FRAME_MS
57
+ tickMillis: SPINNER_FRAME_MS,
58
+ final: (state) => renderAgent(state).trimEnd().split("\n").map((line) => Doc.line(line, { wrap: false }))
56
59
  };
57
60
  /**
58
61
  * The environment a Vitest-hosted live view reads: the kit's `CliEnv` over
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/reporter",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "private": false,
5
5
  "description": "Named VitestAgentReporterFactory implementations for the vitest-agent ecosystem.",
6
6
  "keywords": [
@@ -41,13 +41,13 @@
41
41
  "dependencies": {
42
42
  "@effect/platform-node": "^4.0.0",
43
43
  "@vitest-agent/sdk": "6.0.0",
44
- "@vitest-agent/ui": "4.0.0",
44
+ "@vitest-agent/ui": "4.0.1",
45
45
  "effect": "^4.0.0",
46
46
  "ink": "^7.1.1",
47
47
  "react": "^19.3.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@effected/cli": "^0.11.0",
50
+ "@effected/cli": "^0.12.0",
51
51
  "@effected/env": "^0.1.0",
52
52
  "@effected/glob": "^0.10.0",
53
53
  "@effected/walker": "^0.15.0",