Skip to content

Commit 3b93727

Browse files
committed
Output debug info to build logs instead of file
- Log existing v4 cache files for comparison - Log HTML in 800-char chunks to avoid truncation - This way we can compare build logs to see what's changing
1 parent eba9346 commit 3b93727

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

scripts/generate-md-exports.mjs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,18 @@ async function genMDFromHTML(source, target, {cacheDir, noCache, usedCacheFiles}
286286
console.log(` Looking for cache key: ${cacheKey}`);
287287
console.log(` HTML length: ${leanHTML.length} chars`);
288288

289-
// Save the first 2000 chars to a temp file so we can diff between builds
290-
const debugFile = path.join(cacheDir, '..', 'debug-first-miss.txt');
291-
writeFile(debugFile, `${source}\n${cacheKey}\n${leanHTML.substring(0, 2000)}`, {
292-
encoding: 'utf8',
293-
}).catch(() => {});
294-
console.log(` Saved first 2000 chars to ${debugFile} for comparison`);
289+
// List a few cache files that exist to compare
290+
try {
291+
const existingFiles = await readdir(cacheDir);
292+
const v4Files = existingFiles.filter(f => f.startsWith('v4_')).slice(0, 5);
293+
console.log(` Existing v4 cache files: ${v4Files.join(', ')}`);
294+
} catch (e) {
295+
// Ignore
296+
}
297+
298+
// Log HTML in chunks to avoid truncation
299+
console.log(` HTML chunk 1 (0-800): ${leanHTML.substring(0, 800)}`);
300+
console.log(` HTML chunk 2 (800-1600): ${leanHTML.substring(800, 1600)}`);
295301
}
296302
}
297303
}

0 commit comments

Comments
 (0)