From fef514f912363e60faae9e91965bbe1a95c39746 Mon Sep 17 00:00:00 2001 From: sebastianjnuwu Date: Sun, 22 Dec 2024 09:16:18 -0300 Subject: [PATCH] feat(repo): add husky --- .czrc | 3 +++ .husky/commit-msg | 5 +---- package.json | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .czrc diff --git a/.czrc b/.czrc new file mode 100644 index 0000000..fa0f35b --- /dev/null +++ b/.czrc @@ -0,0 +1,3 @@ +{ + "path": "./node_modules/cz-conventional-changelog" +} diff --git a/.husky/commit-msg b/.husky/commit-msg index 9dcdbc2..34eed8b 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname -- "$0")/_/husky.sh" - -npx --no -- commitlint --edit ${1} +npx --no -- commitlint --edit $1 \ No newline at end of file diff --git a/package.json b/package.json index 7a98696..49e9ef0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,11 @@ "copy": "npx cap copy", "update": "npx cap update", "sync": "npx cap sync", - "prepare": "husky" + "prepare": "husky", + "pre-commit": "cz" + }, + "hooks": { + "prepare-commit-msg": "exec < /dev/tty && npx cz --hook || true" }, "dependencies": { "@capacitor-community/admob": "^6.1.0", @@ -33,6 +37,7 @@ "@commitlint/config-conventional": "^19.6.0", "babel-plugin-transform-remove-console": "^6.9.4", "core-js": "^3.39.0", + "cz-conventional-changelog": "^3.3.0", "husky": "^9.1.7", "typescript": "^5.7.2", "vite": "^5.4.2",