game-harness 1.0.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.
Files changed (69) hide show
  1. package/AGENTS.md +140 -0
  2. package/CHANGELOG.md +69 -0
  3. package/LICENSE +21 -0
  4. package/README.md +568 -0
  5. package/bin/test-harness-visual-battery.mjs +6 -0
  6. package/dist/cjs/bin/visual-battery.js +43 -0
  7. package/dist/cjs/browser-config.js +83 -0
  8. package/dist/cjs/chromium-launch.js +37 -0
  9. package/dist/cjs/index.js +10 -0
  10. package/dist/cjs/lighthouse.js +73 -0
  11. package/dist/cjs/package.json +3 -0
  12. package/dist/cjs/playwright-config.js +303 -0
  13. package/dist/cjs/production-runtime.js +315 -0
  14. package/dist/cjs/release-ladder.js +40 -0
  15. package/dist/cjs/silent-qa.js +75 -0
  16. package/dist/cjs/visual-battery.js +247 -0
  17. package/dist/esm/bin/visual-battery.js +41 -0
  18. package/dist/esm/browser-config.js +80 -0
  19. package/dist/esm/chromium-launch.js +34 -0
  20. package/dist/esm/index.js +3 -0
  21. package/dist/esm/lighthouse.js +70 -0
  22. package/dist/esm/playwright-config.js +292 -0
  23. package/dist/esm/production-runtime.js +304 -0
  24. package/dist/esm/release-ladder.js +37 -0
  25. package/dist/esm/silent-qa.js +67 -0
  26. package/dist/esm/visual-battery.js +239 -0
  27. package/dist/types/bin/visual-battery.d.cts +2 -0
  28. package/dist/types/bin/visual-battery.d.ts +2 -0
  29. package/dist/types/browser-config.d.cts +100 -0
  30. package/dist/types/browser-config.d.ts +100 -0
  31. package/dist/types/chromium-launch.d.cts +27 -0
  32. package/dist/types/chromium-launch.d.ts +27 -0
  33. package/dist/types/index.d.cts +3 -0
  34. package/dist/types/index.d.ts +3 -0
  35. package/dist/types/lighthouse.d.cts +44 -0
  36. package/dist/types/lighthouse.d.ts +44 -0
  37. package/dist/types/playwright-config.d.cts +122 -0
  38. package/dist/types/playwright-config.d.ts +122 -0
  39. package/dist/types/production-runtime.d.cts +105 -0
  40. package/dist/types/production-runtime.d.ts +105 -0
  41. package/dist/types/release-ladder.d.cts +38 -0
  42. package/dist/types/release-ladder.d.ts +38 -0
  43. package/dist/types/silent-qa.d.cts +47 -0
  44. package/dist/types/silent-qa.d.ts +47 -0
  45. package/dist/types/visual-battery.d.cts +69 -0
  46. package/dist/types/visual-battery.d.ts +69 -0
  47. package/docs/404.md +17 -0
  48. package/docs/agent-guide.md +10 -0
  49. package/docs/architecture.md +81 -0
  50. package/docs/assets/game-harness-hero.webp +0 -0
  51. package/docs/changelog.md +9 -0
  52. package/docs/contributing.md +21 -0
  53. package/docs/entry-points.md +41 -0
  54. package/docs/getting-started.md +42 -0
  55. package/docs/guides/chromium-and-silent-qa.md +72 -0
  56. package/docs/guides/lighthouse-and-release-ladder.md +62 -0
  57. package/docs/guides/playwright.md +58 -0
  58. package/docs/guides/production-runtime.md +61 -0
  59. package/docs/guides/visual-battery.md +58 -0
  60. package/docs/guides/vitest.md +41 -0
  61. package/docs/introduction.md +29 -0
  62. package/docs/package.json +13 -0
  63. package/docs/quick-start.md +47 -0
  64. package/docs/reference/troubleshooting.md +33 -0
  65. package/docs/security.md +15 -0
  66. package/docs/sourcey.config.ts +79 -0
  67. package/llms.txt +32 -0
  68. package/maestro/smoke.template.yaml +11 -0
  69. package/package.json +196 -0
