/** * @angular-modernizer/plugin-angular - Core and Shared Modules Orchestrator * * Orchestrator that analyzes and organizes Angular applications into proper * Core and Shared module architecture. * * Philosophy: "Thin Rule, Thick Orchestrator" * - The orchestrator contains all business logic * - The rule is a minimal protocol wrapper * - Complex analysis and AST manipulation happens here */ import type { TransformContext } from '@angular-modernizer/plugin-system'; import type { PublicApi } from '@angular-modernizer/api'; /** * Orchestrator for analyzing and organizing Core/Shared module architecture. * * @remarks * This orchestrator handles the complex logic for: * - Scanning the project for singleton services * - Identifying reusable components, directives, and pipes * - Analyzing module organization * - Creating or updating CoreModule * - Creating or updating SharedModule * - Generating organization reports and recommendations * * The orchestrator uses ts-morph for AST manipulation and Project-wide analysis. * * @public */ export declare class CoreSharedModulesOrchestrator { /** * Singleton service patterns (services that should be in Core). */ private readonly singletonServicePatterns; /** * Common reusable component patterns (components that should be in Shared). */ private readonly sharedComponentPatterns; /** * Run the Core/Shared modules organization on the given context. * * @param context - Transform context with source file and project access * @returns Organization report as string * * @public */ run(context: TransformContext): string; /** * Analyze the entire project for Core/Shared organization issues. * * @param project - The ts-morph Project instance * @returns Organization report * * @private */ private analyzeProject; /** * Check if a class is a service. * * @param classDecl - The class declaration * @returns true if the class is a service * * @private */ private isService; /** * Check if a class is a component. * * @param classDecl - The class declaration * @returns true if the class is a component * * @private */ private isComponent; /** * Check if a class is a directive. * * @param classDecl - The class declaration * @returns true if the class is a directive * * @private */ private isDirective; /** * Check if a class is a pipe. * * @param classDecl - The class declaration * @returns true if the class is a pipe * * @private */ private isPipe; /** * Check if a class is an NgModule. * * @param classDecl - The class declaration * @returns true if the class is an NgModule * * @private */ private isNgModule; /** * Analyze an NgModule to determine if it's a shared module. * * @param classDecl - The NgModule class declaration * @param filePath - Path to the file * @param project - The project instance * @returns Shared module information * * @private */ private analyzeNgModule; /** * Analyze a service to extract information. * * @param classDecl - The service class declaration * @param filePath - Path to the file * @returns Service information * * @private */ private analyzeService; /** * Check if a service should be a singleton (in CoreModule). * * @param service - The service to check * @returns true if the service should be a singleton * * @private */ private isSingletonService; /** * Analyze a component to extract information and usage count. * * @param classDecl - The component class declaration * @param filePath - Path to the file * @param project - The project instance * @returns Component information * * @private */ private analyzeComponent; /** * Analyze a directive to extract information. * * @param classDecl - The directive class declaration * @param filePath - Path to the file * @param project - The project instance * @returns Directive information * * @private */ private analyzeDirective; /** * Analyze a pipe to extract information. * * @param classDecl - The pipe class declaration * @param filePath - Path to the file * @param project - The project instance * @returns Pipe information * * @private */ private analyzePipe; /** * Count how many times a class is used across the project. * * @param className - The class name to search for * @param project - The project instance * @returns Usage count * * @private */ private countUsages; /** * Count how many times a module is imported across the project. * * @param moduleClassName - The module class name to search for * @param project - The project instance * @returns Import count * * @private */ private countModuleUsages; /** * Generate recommendations based on analysis. * * @param singletonServices - Singleton services found * @param reusableArtifacts - Reusable artifacts found * @param sharedModules - Detected shared modules * @param hasCoreModule - Whether CoreModule exists * @param hasSharedModule - Whether SharedModule exists * @returns Array of recommendations * * @private */ private generateRecommendations; /** * Generate a text report from the analysis. * * @param report - The organization report * @returns Formatted report text * * @private */ private generateReport; /** * Create or update CoreModule and SharedModule. * * @param project - The project instance * @param report - The organization report * * @private */ private createOrUpdateModules; } //# sourceMappingURL=core-shared-modules-orchestrator.d.ts.map