@@ -12,8 +12,8 @@ import { FileUtils } from "./utils/file.utils";
1212import { POST_PROCESSORS } from "./features" ;
1313import { ProjectUtils } from "./utils/project.utils" ;
1414import { LCEProject , LCEProjectInfo } from "./project" ;
15+ import { debug , DEBUG_LOGGING } from "./utils/log.utils" ;
1516
16- // eslint-disable-next-line @typescript-eslint/ban-types
1717export interface ExtractorOptions {
1818 prettyPrint ?: boolean ;
1919}
@@ -36,8 +36,8 @@ export async function processProjectsAndOutputResult(scanRoot: string, options:
3636 options . prettyPrint ? 2 : undefined ,
3737 ) ;
3838
39- let dirPath = path . join ( scanRoot , ".reports" , "jqa" ) ;
40- let filePath = path . join ( dirPath , "ts-output.json" ) ;
39+ const dirPath = path . join ( scanRoot , ".reports" , "jqa" ) ;
40+ const filePath = path . join ( dirPath , "ts-output.json" ) ;
4141 fs . mkdir ( dirPath , { recursive : true } , ( errDir ) => {
4242 if ( errDir ) {
4343 console . log ( "Could not create directory: " + dirPath ) ;
@@ -86,12 +86,14 @@ export async function processProject(project: LCEProjectInfo): Promise<LCEProjec
8686 const startTime = process . hrtime ( ) ;
8787 let fileReadingTime = 0 ;
8888 const progressBar = new SingleBar ( { } , Presets . shades_classic ) ;
89- progressBar . start ( fileList . length , 0 ) ;
89+ if ( ! DEBUG_LOGGING )
90+ progressBar . start ( fileList . length , 0 ) ;
9091
9192 // Traverse and process all individual project files
9293 const traverser = new AstTraverser ( ) ;
9394 for ( let i = 0 ; i < fileList . length ; i ++ ) {
94- progressBar . update ( i + 1 ) ;
95+ if ( ! DEBUG_LOGGING )
96+ progressBar . update ( i + 1 ) ;
9597 const file = fileList [ i ] ;
9698
9799 const frStartTime = process . hrtime ( ) ;
@@ -100,6 +102,8 @@ export async function processProject(project: LCEProjectInfo): Promise<LCEProjec
100102 fileReadingTime += frEndTime [ 0 ] + frEndTime [ 1 ] / 10 ** 9 - ( frStartTime [ 0 ] + frStartTime [ 1 ] / 10 ** 9 ) ;
101103
102104 try {
105+ debug ( `Processing file [${ i + 1 } /${ fileList . length } ]: ${ FileUtils . normalizePath ( ModulePathUtils . normalize ( projectRoot , file ) ) } ` ) ;
106+
103107 const { ast, services } = parseAndGenerateServices ( code , {
104108 loc : true ,
105109 range : true ,
@@ -127,7 +131,8 @@ export async function processProject(project: LCEProjectInfo): Promise<LCEProjec
127131 console . log ( e ) ;
128132 }
129133 }
130- progressBar . stop ( ) ;
134+ if ( ! DEBUG_LOGGING )
135+ progressBar . stop ( ) ;
131136 const normalizedConcepts : Map < string , LCEConcept [ ] > = unifyConceptMap ( concepts , "" ) . get ( "" ) ?? new Map ( ) ;
132137
133138 const endTime = process . hrtime ( ) ;
0 commit comments