From 6ac8a62770a350a11f4f5fab4bee6e4b2365bc0e Mon Sep 17 00:00:00 2001 From: zuiidea Date: Tue, 28 Apr 2026 10:23:25 +0800 Subject: [PATCH] chore: update with-lingui pre-commit hook and i18n translations --- apps/basic/.vite-hooks/pre-commit | 1 + apps/with-lingui/.vite-hooks/pre-commit | 27 +------------------------ 2 files changed, 2 insertions(+), 26 deletions(-) create mode 100755 apps/basic/.vite-hooks/pre-commit diff --git a/apps/basic/.vite-hooks/pre-commit b/apps/basic/.vite-hooks/pre-commit new file mode 100755 index 0000000..a54ea02 --- /dev/null +++ b/apps/basic/.vite-hooks/pre-commit @@ -0,0 +1 @@ +pnpm lint && pnpm fmt \ No newline at end of file diff --git a/apps/with-lingui/.vite-hooks/pre-commit b/apps/with-lingui/.vite-hooks/pre-commit index b8cd380..a54ea02 100755 --- a/apps/with-lingui/.vite-hooks/pre-commit +++ b/apps/with-lingui/.vite-hooks/pre-commit @@ -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 \ No newline at end of file