mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
23 lines
673 B
JavaScript
23 lines
673 B
JavaScript
const getReleaseLine = async (changeset, _type) => {
|
|
const [firstLine, ...futureLines] = changeset.summary.split('\n').map((l) => l.trimRight());
|
|
|
|
let returnVal = `- ${firstLine}`;
|
|
|
|
if (futureLines.length > 0) {
|
|
returnVal += `\n${futureLines.map((l) => ` ${l}`).join('\n')}`;
|
|
}
|
|
return returnVal;
|
|
};
|
|
|
|
const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => {
|
|
if (dependenciesUpdated.length === 0) return '';
|
|
return `- Updated ${dependenciesUpdated[0].name} to v${dependenciesUpdated[0].newVersion}.`;
|
|
};
|
|
|
|
const defaultChangelogFunctions = {
|
|
getReleaseLine,
|
|
getDependencyReleaseLine,
|
|
};
|
|
|
|
module.exports = defaultChangelogFunctions;
|