@@ -82,14 +82,12 @@ class EnvironmentTestRunner {
8282 * Copy a directory from src to dest, excluding files that match the excludePatterns
8383 * @param src - The source directory
8484 * @param dest - The destination directory
85- * @param excludePatterns - An array of file names to exclude from the copy (only at the top level)
86- * @param isTopLevel - Whether this is the top level call (used to only apply excludePatterns at root)
85+ * @param excludePatterns - An array of file names to exclude from the copy
8786 */
8887 private async copyDirectory (
8988 src : string ,
9089 dest : string ,
91- excludePatterns : string [ ] = [ ] ,
92- isTopLevel : boolean = true
90+ excludePatterns : string [ ] = [ ]
9391 ) : Promise < void > {
9492 await fs . mkdir ( dest , { recursive : true } ) ;
9593
@@ -100,17 +98,13 @@ class EnvironmentTestRunner {
10098 const srcPath = path . join ( src , entry . name ) ;
10199 const destPath = path . join ( dest , entry . name ) ;
102100
103- // Skip excluded patterns only at the top level
104- // This allows dist/node_modules (bundled dependencies) to be copied
105- if (
106- isTopLevel &&
107- excludePatterns . some ( ( pattern ) => entry . name === pattern )
108- ) {
101+ // Skip excluded patterns
102+ if ( excludePatterns . some ( ( pattern ) => entry . name === pattern ) ) {
109103 return ;
110104 }
111105
112106 if ( entry . isDirectory ( ) ) {
113- await this . copyDirectory ( srcPath , destPath , excludePatterns , false ) ;
107+ await this . copyDirectory ( srcPath , destPath , excludePatterns ) ;
114108 } else {
115109 await fs . copyFile ( srcPath , destPath ) ;
116110 }
@@ -233,10 +227,12 @@ class EnvironmentTestRunner {
233227 return ;
234228 }
235229
236- const destDirName : string =
237- pkg . name === "langchain"
238- ? "langchain"
239- : pkg . name . replace ( "@langchain/" , "langchain-" ) ;
230+ let destDirName : string ;
231+ if ( pkg . name === "langchain" ) {
232+ destDirName = "langchain" ;
233+ } else {
234+ destDirName = pkg . name . replace ( "@langchain/" , "langchain-" ) ;
235+ }
240236 const destDir = path . join ( libsDir , destDirName ) ;
241237 await fs . mkdir ( destDir , { recursive : true } ) ;
242238
0 commit comments