diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..af0cff7 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm test diff --git a/package.json b/package.json index 87679d1..44aa303 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "vite", "build": "tsc && vite build", "preinstall": "npx only-allow pnpm", - "test": "jest" + "test": "jest", + "prepare": "husky install" }, "license": "MIT", "dependencies": { @@ -26,6 +27,7 @@ "@typescript-eslint/parser": "5.45.0", "conventional-changelog-conventionalcommits": "5.0.0", "eslint": "8.28.0", + "husky": "^8.0.3", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", "semantic-release": "19.0.5", @@ -38,4 +40,4 @@ "id": "_eindex-logseq-memos-sync", "icon": "./logo.webp" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 609dc54..50c3178 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,6 +15,7 @@ specifiers: conventional-changelog-conventionalcommits: 5.0.0 date-fns: ^2.29.3 eslint: 8.28.0 + husky: ^8.0.3 jest: ^29.5.0 jest-environment-jsdom: ^29.5.0 semantic-release: 19.0.5 @@ -40,6 +41,7 @@ devDependencies: '@typescript-eslint/parser': 5.45.0_hsf322ms6xhhd4b5ne6lb74y4a conventional-changelog-conventionalcommits: 5.0.0 eslint: 8.28.0 + husky: 8.0.3 jest: 29.5.0_@types+node@18.11.9 jest-environment-jsdom: 29.5.0 semantic-release: 19.0.5 @@ -2815,6 +2817,12 @@ packages: engines: {node: '>=10.17.0'} dev: true + /husky/8.0.3: + resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} + engines: {node: '>=14'} + hasBin: true + dev: true + /iconv-lite/0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'}