2023-12-07 15:56:12 +00:00
|
|
|
import conventionalChangelogPreset from 'conventional-changelog-conventionalcommits';
|
|
|
|
import conventionalChangelogCore from 'conventional-changelog-core';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {import('conventional-changelog-core').Options}
|
|
|
|
*/
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
|
|
export const config = conventionalChangelogPreset({
|
|
|
|
types: [
|
|
|
|
{
|
|
|
|
type: 'feat',
|
|
|
|
section: 'Features',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'fix',
|
|
|
|
section: 'Bug Fixes',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'perf',
|
|
|
|
section: 'Performance Improvements',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'revert',
|
|
|
|
section: 'Reverts',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'docs',
|
|
|
|
section: 'Documentation',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'style',
|
|
|
|
section: 'Styles',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'refactor',
|
|
|
|
section: 'Code Refactoring',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'test',
|
|
|
|
section: 'Tests',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'build',
|
|
|
|
section: 'Build System',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'ci',
|
|
|
|
section: 'Continuous Integration',
|
|
|
|
},
|
2024-02-07 14:46:49 +00:00
|
|
|
{
|
|
|
|
type: 'chore',
|
|
|
|
section: 'Miscellaneous Chores',
|
|
|
|
},
|
2023-12-07 15:56:12 +00:00
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2024-09-12 06:31:14 +00:00
|
|
|
* @param {boolean|undefined} onTag
|
2023-12-07 15:56:12 +00:00
|
|
|
* @returns
|
|
|
|
*/
|
2024-11-01 15:10:12 +00:00
|
|
|
export function getChangelog(onTag = false) {
|
2023-12-07 15:56:12 +00:00
|
|
|
return conventionalChangelogCore(
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
releaseCount: onTag ? 2 : 1,
|
|
|
|
},
|
2024-11-01 15:10:12 +00:00
|
|
|
undefined,
|
2023-12-07 15:56:12 +00:00
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
{ headerPartial: '' },
|
|
|
|
);
|
|
|
|
}
|