@@ -160,8 +160,15 @@ export class DependencyTree {
160
160
// The files to gather dependencies for
161
161
// by default globbing is used to find files from rootDirs
162
162
filesToProcess,
163
+ // All files collected
164
+ // by default globbing is used to find files from rootDirs
165
+ allFilesToProcess,
163
166
batchSize = 10 ,
164
- } : { batchSize ?: number ; filesToProcess ?: readonly string [ ] } = { } ) : Promise < {
167
+ } : {
168
+ batchSize ?: number ;
169
+ filesToProcess ?: readonly string [ ] ;
170
+ allFilesToProcess ?: readonly string [ ] ;
171
+ } = { } ) : Promise < {
165
172
missing : FileToDeps ;
166
173
resolved : FileToDeps ;
167
174
} > {
@@ -173,12 +180,17 @@ export class DependencyTree {
173
180
174
181
const fileToDeps : FileToDeps = new Map ( ) ;
175
182
const missing : FileToDeps = new Map ( ) ;
176
- const files = filesToProcess ?? this . getFiles ( ) ;
183
+ const allFiles = allFilesToProcess ?? this . getFiles ( ) ;
184
+ const files = filesToProcess ?? allFiles ;
177
185
info ( `Found a total of ${ files . length } source files` ) ;
178
186
179
187
const getDepsForFilesTasks = files . map ( ( file : string ) => async ( ) => {
180
188
info ( 'Scanning %s' , file ) ;
181
- const importedFiles = await this . getImportedFiles ( file , missing , files ) ;
189
+ const importedFiles = await this . getImportedFiles (
190
+ file ,
191
+ missing ,
192
+ allFiles ,
193
+ ) ;
182
194
fileToDeps . set ( file , importedFiles ) ;
183
195
} ) ;
184
196
@@ -289,7 +301,7 @@ export class DependencyTree {
289
301
*
290
302
* @returns {string[] } An array of found files (absolute paths)
291
303
*/
292
- private getFiles ( ) : readonly Path [ ] {
304
+ getFiles ( ) : readonly Path [ ] {
293
305
const supportedFileTypes = new Set (
294
306
this . fileProcessors . reduce (
295
307
( acc , processor ) => [ ...acc , ...processor . supportedFileTypes ( ) ] ,
0 commit comments