This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @canva/dependency-tree" ,
3
- "version" : " 3.1.6 " ,
3
+ "version" : " 3.1.7 " ,
4
4
"description" : " Calculates a dependency tree for set of files" ,
5
5
"main" : " dist/index.js" ,
6
6
"author" : " Canva Pty Ltd" ,
Original file line number Diff line number Diff line change @@ -157,8 +157,11 @@ export class DependencyTree {
157
157
* Built-in (Node) and package dependencies are ignored.
158
158
*/
159
159
public async gather ( {
160
+ // The files to gather dependencies for
161
+ // by default globbing is used to find files from rootDirs
162
+ filesToProcess,
160
163
batchSize = 10 ,
161
- } : { batchSize ?: number } = { } ) : Promise < {
164
+ } : { batchSize ?: number ; filesToProcess ?: readonly string [ ] } = { } ) : Promise < {
162
165
missing : FileToDeps ;
163
166
resolved : FileToDeps ;
164
167
} > {
@@ -170,7 +173,7 @@ export class DependencyTree {
170
173
171
174
const fileToDeps : FileToDeps = new Map ( ) ;
172
175
const missing : FileToDeps = new Map ( ) ;
173
- const files = this . getFiles ( ) ;
176
+ const files = filesToProcess ?? this . getFiles ( ) ;
174
177
info ( `Found a total of ${ files . length } source files` ) ;
175
178
176
179
const getDepsForFilesTasks = files . map ( ( file : string ) => async ( ) => {
You can’t perform that action at this time.
0 commit comments