@@ -7,7 +7,6 @@ import assert, {AssertionError} from "assert";
7
7
import chalk from "chalk" ;
8
8
import { Parser } from "./parser.js" ;
9
9
import axios from "axios" ;
10
- import globby from "globby" ;
11
10
import path from "path" ;
12
11
import semver from "semver" ;
13
12
import { RE2JS } from "re2js" ;
@@ -93,7 +92,7 @@ export class ParserIncludes {
93
92
}
94
93
if ( value [ "local" ] ) {
95
94
validateIncludeLocal ( value [ "local" ] ) ;
96
- const files = resolveIncludeLocal ( value [ "local" ] , cwd ) ;
95
+ const files = await resolveIncludeLocal ( value [ "local" ] , cwd ) ;
97
96
if ( files . length == 0 ) {
98
97
throw new AssertionError ( { message : `Local include file cannot be found ${ value [ "local" ] } ` } ) ;
99
98
}
@@ -327,11 +326,11 @@ export class ParserIncludes {
327
326
328
327
static readonly memoLocalRepoFiles = ( ( ) => {
329
328
const cache = new Map < string , string [ ] > ( ) ;
330
- return ( path : string ) => {
329
+ return async ( path : string ) => {
331
330
let result = cache . get ( path ) ;
332
331
if ( typeof result !== "undefined" ) return result ;
333
332
334
- result = globby . sync ( path , { dot : true , gitignore : true } ) ;
333
+ result = ( await Utils . getTrackedFiles ( path ) ) . map ( p => ` ${ path } / ${ p } ` ) ;
335
334
cache . set ( path , result ) ;
336
335
return result ;
337
336
} ;
@@ -361,8 +360,8 @@ export function resolveSemanticVersionRange (range: string, gitTags: string[]) {
361
360
return found ;
362
361
}
363
362
364
- export function resolveIncludeLocal ( pattern : string , cwd : string ) {
365
- const repoFiles = ParserIncludes . memoLocalRepoFiles ( cwd ) ;
363
+ export async function resolveIncludeLocal ( pattern : string , cwd : string ) {
364
+ const repoFiles = await ParserIncludes . memoLocalRepoFiles ( cwd ) ;
366
365
367
366
if ( ! pattern . startsWith ( "/" ) ) pattern = `/${ pattern } ` ; // Ensure pattern starts with `/`
368
367
pattern = `${ cwd } ${ pattern } ` ;
0 commit comments