@unotest/viewer 0.26.0 → 0.26.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.26.1] - 2026-08-30
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix: a run started from a box's viewer stayed pending and never reached
8
+ the history
9
+
10
+ The viewer watched the run directories of environments it could see on
11
+ disk — overlay files `unotest/.env.<name>` and existing `.runs.<name>`
12
+ directories. A box has neither at start: environment values come from the
13
+ daemon, not from a file, and the runs directory appears with the first
14
+ run. So the viewer watched only the base root while every run was filed
15
+ under `.runs.<environment>`: the tab stayed PENDING, the history stayed
16
+ empty and the run 404-ed by its own id, until a restart happened to find
17
+ the directory already there. The environment a viewer was started for is
18
+ now known to it by definition, whatever the disk says.
19
+
20
+ - Fix: a run's captured output landed outside the run's directory
21
+
22
+ `stdout.log` / `stderr.log` were written to `<runs-root>/<runId>/` while
23
+ the run itself lives under its date shard — two orphan directories next to
24
+ the shard, holding the only copy of what the child said.
25
+
26
+ - Fix: a viewer started for an environment listed no runs at all
27
+
28
+ The standalone launcher read the project root, the port, the host and the
29
+ target from its environment — but not `UNOTEST_ENV`. A box starts one
30
+ viewer per environment and names it exactly that way, so every one of them
31
+ came up on the BASE runs directory while its runs were being filed under
32
+ `.runs.<environment>`: an empty history on a box that had just finished a
33
+ suite. Found on the first end-to-end run of the local box stand.
34
+
35
+ - 9424f6b: Fix: screenshots stayed blank in the viewer when runs write to a separate
36
+ artifact root
37
+
38
+ A run whose artifacts do not live under the working directory — every run on
39
+ a box, where the sources are a disposable copy of a test bundle — emitted
40
+ `screenshot` events whose path was relativised against the working directory.
41
+ That came out as `../../../…`, which the viewer's asset route refuses to
42
+ serve, so every step preview rendered as a broken image. Artifact paths are
43
+ now relative to the artifact root, which is still the project root on every
44
+ local run.
45
+
46
+ The failure bundle had the mirror-image problem: it was written to
47
+ `.unotest/failures/` under the working directory, so on a box it landed
48
+ inside the bundle copy — outside the tree the viewer serves, and discarded on
49
+ the next bundle push. It now hangs off the artifact root too, which leaves
50
+ local runs byte-for-byte unchanged.
51
+
52
+ The inspector's Semantic DOM, Console, Network and Snapshot panes were dark
53
+ for a third reason, and this one bit local runs as well: they composed the
54
+ run's directory in the browser and left out the date shard runs have been
55
+ filed under since M-10, plus the environment suffix on a box. The viewer's
56
+ asset route now takes `?file=<name-relative-to-the-run-dir>` and resolves the
57
+ directory itself — runs root, target suffix, environment suffix and shard are
58
+ all things only the server knows. `?path=` stays for the whole paths the
59
+ server ships on run events.
60
+
61
+ - Updated dependencies [9424f6b]
62
+ - @unotest/protocol@0.26.1
63
+ - @unotest/core@0.26.1
64
+ - @unotest/dsl@0.26.1
65
+
3
66
  ## [0.26.0] - 2026-08-30
4
67
 
5
68
  ### Minor Changes
@@ -73,6 +73,14 @@ declare function startViewerServer(opts: StartViewerOptions): Promise<ViewerHand
73
73
  * the installed `@unotest/*` runner packages (by name — DIP boundary
74
74
  * intact). `UNOTEST_RUNNER_PKG` (legacy single-runner var) and
75
75
  * `UNOTEST_TARGET` just pick which detected target is active at boot. */
76
+ /** Everything the standalone launcher reads from its environment, in one
77
+ * pure place so the plumbing is testable without starting a server.
78
+ *
79
+ * `activeEnv` is the one that has bitten: a box starts one viewer per
80
+ * environment and says which through `UNOTEST_ENV`. Dropping it left every
81
+ * viewer reading the BASE runs directory while its runs were filed under
82
+ * `.runs.<env>` — an empty history on a box that had just run a suite. */
83
+ declare function viewerCliOptions(env: NodeJS.ProcessEnv, cwd: string): Omit<StartViewerOptions, "runners">;
76
84
  declare function runViewerCli(): Promise<void>;
77
85
 
78
- export { type RunnerEntry, type StartViewerOptions, type ViewerHandle, runViewerCli, startViewerServer };
86
+ export { type RunnerEntry, type StartViewerOptions, type ViewerHandle, runViewerCli, startViewerServer, viewerCliOptions };