( lastSeenVersion: string | null | undefined, currentVersion: string = MACRO.VERSION, )
| 333 | * returns accurate results in component render bodies. |
| 334 | */ |
| 335 | export function checkForReleaseNotesSync( |
| 336 | lastSeenVersion: string | null | undefined, |
| 337 | currentVersion: string = MACRO.VERSION, |
| 338 | ): { hasReleaseNotes: boolean; releaseNotes: string[] } { |
| 339 | // For Ant builds, use VERSION_CHANGELOG bundled at build time |
| 340 | if (process.env.USER_TYPE === 'ant') { |
| 341 | const changelog = MACRO.VERSION_CHANGELOG |
| 342 | if (changelog) { |
| 343 | const commits = changelog.trim().split('\n').filter(Boolean) |
| 344 | return { |
| 345 | hasReleaseNotes: commits.length > 0, |
| 346 | releaseNotes: commits, |
| 347 | } |
| 348 | } |
| 349 | return { |
| 350 | hasReleaseNotes: false, |
| 351 | releaseNotes: [], |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion) |
| 356 | return { |
| 357 | hasReleaseNotes: releaseNotes.length > 0, |
| 358 | releaseNotes, |
| 359 | } |
| 360 | } |
no test coverage detected