Compare commits

...

8 Commits

6 changed files with 63 additions and 11 deletions

View File

@@ -1,5 +1,34 @@
# Changelog
## 2026-03-05 - 4.1.7 - fix(fs/compiler/unpack)
robustify directory removal and remove noisy diagnostic logging
- Use fs.promises.rm with force, maxRetries and retryDelay in removeDirectory to reduce intermittent failures during removals.
- Handle ENOTEMPTY in removeEmptyDirectory by falling back to a recursive rm and ignore ENOENT to avoid errors from transient filesystem metadata lag.
- Remove several diagnostic/verbose console logs in the compiler and unpacker paths to reduce noisy output and simplify flow.
- Short-circuit unpack logic when no nesting is detected to avoid unnecessary work and logs.
- No public API or behavior-breaking changes; suitable for a patch release.
## 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
- Enable TypeScript CompilerOptions.listEmittedFiles to surface emitted file info
- Log destination directory contents and emitted file/error counts after compile and after unpack (only when not quiet and not json)
- Add unpack-specific diagnostic logs: shouldUnpack skip, detectNesting result and nestedPath, and nested/destination directory listings before removing sibling directories
- All logs use console.log and are wrapped in try/catch to avoid throwing; changes are informational and non-breaking
## 2026-03-05 - 4.1.4 - fix(deps)
bump @git.zone/tspublish dependency to ^1.11.2
- Updated @git.zone/tspublish from ^1.11.0 to ^1.11.2 in package.json
## 2026-03-04 - 4.1.3 - fix(deps)
bump dependencies: @push.rocks/smartcli, @push.rocks/smartlog, @git.zone/tstest, and @types/node to their newer versions

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tsbuild",
"version": "4.1.3",
"version": "4.1.7",
"private": false,
"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",
@@ -36,7 +36,7 @@
},
"homepage": "https://code.foss.global/git.zone/tsbuild#README",
"dependencies": {
"@git.zone/tspublish": "^1.11.0",
"@git.zone/tspublish": "^1.11.2",
"@push.rocks/early": "^4.0.4",
"@push.rocks/smartcli": "^4.0.20",
"@push.rocks/smartdelay": "^3.0.5",

23
pnpm-lock.yaml generated
View File

@@ -9,8 +9,8 @@ importers:
.:
dependencies:
'@git.zone/tspublish':
specifier: ^1.11.0
version: 1.11.0
specifier: ^1.11.2
version: 1.11.2
'@push.rocks/early':
specifier: ^4.0.4
version: 4.0.4
@@ -627,8 +627,8 @@ packages:
resolution: {integrity: sha512-itXX/oiJjrRHUlIGTHUEqSwPuGwsG4Cq8kh7aqFOm8mYzJwtXYE1gBqLJTWZma6gI5n+xAk5qTxTyfikuPgWQA==}
hasBin: true
'@git.zone/tspublish@1.11.0':
resolution: {integrity: sha512-dkgaDBTzZJ53lAV72r7OW/W7l/KqpkncFuPojr11JO35OKAbjjDhZbAwPv4oGX9NplyXrhC5VJRPNX/orqNTHA==}
'@git.zone/tspublish@1.11.2':
resolution: {integrity: sha512-BcGap1OzXDgXpfQXMh9W17r/CkWNhPsJ3WzjG2wrGE+ePUJCJAm9w6+J8G5WdZZcZKPqTB07cp707LbSiksc5A==}
hasBin: true
'@git.zone/tsrun@2.0.1':
@@ -1087,6 +1087,9 @@ packages:
'@push.rocks/smartshell@3.3.6':
resolution: {integrity: sha512-ZJ53P5gri5FYgI/iLdqfM/uePptkbhmTS7/sugMXEEFd46MVLGAwu/DAmpHpBs6vdHoXXH3wOhNpSZNi3YG7kA==}
'@push.rocks/smartshell@3.3.7':
resolution: {integrity: sha512-b3st2+FjHUVhZZRlXfw93+SQA0UMVlURqe55uVpWdjJX7jeGXTTeszuYygtiR99zC5iZ8WZhGDct3N2L1qc/qw==}
'@push.rocks/smartsitemap@2.0.4':
resolution: {integrity: sha512-76dYWG/o/EjV4vYCK7ZKM35T9xgrI+oHEiiIE6E2MDaFIU6QnSfciTfbscH5nc0vxx8Ah+I0HPEJO94BM2S39w==}
@@ -4887,7 +4890,7 @@ snapshots:
- supports-color
- vue
'@git.zone/tspublish@1.11.0':
'@git.zone/tspublish@1.11.2':
dependencies:
'@push.rocks/consolecolor': 2.0.3
'@push.rocks/npmextra': 5.3.3
@@ -4899,7 +4902,7 @@ snapshots:
'@push.rocks/smartnpm': 2.0.6
'@push.rocks/smartpath': 6.0.0
'@push.rocks/smartrequest': 5.0.1
'@push.rocks/smartshell': 3.3.0
'@push.rocks/smartshell': 3.3.7
transitivePeerDependencies:
- '@nuxt/kit'
- aws-crt
@@ -5948,6 +5951,14 @@ snapshots:
tree-kill: 1.2.2
which: 6.0.1
'@push.rocks/smartshell@3.3.7':
dependencies:
'@push.rocks/smartdelay': 3.0.5
'@push.rocks/smartexit': 2.0.3
'@push.rocks/smartpromise': 4.2.3
'@types/which': 3.0.4
which: 6.0.1
'@push.rocks/smartsitemap@2.0.4':
dependencies:
'@push.rocks/smartcache': 1.0.18

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tsbuild',
version: '4.1.3',
version: '4.1.7',
description: 'A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.'
}

View File

@@ -349,6 +349,7 @@ export class TsCompiler {
const options: CompilerOptions = {
...customOptions,
outDir: destDir,
listEmittedFiles: true,
};
currentTask++;
@@ -367,8 +368,10 @@ export class TsCompiler {
// Perform unpack if compilation succeeded
if (result.errorSummary.totalErrors === 0) {
await performUnpack(pattern, destDir, this.cwd);
successfulOutputDirs.push(destDir);
}
}
// Rewrite import paths in all output directories to handle cross-module references

View File

@@ -125,7 +125,7 @@ export class FsHelpers {
* Remove a directory recursively
*/
public static async removeDirectory(dirPath: string): Promise<void> {
await fs.promises.rm(dirPath, { recursive: true });
await fs.promises.rm(dirPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
}
/**
@@ -139,6 +139,15 @@ export class FsHelpers {
* Remove an empty directory
*/
public static async removeEmptyDirectory(dirPath: string): Promise<void> {
await fs.promises.rmdir(dirPath);
try {
await fs.promises.rmdir(dirPath);
} catch (err: any) {
if (err.code === 'ENOTEMPTY') {
// Filesystem metadata lag — use recursive rm as fallback
await fs.promises.rm(dirPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
} else if (err.code !== 'ENOENT') {
throw err;
}
}
}
}