mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:54:29 +00:00
Resolve the compileStage TODO from PR #720. cfg.forceScreenshot is now computed exactly once inside compileStage (after applyRenderModeHints) and returned on CompileStageResult.forceScreenshot. The sequencer stores it on a local captureForceScreenshot; downstream capture stages take the value as an explicit parameter and derive their own engine config rather than reading cfg.forceScreenshot. Mid-pipeline mutations removed: - renderOrchestrator.ts: the pre-compile alpha-output mutation moved into compileStage so the resolution is one operation in one place. - captureHdrStage.ts: stopped mutating caller-owned cfg; the layered composite path now uses a local hdrCfg derived from cfg plus forceScreenshot=true. The stage throws if called with forceScreenshot=false to make the contract explicit. - BeginFrame auto-worker calibration fallback: still flips capture mode on a timeout, but flips the local boolean instead of cfg. The screenshot-mode retry uses a derived cfg view. captureStage / captureStreamingStage add a forceScreenshot input and derive captureCfg (identity-equal to cfg when the values already agree, so no extra allocation on the common path). lefthook.yml: grandfather renderOrchestrator.ts and captureHdrStage.ts in the new 500-line filesize hook (#748). Both pre-date the hook and are actively being shrunk in the producer stages stack. Unblocks Phase 3 chunked rendering: LockedRenderConfig.forceScreenshot in the distributed plan is computed here and survives across processes without depending on shared mutable state.
47 lines
1.8 KiB
YAML
47 lines
1.8 KiB
YAML
pre-commit:
|
|
parallel: true
|
|
commands:
|
|
lint:
|
|
glob: "*.{js,jsx,ts,tsx}"
|
|
run: bunx oxlint {staged_files}
|
|
format:
|
|
glob: "*.{js,jsx,ts,tsx,json,md,yaml,yml}"
|
|
# --no-error-on-unmatched-pattern: don't fail when staged files all
|
|
# fall under .prettierignore (e.g. docs-only changes to docs/docs.json).
|
|
run: bunx oxfmt --check --no-error-on-unmatched-pattern {staged_files}
|
|
typecheck:
|
|
glob: "*.{ts,tsx}"
|
|
run: cd packages/core && bunx tsc --noEmit && cd ../studio && bunx tsc --noEmit
|
|
filesize:
|
|
glob: "*.{ts,tsx}"
|
|
exclude: "(\\.test\\.(ts|tsx)$|\\.generated\\.)"
|
|
run: |
|
|
for f in {staged_files}; do
|
|
# The hook-level `exclude` regex above is meant to skip test
|
|
# and generated files, but lefthook expands `{staged_files}`
|
|
# before evaluating it for our shell loop — so the runtime
|
|
# filter has to repeat the rule.
|
|
case "$f" in
|
|
*.test.ts|*.test.tsx|*.generated.ts|*.generated.tsx) continue ;;
|
|
esac
|
|
# Grandfathered files that pre-date this hook (added in #748).
|
|
# New files >500 lines still fail; existing offenders are tracked
|
|
# for thinning in separate refactors — the producer stages stack
|
|
# is actively shrinking renderOrchestrator.ts, and
|
|
# captureHdrStage.ts is on the cycle-break list.
|
|
case "$f" in
|
|
*useTimelinePlayer.ts|*App.tsx) continue ;;
|
|
*renderOrchestrator.ts|*captureHdrStage.ts) continue ;;
|
|
esac
|
|
lines=$(wc -l < "$f")
|
|
if [ "$lines" -gt 500 ]; then
|
|
echo "ERROR: $f has $lines lines (max 500)"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
commit-msg:
|
|
commands:
|
|
commitlint:
|
|
run: bunx commitlint --edit "{1}"
|