( lastSeenVersion: string | null | undefined, currentVersion: string = MACRO.VERSION, )
| 358 | * returns accurate results in component render bodies. |
| 359 | */ |
| 360 | export function checkForReleaseNotesSync( |
| 361 | lastSeenVersion: string | null | undefined, |
| 362 | currentVersion: string = MACRO.VERSION, |
| 363 | ): { hasReleaseNotes: boolean; releaseNotes: string[] } { |
| 364 | // For Ant builds, use VERSION_CHANGELOG bundled at build time |
| 365 | if (process.env.USER_TYPE === 'ant') { |
| 366 | const changelog = MACRO.VERSION_CHANGELOG |
| 367 | if (changelog) { |
| 368 | const commits = changelog.trim().split('\n').filter(Boolean) |
| 369 | return { |
| 370 | hasReleaseNotes: commits.length > 0, |
| 371 | releaseNotes: commits, |
| 372 | } |
| 373 | } |
| 374 | return { |
| 375 | hasReleaseNotes: false, |
| 376 | releaseNotes: [], |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion) |
| 381 | return { |
| 382 | hasReleaseNotes: releaseNotes.length > 0, |
| 383 | releaseNotes, |
| 384 | } |
| 385 | } |
no test coverage detected