File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ const Debug = require ( 'debug' ) ;
3
4
const { Arborist } = require ( '@npmcli/arborist' ) ;
4
5
const Fs = require ( 'fs' ) ;
5
6
const Path = require ( 'path' ) ;
@@ -11,6 +12,9 @@ const Utils = require('./utils');
11
12
const internals = { } ;
12
13
13
14
15
+ internals . log = Debug ( 'detect-node-support' ) ;
16
+
17
+
14
18
internals . walk = ( node , callback ) => {
15
19
16
20
callback ( node ) ;
@@ -103,14 +107,22 @@ internals.tryLoad = async (loadFile, filename) => {
103
107
exports . detect = async ( { packageJson, loadFile } , options ) => {
104
108
105
109
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' ) ;
106
111
107
112
const versions = await internals . resolve ( { packageJson, lockfile } , options ) ;
108
113
109
114
const support = [ ] ;
110
115
const errors = { } ;
111
116
let hasErrors = false ;
112
117
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
+
114
126
try {
115
127
const { result } = await Package . detect ( { packageName } ) ;
116
128
support . push ( result ) ;
Original file line number Diff line number Diff line change 38
38
"@hapi/wreck" : " ^17.0.0" ,
39
39
"@npmcli/arborist" : " 0.0.0-pre.14" ,
40
40
"@pkgjs/nv" : " 0.0.3" ,
41
+ "debug" : " ^4.1.1" ,
41
42
"git-url-parse" : " ^11.1.2" ,
42
43
"js-yaml" : " ^3.13.1" ,
43
44
"minimist" : " ^1.2.5" ,
You can’t perform that action at this time.
0 commit comments