From 8488d5b69b9a75cc5ad6ab85bb202a857a8d280a Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 24 Jul 2024 09:44:29 -0700 Subject: [PATCH] cr --- libs/langchain-scripts/src/build_v2.ts | 35 ++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/libs/langchain-scripts/src/build_v2.ts b/libs/langchain-scripts/src/build_v2.ts index 2b274d8f21e0..ca0fb305c901 100644 --- a/libs/langchain-scripts/src/build_v2.ts +++ b/libs/langchain-scripts/src/build_v2.ts @@ -639,11 +639,17 @@ export async function buildWithTSup() { // Clean & generate build files if (pre && shouldGenMaps) { await Promise.all([ - rimraf("dist").catch((e) => { + rimraf("dist", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing dist (pre && shouldGenMaps)"); throw e; }), - rimraf(".turbo").catch((e) => { + rimraf(".turbo", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing .turbo (pre && shouldGenMaps)"); throw e; }), @@ -654,11 +660,17 @@ export async function buildWithTSup() { ]); } else if (pre && !shouldGenMaps) { await Promise.all([ - rimraf("dist").catch((e) => { + rimraf("dist", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing dist (pre && !shouldGenMaps)"); throw e; }), - rimraf(".turbo").catch((e) => { + rimraf(".turbo", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing .turbo (pre && !shouldGenMaps)"); throw e; }), @@ -679,15 +691,24 @@ export async function buildWithTSup() { // move CJS to dist await Promise.all([ updatePackageJson(config), - rimraf("dist-cjs").catch((e) => { + rimraf("dist-cjs", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing dist-cjs"); throw e; }), - rimraf("dist/tests").catch((e) => { + rimraf("dist/tests", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing dist/tests"); throw e; }), - rimraf("dist/**/tests").catch((e) => { + rimraf("dist/**/tests", { + retryDelay: 1000, + maxRetries: 5, + }).catch((e) => { console.error("Error removing dist/**/tests"); throw e; }),