refactor: add main.ts decomposition guardrails and extract core helpers

This commit is contained in:
2026-02-09 19:33:36 -08:00
parent f92b57c7b6
commit 1071001ab0
15 changed files with 1331 additions and 823 deletions

25
scripts/check-main-lines.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
target="${1:-1500}"
file="${2:-src/main.ts}"
if [[ ! -f "$file" ]]; then
echo "[ERROR] File not found: $file" >&2
exit 1
fi
if ! [[ "$target" =~ ^[0-9]+$ ]]; then
echo "[ERROR] Target line count must be an integer. Got: $target" >&2
exit 1
fi
actual="$(wc -l < "$file" | tr -d ' ')"
echo "[INFO] $file lines: $actual (target: <= $target)"
if (( actual > target )); then
echo "[ERROR] Line gate failed: $actual > $target" >&2
exit 1
fi
echo "[OK] Line gate passed"