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: