File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ const Debug = require ( 'debug' ) ;
34const { Arborist } = require ( '@npmcli/arborist' ) ;
45const Fs = require ( 'fs' ) ;
56const Path = require ( 'path' ) ;
@@ -11,6 +12,9 @@ const Utils = require('./utils');
1112const internals = { } ;
1213
1314
15+ internals . log = Debug ( 'detect-node-support' ) ;
16+
17+
1418internals . walk = ( node , callback ) => {
1519
1620 callback ( node ) ;
@@ -103,14 +107,22 @@ internals.tryLoad = async (loadFile, filename) => {
103107exports . detect = async ( { packageJson, loadFile } , options ) => {
104108
105109 const lockfile = ( await internals . tryLoad ( loadFile , 'package-lock.json' ) ) || ( await internals . tryLoad ( loadFile , 'npm-shrinkwrap.json' ) ) ;
110+ internals . log ( lockfile ? 'Lock file present' : 'Lock file missing - things will be a bit slower' ) ;
106111
107112 const versions = await internals . resolve ( { packageJson, lockfile } , options ) ;
108113
109114 const support = [ ] ;
110115 const errors = { } ;
111116 let hasErrors = false ;
112117
113- for ( const packageName of Object . keys ( versions ) . sort ( ) ) {
118+ const packages = Object . keys ( versions ) . sort ( ) ;
119+ const n = packages . length ;
120+
121+ for ( let i = 0 ; i < n ; ++ i ) {
122+
123+ const packageName = packages [ i ] ;
124+ internals . log ( `Resolving dependency ${ i + 1 } of ${ n } : ${ packageName } ` ) ;
125+
114126 try {
115127 const { result } = await Package . detect ( { packageName } ) ;
116128 support . push ( result ) ;
Original file line number Diff line number Diff line change 3838 "@hapi/wreck" : " ^17.0.0" ,
3939 "@npmcli/arborist" : " 0.0.0-pre.14" ,
4040 "@pkgjs/nv" : " 0.0.3" ,
41+ "debug" : " ^4.1.1" ,
4142 "git-url-parse" : " ^11.1.2" ,
4243 "js-yaml" : " ^3.13.1" ,
4344 "minimist" : " ^1.2.5" ,
You can’t perform that action at this time.
0 commit comments