From c798fc17ff8dfef725faf31bbcfc28e5f682a2aa Mon Sep 17 00:00:00 2001 From: Steffan Date: Tue, 27 Aug 2024 18:30:02 +0200 Subject: [PATCH] chore: add simple-git-hooks, remove husky --- .husky/.gitignore | 1 - .husky/commit-msg | 4 ---- .husky/pre-commit | 4 ---- package-lock.json | 38 +++++++++++++++++--------------------- package.json | 10 +++++++--- 5 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 .husky/.gitignore delete mode 100755 .husky/commit-msg delete mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore deleted file mode 100644 index 31354ec..0000000 --- a/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index b567676..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx --no -- commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 36af219..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx lint-staged diff --git a/package-lock.json b/package-lock.json index 70f22ae..8412d59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "name": "starter-utils", + "hasInstallScript": true, "devDependencies": { "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", @@ -12,9 +13,9 @@ "@prettier/plugin-xml": "^3.4.1", "conventional-changelog-angular": "^8.0.0", "conventional-changelog-cli": "^5.0.0", - "husky": "^8.0.0", "lint-staged": "^15.2.7", - "prettier": "^3.3.3" + "prettier": "^3.3.3", + "simple-git-hooks": "^2.11.1" } }, "node_modules/@babel/code-frame": { @@ -1524,22 +1525,6 @@ "node": ">=16.17.0" } }, - "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", - "dev": true, - "license": "MIT", - "bin": { - "husky": "lib/bin.js" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -1978,9 +1963,9 @@ "license": "MIT" }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { @@ -2423,6 +2408,17 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-git-hooks": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/simple-git-hooks/-/simple-git-hooks-2.11.1.tgz", + "integrity": "sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "simple-git-hooks": "cli.js" + } + }, "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", diff --git a/package.json b/package.json index be4b222..419a778 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,18 @@ "type": "module", "private": true, "scripts": { - "prepare": "husky install", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "postinstall": "simple-git-hooks", "prettier:check": "prettier . --check", "prettier:write": "prettier . --write" }, "lint-staged": { "*.{md,js,json,css,php}": "prettier --write" }, + "simple-git-hooks": { + "pre-commit": "npx lint-staged", + "commit-msg": "npx --no -- commitlint --edit \"$1\"" + }, "devDependencies": { "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", @@ -18,8 +22,8 @@ "@prettier/plugin-xml": "^3.4.1", "conventional-changelog-angular": "^8.0.0", "conventional-changelog-cli": "^5.0.0", - "husky": "^8.0.0", "lint-staged": "^15.2.7", - "prettier": "^3.3.3" + "prettier": "^3.3.3", + "simple-git-hooks": "^2.11.1" } }