@unotest/viewer 0.14.0 → 0.16.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.0] - 2026-08-19
4
+
5
+ ### Minor Changes
6
+
7
+ - 1327a52: Capability-aware UI when the viewer runs behind a proxy.
8
+
9
+ New `GET /api/session` reports what the current session may do
10
+ (`canRun` / `canEditFiles` / `canTerminal` / `canBrowseFs`) plus a
11
+ display-only identity. A fronting proxy stamps the answer on every
12
+ request it forwards via the `x-unotest-viewer-session` header; the
13
+ contract and its codec ship as the new `@unotest/viewer/session`
14
+ subpath export.
15
+
16
+ The frontend greys out Run/Debug, the terminal (button AND the ⌃`
17
+ chord), scenario/collection/snapshot mutations and the Save button when
18
+ the session lacks the matching capability, and the status bar names the
19
+ session with a Log out entry.
20
+
21
+ No change for plain localhost usage: with no header the endpoint answers
22
+ full capabilities and no identity, and a failed lookup keeps the UI
23
+ permissive. The viewer still authorizes nothing itself — the header can
24
+ only narrow what the UI offers, never grant access.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [bf92e6f]
29
+ - @unotest/dsl@0.16.0
30
+ - @unotest/protocol@0.16.0
31
+
32
+ ## [0.15.0] - 2026-08-17
33
+
34
+ ### Minor Changes
35
+
36
+ - 32692b4: Make `node-pty` an optional dependency. It is a native addon with no prebuilt
37
+ binary for every platform — linux-arm64 among them — so on a machine without a
38
+ C/C++ toolchain npm compiled it from source and the whole install died with a
39
+ node-gyp error, before anything of ours was on disk. It backs one panel, the
40
+ docked terminal, which most runs never open.
41
+
42
+ It is now loaded on first use rather than at import time, so its absence is a
43
+ state the viewer reports instead of a crash it takes: the server starts, runs
44
+ and scenarios and the editor work, and the terminal panel explains what is
45
+ missing, what still works, and how to enable it.
46
+
47
+ ### Patch Changes
48
+
49
+ - d2161a9: Fix the standalone `unotest-viewer` bin, which started nothing. It imported
50
+ `dist/server/main.js` for its side effect, but that module self-starts only
51
+ when node was pointed at it directly — launched through the bin the check was
52
+ false, so the process exited 0 with no output, no error and no server. The bin
53
+ now calls the exported `runViewerCli()`.
54
+
55
+ `npx @unotest/web viewer` was never affected: it imports `@unotest/viewer/server`
56
+ and calls `startViewerServer()` itself. That import must stay side-effect free,
57
+ so the entry-point check stays — the bin just no longer depends on it.
58
+
59
+ A build-time smoke (`smoke:bin`) now starts the built bin, fetches the URL it
60
+ reports and kills it, because the failure mode here is silence: a bin that
61
+ exits 0 and serves nothing passes every check that only looks at exit codes.
62
+
63
+ - @unotest/dsl@0.15.0
64
+ - @unotest/protocol@0.15.0
65
+
3
66
  ## [0.14.0] - 2026-08-16
4
67
 
5
68
  ### Patch Changes
@@ -3,5 +3,11 @@
3
3
  // invoke this — `npx @unotest/web viewer` is the canonical entry that
4
4
  // spawns the same server. Kept here for dev / debug / future Electron
5
5
  // builds that embed Nest directly.
6
+ //
7
+ // Calls the exported function rather than importing the module for its
8
+ // side effect: main.js only self-starts when node was pointed AT it, so
9
+ // a bare import from here started nothing and exited 0 in silence.
6
10
 
7
- import "./../dist/server/main.js";
11
+ import { runViewerCli } from "./../dist/server/main.js";
12
+
13
+ await runViewerCli();
@@ -43,5 +43,17 @@ interface ViewerHandle {
43
43
  /** Public entry — `@unotest/web`'s viewer subcommand calls this via
44
44
  * `await import('@unotest/viewer/server').startViewerServer({...})`. */
45
45
  declare function startViewerServer(opts: StartViewerOptions): Promise<ViewerHandle>;
46
+ /** Standalone launch: read the environment, start the server, stay up
47
+ * until a signal. Exported because `bin/unotest-viewer.js` has to CALL
48
+ * it — importing this module and hoping the entry-point check below
49
+ * fires is what the bin used to do, and the check is false when node
50
+ * was pointed at the bin (argv[1] is the bin, not this file). The
51
+ * server never started and the process exited 0, saying nothing.
52
+ *
53
+ * No caller injects runners here, so `startViewerServer` auto-detects
54
+ * the installed `@unotest/*` runner packages (by name — DIP boundary
55
+ * intact). `UNOTEST_RUNNER_PKG` (legacy single-runner var) and
56
+ * `UNOTEST_TARGET` just pick which detected target is active at boot. */
57
+ declare function runViewerCli(): Promise<void>;
46
58
 
47
- export { type RunnerEntry, type StartViewerOptions, type ViewerHandle, startViewerServer };
59
+ export { type RunnerEntry, type StartViewerOptions, type ViewerHandle, runViewerCli, startViewerServer };