@scenar/cli 0.8.0 → 0.9.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/example-bundle/assets/index-BoIR0_nN.js +147 -0
- package/example-bundle/assets/style-YRMeJPPX.css +1 -0
- package/example-bundle/index.html +2 -2
- package/example-bundle/pack-manifest.json +7 -7
- package/package.json +9 -5
- package/src/__tests__/pack-generate-embed-entry.test.ts +68 -3
- package/src/__tests__/run-shoot.test.ts +270 -0
- package/src/api.d.ts +3 -0
- package/src/api.d.ts.map +1 -1
- package/src/api.js +2 -0
- package/src/api.js.map +1 -1
- package/src/api.ts +5 -0
- package/src/commands/shoot.d.ts +3 -0
- package/src/commands/shoot.d.ts.map +1 -0
- package/src/commands/shoot.js +52 -0
- package/src/commands/shoot.js.map +1 -0
- package/src/commands/shoot.ts +72 -0
- package/src/index.d.ts.map +1 -1
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/index.ts +2 -0
- package/src/pack/generate-embed-entry.d.ts +11 -0
- package/src/pack/generate-embed-entry.d.ts.map +1 -1
- package/src/pack/generate-embed-entry.js +82 -1
- package/src/pack/generate-embed-entry.js.map +1 -1
- package/src/pack/generate-embed-entry.ts +83 -1
- package/src/shoot/playwright-browser.d.ts +9 -0
- package/src/shoot/playwright-browser.d.ts.map +1 -0
- package/src/shoot/playwright-browser.js +92 -0
- package/src/shoot/playwright-browser.js.map +1 -0
- package/src/shoot/playwright-browser.ts +121 -0
- package/src/shoot/run-shoot.d.ts +52 -0
- package/src/shoot/run-shoot.d.ts.map +1 -0
- package/src/shoot/run-shoot.js +172 -0
- package/src/shoot/run-shoot.js.map +1 -0
- package/src/shoot/run-shoot.ts +251 -0
- package/src/shoot/types.d.ts +40 -0
- package/src/shoot/types.d.ts.map +1 -0
- package/src/shoot/types.js +2 -0
- package/src/shoot/types.js.map +1 -0
- package/src/shoot/types.ts +40 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/example-bundle/assets/index-CBaiZ4ek.js +0 -147
- package/example-bundle/assets/style-Ci-h7jik.css +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ScenarioShot } from "@scenar/core";
|
|
2
|
+
|
|
3
|
+
/** The two capture themes — every shot is rendered once per theme (DD-02 D2). */
|
|
4
|
+
export type ShotTheme = "light" | "dark";
|
|
5
|
+
|
|
6
|
+
/** What the capture page reports once its driver is ready. */
|
|
7
|
+
export interface ShotCaptureInfo {
|
|
8
|
+
/** The bundle's declared shots, validated and in timeline order. */
|
|
9
|
+
readonly shots: readonly ScenarioShot[];
|
|
10
|
+
/** Selector for the element to screenshot (owned by the capture mount). */
|
|
11
|
+
readonly frameSelector: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* One themed browser page driving a capture — the narrow seam between
|
|
16
|
+
* run-shoot's orchestration (unit-tested against a fake) and Playwright
|
|
17
|
+
* (exercised by the real end-to-end capture, not by unit tests).
|
|
18
|
+
*/
|
|
19
|
+
export interface ShotSession {
|
|
20
|
+
/**
|
|
21
|
+
* Navigate to the capture URL and wait for the page to report either a
|
|
22
|
+
* ready driver or an error (`window.__scenarShot` / `__scenarShotError`).
|
|
23
|
+
* Throws with the page's own message on a reported error or on timeout.
|
|
24
|
+
*/
|
|
25
|
+
open(url: string, timeoutMs: number): Promise<ShotCaptureInfo>;
|
|
26
|
+
/** Advance the page's TimeSource walk to `timeMs` (sequential, never back). */
|
|
27
|
+
walkTo(timeMs: number): Promise<void>;
|
|
28
|
+
/** Screenshot the capture frame, animations disabled. */
|
|
29
|
+
screenshotFrame(): Promise<Buffer>;
|
|
30
|
+
close(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A launched capture browser that can open themed sessions. */
|
|
34
|
+
export interface ShotBrowser {
|
|
35
|
+
newSession(options: {
|
|
36
|
+
theme: ShotTheme;
|
|
37
|
+
viewport: { width: number; height: number };
|
|
38
|
+
}): Promise<ShotSession>;
|
|
39
|
+
close(): Promise<void>;
|
|
40
|
+
}
|