chore: update with-lingui pre-commit hook and i18n translations

This commit is contained in:
zuiidea
2026-04-28 10:23:25 +08:00
parent 335c77cc8c
commit 6ac8a62770
2 changed files with 2 additions and 26 deletions
+1
View File
@@ -0,0 +1 @@
pnpm lint && pnpm fmt
+1 -26
View File
@@ -1,26 +1 @@
#!/usr/bin/env sh
# Run vp staged from each Vite+ app root so vite.config.ts (and its staged block) resolves.
# Git's cwd is the repo root while core.hooksPath points here; vp staged otherwise looks for
# vite.config.ts in the wrong directory.
root=$(git rev-parse --show-toplevel) || exit 1
cd "$root" || exit 1
files=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null || true)
[ -z "$files" ] && exit 0
failed=0
if echo "$files" | grep -q '^apps/with-lingui/'; then
(cd apps/with-lingui && PATH="$PWD/node_modules/.bin:$PATH" vp staged) || failed=1
fi
if echo "$files" | grep -q '^apps/basic/'; then
(cd apps/basic && PATH="$PWD/node_modules/.bin:$PATH" vp staged) || failed=1
fi
if echo "$files" | grep -E -q '^packages/create/.*\.(ts|tsx|mts)$'; then
pnpm --dir "$root/packages/create" run check-types || failed=1
fi
exit "$failed"
pnpm lint && pnpm fmt