@@ -449,6 +449,7 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
449
449
var typings = getDefinitionsForNodeModules ( dir , project . files ) ;
450
450
project . files = project . files . concat ( typings . implicit ) ;
451
451
project . typings = typings . ours . concat ( typings . implicit ) ;
452
+ project . files = project . files . concat ( typings . packagejson ) ;
452
453
453
454
// Normalize to "/" for all files
454
455
// And take the uniq values
@@ -575,8 +576,9 @@ interface Typings {
575
576
* We will expand on files making sure that we don't have a `typing` with the same name
576
577
* Also if two node_modules reference a similar sub project (and also recursively) then the one with latest `version` field wins
577
578
*/
578
- function getDefinitionsForNodeModules ( projectDir : string , files : string [ ] ) : { ours : string [ ] ; implicit : string [ ] } {
579
-
579
+ function getDefinitionsForNodeModules ( projectDir : string , files : string [ ] ) : { ours : string [ ] ; implicit : string [ ] , packagejson : string [ ] } {
580
+ let packagejson = [ ] ;
581
+
580
582
/** TODO use later when we care about versions */
581
583
function versionStringToNumber ( version : string ) : number {
582
584
var [ maj , min , patch ] = version . split ( '.' ) ;
@@ -636,6 +638,7 @@ function getDefinitionsForNodeModules(projectDir: string, files: string[]): { ou
636
638
for ( let moduleDir of moduleDirs ) {
637
639
try {
638
640
var package_json = JSON . parse ( fs . readFileSync ( `${ moduleDir } /package.json` ) . toString ( ) ) ;
641
+ packagejson . push ( `${ moduleDir } /package.json` ) ;
639
642
}
640
643
catch ( ex ) {
641
644
// Can't read package.json ... no worries ... move on to other modules
@@ -674,7 +677,7 @@ function getDefinitionsForNodeModules(projectDir: string, files: string[]): { ou
674
677
var ours = all
675
678
. filter ( x => existing [ x ] ) ;
676
679
677
- return { implicit, ours } ;
680
+ return { implicit, ours, packagejson } ;
678
681
}
679
682
680
683
export function prettyJSON ( object : any ) : string {
0 commit comments