diff --git a/.releaserc.js b/.releaserc.js index 56b89c6..c5642e2 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -7,16 +7,40 @@ const config = { // For defaults see: // https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#plugins plugins: [ - // Treat refactors as patch releases. See - // https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#usage. [ '@semantic-release/commit-analyzer', { - preset: 'angular', + // Use conventionalcommits instead of angular, which is likely + // to become the new default at some point, and supports more + // extensive configuration. See + // https://github.com/semantic-release/semantic-release/pull/1836. + preset: 'conventionalcommits', + // Treat refactors as patch releases. See + // https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#usage. releaseRules: [{ type: 'refactor', release: 'patch' }], }, ], - '@semantic-release/release-notes-generator', + [ + '@semantic-release/release-notes-generator', + { + preset: 'conventionalcommits', + presetConfig: { + types: [ + // Default sections, see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md#types. + { type: 'feat', section: 'Features' }, + { type: 'fix', section: 'Bug Fixes' }, + { type: 'chore', hidden: true }, + { type: 'docs', hidden: true }, + { type: 'style', hidden: true }, + { type: 'test', hidden: true }, + + // Overrides for additional patch release types. + { type: 'refactor', section: 'Refactors', hidden: false }, + { type: 'perf', section: 'Performance', hidden: false }, + ], + }, + }, + ], // Publish releases to NPM. '@semantic-release/npm', // Publish releases to GitHub. diff --git a/package-lock.json b/package-lock.json index 0aff316..bc207fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@types/mocha": "^9.1.1", "@types/tmp": "^0.2.3", "chai": "^4.1.2", + "conventional-changelog-conventionalcommits": "^8.0.0", "eslint": "^8.20.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^8.5.0", @@ -1781,6 +1782,18 @@ "node": ">=18" } }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-8.0.0.tgz", + "integrity": "sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/conventional-changelog-writer": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-8.0.0.tgz", @@ -11585,6 +11598,15 @@ "compare-func": "^2.0.0" } }, + "conventional-changelog-conventionalcommits": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-8.0.0.tgz", + "integrity": "sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA==", + "dev": true, + "requires": { + "compare-func": "^2.0.0" + } + }, "conventional-changelog-writer": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-8.0.0.tgz", diff --git a/package.json b/package.json index a533bfc..b5fa75a 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@types/mocha": "^9.1.1", "@types/tmp": "^0.2.3", "chai": "^4.1.2", + "conventional-changelog-conventionalcommits": "^8.0.0", "eslint": "^8.20.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^8.5.0",