Files
payloadcms/packages/payload/.release-it.js
2023-10-16 22:47:27 -04:00

52 lines
1.4 KiB
JavaScript

module.exports = {
verbose: true,
git: {
commitMessage: 'chore(release): v${version}',
requireCleanWorkingDir: false,
tagMatch: 'v*', // payload is tagged normally, other packages are tagged with a prefix
},
github: {
release: true,
},
npm: {
skipChecks: true,
},
hooks: {
'before:init': ['pnpm install', 'pnpm clean', 'pnpm test'],
},
plugins: {
'@release-it/conventional-changelog': {
infile: '../../CHANGELOG.md',
preset: {
name: 'conventionalcommits',
types: [
{ type: 'feat', section: 'Features' },
{ type: 'feature', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'docs', section: 'Documentation' },
],
},
writerOpts: {
commitGroupsSort: (a, b) => {
const groupOrder = ['Features', 'Bug Fixes', 'Documentation']
return groupOrder.indexOf(a.title) - groupOrder.indexOf(b.title)
},
// Scoped commits at the end, alphabetical sort
commitsSort: (a, b) => {
if (a.scope || b.scope) {
if (!a.scope) return -1
if (!b.scope) return 1
return a.scope === b.scope
? a.subject.localeCompare(b.subject)
: a.scope.localeCompare(b.scope)
}
// Alphabetical sort
return a.subject.localeCompare(b.subject)
},
},
},
},
}