@@ -0,0 +1,79 @@
1
+ import { defineConfig, markdown } from 'sourcey';
2
+
3
+ export default defineConfig({
4
+ name: 'Game Harness',
5
+ siteUrl: 'https://jonbogaty.com',
6
+ baseUrl: '/game-harness',
7
+ theme: {
8
+ preset: 'default',
9
+ colors: {
10
+ primary: '#0f766e',
11
+ light: '#2dd4bf',
12
+ dark: '#115e59',
13
+ },
14
+ fonts: {
15
+ sans: 'Inter, system-ui, sans-serif',
16
+ mono: 'JetBrains Mono, ui-monospace, monospace',
17
+ },
18
+ layout: {
19
+ content: '48rem',
20
+ },
21
+ },
22
+ prettyUrls: 'slash',
23
+ favicon: './assets/game-harness-hero.webp',
24
+ ogImage: './assets/game-harness-hero.webp',
25
+ repo: 'https://github.com/jbcom/game-harness',
26
+ editBranch: 'main',
27
+ editBasePath: 'docs',
28
+ navbar: {
29
+ links: [
30
+ { type: 'github', href: 'https://github.com/jbcom/game-harness' },
31
+ {
32
+ type: 'link',
33
+ label: 'npm',
34
+ href: 'https://www.npmjs.com/package/game-harness',
35
+ },
36
+ ],
37
+ },
38
+ footer: {
39
+ links: [
40
+ { type: 'github', href: 'https://github.com/jbcom/game-harness' },
41
+ { type: 'link', label: 'Security', href: 'https://jonbogaty.com/game-harness/security/' },
42
+ ],
43
+ },
44
+ navigation: {
45
+ tabs: [
46
+ {
47
+ tab: 'Documentation',
48
+ slug: '',
49
+ source: markdown({
50
+ groups: [
51
+ {
52
+ group: 'Getting Started',
53
+ pages: ['introduction', 'getting-started', 'quick-start', 'entry-points'],
54
+ },
55
+ {
56
+ group: 'Guides',
57
+ pages: [
58
+ 'guides/playwright',
59
+ 'guides/vitest',
60
+ 'guides/chromium-and-silent-qa',
61
+ 'guides/production-runtime',
62
+ 'guides/visual-battery',
63
+ 'guides/lighthouse-and-release-ladder',
64
+ ],
65
+ },
66
+ {
67
+ group: 'Reference',
68
+ pages: ['architecture', 'reference/troubleshooting'],
69
+ },
70
+ {
71
+ group: 'Project',
72
+ pages: ['contributing', 'security', 'changelog', 'agent-guide'],
73
+ },
74
+ ],
75
+ }),
76
+ },
77
+ ],
78
+ },
79
+ });
package/llms.txt ADDED
@@ -0,0 +1,32 @@
1
+ # Game Harness
2
+
3
+ > Release-grade browser QA primitives for TypeScript games: silent Playwright/Vitest sessions, deterministic screenshots, production-runtime proof, and Lighthouse gates.
4
+
5
+ Game Harness is a focused library, not a test framework. It supplies a
6
+ reusable, fail-closed safety and orchestration layer around Playwright and
7
+ Vitest Browser Mode; a consuming game keeps its own journeys, assertions,
8
+ art direction, and audio engine. Install from npm as
9
+ `game-harness`, Node 22 or newer. Import only the subpath
10
+ entry point a game needs — the package root stays peer-free and never loads
11
+ Playwright or Vitest. See AGENTS.md at the repository root for an
12
+ agent-oriented quick reference before writing code against this package.
13
+
14
+ ## Docs
15
+
16
+ - [Getting started](https://jonbogaty.com/game-harness/getting-started/): Installation and the current release/conformance matrix.
17
+ - [Quick start](https://jonbogaty.com/game-harness/quick-start/): Wire up the silent runtime marker and a first Playwright config.
18
+ - [Entry points](https://jonbogaty.com/game-harness/entry-points/): The full subpath-export map and required peers.
19
+ - [Playwright guide](https://jonbogaty.com/game-harness/guides/playwright/): Deterministic ports, strict-port preview servers, device tiers.
20
+ - [Vitest Browser Mode guide](https://jonbogaty.com/game-harness/guides/vitest/): Headed real-Chromium Vitest projects.
21
+ - [Chromium launch profile & Silent QA guide](https://jonbogaty.com/game-harness/guides/chromium-and-silent-qa/): The peer-free primitives behind every silent browser launch.
22
+ - [Production runtime verification guide](https://jonbogaty.com/game-harness/guides/production-runtime/): Turning a build into fail-closed runtime evidence.
23
+ - [Visual battery guide](https://jonbogaty.com/game-harness/guides/visual-battery/): Deterministic screenshot baseline orchestration.
24
+ - [Lighthouse presets & release ladder guide](https://jonbogaty.com/game-harness/guides/lighthouse-and-release-ladder/): CI Lighthouse assertions and the release-step orchestrator.
25
+ - [Architecture reference](https://jonbogaty.com/game-harness/reference/architecture/): Module boundaries, runtime evidence flow, build/distribution guarantees.
26
+ - [Troubleshooting reference](https://jonbogaty.com/game-harness/reference/troubleshooting/): Common failure modes and releases/support.
27
+
28
+ ## Optional
29
+
30
+ - [Repository](https://github.com/jbcom/game-harness): Source, issues, and pull requests.
31
+ - [AGENTS.md](https://github.com/jbcom/game-harness/blob/main/AGENTS.md): Agent-facing quick reference for using this package correctly.
32
+ - [CHANGELOG](https://github.com/jbcom/game-harness/blob/main/CHANGELOG.md): Release history, managed by release-please.
@@ -0,0 +1,11 @@
1
+ # Maestro smoke-test template — copy to <repo>/.maestro/smoke.yaml and fill
2
+ # in the placeholders below. This is the minimal "does the app boot and
3
+ # render its first screen" flow; add game-specific flows alongside it as
4
+ # separate .maestro/*.yaml files (they're app-specific user journeys, not
5
+ # shareable config — see game-harness's package notes).
6
+ appId: __APP_ID__ # e.g. com.jbcom.kuroga — must match capacitor.config.ts's appId
7
+ ---
8
+ - launchApp
9
+ - assertVisible:
10
+ id: __ROOT_ELEMENT_ID__ # e.g. the canvas mount root or title-screen testID
11
+ - takeScreenshot: smoke-boot
package/package.json ADDED
@@ -0,0 +1,196 @@
1
+ {
2
+ "name": "game-harness",
3
+ "version": "1.0.0",
4
+ "description": "Release-grade browser QA primitives for TypeScript games: silent Playwright/Vitest sessions, deterministic screenshots, runtime proof, and Lighthouse gates.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/jbcom/game-harness.git"
10
+ },
11
+ "files": [
12
+ "AGENTS.md",
13
+ "bin",
14
+ "CHANGELOG.md",
15
+ "dist",
16
+ "docs",
17
+ "llms.txt",
18
+ "maestro",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
22
+ "bin": {
23
+ "game-harness-visual-battery": "bin/test-harness-visual-battery.mjs",
24
+ "test-harness-visual-battery": "bin/test-harness-visual-battery.mjs"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "import": {
29
+ "types": "./dist/types/index.d.ts",
30
+ "default": "./dist/esm/index.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/types/index.d.cts",
34
+ "default": "./dist/cjs/index.js"
35
+ }
36
+ },
37
+ "./vitest": {
38
+ "import": {
39
+ "types": "./dist/types/browser-config.d.ts",
40
+ "default": "./dist/esm/browser-config.js"
41
+ },
42
+ "require": {
43
+ "types": "./dist/types/browser-config.d.cts",
44
+ "default": "./dist/cjs/browser-config.js"
45
+ }
46
+ },
47
+ "./playwright": {
48
+ "import": {
49
+ "types": "./dist/types/playwright-config.d.ts",
50
+ "default": "./dist/esm/playwright-config.js"
51
+ },
52
+ "require": {
53
+ "types": "./dist/types/playwright-config.d.cts",
54
+ "default": "./dist/cjs/playwright-config.js"
55
+ }
56
+ },
57
+ "./silent-qa": {
58
+ "import": {
59
+ "types": "./dist/types/silent-qa.d.ts",
60
+ "default": "./dist/esm/silent-qa.js"
61
+ },
62
+ "require": {
63
+ "types": "./dist/types/silent-qa.d.cts",
64
+ "default": "./dist/cjs/silent-qa.js"
65
+ }
66
+ },
67
+ "./production-runtime": {
68
+ "import": {
69
+ "types": "./dist/types/production-runtime.d.ts",
70
+ "default": "./dist/esm/production-runtime.js"
71
+ },
72
+ "require": {
73
+ "types": "./dist/types/production-runtime.d.cts",
74
+ "default": "./dist/cjs/production-runtime.js"
75
+ }
76
+ },
77
+ "./chromium": {
78
+ "import": {
79
+ "types": "./dist/types/chromium-launch.d.ts",
80
+ "default": "./dist/esm/chromium-launch.js"
81
+ },
82
+ "require": {
83
+ "types": "./dist/types/chromium-launch.d.cts",
84
+ "default": "./dist/cjs/chromium-launch.js"
85
+ }
86
+ },
87
+ "./lighthouse": {
88
+ "import": {
89
+ "types": "./dist/types/lighthouse.d.ts",
90
+ "default": "./dist/esm/lighthouse.js"
91
+ },
92
+ "require": {
93
+ "types": "./dist/types/lighthouse.d.cts",
94
+ "default": "./dist/cjs/lighthouse.js"
95
+ }
96
+ },
97
+ "./release-ladder": {
98
+ "import": {
99
+ "types": "./dist/types/release-ladder.d.ts",
100
+ "default": "./dist/esm/release-ladder.js"
101
+ },
102
+ "require": {
103
+ "types": "./dist/types/release-ladder.d.cts",
104
+ "default": "./dist/cjs/release-ladder.js"
105
+ }
106
+ },
107
+ "./visual-battery": {
108
+ "import": {
109
+ "types": "./dist/types/visual-battery.d.ts",
110
+ "default": "./dist/esm/visual-battery.js"
111
+ },
112
+ "require": {
113
+ "types": "./dist/types/visual-battery.d.cts",
114
+ "default": "./dist/cjs/visual-battery.js"
115
+ }
116
+ },
117
+ "./package.json": "./package.json"
118
+ },
119
+ "main": "./dist/cjs/index.js",
120
+ "module": "./dist/esm/index.js",
121
+ "types": "./dist/types/index.d.ts",
122
+ "dependencies": {
123
+ "cross-spawn": "7.0.6",
124
+ "get-port": "7.2.0"
125
+ },
126
+ "peerDependencies": {
127
+ "@playwright/test": ">=1.62.1 <2",
128
+ "@vitest/browser-playwright": ">=4.1.10 <5",
129
+ "vitest": ">=4.1.10 <5"
130
+ },
131
+ "peerDependenciesMeta": {
132
+ "@playwright/test": {
133
+ "optional": true
134
+ },
135
+ "@vitest/browser-playwright": {
136
+ "optional": true
137
+ },
138
+ "vitest": {
139
+ "optional": true
140
+ }
141
+ },
142
+ "devDependencies": {
143
+ "@arethetypeswrong/cli": "0.18.5",
144
+ "@playwright/test": "1.62.1",
145
+ "@types/cross-spawn": "6.0.6",
146
+ "@types/node": "24.13.3",
147
+ "@vitest/browser-playwright": "4.1.10",
148
+ "@vitest/coverage-v8": "4.1.10",
149
+ "oxlint": "1.79.0",
150
+ "prettier": "3.9.6",
151
+ "publint": "0.3.24",
152
+ "rimraf": "6.1.3",
153
+ "typescript": "7.0.2",
154
+ "vitest": "4.1.10"
155
+ },
156
+ "engines": {
157
+ "node": ">=22"
158
+ },
159
+ "publishConfig": {
160
+ "access": "public",
161
+ "provenance": true
162
+ },
163
+ "bugs": {
164
+ "url": "https://github.com/jbcom/game-harness/issues"
165
+ },
166
+ "homepage": "https://github.com/jbcom/game-harness#readme",
167
+ "sideEffects": false,
168
+ "author": "Jon Bogaty <jon@jonbogaty.com>",
169
+ "keywords": [
170
+ "vitest",
171
+ "playwright",
172
+ "testing",
173
+ "browser-testing",
174
+ "visual-regression",
175
+ "lighthouse",
176
+ "ci",
177
+ "game-dev"
178
+ ],
179
+ "scripts": {
180
+ "build": "pnpm run clean && pnpm run build:esm && pnpm run build:cjs && pnpm run build:types && pnpm run build:fixup",
181
+ "build:esm": "tsc -p tsconfig.esm.json",
182
+ "build:cjs": "tsc -p tsconfig.cjs.json",
183
+ "build:types": "tsc -p tsconfig.types.json",
184
+ "build:fixup": "node scripts/fixup-cjs-package-json.mjs",
185
+ "clean": "rimraf dist",
186
+ "coverage": "vitest run --coverage",
187
+ "format": "prettier --write .",
188
+ "format:check": "prettier --check .",
189
+ "lint": "oxlint --deny-warnings src tests scripts",
190
+ "package:check": "publint && attw --pack . --profile node16",
191
+ "test": "vitest run",
192
+ "test:package": "node scripts/verify-package-boundaries.mjs",
193
+ "typecheck": "tsc -p tsconfig.json --noEmit",
194
+ "verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run coverage && pnpm run build && pnpm run package:check && pnpm run test:package"
195
+ }
196
+ }