release: WRNexusJS 0.2.78

This commit is contained in:
2026-07-22 01:53:18 +05:30
parent 7ff5b3e8c5
commit c6fc0f1f63
60 changed files with 228 additions and 96 deletions
+23 -1
View File
@@ -106,6 +106,28 @@ function entriesOf(dir: string, m: Record<string, any>): Record<string, string>
return map;
}
function removeDirectoryWithRetry(path: string): void {
try {
rmSync(path, {
recursive: true,
force: true,
maxRetries: 10,
retryDelay: 300,
});
} catch (error) {
const code = error && typeof error === "object" && "code" in error ? String(error.code) : "";
if (code === "EBUSY" || code === "EPERM") {
throw new Error(
`Unable to clean ${path}. Close any Explorer window, editor, terminal, antivirus scan, or process using this directory, then retry.`,
{ cause: error },
);
}
throw error;
}
}
/** Rewrite the manifest for publishing. */
function publishManifest(m: Record<string, any>, version: string): Record<string, any> {
const js = (ts: string) => "./dist/" + ts.replace(/^\.?\/?src\//, "").replace(/\.ts$/, ".js");
@@ -165,7 +187,7 @@ async function main() {
console.error("No @wrnexus packages matched.");
process.exit(1);
}
rmSync(stageRoot, { recursive: true, force: true });
removeDirectoryWithRetry(stageRoot);
mkdirSync(stageRoot, { recursive: true });
const order: string[] = [];