@@ -223,25 +223,34 @@ async function createVersionPr(
223223
224224// ---- PR comment helpers ----
225225
226+ const FROG_IMG_BASE = 'https://raw.githubusercontent.com/dmno-dev/bumpy/main/images' ;
227+
226228function formatReleasePlanComment ( plan : ReleasePlan , changesetCount : number ) : string {
227229 const lines : string [ ] = [ ] ;
228- lines . push ( '## 🐸 Bumpy Release Plan\n' ) ;
229- lines . push ( `**${ changesetCount } ** changeset(s) → **${ plan . releases . length } ** package(s) to release\n` ) ;
230-
231- const groups : [ string , PlannedRelease [ ] ] [ ] = [
232- [ '🔴 Major' , plan . releases . filter ( ( r ) => r . type === 'major' ) ] ,
233- [ '🟡 Minor' , plan . releases . filter ( ( r ) => r . type === 'minor' ) ] ,
234- [ '🟢 Patch' , plan . releases . filter ( ( r ) => r . type === 'patch' ) ] ,
235- ] ;
236-
237- for ( const [ label , group ] of groups ) {
238- if ( group . length === 0 ) continue ;
239- lines . push ( `### ${ label } \n` ) ;
240- lines . push ( '| Package | Change |' ) ;
241- lines . push ( '|---------|--------|' ) ;
242- for ( const r of group ) {
230+
231+ const preamble = [
232+ `<a href="${ __BUMPY_WEBSITE_URL__ } "><img src="${ FROG_IMG_BASE } /frog-talking.png" alt="bumpy-frog" width="60" align="left" style="image-rendering: pixelated;" title="Hi! I'm bumpy!" /></a>` ,
233+ '' ,
234+ `**${ changesetCount } ** changeset(s) → **${ plan . releases . length } ** package(s) to release` ,
235+ '<br clear="left" />' ,
236+ ] . join ( '\n' ) ;
237+ lines . push ( preamble ) ;
238+ lines . push ( '' ) ;
239+
240+ const groups : Record < string , PlannedRelease [ ] > = { major : [ ] , minor : [ ] , patch : [ ] } ;
241+ for ( const r of plan . releases ) {
242+ groups [ r . type ] ?. push ( r ) ;
243+ }
244+
245+ for ( const type of [ 'major' , 'minor' , 'patch' ] as const ) {
246+ const releases = groups [ type ] ;
247+ if ( ! releases || releases . length === 0 ) continue ;
248+
249+ lines . push ( bumpSectionHeader ( type ) ) ;
250+ lines . push ( '' ) ;
251+ for ( const r of releases ) {
243252 const suffix = r . isDependencyBump ? ' _(dep)_' : r . isCascadeBump ? ' _(cascade)_' : '' ;
244- lines . push ( `| \`${ r . name } \` | ${ r . oldVersion } → **${ r . newVersion } **${ suffix } | ` ) ;
253+ lines . push ( `- \`${ r . name } \` ${ r . oldVersion } → **${ r . newVersion } **${ suffix } ` ) ;
245254 }
246255 lines . push ( '' ) ;
247256 }
@@ -253,8 +262,10 @@ function formatReleasePlanComment(plan: ReleasePlan, changesetCount: number): st
253262
254263function formatNoChangesetsComment ( ) : string {
255264 return [
256- '## 🐸 Bumpy Release Plan\n' ,
257- 'No changesets found in this PR. If this PR should trigger a release, run:\n' ,
265+ `<a href="${ __BUMPY_WEBSITE_URL__ } "><img src="${ FROG_IMG_BASE } /frog-neutral.png" alt="bumpy-frog" width="60" align="left" style="image-rendering: pixelated;" title="Hi! I'm bumpy!" /></a>` ,
266+ '' ,
267+ 'No changesets found in this PR. If this PR should trigger a release, run:' ,
268+ '<br clear="left" />\n' ,
258269 '```bash' ,
259270 'bumpy add' ,
260271 '```\n' ,
@@ -263,8 +274,6 @@ function formatNoChangesetsComment(): string {
263274 ] . join ( '\n' ) ;
264275}
265276
266- const FROG_IMG_BASE = 'https://raw.githubusercontent.com/dmno-dev/bumpy/main/images' ;
267-
268277function bumpSectionHeader ( type : string ) : string {
269278 // I think pixelated css gets stripped but may as well leave it
270279 const frog = `<img src="${ FROG_IMG_BASE } /frog-${ type } .png" alt="${ type } " width="52" style="image-rendering: pixelated;" align="right" />` ;
0 commit comments