MCPcopy
hub / github.com/codeaashu/claude-code / getRecentReleaseNotes

Function getRecentReleaseNotes

src/utils/releaseNotes.ts:207–240  ·  view source on GitHub ↗
(
  currentVersion: string,
  previousVersion: string | null | undefined,
  changelogContent: string = getStoredChangelogFromMemory(),
)

Source from the content-addressed store, hash-verified

205 * @returns Array of release notes to display
206 */
207export function getRecentReleaseNotes(
208 currentVersion: string,
209 previousVersion: string | null | undefined,
210 changelogContent: string = getStoredChangelogFromMemory(),
211): string[] {
212 try {
213 const releaseNotes = parseChangelog(changelogContent)
214
215 // Strip SHA from both versions to compare only the base versions
216 const baseCurrentVersion = coerce(currentVersion)
217 const basePreviousVersion = previousVersion ? coerce(previousVersion) : null
218
219 if (
220 !basePreviousVersion ||
221 (baseCurrentVersion &&
222 gt(baseCurrentVersion.version, basePreviousVersion.version))
223 ) {
224 // Get all versions that are newer than the last seen version
225 return Object.entries(releaseNotes)
226 .filter(
227 ([version]) =>
228 !basePreviousVersion || gt(version, basePreviousVersion.version),
229 )
230 .sort(([versionA], [versionB]) => (gt(versionA, versionB) ? -1 : 1)) // Sort newest first
231 .flatMap(([_, notes]) => notes)
232 .filter(Boolean)
233 .slice(0, MAX_RELEASE_NOTES_SHOWN)
234 }
235 } catch (error) {
236 logError(toError(error))
237 return []
238 }
239 return []
240}
241
242/**
243 * Gets all release notes as an array of [version, notes] arrays.

Callers 2

checkForReleaseNotesFunction · 0.85
checkForReleaseNotesSyncFunction · 0.85

Calls 6

parseChangelogFunction · 0.85
gtFunction · 0.85
toErrorFunction · 0.85
entriesMethod · 0.80
logErrorFunction · 0.70

Tested by

no test coverage detected