Files
hyperframes/package.json
T
James Russo 05aceedd30 feat(docs): add template preview generation script (#159)
## What

Add a script that uses `@hyperframes/producer` to render PNG thumbnails of each built-in template. Output goes to `docs/images/templates/`.

## Why

User feedback: "I would have loved more visual examples of what's actually possible. I had to scaffold every template just to see what they look like." This is the foundation for a visual template gallery in the docs.

## How

- New `scripts/generate-template-previews.ts` uses the producer's `createFileServer` + `createCaptureSession` + `captureFrame` APIs — hyperframes renders its own templates
- Patches out `__VIDEO_SRC__` placeholders (same logic as `init.ts`) so templates render without a video file
- Captures a frame at t=2s for each template (skips `blank` — it's just empty scaffolding)
- Handles varying dimensions (vignelli is 1080x1920 portrait)
- Adds `pnpm generate:previews` npm script

## Test plan

- [x] `pnpm generate:previews` generates 8 PNGs in `docs/images/templates/`
- [x] Each PNG is visually correct (verified by viewing)
- [x] `--only <template>` flag works for single template generation
2026-03-31 14:23:11 -04:00

43 lines
1.4 KiB
JSON

{
"name": "hyperframes-monorepo",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/heygen-com/hyperframes"
},
"workspaces": [
"packages/*"
],
"type": "module",
"scripts": {
"dev": "bun run studio",
"build": "bun run --filter '*' build",
"build:producer": "bun run --filter @hyperframes/producer build",
"studio": "bun run --filter @hyperframes/studio dev",
"build:hyperframes-runtime": "bun run --filter @hyperframes/core build:hyperframes-runtime",
"build:hyperframes-runtime:modular": "bun run --filter @hyperframes/core build:hyperframes-runtime:modular",
"verify:packed-manifests": "node scripts/verify-packed-manifests.mjs",
"set-version": "tsx scripts/set-version.ts",
"lint": "oxlint . && tsx scripts/lint-skills.ts",
"lint:skills": "tsx scripts/lint-skills.ts",
"lint:fix": "oxlint --fix .",
"format": "oxfmt .",
"format:check": "oxfmt --check .",
"knip": "knip",
"generate:previews": "tsx scripts/generate-template-previews.ts",
"prepare": "test -d .git && lefthook install || true"
},
"devDependencies": {
"@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0",
"@types/node": "^25.0.10",
"concurrently": "^8.2.0",
"knip": "^6.0.3",
"lefthook": "^2.1.4",
"oxfmt": "^0.41.0",
"oxlint": "^1.56.0",
"tsx": "^4.21.0",
"typescript": "^5.0.0"
}
}