From 5698a96f2335db127e63fca72aef547ea3fc072c Mon Sep 17 00:00:00 2001 From: chufan Date: Wed, 16 Oct 2024 15:40:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8`simple-git-hooks`?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=85=8D=E7=BD=AE=E9=92=A9=E5=AD=90=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E8=A7=84=E8=8C=83=E4=BB=93=E5=BA=93=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 7 ++++++- pnpm-lock.yaml | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 015e73f..c48de43 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "scripts": { "preinstall": "npx only-allow pnpm && chmod +x ./scripts/*", - "postinstall": "pnpm build:mark-map", + "postinstall": "simple-git-hooks", "clean": "npx fa clean --ignore-tips --dist --vite --all", "lint": "npx fa lint", "lint:fix": "npx fa lint --fix", @@ -39,6 +39,7 @@ "mermaid": "^10.9.1", "only-allow": "^1.2.1", "sass-embedded": "^1.79.5", + "simple-git-hooks": "^2.11.1", "typescript": "^5.5.4", "vercel": "^32.7.2", "vue": "^3.5.8", @@ -46,5 +47,9 @@ "vuepress-plugin-search-pro": "^2.0.0-rc.57", "vuepress-theme-hope": "^2.0.0-rc.58", "xmind-embed-viewer": "^1.2.0" + }, + "simple-git-hooks": { + "pre-commit": "pnpm lint:fix", + "prepare-commit-msg": "pnpm build" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8829d33..4c8be48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: sass-embedded: specifier: ^1.79.5 version: 1.79.5 + simple-git-hooks: + specifier: ^2.11.1 + version: 2.11.1 typescript: specifier: ^5.5.4 version: 5.6.3 @@ -4236,6 +4239,10 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-git-hooks@2.11.1: + resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} + hasBin: true + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -9692,6 +9699,8 @@ snapshots: signal-exit@4.1.0: {} + simple-git-hooks@2.11.1: {} + sisteransi@1.0.5: {} sitemap@8.0.0: