@@ -150,13 +150,13 @@ export async function cmdSync(opts: GlobalOpts, options: SyncOptions, inputAllow
150150 matchVersion = remote === skill . fingerprint ? latestVersion : null
151151 }
152152
153- candidates . push ( {
154- ...skill ,
155- status : matchVersion ? 'synced' : 'update' ,
156- matchVersion,
157- latestVersion,
158- } )
159- }
153+ candidates . push ( {
154+ ...skill ,
155+ status : matchVersion ? 'synced' : 'update' ,
156+ matchVersion,
157+ latestVersion,
158+ } )
159+ }
160160 } catch ( error ) {
161161 candidatesSpinner . fail ( formatError ( error ) )
162162 throw error
@@ -176,9 +176,15 @@ export async function cmdSync(opts: GlobalOpts, options: SyncOptions, inputAllow
176176 return
177177 }
178178
179- note ( 'To sync' , formatBulletList ( actionable . map ( ( candidate ) => formatActionableLine ( candidate , bump ) ) ) )
179+ note (
180+ 'To sync' ,
181+ formatBulletList (
182+ actionable . map ( ( candidate ) => formatActionableLine ( candidate , bump ) ) ,
183+ 20 ,
184+ ) ,
185+ )
180186 if ( synced . length > 0 ) {
181- note ( 'Already synced' , formatBulletList ( synced . map ( formatSyncedLine ) ) )
187+ note ( 'Already synced' , formatSyncedDisplay ( synced ) )
182188 }
183189
184190 const selected = await selectToUpload ( actionable , {
@@ -350,10 +356,7 @@ function dedupeSkillsBySlug(skills: SkillFolder[]) {
350356 return { skills : unique , duplicates }
351357}
352358
353- function formatActionableStatus (
354- candidate : Candidate ,
355- bump : 'patch' | 'minor' | 'major' ,
356- ) : string {
359+ function formatActionableStatus ( candidate : Candidate , bump : 'patch' | 'minor' | 'major' ) : string {
357360 if ( candidate . status === 'new' ) return 'NEW'
358361 const latest = candidate . latestVersion
359362 const next = latest ? semver . inc ( latest , bump ) : null
@@ -375,8 +378,17 @@ function formatSyncedSummary(candidate: Candidate): string {
375378 return version ? `${ candidate . slug } @${ version } ` : candidate . slug
376379}
377380
378- function formatBulletList ( lines : string [ ] ) : string {
379- return lines . map ( ( line ) => `- ${ line } ` ) . join ( '\n' )
381+ function formatBulletList ( lines : string [ ] , max : number ) : string {
382+ if ( lines . length <= max ) return lines . map ( ( line ) => `- ${ line } ` ) . join ( '\n' )
383+ const head = lines . slice ( 0 , max )
384+ const rest = lines . length - head . length
385+ return [ ...head , `... +${ rest } more` ] . map ( ( line ) => `- ${ line } ` ) . join ( '\n' )
386+ }
387+
388+ function formatSyncedDisplay ( synced : Candidate [ ] ) {
389+ const lines = synced . map ( formatSyncedLine )
390+ if ( lines . length <= 12 ) return formatBulletList ( lines , 12 )
391+ return formatCommaList ( synced . map ( formatSyncedSummary ) , 24 )
380392}
381393
382394function formatCommaList ( values : string [ ] , max : number ) {
0 commit comments