@@ -248,31 +248,42 @@ export interface ServerConfig {
248248 const sharedUtilsModule = result . Modules [ '@test/shared-utils' ] ;
249249 expect ( sharedUtilsModule ) . toBeDefined ( ) ;
250250 expect ( sharedUtilsModule . Packages ) . toBeDefined ( ) ;
251- expect ( sharedUtilsModule . Packages . src ) . toBeDefined ( ) ;
251+
252+ // Collect all functions, types, and vars from all file-based packages
253+ const allFunctions : Record < string , any > = { } ;
254+ const allTypes : Record < string , any > = { } ;
255+ const allVars : Record < string , any > = { } ;
256+
257+ Object . values ( sharedUtilsModule . Packages ) . forEach ( ( pkg : any ) => {
258+ if ( pkg . Functions ) Object . assign ( allFunctions , pkg . Functions ) ;
259+ if ( pkg . Types ) Object . assign ( allTypes , pkg . Types ) ;
260+ if ( pkg . Vars ) Object . assign ( allVars , pkg . Vars ) ;
261+ } ) ;
252262
253263 // Verify functions are parsed
254- const sharedUtilsFunctions = sharedUtilsModule . Packages . src . Functions ;
255- expect ( sharedUtilsFunctions ) . toBeDefined ( ) ;
256- expect ( sharedUtilsFunctions [ 'formatMessage' ] ) . toBeDefined ( ) ;
257- expect ( sharedUtilsFunctions [ 'capitalize' ] ) . toBeDefined ( ) ;
258- expect ( sharedUtilsFunctions [ 'formatDate' ] ) . toBeDefined ( ) ;
259- expect ( sharedUtilsFunctions [ 'addDays' ] ) . toBeDefined ( ) ;
264+ expect ( allFunctions [ 'formatMessage' ] ) . toBeDefined ( ) ;
265+ expect ( allFunctions [ 'capitalize' ] ) . toBeDefined ( ) ;
266+ expect ( allFunctions [ 'formatDate' ] ) . toBeDefined ( ) ;
267+ expect ( allFunctions [ 'addDays' ] ) . toBeDefined ( ) ;
260268
261269 // Verify types are parsed
262- const sharedUtilsTypes = sharedUtilsModule . Packages . src . Types ;
263- expect ( sharedUtilsTypes ) . toBeDefined ( ) ;
264- expect ( sharedUtilsTypes [ 'StringOptions' ] ) . toBeDefined ( ) ;
270+ expect ( allTypes [ 'StringOptions' ] ) . toBeDefined ( ) ;
265271
266272 // Verify variables are parsed
267- const sharedUtilsVars = sharedUtilsModule . Packages . src . Vars ;
268- expect ( sharedUtilsVars ) . toBeDefined ( ) ;
269- expect ( sharedUtilsVars [ 'SHARED_CONSTANTS' ] ) . toBeDefined ( ) ;
273+ expect ( allVars [ 'SHARED_CONSTANTS' ] ) . toBeDefined ( ) ;
270274
271275 // Verify api-server module
272276 const apiServerModule = result . Modules [ '@test/api-server' ] ;
273277 expect ( apiServerModule ) . toBeDefined ( ) ;
274- expect ( apiServerModule . Packages . src . Types [ 'ApiServer' ] ) . toBeDefined ( ) ;
275- expect ( apiServerModule . Packages . src . Types [ 'ServerConfig' ] ) . toBeDefined ( ) ;
278+
279+ // Collect types from api-server packages
280+ const apiServerTypes : Record < string , any > = { } ;
281+ Object . values ( apiServerModule . Packages ) . forEach ( ( pkg : any ) => {
282+ if ( pkg . Types ) Object . assign ( apiServerTypes , pkg . Types ) ;
283+ } ) ;
284+
285+ expect ( apiServerTypes [ 'ApiServer' ] ) . toBeDefined ( ) ;
286+ expect ( apiServerTypes [ 'ServerConfig' ] ) . toBeDefined ( ) ;
276287
277288 // Verify dependency graph includes cross-package dependencies
278289 expect ( result . Graph ) . toBeDefined ( ) ;
@@ -476,7 +487,14 @@ export class WebApplication {
476487
477488 // Verify inheritance is captured
478489 const uiModule = result . Modules [ '@test/ui-components' ] ;
479- const uiServiceType = uiModule . Packages . src . Types [ 'UIService' ] ;
490+
491+ // Collect types from all ui-components packages
492+ const uiTypes : Record < string , any > = { } ;
493+ Object . values ( uiModule . Packages ) . forEach ( ( pkg : any ) => {
494+ if ( pkg . Types ) Object . assign ( uiTypes , pkg . Types ) ;
495+ } ) ;
496+
497+ const uiServiceType = uiTypes [ 'UIService' ] ;
480498 expect ( uiServiceType ) . toBeDefined ( ) ;
481499 expect ( uiServiceType . Exported ) . toBe ( true ) ;
482500
@@ -668,18 +686,34 @@ export function createButton(props: ComponentProps): string {
668686 // Verify core module structure
669687 const coreModule = result . Modules [ '@test/core' ] ;
670688 expect ( coreModule ) . toBeDefined ( ) ;
671- expect ( coreModule . Packages . src ) . toBeDefined ( ) ;
672- expect ( coreModule . Packages . src . Types [ 'Config' ] ) . toBeDefined ( ) ;
673- expect ( coreModule . Packages . src . Types [ 'BaseService' ] ) . toBeDefined ( ) ;
674- expect ( coreModule . Packages . src . Functions [ 'createConfig' ] ) . toBeDefined ( ) ;
689+
690+ // Collect types and functions from all core packages
691+ const coreTypes : Record < string , any > = { } ;
692+ const coreFunctions : Record < string , any > = { } ;
693+ Object . values ( coreModule . Packages ) . forEach ( ( pkg : any ) => {
694+ if ( pkg . Types ) Object . assign ( coreTypes , pkg . Types ) ;
695+ if ( pkg . Functions ) Object . assign ( coreFunctions , pkg . Functions ) ;
696+ } ) ;
697+
698+ expect ( coreTypes [ 'Config' ] ) . toBeDefined ( ) ;
699+ expect ( coreTypes [ 'BaseService' ] ) . toBeDefined ( ) ;
700+ expect ( coreFunctions [ 'createConfig' ] ) . toBeDefined ( ) ;
675701
676702 // Verify UI module structure and dependencies
677703 const uiModule = result . Modules [ '@test/ui' ] ;
678704 expect ( uiModule ) . toBeDefined ( ) ;
679- expect ( uiModule . Packages . src ) . toBeDefined ( ) ;
680- expect ( uiModule . Packages . src . Types [ 'UIService' ] ) . toBeDefined ( ) ;
681- expect ( uiModule . Packages . src . Types [ 'ComponentProps' ] ) . toBeDefined ( ) ;
682- expect ( uiModule . Packages . src . Functions [ 'createButton' ] ) . toBeDefined ( ) ;
705+
706+ // Collect types and functions from all ui packages
707+ const uiTypes : Record < string , any > = { } ;
708+ const uiFunctions : Record < string , any > = { } ;
709+ Object . values ( uiModule . Packages ) . forEach ( ( pkg : any ) => {
710+ if ( pkg . Types ) Object . assign ( uiTypes , pkg . Types ) ;
711+ if ( pkg . Functions ) Object . assign ( uiFunctions , pkg . Functions ) ;
712+ } ) ;
713+
714+ expect ( uiTypes [ 'UIService' ] ) . toBeDefined ( ) ;
715+ expect ( uiTypes [ 'ComponentProps' ] ) . toBeDefined ( ) ;
716+ expect ( uiFunctions [ 'createButton' ] ) . toBeDefined ( ) ;
683717
684718 // Verify cross-module dependencies in graph
685719 const graphKeys = Object . keys ( result . Graph ) ;
@@ -936,12 +970,26 @@ export class UserService {
936970
937971 // Verify inheritance chains are captured
938972 const domainModule = result . Modules [ '@complex/domain' ] ;
939- const userType = domainModule . Packages . src . Types [ 'User' ] ;
973+
974+ // Collect types from all domain packages
975+ const domainTypes : Record < string , any > = { } ;
976+ Object . values ( domainModule . Packages ) . forEach ( ( pkg : any ) => {
977+ if ( pkg . Types ) Object . assign ( domainTypes , pkg . Types ) ;
978+ } ) ;
979+
980+ const userType = domainTypes [ 'User' ] ;
940981 expect ( userType ) . toBeDefined ( ) ;
941982 expect ( userType . Exported ) . toBe ( true ) ;
942983
943984 const serviceModule = result . Modules [ '@complex/service' ] ;
944- const userServiceType = serviceModule . Packages . src . Types [ 'UserService' ] ;
985+
986+ // Collect types from all service packages
987+ const serviceTypes : Record < string , any > = { } ;
988+ Object . values ( serviceModule . Packages ) . forEach ( ( pkg : any ) => {
989+ if ( pkg . Types ) Object . assign ( serviceTypes , pkg . Types ) ;
990+ } ) ;
991+
992+ const userServiceType = serviceTypes [ 'UserService' ] ;
945993 expect ( userServiceType ) . toBeDefined ( ) ;
946994
947995 // Verify complex dependency graph
@@ -1218,7 +1266,7 @@ export const DEFAULT_VALUE = 'test';
12181266 . mockImplementation ( ( ) => { } ) ;
12191267
12201268 // Test without specifying monorepoMode (should default to combined)
1221- const result = await parser . parseRepository ( testProject . rootDir , { } ) ;
1269+ await parser . parseRepository ( testProject . rootDir , { } ) ;
12221270
12231271 // Verify combined mode was called (default behavior)
12241272 expect ( parseMonorepoCombinedModeSpy ) . toHaveBeenCalled ( ) ;
0 commit comments