@tuidom/headless-backend 0.1.0 → 0.2.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/README.md +26 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @tuidom/headless-backend
|
|
2
|
+
|
|
3
|
+
Headless capture backend for [TUIDom](https://github.com/tuidom/tuidom):
|
|
4
|
+
renders frames into memory instead of a terminal — for screenshots, e2e and CI.
|
|
5
|
+
|
|
6
|
+
> ⚠️ Experimental — the API is unstable, deep imports expose internals on purpose.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @tuidom/core @tuidom/headless-backend
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { Size } from "@tuidom/core/common/geometryPromitives";
|
|
14
|
+
import { TuiApplication } from "@tuidom/core/dom/tuiApplication";
|
|
15
|
+
import { HeadlessCaptureBackend } from "@tuidom/headless-backend/headlessCaptureBackend";
|
|
16
|
+
|
|
17
|
+
const backend = new HeadlessCaptureBackend(new Size(80, 24));
|
|
18
|
+
const app = new TuiApplication(backend);
|
|
19
|
+
// ...build the tree, app.run(), then:
|
|
20
|
+
const frame = backend.captureFrame(); // plain-data GridSnapshot
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For unit tests prefer the scripted harness in `@tuidom/testing`
|
|
24
|
+
(`renderElement`, `TestApp`, screen assertions).
|
|
25
|
+
|
|
26
|
+
Full guide: <https://github.com/tuidom/tuidom/blob/main/GUIDE.md>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuidom/headless-backend",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Experimental terminal UI DOM — headless capture backend (in-memory frames for screenshots/e2e). API is unstable.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"./*": "./dist/*.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@tuidom/core": "0.1
|
|
31
|
+
"@tuidom/core": "0.2.1"
|
|
32
32
|
}
|
|
33
33
|
}
|