Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions plugins/screen-capture/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @game-ci/screen-capture (draft, GPU-required)

Baseline-vs-current frame diffing and QA evidence capture. **Not
functional yet**, and `capture` is not yet registered anywhere in core's
CLI. Requires a GPU-capable runner - unlike most plugins in this batch.

## Why this, distinct from marketing screenshots

Deliberately separate concern from a store-screenshot/marketing-asset
plugin: this is about catching visual regressions with orphan-process
cleanup and baseline comparison, not generating polished store assets.

## Remaining work before this is real

1. Add `capture <buildPath>` to core's `CliCommands`.
2. Define capture checkpoints - how does a game project mark "capture a
frame here" (likely an in-game hook similar to
runtime-test-framework's harness)?
3. Baseline storage/diffing strategy (perceptual diff threshold, not
exact-pixel-match, to tolerate benign renderer/driver noise).
4. Orphaned-capture-process cleanup for killed/crashed runs.
5. Tests once the above is real.
32 changes: 32 additions & 0 deletions plugins/screen-capture/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@game-ci/screen-capture",
"version": "0.0.1",
"description": "Screen Capture and Visual Regression plugin (draft, GPU-required). Baseline-vs-current frame diffing and QA evidence capture, distinct from marketing-asset generation.",
"license": "MIT",
"repository": "git@github.com:game-ci/cli.git",
"files": [
"dist"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/node": "^17.0.23",
"typescript": "4.7.4",
"vitest": "^4"
},
"engines": {
"node": ">=18.x"
}
}
42 changes: 42 additions & 0 deletions plugins/screen-capture/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Screen Capture & Visual Regression plugin - DRAFT (GPU-required).
*
* Plan: `game-ci capture <buildPath> --baseline <dir>` launches the built
* player, captures screenshots/video at defined checkpoints, and diffs
* against a maintained baseline to catch visual regressions - QA
* evidence, deliberately distinct in purpose from marketing-asset
* screenshot generation (a different, unrelated capability). Requires a
* GPU-capable runner, unlike most of this batch.
*
* NOTE: `capture` is not yet registered as a core CLI command.
*/

export const screenCapturePlugin = {
name: "screen-capture",
version: "0.0.1",

commands: [
{
engine: "*",
createCommand(command: string, _subCommands: string[]) {
if (command === "capture") {
return {
name: "Screen capture",
async configureOptions() {
// TODO: register --baseline, --diffThreshold, --outputDir.
},
async execute(): Promise<boolean> {
throw new Error(
"Screen Capture & Visual Regression is not implemented yet (draft plugin), and " +
"`capture` is not yet registered as a core command either. See plugins/screen-capture/README.md.",
);
},
};
}
return null;
},
},
],
};

export default screenCapturePlugin;
19 changes: 19 additions & 0 deletions plugins/screen-capture/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es2022",
"lib": ["es2022"],
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"noImplicitAny": false,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.test.ts", "dist"]
}