@@ -458,7 +458,13 @@ def _maybe(repo_rule, name, **kwargs):
458458 . filter ( f => ! f . startsWith ( '.' ) )
459459 . map ( f => path . posix . join ( p , f ) )
460460 . filter ( f => isDirectory ( f ) ) ;
461- packages . forEach ( f => pkgs . push ( parsePackage ( f ) , ...findPackages ( path . posix . join ( f , 'node_modules' ) ) ) ) ;
461+ packages . forEach ( f => {
462+ let hide = true ;
463+ if ( fs . lstatSync ( f ) . isSymbolicLink ( ) ) {
464+ hide = false ;
465+ }
466+ pkgs . push ( parsePackage ( f , hide ) , ...findPackages ( path . posix . join ( f , 'node_modules' ) ) ) ;
467+ } ) ;
462468 const scopes = listing . filter ( f => f . startsWith ( '@' ) )
463469 . map ( f => path . posix . join ( p , f ) )
464470 . filter ( f => isDirectory ( f ) ) ;
@@ -486,7 +492,7 @@ def _maybe(repo_rule, name, **kwargs):
486492 * package json and return it as an object along with
487493 * some additional internal attributes prefixed with '_'.
488494 */
489- function parsePackage ( p ) {
495+ function parsePackage ( p , hide = true ) {
490496 // Parse the package.json file of this package
491497 const packageJson = path . posix . join ( p , 'package.json' ) ;
492498 const pkg = isFile ( packageJson ) ? JSON . parse ( fs . readFileSync ( packageJson , { encoding : 'utf8' } ) ) :
@@ -509,7 +515,8 @@ def _maybe(repo_rule, name, **kwargs):
509515 // Hide bazel files in this package. We do this before parsing
510516 // the next package to prevent issues caused by symlinks between
511517 // package and nested packages setup by the package manager.
512- hideBazelFiles ( pkg ) ;
518+ if ( hide )
519+ hideBazelFiles ( pkg ) ;
513520 return pkg ;
514521 }
515522 /**
0 commit comments