mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-10-30 17:27:09 +00:00
* perf(packages): ship npm packages without source maps and guard their size in CI No package or consumer reads the published source maps, so they are no longer built. The CLI copies only the studio app it serves instead of the whole studio dist. verify:packed-manifests now holds every published package to a size budget that ratchets down, and CI rejects pull requests that add a large binary outside LFS. * fix(ci): large-binary check reads every filename and fails on git errors * ci: run only Build when a skill bundled into the CLI changes * fix(ci): size guards also catch type changes, odd file names, unreadable blobs and bad budgets * fix(ci): large-binary check reads blobs by id and skips submodules * fix(ci): exempt only exact registry copies under docs/public/catalog * test(ci): cover the staged catalog-copy exemption; drop the local-only override hint in CI * fix(ci): producer budget follows its slimmed package; size checks name their real cause
65 lines
3.4 KiB
YAML
65 lines
3.4 KiB
YAML
pre-commit:
|
|
parallel: true
|
|
commands:
|
|
lint:
|
|
glob: "*.{js,jsx,ts,tsx}"
|
|
run: bunx oxlint --no-error-on-unmatched-pattern {staged_files}
|
|
format:
|
|
glob: "*.{js,jsx,ts,tsx,json,md,yaml,yml}"
|
|
# Auto-format and re-stage so the committed snapshot is always formatted.
|
|
# Replaces --check which only reports — that left unformatted files in
|
|
# commits when the hook ran after the amend snapshot was taken.
|
|
run: bunx oxfmt --no-error-on-unmatched-pattern {staged_files} && git add -f {staged_files}
|
|
skills-manifest:
|
|
glob: "skills/**"
|
|
# Regenerate the freshness fingerprint when a skill changes, then re-stage
|
|
# it so skills-manifest.json (repo root) never drifts from skills/ (CI
|
|
# enforces the same via the "Skills: manifest in sync" job). Churn-free:
|
|
# the generator rewrites only when a content hash actually changed.
|
|
run: bun packages/cli/scripts/gen-skills-manifest.ts && git add skills-manifest.json
|
|
typecheck:
|
|
glob: "*.{ts,tsx}"
|
|
run: cd packages/core && bunx tsc --noEmit && cd ../studio && bunx tsc --noEmit && cd ../.. && bunx tsc --noEmit -p scripts/tsconfig.json
|
|
# Mirrors the CI gate (same `--base origin/main` so the local hook can't
|
|
# pass on a branch CI would fail). Audits the working tree, which means
|
|
# unstaged WIP in `packages/**` is part of the diff — stash before
|
|
# committing if that surprises you. `--gate new-only` (the default) only
|
|
# fails on issues introduced by the branch, not inherited findings.
|
|
fallow:
|
|
glob: "packages/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}"
|
|
# Unset git worktree env vars: fallow creates a temp worktree internally and
|
|
# GIT_DIR/GIT_INDEX_FILE (set by git in worktree hook context) break that.
|
|
# env -u is safe in non-worktree contexts (no-op when var is unset).
|
|
# The prune keeps one audit base cache per checkout; the commit gets the audit's own status.
|
|
run: env -u GIT_DIR -u GIT_INDEX_FILE -u GIT_WORK_TREE sh -c 'bunx fallow audit --base origin/main --fail-on-issues; status=$?; bun scripts/prune-fallow-audit-caches.mjs origin/main; exit $status'
|
|
largefiles:
|
|
# Rejects staged binaries over the limit that are not LFS pointers; see
|
|
# the script header. CI runs the same script with --range.
|
|
run: ./scripts/check-large-files.sh
|
|
tracked-artifacts:
|
|
# Keep ignored dependency trees and platform metadata out of commits.
|
|
# `git ls-files` observes the staged index, so staged removals pass and
|
|
# an accidental force-add fails before the commit is created.
|
|
run: bun run check:tracked-artifacts
|
|
filesize:
|
|
# Scoped to packages/studio — the 600 LOC limit is a studio architecture
|
|
# standard enforced as part of the App.tsx decomposition work. Player and
|
|
# other packages enforce size discipline via code review and convention.
|
|
glob: "packages/studio/**/*.{ts,tsx}"
|
|
exclude: "(\\.test\\.(ts|tsx)$|\\.generated\\.)"
|
|
run: |
|
|
for f in {staged_files}; do
|
|
# Skip test and generated files (exclude pattern backup in case lefthook doesn't filter)
|
|
case "$f" in *.test.ts|*.test.tsx|*.generated.*) continue ;; esac
|
|
lines=$(wc -l < "$f")
|
|
if [ "$lines" -gt 600 ]; then
|
|
echo "ERROR: $f has $lines lines (max 600)"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
commit-msg:
|
|
commands:
|
|
commitlint:
|
|
run: bunx commitlint --edit "{1}"
|