( maxItems: number, currentVersion: string = MACRO.VERSION, lastSeenVersion?: string | null, )
| 315 | * For external users, uses public changelog |
| 316 | */ |
| 317 | export function getRecentReleaseNotesSync( |
| 318 | maxItems: number, |
| 319 | currentVersion: string = MACRO.VERSION, |
| 320 | lastSeenVersion?: string | null, |
| 321 | ): string[] { |
| 322 | // For ants, use bundled changelog |
| 323 | if (process.env.USER_TYPE === 'ant') { |
| 324 | const changelog = MACRO.VERSION_CHANGELOG |
| 325 | if (changelog) { |
| 326 | const commits = changelog.trim().split('\n').filter(Boolean) |
| 327 | return commits.slice(0, maxItems) |
| 328 | } |
| 329 | return [] |
| 330 | } |
| 331 | |
| 332 | const changelog = getStoredChangelogFromMemory() |
| 333 | if (!changelog) { |
| 334 | return [] |
| 335 | } |
| 336 | |
| 337 | return getRecentReleaseNotes(currentVersion, lastSeenVersion, changelog).slice( |
| 338 | 0, |
| 339 | maxItems, |
| 340 | ) |
| 341 | } |
no test coverage detected