Angular Modernizer
    Preparing search index...

    Extracts dependency relationships and builds symbol maps for Angular modules. Recursively walks NgModule imports to build the map of symbols available in a module's scope (declared, imported, exported), including @Input on setters with aliases.

    Index

    Constructors

    Methods

    • Analyze all dependencies from a source file. Extracts all named imports and creates dependency objects for each.

      Parameters

      • sourceFile: SourceFile

        The source file to analyze

      Returns Dependency[]

      Array of dependencies

    • Build a comprehensive symbol map for an NgModule.

      This is the heart of the "Trust the Map" architecture. It creates the definitive map of what's available in a module's scope.

      Parameters

      • moduleFile: SourceFile

        The source file containing the NgModule

      • Optionalproject: Project

        Optional ts-morph Project to resolve symbols across files

      Returns SymbolMap

      Complete symbol map

    • Check if a file depends on another file.

      Parameters

      • sourceFile: SourceFile

        The source file

      • targetPath: string

        The target file path

      Returns boolean

      True if dependency exists

    • Detect circular dependencies in a project.

      Parameters

      • project: Project

        The ts-morph project

      Returns { cycle: string[]; severity: "error" | "warning" }[]

      Array of circular dependency chains, deduplicated

      • cycle: string[]

        File paths of the chain; the first file repeats at the end.

      • severity: "error" | "warning"

        error when more than three files take part, warning otherwise.

    • Extract comprehensive symbol information from a class. Identifies Angular artifact types (@Component, @Directive, @Pipe) and extracts metadata.

      CRITICAL: Handles the edge case of @Input on setters with aliases.

      Parameters

      • sourceFile: SourceFile

        The source file

      • className: string

        The class name to analyze

      Returns SymbolInfo | undefined

      Symbol information or undefined

    • Get all transitive dependencies for a source file. Follows dependency chain recursively.

      Parameters

      • sourceFile: SourceFile

        The source file

      • project: Project

        The ts-morph project

      • visited: Set<string> = ...

        Set of already visited files (for cycle detection)

      Returns Dependency[]

      Array of all transitive dependencies