diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..20d0d06 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000..9ec4d98 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run test:unit:ci diff --git a/README.md b/README.md index ae32616..e47a9e2 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ services: ## Development Setup ```sh -npm install +npm install && npm run prepare ``` ### Compile and Hot-Reload for Development diff --git a/package-lock.json b/package-lock.json index 82e3cd2..7be849f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "eslint": "^8.5.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-vue": "^8.2.0", + "husky": "^7.0.0", "jsdom": "^19.0.0", "nodemon": "^2.0.15", "pino-pretty": "^7.5.1", @@ -3659,6 +3660,21 @@ "node": ">= 6" } }, + "node_modules/husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -9719,6 +9735,12 @@ "debug": "4" } }, + "husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true + }, "iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", diff --git a/package.json b/package.json index 2b4ef6a..765c56f 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test:unit": "vitest --environment jsdom", "test:unit:ci": "vitest --environment jsdom --run", "typecheck": "vue-tsc --noEmit", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" + "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "prepare": "husky install" }, "prisma": { "seed": "ts-node prisma/seed.ts" @@ -52,6 +53,7 @@ "typescript": "~4.5.4", "vite": "^2.7.13", "vitest": "^0.1.23", - "vue-tsc": "^0.29.8" + "vue-tsc": "^0.29.8", + "husky": "^7.0.0" } }