mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
## Summary PR 2 of 5 in the hf#732 decomposition stack. Adds a `worker_threads`-based pool that offloads PNG decode + alpha-blit onto a fixed-size pool. **No production wiring yet** — the pool stands alone and ships behind a later PR in the stack. ### New files - `packages/producer/src/services/pngDecodeBlitWorker.ts` — worker entry. Imports from `@hyperframes/engine/alpha-blit` (zero-import TS source, survives the `new Worker(<path>)` loader boundary). - `packages/producer/src/services/pngDecodeBlitWorkerPool.ts` — fixed-size pool with `run()` API. Uses `transferList` for buffer ownership transfer (no 16bpc HDR buffer copies). - `packages/producer/src/services/pngDecodeBlitWorkerPool.test.ts` — 6 vitest tests pinning byte-equivalence with inline path, transferList correctness, concurrent dispatch, termination semantics. All pass. ### Build wiring - `packages/cli/tsup.config.ts`: second tsup entry emits `dist/pngDecodeBlitWorker.js` next to `dist/cli.js`. Without this entry the pool's `new Worker(<path>)` would fail at runtime in the shipped CLI. - `packages/producer/build.mjs`: third esbuild entry mirrors the wiring for direct producer consumers. - `packages/engine/package.json`: adds `./alpha-blit` subpath export pointing at `src/utils/alphaBlit.ts`. ## Stack Stacked on top of #756 (PR 1: worker-count cap). No behavior change in any render. ## Test plan - [x] 6 pool tests pass - [x] Producer + engine typecheck clean - [x] oxlint clean — Vai
40 lines
938 B
JSON
40 lines
938 B
JSON
{
|
|
"name": "@hyperframes/engine",
|
|
"version": "0.6.5",
|
|
"description": "Seekable web page to video rendering engine (Puppeteer + FFmpeg)",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
"directory": "packages/engine"
|
|
},
|
|
"type": "module",
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"exports": {
|
|
".": "./src/index.ts",
|
|
"./alpha-blit": "./src/utils/alphaBlit.ts"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"test": "vitest run",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"@hono/node-server": "^1.13.0",
|
|
"@hyperframes/core": "workspace:^",
|
|
"hono": "^4.6.0",
|
|
"linkedom": "^0.18.12",
|
|
"puppeteer": "^24.0.0",
|
|
"puppeteer-core": "^24.39.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^25.0.10",
|
|
"@webgpu/types": "^0.1.69",
|
|
"typescript": "^5.7.2",
|
|
"vitest": "^3.2.4"
|
|
},
|
|
"engines": {
|
|
"node": ">=22"
|
|
}
|
|
}
|