@@ -84,7 +84,7 @@ console.log('');
8484console . log ( `Migration (trend): ${ asyncFunctions } /${ asyncFunctions + callbackFunctions } (${ migrationPercent } %)` ) ;
8585
8686if ( process . env . GITHUB_STEP_SUMMARY ) {
87- const { appendFileSync } = await import ( 'node:fs' ) ;
87+ const { appendFileSync, writeFileSync } = await import ( 'node:fs' ) ;
8888 appendFileSync ( process . env . GITHUB_STEP_SUMMARY , [
8989 '## Async/Await Migration Progress' ,
9090 '' ,
@@ -97,4 +97,24 @@ if (process.env.GITHUB_STEP_SUMMARY) {
9797 `| Migration trend (async / (async + callback)) | ${ asyncFunctions } /${ asyncFunctions + callbackFunctions } (${ migrationPercent } %) |` ,
9898 '' ,
9999 ] . join ( '\n' ) ) ;
100+
101+ // Output benchmark JSON for visualization
102+ const benchmarkData = [
103+ {
104+ name : 'Async Migration Progress' ,
105+ unit : '%' ,
106+ value : parseFloat ( migrationPercent ) ,
107+ } ,
108+ {
109+ name : 'Async Functions Percentage' ,
110+ unit : '%' ,
111+ value : parseFloat ( asyncFunctionPercent ) ,
112+ } ,
113+ {
114+ name : 'Total callback functions' ,
115+ unit : 'count' ,
116+ value : callbackFunctions ,
117+ }
118+ ] ;
119+ writeFileSync ( 'async-migration-benchmark.json' , JSON . stringify ( benchmarkData , null , 2 ) ) ;
100120}
0 commit comments