Files
hyperframes/packages/cli/package.json
T
ukimsanovandClaude Opus 4.7 86ac4e25f8 feat(capture): identify hashed fonts via OpenType name table
Modern frameworks (Next.js, Webpack) rename downloaded fonts with content
hashes for cache-busting. The captured filenames look like
'19cfc7226ec3afaa-s.woff2' and the CSS @font-face mapping that originally
tied each hash to a family name is lost during capture. The previous
DESIGN.md guidance — "hashed = Google Fonts subset, use Inter as substitute"
— was wrong half the time. The Raycast capture, for example, ships Inter,
JetBrains Mono, and Geist Mono all hashed identically.

Every OpenType / WOFF / WOFF2 file embeds a 'name' table (part of the spec
since 1996) with the family name, subfamily, weight class, and variation
axes. Subsetting and hashing don't strip it. This change uses fontkit to
read the name table from each downloaded font and writes a per-project
manifest the rest of the pipeline can consult instead of guessing.

Output: capture/extracted/fonts-manifest.json with per-file metadata and
per-family aggregation (weights captured, variable-font axes detected).
Cross-tested against 9 existing captures (Huly, Raycast, Framer, WorkOS,
Mercury, Loom, Arc, HeyGen, Railway): 132/132 files identified, 0 failures.
The 'ES Build Neutral' font in Huly captures — the one DESIGN.md was
calling '__esbuild_b38aaf' and substituting Inter for — now resolves to
its real family name with all 3 weights aggregated.

Includes canonicalization that collapses static-weight family-name
packaging ('Inter Medium' → family 'Inter' with weight 500) so the
families[] aggregate reads cleanly. Handles compound weight names
('Semi Bold' → 'SemiBold' before stripping). rawFamily preserved for
transparency.

- packages/cli/src/capture/fontMetadataExtractor.ts (new, ~210 lines)
- packages/cli/src/capture/index.ts (wired in after downloadAndRewriteFonts)
- packages/cli/package.json + bun.lock (added fontkit@2.0.4, @types/fontkit@2.0.9)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 10:53:36 -07:00

68 lines
1.8 KiB
JSON

{
"name": "@hyperframes/cli",
"version": "0.5.7",
"description": "HyperFrames CLI — create, preview, and render HTML video compositions",
"repository": {
"type": "git",
"url": "https://github.com/heygen-com/hyperframes",
"directory": "packages/cli"
},
"bin": {
"hyperframes": "./dist/cli.js"
},
"files": [
"dist"
],
"type": "module",
"scripts": {
"test": "vitest run",
"dev": "tsx src/cli.ts",
"build": "bun run build:fonts && tsup && bun run build:runtime && bun run build:copy",
"build:fonts": "cd ../producer && tsx scripts/generate-font-data.ts",
"build:runtime": "tsx scripts/build-runtime.ts",
"build:copy": "node scripts/build-copy.mjs",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@hono/node-server": "^1.8.0",
"@puppeteer/browsers": "^2.13.0",
"adm-zip": "^0.5.16",
"citty": "^0.2.1",
"compare-versions": "^6.1.1",
"esbuild": "^0.25.0",
"fontkit": "^2.0.4",
"giget": "^3.2.0",
"hono": "^4.0.0",
"mime-types": "^3.0.2",
"onnxruntime-node": "^1.20.0",
"open": "^10.0.0",
"postcss": "^8.5.8",
"prettier": "^3.8.1",
"puppeteer-core": "^24.39.1",
"sharp": "^0.34.5"
},
"devDependencies": {
"@clack/prompts": "^1.1.0",
"@hyperframes/core": "workspace:*",
"@hyperframes/engine": "workspace:*",
"@hyperframes/producer": "workspace:*",
"@hyperframes/studio": "workspace:*",
"@types/adm-zip": "^0.5.7",
"@types/fontkit": "^2.0.9",
"@types/mime-types": "^3.0.1",
"@types/node": "^22.0.0",
"linkedom": "^0.18.12",
"picocolors": "^1.1.1",
"tsup": "^8.0.0",
"tsx": "^4.0.0",
"typescript": "^5.0.0",
"vitest": "^3.2.4"
},
"optionalDependencies": {
"@google/genai": "^1.50.1"
},
"engines": {
"node": ">=22"
}
}