fix(mod_compiler): add diagnostic logging to report dist_ts and output directory contents after each compilation task and after import-path rewriting
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsbuild',
|
||||
version: '4.1.5',
|
||||
version: '4.1.6',
|
||||
description: 'A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.'
|
||||
}
|
||||
|
||||
@@ -394,6 +394,19 @@ export class TsCompiler {
|
||||
|
||||
successfulOutputDirs.push(destDir);
|
||||
}
|
||||
|
||||
// DIAGNOSTIC: Check dist_ts after each task (not just current destDir)
|
||||
if (!isQuiet && !isJson) {
|
||||
try {
|
||||
const fs = await import('fs');
|
||||
const distTsPath = require('path').join(this.cwd, 'dist_ts');
|
||||
if (fs.existsSync(distTsPath)) {
|
||||
const dirEntries = fs.readdirSync(distTsPath, { withFileTypes: true });
|
||||
const dirs = dirEntries.filter((e: any) => e.isDirectory()).map((e: any) => e.name).sort();
|
||||
console.log(` 📋 [DIAG-CROSSTASK] dist_ts after task ${currentTask}: ${dirs.length} dirs [${dirs.join(', ')}]`);
|
||||
}
|
||||
} catch (e: any) { /* ignore */ }
|
||||
}
|
||||
}
|
||||
|
||||
// Rewrite import paths in all output directories to handle cross-module references
|
||||
@@ -410,6 +423,20 @@ export class TsCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
// DIAGNOSTIC: Check dist_ts after path rewriting
|
||||
if (!isQuiet && !isJson) {
|
||||
for (const outputDir of successfulOutputDirs) {
|
||||
try {
|
||||
const fs = await import('fs');
|
||||
const dirEntries = fs.readdirSync(outputDir, { withFileTypes: true });
|
||||
const dirs = dirEntries.filter((e: any) => e.isDirectory()).map((e: any) => e.name).sort();
|
||||
const fileCount = dirEntries.filter((e: any) => e.isFile()).length;
|
||||
const relDir = outputDir.replace(this.cwd, '').replace(/^\//, '');
|
||||
console.log(` 📋 [DIAG-FINAL] ${relDir}: ${dirs.length} dirs [${dirs.join(', ')}], ${fileCount} files`);
|
||||
} catch (e: any) { console.log(` 📋 [DIAG-FINAL] Error: ${e.message}`); }
|
||||
}
|
||||
}
|
||||
|
||||
// Merge all error summaries
|
||||
const finalErrorSummary = this.mergeErrorSummaries(errorSummaries);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user