diff --git a/.release-it.json b/.release-it.json index 96f6149..b0ddd69 100644 --- a/.release-it.json +++ b/.release-it.json @@ -1,17 +1,39 @@ { "git": { - "changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs", - "tagName": "v${version}" + "tagName": "v${version}", + "commitMessage": "chore: release v${version}" + }, + "npm": { + "publish": true }, "github": { "release": true, - "releaseName": "${version}", - "releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs" + "releaseName": "${version}" }, - "hooks": { - "after:bump": "npx auto-changelog --commit-limit false -p" - }, - "npm": { - "publish": false + "plugins": { + "@release-it/conventional-changelog": { + "infile": "CHANGELOG.md", + "preset": { + "name": "conventionalcommits", + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "refactor", + "section": "Changes" + }, + { + "type": "chore", + "section": "Maintenance" + } + ] + } + } } } diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..422b194 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/package.json b/package.json index a8f4d12..2c4f441 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,21 @@ "addons": [ "volto-subblocks" ], + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "pre-commit": "lint-staged" + } + }, "dependencies": { "file-saver": "^2.0.5", "react-google-recaptcha-v3": "^1.8.0", "volto-subblocks": "collective/volto-subblocks#v1.0.1" + }, + "devDependencies": { + "@commitlint/cli": "^12.1.4", + "@commitlint/config-conventional": "^12.1.4", + "@release-it/conventional-changelog": "^2.0.1", + "husky": "^6.0.0" } }