UNPKG

bugger-mcp

Version:

MCP Server for managing bugs, feature requests, and improvements

114 lines 3.35 kB
export interface ImportStatement { source: string; imported: string[]; type: 'import' | 'require' | 'dynamic'; isTypeOnly: boolean; isDefault: boolean; alias?: string; line: number; } export interface ExportStatement { exported: string[]; type: 'export' | 'module.exports' | 'exports'; isDefault: boolean; source?: string; line: number; } export interface DependencyRelationship { from: string; to: string; type: 'import' | 'require' | 'dynamic' | 'inheritance' | 'composition' | 'usage'; strength: number; imports: string[]; line: number; } export interface FileRelationship { filePath: string; dependencies: string[]; dependents: string[]; imports: ImportStatement[]; exports: ExportStatement[]; cyclicDependencies: string[]; relationshipStrength: number; isEntryPoint: boolean; isLeafNode: boolean; } export interface DependencyGraph { nodes: Map<string, FileRelationship>; edges: DependencyRelationship[]; entryPoints: string[]; leafNodes: string[]; cyclicDependencies: string[][]; clusters: string[][]; metrics: { totalFiles: number; totalDependencies: number; averageDependencies: number; maxDependencies: number; cyclicDependencyCount: number; cohesion: number; coupling: number; }; } export interface ModuleSystem { type: 'commonjs' | 'esmodule' | 'amd' | 'umd' | 'mixed'; confidence: number; examples: string[]; } export interface DependencyAnalysisOptions { includeExtensions: string[]; excludePatterns: string[]; followSymlinks: boolean; resolveAliases: boolean; includeNodeModules: boolean; maxDepth: number; detectCircularDependencies: boolean; analyzeTypeImports: boolean; } /** * Main dependency analysis engine */ export declare class DependencyAnalyzer { private rootPath; private readonly defaultExtensions; private readonly defaultExcludePatterns; private aliasMap; private baseUrl; constructor(rootPath?: string); /** * Analyze imports and requires in a file */ analyzeImports(filePath: string): Promise<ImportStatement[]>; /** * Analyze exports in a file */ analyzeExports(filePath: string): Promise<ExportStatement[]>; /** * Build complete dependency graph for the project */ buildDependencyGraph(options?: DependencyAnalysisOptions): Promise<DependencyGraph>; /** * Map file relationships for navigation */ mapFileRelationships(filePath: string, options?: DependencyAnalysisOptions): Promise<FileRelationship>; /** * Detect module system used in the project */ detectModuleSystem(options?: DependencyAnalysisOptions): Promise<ModuleSystem>; private findSourceFiles; private extractImports; private extractExports; private parseESImport; private resolveModulePath; private calculateDependencyStrength; private calculateRelationshipStrength; private detectCircularDependencies; private detectClusters; private calculateMetrics; private calculateCohesion; private calculateCoupling; private loadPathAliases; private shouldExclude; private getDefaultOptions; } //# sourceMappingURL=dependency-analysis.d.ts.map