From d5b27734367d9bdaba0cb07999189406cded0902 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Wed, 20 May 2026 23:19:52 +0200 Subject: [PATCH] fix: satisfy release project build --- .husky/pre-push | 5 +---- src/utils/autoGitWork.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index e7d3c977..96d8db82 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -155,10 +155,7 @@ fi # ── 0. TypeScript + Vite build ────────────────────────────────────────── echo "" echo "📦 [0/5] TypeScript + Vite build..." -pnpm exec tsc --noEmit -# TypeScript is checked explicitly above; run Vite directly here to avoid -# paying for the package build script's duplicate `tsc -b` pass. -pnpm exec vite build +pnpm build echo " ✅ Build OK" # ── 1. Frontend coverage (≥70%) — includes all unit tests ─────────────── diff --git a/src/utils/autoGitWork.ts b/src/utils/autoGitWork.ts index 384be0ed..38e5fa1a 100644 --- a/src/utils/autoGitWork.ts +++ b/src/utils/autoGitWork.ts @@ -8,8 +8,8 @@ interface AutoGitWorkInput { remoteStatusForRepository: (path: string) => GitRemoteStatus | null } -function hasPushableCommits(status: GitRemoteStatus | null | undefined): boolean { - return status?.hasRemote === true && status.ahead > 0 +function pushableAhead(status: GitRemoteStatus | null | undefined): number | null { + return status?.hasRemote === true && status.ahead > 0 ? status.ahead : null } function modifiedFileSignature(file: ModifiedFile): string { @@ -21,7 +21,8 @@ function pushableRepositorySignature( remoteStatusForRepository: (path: string) => GitRemoteStatus | null, ): string | null { const status = remoteStatusForRepository(path) - return hasPushableCommits(status) ? `${path}:${status.ahead}` : null + const ahead = pushableAhead(status) + return ahead === null ? null : `${path}:${ahead}` } function activeRemoteSignature({ @@ -29,9 +30,10 @@ function activeRemoteSignature({ activeVaultPath, repositoryPaths, }: Pick): string | null { - if (!hasPushableCommits(activeRemoteStatus)) return null + const ahead = pushableAhead(activeRemoteStatus) + if (ahead === null) return null if (repositoryPaths.includes(activeVaultPath)) return null - return `${activeVaultPath}:${activeRemoteStatus.ahead}` + return `${activeVaultPath}:${ahead}` } export function autoGitWorkSignature({