From 004ab6c56a55cd066c46de59083ef35347f4fbf8 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 1 Mar 2022 23:23:20 +0800 Subject: [PATCH] build(deps): add `commitlint`, `husky`, and `standard-version` --- .gitignore | 1 + .husky/commit-msg | 4 ++++ package.json | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 .husky/commit-msg diff --git a/.gitignore b/.gitignore index 982a22d..ca4c7b4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ !.editorconfig !.nojekyll !.travis.yml +!.husky # bundler cache _site diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..7fed485 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no -- commitlint --edit diff --git a/package.json b/package.json index 3a37427..a17cfe9 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,43 @@ "url": "https://github.com/cotes2020/jekyll-theme-chirpy/issues" }, "homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme", - "dependencies": { + "scripts": { + "prepare": "husky install" + }, + "devDependencies": { + "@commitlint/cli": "^16.2.1", + "@commitlint/config-conventional": "^16.2.1", "gulp": "^4.0.2", "gulp-concat": "^2.6.1", "gulp-insert": "^0.5.0", "gulp-rename": "^2.0.0", "gulp-uglify": "^3.0.2", + "husky": "^7.0.4", + "standard-version": "^9.3.2", "uglify-js": "^3.14.3" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "standard-version": { + "skip": { + "commit": true, + "tag": true + }, + "types": [{ + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Improvements" + } + ] } }