Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f5e4ad76e | |||
| 4feb074c03 | |||
| 95e4f1f036 | |||
| eaa66dff1d |
14
changelog.md
14
changelog.md
@@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-05 - 4.1.23 - fix(mod_unpack)
|
||||||
|
handle partial readdirSync results when moving nested directory entries and add diagnostic log
|
||||||
|
|
||||||
|
- Loop over readdirSync results until the nested directory is empty to avoid missing entries from partial reads
|
||||||
|
- Count moved entries and print a diagnostic message with the final destination entry count
|
||||||
|
- Keep removal of the now-empty nested directory (fs.rmdirSync) after moving contents
|
||||||
|
|
||||||
|
## 2026-03-05 - 4.1.22 - fix(mod_compiler)
|
||||||
|
improve logging of successful output directories to include a sorted list of entries and use a shortened relative path
|
||||||
|
|
||||||
|
- Adds shortDir variable to display relative path instead of repeating inline replace(this.cwd + '/')
|
||||||
|
- Appends a sorted, comma-separated list of directory entries to the log output for easier inspection
|
||||||
|
- Change located in ts/mod_compiler/classes.tscompiler.ts
|
||||||
|
|
||||||
## 2026-03-05 - 4.1.21 - fix(compiler)
|
## 2026-03-05 - 4.1.21 - fix(compiler)
|
||||||
log emitted files written outside expected destination directory for diagnostics
|
log emitted files written outside expected destination directory for diagnostics
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@git.zone/tsbuild",
|
"name": "@git.zone/tsbuild",
|
||||||
"version": "4.1.21",
|
"version": "4.1.23",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.",
|
"description": "A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsbuild',
|
name: '@git.zone/tsbuild',
|
||||||
version: '4.1.21',
|
version: '4.1.23',
|
||||||
description: 'A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.'
|
description: 'A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -345,7 +345,8 @@ export class TsCompiler {
|
|||||||
try {
|
try {
|
||||||
const entries = fs.readdirSync(prevDir);
|
const entries = fs.readdirSync(prevDir);
|
||||||
const dirs = entries.filter(e => { try { return fs.statSync(prevDir + '/' + e).isDirectory(); } catch { return false; } });
|
const dirs = entries.filter(e => { try { return fs.statSync(prevDir + '/' + e).isDirectory(); } catch { return false; } });
|
||||||
console.log(` 📋 [${label}] ${prevDir.replace(this.cwd + '/', '')}: ${entries.length} entries, ${dirs.length} dirs`);
|
const shortDir = prevDir.replace(this.cwd + '/', '');
|
||||||
|
console.log(` 📋 [${label}] ${shortDir}: ${entries.length} entries, ${dirs.length} dirs [${entries.sort().join(', ')}]`);
|
||||||
} catch {
|
} catch {
|
||||||
console.log(` 📋 [${label}] ${prevDir.replace(this.cwd + '/', '')}: MISSING!`);
|
console.log(` 📋 [${label}] ${prevDir.replace(this.cwd + '/', '')}: MISSING!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,17 +116,27 @@ export class TsUnpacker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Step 2: Move all contents from nested dir up to dest dir
|
// Step 2: Move all contents from nested dir up to dest dir
|
||||||
const nestedEntries = fs.readdirSync(nestedPath);
|
// Use a loop to handle any partial readdirSync results
|
||||||
for (const entry of nestedEntries) {
|
let moved = 0;
|
||||||
fs.renameSync(
|
while (true) {
|
||||||
path.join(nestedPath, entry),
|
const entries = fs.readdirSync(nestedPath);
|
||||||
path.join(this.destDir, entry),
|
if (entries.length === 0) break;
|
||||||
);
|
for (const entry of entries) {
|
||||||
|
fs.renameSync(
|
||||||
|
path.join(nestedPath, entry),
|
||||||
|
path.join(this.destDir, entry),
|
||||||
|
);
|
||||||
|
moved++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 3: Remove the now-empty nested directory
|
// Step 3: Remove the now-empty nested directory
|
||||||
fs.rmdirSync(nestedPath);
|
fs.rmdirSync(nestedPath);
|
||||||
|
|
||||||
|
// Diagnostic: verify final state
|
||||||
|
const finalEntries = fs.readdirSync(this.destDir);
|
||||||
|
console.log(` 📦 Unpacked ${this.sourceFolderName}: moved ${moved} entries, final: ${finalEntries.length} entries`);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user