feat(cli): show changelog entries before running upgrades

This commit is contained in:
2026-04-16 13:09:21 +00:00
parent 6b2fa65611
commit ba4e56338c
8 changed files with 493 additions and 897 deletions
+16
View File
@@ -0,0 +1,16 @@
import { SmartChangelog } from 'npm:@push.rocks/smartchangelog@^0.1.0';
export const renderUpgradeChangelog = (
changelogMarkdown: string,
currentVersion: string,
latestVersion: string,
): string => {
const changelog = SmartChangelog.fromMarkdown(changelogMarkdown);
const entries = changelog.getEntriesBetween(currentVersion, latestVersion);
if (entries.length === 0) {
return '';
}
return entries.map((entry) => entry.toCliString()).join('\n\n');
};