refactor: harden client runtime and exports

This commit is contained in:
ANG-Server
2026-07-23 00:59:00 +08:00
parent 5d2339a29b
commit fc872fe8af
27 changed files with 902 additions and 856 deletions

21
scripts/audit_asset_size.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
# Keep single source assets below 20 MiB by default. Override in CI when a
# stricter product budget is available.
limit_bytes="${ASSET_LIMIT_BYTES:-20971520}"
status=0
while IFS= read -r -d '' file; do
size=$(wc -c < "$file")
if (( size > limit_bytes )); then
printf '%s\t%s\n' "$size" "$file"
status=1
fi
done < <(git ls-files -z -- 'assets/**')
if (( status != 0 )); then
printf '发现超过 %s 字节的受版本控制资源;请压缩、外置或使用 Git LFS。\n' "$limit_bytes" >&2
fi
exit "$status"