@@ -1232,21 +1232,23 @@ function publish( pkg, clbk ) {
1232
1232
shell ( command , opts ) ;
1233
1233
}
1234
1234
1235
- // For all dependencies, check in *.js files if they are used in what will be published to npm; if not, remove them:
1236
- for ( dep in pkgJSON . dependencies ) {
1237
- if ( hasOwnProp ( pkgJSON . dependencies , dep ) ) {
1238
- escaped = replace ( dep , '@' , '\\@' ) ;
1239
- escaped = replace ( escaped , '/' , '\\/' ) ;
1240
- command = [
1241
- 'if ! find lib -name "*.js" -exec grep -q "' + escaped + '" {} + && ! grep -q -s "' + escaped + '" manifest.json && ! grep -q -s "' + escaped + '" include.gypi; then' ,
1242
- ' printf "false"' ,
1243
- 'else' ,
1244
- ' printf "true"' ,
1245
- 'fi'
1246
- ] . join ( '\n' ) ;
1247
- found = shell ( command , opts ) . toString ( ) ;
1248
- if ( found === 'false' && dep !== '@stdlib/error-tools-fmtprodmsg' ) {
1249
- delete pkgJSON . dependencies [ dep ] ;
1235
+ if ( ! isTopLevelNS ) {
1236
+ // For all dependencies, check in *.js files if they are used in what will be published to npm; if not, remove them:
1237
+ for ( dep in pkgJSON . dependencies ) {
1238
+ if ( hasOwnProp ( pkgJSON . dependencies , dep ) ) {
1239
+ escaped = replace ( dep , '@' , '\\@' ) ;
1240
+ escaped = replace ( escaped , '/' , '\\/' ) ;
1241
+ command = [
1242
+ 'if ! find lib -name "*.js" -exec grep -q "' + escaped + '" {} + && ! grep -q -s "' + escaped + '" manifest.json && ! grep -q -s "' + escaped + '" include.gypi; then' ,
1243
+ ' printf "false"' ,
1244
+ 'else' ,
1245
+ ' printf "true"' ,
1246
+ 'fi'
1247
+ ] . join ( '\n' ) ;
1248
+ found = shell ( command , opts ) . toString ( ) ;
1249
+ if ( found === 'false' && dep !== '@stdlib/error-tools-fmtprodmsg' ) {
1250
+ delete pkgJSON . dependencies [ dep ] ;
1251
+ }
1250
1252
}
1251
1253
}
1252
1254
}
0 commit comments