@@ -9,20 +9,17 @@ import {
9
9
getAuthorizationServerOrigin ,
10
10
isBuilderUrl ,
11
11
} from "./app/shared/router-utils/origins" ;
12
- import { readFileSync , readdirSync , existsSync } from "node:fs" ;
12
+ import { readFileSync , existsSync } from "node:fs" ;
13
+ import fg from "fast-glob" ;
13
14
14
- const isFolderEmpty = ( folderPath : string ) => {
15
- if ( ! existsSync ( folderPath ) ) {
16
- return true ; // Folder does not exist
17
- }
18
- const contents = readdirSync ( folderPath ) ;
19
-
20
- return contents . length === 0 ;
21
- } ;
15
+ const rootDir = [ ".." , "../.." , "../../.." ]
16
+ . map ( ( dir ) => path . join ( __dirname , dir ) )
17
+ . find ( ( dir ) => existsSync ( path . join ( dir , ".git" ) ) ) ;
22
18
23
- const hasPrivateFolders = ! isFolderEmpty (
24
- path . join ( __dirname , "../../packages/sdk-components-animation/private-src" )
25
- ) ;
19
+ const hasPrivateFolders =
20
+ fg . sync ( [ path . join ( rootDir ?? "" , "packages/*/private-src/*" ) ] , {
21
+ ignore : [ "**/node_modules/**" ] ,
22
+ } ) . length > 0 ;
26
23
27
24
export default defineConfig ( ( { mode } ) => {
28
25
if ( mode === "test" ) {
0 commit comments