feat(tsbuild): Improve task logging and update dependencies
This commit is contained in:
		@@ -6,16 +6,28 @@ export type { CompilerOptions, ScriptTarget, ModuleKind };
 | 
			
		||||
 | 
			
		||||
export * from './tsbuild.classes.tsbuild.js';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Interface for task information
 | 
			
		||||
 */
 | 
			
		||||
export interface ITaskInfo {
 | 
			
		||||
  taskNumber: number;
 | 
			
		||||
  totalTasks: number;
 | 
			
		||||
  sourcePattern: string;
 | 
			
		||||
  destDir: string;
 | 
			
		||||
  fileCount: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * compile an array of absolute file paths with error tracking
 | 
			
		||||
 */
 | 
			
		||||
export let compileFileArrayWithErrorTracking = async (
 | 
			
		||||
  fileStringArrayArg: string[],
 | 
			
		||||
  compilerOptionsArg: CompilerOptions = {},
 | 
			
		||||
  argvArg?: any
 | 
			
		||||
  argvArg?: any,
 | 
			
		||||
  taskInfo?: ITaskInfo
 | 
			
		||||
): Promise<{ emittedFiles: any[], errorSummary: import('./tsbuild.classes.tsbuild.js').IErrorSummary }> => {
 | 
			
		||||
  const { TsBuild } = await import('./tsbuild.classes.tsbuild.js');
 | 
			
		||||
  const tsBuild = new TsBuild(fileStringArrayArg, compilerOptionsArg, argvArg);
 | 
			
		||||
  const tsBuild = new TsBuild(fileStringArrayArg, compilerOptionsArg, argvArg, taskInfo);
 | 
			
		||||
  return tsBuild.compileWithErrorTracking();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -115,8 +127,11 @@ export let compileGlobStringObject = async (
 | 
			
		||||
  let compiledFiles: any[] = [];
 | 
			
		||||
  const errorSummaries: import('./tsbuild.classes.tsbuild.js').IErrorSummary[] = [];
 | 
			
		||||
  
 | 
			
		||||
  const totalTasks = Object.keys(globStringObjectArg).length;
 | 
			
		||||
  let currentTask = 0;
 | 
			
		||||
  
 | 
			
		||||
  // Log the compilation tasks in a nice format
 | 
			
		||||
  console.log('\n👷 TypeScript Compilation Tasks:');
 | 
			
		||||
  console.log(`\n👷 TypeScript Compilation Tasks (${totalTasks} task${totalTasks !== 1 ? 's' : ''}):`);
 | 
			
		||||
  Object.entries(globStringObjectArg).forEach(([source, dest]) => {
 | 
			
		||||
    console.log(`  📂 ${source} → ${dest}`);
 | 
			
		||||
  });
 | 
			
		||||
@@ -153,7 +168,16 @@ export let compileGlobStringObject = async (
 | 
			
		||||
      };
 | 
			
		||||
      
 | 
			
		||||
      // Compile with error tracking
 | 
			
		||||
      const result = await compileFileArrayWithErrorTracking(absoluteFilePathArray, updatedTsOptions, argvArg);
 | 
			
		||||
      currentTask++;
 | 
			
		||||
      const taskInfo = {
 | 
			
		||||
        taskNumber: currentTask,
 | 
			
		||||
        totalTasks,
 | 
			
		||||
        sourcePattern: keyArg,
 | 
			
		||||
        destDir: globStringObjectArg[keyArg],
 | 
			
		||||
        fileCount: absoluteFilePathArray.length
 | 
			
		||||
      };
 | 
			
		||||
      
 | 
			
		||||
      const result = await compileFileArrayWithErrorTracking(absoluteFilePathArray, updatedTsOptions, argvArg, taskInfo);
 | 
			
		||||
      compiledFiles = compiledFiles.concat(result.emittedFiles);
 | 
			
		||||
      errorSummaries.push(result.errorSummary);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user