From 1c4d7a5b324c727974ef49acd3af0f2a31a34d08 Mon Sep 17 00:00:00 2001 From: Fredrik Johansen Date: Wed, 11 Dec 2024 09:02:58 +0100 Subject: [PATCH 1/4] chore(npm): removes "install" parameter from husky prepare script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6eaff75..b30e7bd 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test": "jest", "lint": "eslint ./src --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "prepare": "husky install" + "prepare": "husky" }, "repository": { "type": "git", From 61fda811f6653e20d993a330564780f92f01dd1d Mon Sep 17 00:00:00 2001 From: Fredrik Johansen Date: Wed, 11 Dec 2024 09:03:13 +0100 Subject: [PATCH 2/4] chore(npm): bumps husky to version 9.1.7 --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index b8a5fcb..c5f90b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@typescript-eslint/parser": "^6.10.0", "eslint": "^8.49.0", "fastify": "^4.23.2", - "husky": "^8.0.3", + "husky": "^9.1.7", "jest": "^29.7.0", "rimraf": "^5.0.1", "semantic-release-export-data": "^1.0.1", @@ -6882,15 +6882,15 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -20178,9 +20178,9 @@ "dev": true }, "husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true }, "ieee754": { diff --git a/package.json b/package.json index b30e7bd..70c163e 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@typescript-eslint/parser": "^6.10.0", "eslint": "^8.49.0", "fastify": "^4.23.2", - "husky": "^8.0.3", + "husky": "^9.1.7", "jest": "^29.7.0", "rimraf": "^5.0.1", "semantic-release-export-data": "^1.0.1", From 4e9fb3a416a998d48a72a587e19db004c3e93996 Mon Sep 17 00:00:00 2001 From: Fredrik Johansen Date: Wed, 11 Dec 2024 09:03:31 +0100 Subject: [PATCH 3/4] ci(husky): adds pre-commit hook to lint, test and build project --- .husky/pre-commit | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..ce3d475 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,3 @@ +npm run lint +npm run test +npm run build \ No newline at end of file From b3603365853fa7d87af81e16acbfb53879128c4c Mon Sep 17 00:00:00 2001 From: Fredrik Johansen Date: Wed, 11 Dec 2024 09:03:45 +0100 Subject: [PATCH 4/4] ci(husky): adds commit-msg hook to check for conventional commit message --- .husky/commit-msg | 1 + 1 file changed, 1 insertion(+) create mode 100644 .husky/commit-msg diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..17bce4a --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +pnpm exec commitlint --edit --extends @commitlint/config-conventional \ No newline at end of file