@@ -31,8 +31,8 @@ export class SchemaGenerator {
3131 rootType : this . nodeParser . createType ( rootNode , new Context ( ) ) ,
3232 } ) ) ;
3333
34- const rootTypeDefinition =
35- roots . length === 1 ? this . getRootTypeDefinition ( roots [ 0 ] . rootType , roots [ 0 ] . rootNode ) : undefined ;
34+ const rootTypeDefinitions = roots . map ( ( root ) => this . getRootTypeDefinition ( root . rootType , root . rootNode ) ) ;
35+ const rootTypeDefinition = rootTypeDefinitions . length === 1 ? rootTypeDefinitions [ 0 ] : undefined ;
3636 const definitions : StringMap < Definition > = { } ;
3737
3838 for ( const root of roots ) {
@@ -47,7 +47,10 @@ export class SchemaGenerator {
4747 }
4848 }
4949
50- const reachableDefinitions = removeUnreachable ( rootTypeDefinition , definitions ) ;
50+ const reachableDefinitions = rootTypeDefinitions . reduce < StringMap < Definition > > (
51+ ( acc , def ) => Object . assign ( acc , removeUnreachable ( def , definitions ) ) ,
52+ { } ,
53+ ) ;
5154
5255 return {
5356 ...( this . config ?. schemaId ? { $id : this . config . schemaId } : { } ) ,
@@ -229,11 +232,18 @@ export class SchemaGenerator {
229232 return ;
230233 }
231234
232- // export { variable } clauses
235+ if ( node . exportClause ) {
236+ // export { Foo } from './lib' or export { Foo };
237+ // export * as Foo from './lib' should not import all exports
238+ ts . forEachChild ( node . exportClause , ( subnode ) => this . inspectNode ( subnode , typeChecker , allTypes ) ) ;
239+ return ;
240+ }
241+
233242 if ( ! node . moduleSpecifier ) {
234243 return ;
235244 }
236245
246+ // export * from './lib'
237247 const symbol = typeChecker . getSymbolAtLocation ( node . moduleSpecifier ) ;
238248
239249 // should never hit this (maybe type error in user's code)
0 commit comments