diff --git a/changelog.md b/changelog.md index d270c82..8205811 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-03-05 - 4.1.6 - fix(mod_compiler) +add diagnostic logging to report dist_ts and output directory contents after each compilation task and after import-path rewriting + +- Adds DIAG-CROSSTASK logs to inspect dist_ts subdirectories after each task when not in quiet or JSON mode +- Adds DIAG-FINAL logs to report directory names and file counts for each successful output dir after import-path rewriting +- Diagnostics use dynamic fs import and are non-intrusive: gated by isQuiet/isJson and errors are ignored + ## 2026-03-05 - 4.1.5 - fix(diagnostics) add diagnostic logging around compilation and unpack to aid troubleshooting diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index a8c261c..d355d21 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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.' } diff --git a/ts/mod_compiler/classes.tscompiler.ts b/ts/mod_compiler/classes.tscompiler.ts index 5f61c0a..482b3f1 100644 --- a/ts/mod_compiler/classes.tscompiler.ts +++ b/ts/mod_compiler/classes.tscompiler.ts @@ -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);