Angular Modernizer
    Preparing search index...

    Interface ParserProjectContext

    Project context information for parser selection.

    This interface captures key characteristics of the project that influence parser selection. The parser orchestrator uses this context to select the most appropriate parser strategy.

    Detection Strategy:

    • ProjectCompatibilityValidator detects these characteristics
    • Cached in Kernel.projectContext during initialization
    • Used by ParserOrchestrator.selectParser() to choose parser strategy

    Project Characteristics:

    • Standard Angular CLI projects: hasCustomDecorators=false, hasPathAliases=false, hasComplexConstructors=false
    • Projects with external decorators: hasCustomDecorators=true (e.g., @PageComponent, @RemoteFunction)
    • Projects with path aliases: hasPathAliases=true (e.g., @shared/, @domain/)
    • Projects with complex constructors: hasComplexConstructors=true (e.g., super calls with "import" variables)
    const context: ProjectContext = {
    projectRoot: '/home/user/my-app',
    hasCustomDecorators: false,
    hasPathAliases: false,
    hasComplexConstructors: false,
    angularVersion: '17.2.0'
    };
    // Selected parser: StandardParserStrategy (reliability 0.95)
    const context: ProjectContext = {
    projectRoot: '/home/user/enterprise-app',
    hasCustomDecorators: true, // Uses `@PageComponent`, `@RemoteFunction`
    hasPathAliases: true, // Uses @shared/*, @domain/*
    hasComplexConstructors: true, // Complex dependency injection patterns
    angularVersion: '16.1.0'
    };
    // Selected parser: EnhancedParserStrategy (reliability 0.6-0.8)
    interface ParserProjectContext {
        angularVersion: string;
        hasComplexConstructors: boolean;
        hasCustomDecorators: boolean;
        hasPathAliases: boolean;
        projectRoot: string;
    }
    Index

    Properties

    angularVersion: string

    Angular version string (e.g., '17.2.0').

    Used to determine which Angular features are available (e.g., standalone components require >=14).

    hasComplexConstructors: boolean

    Whether project has complex constructor patterns.

    Examples:

    • Constructor parameters with "import" keyword: constructor(private importService: ImportService)
    • Super calls with "import" variables: super(importConfig, importHelper)
    • Configuration objects with "import" properties: providers: [importService]

    Detection: ProjectCompatibilityValidator samples 50 files for these patterns

    hasCustomDecorators: boolean

    Whether project uses custom decorators (non-standard Angular decorators).

    Examples: @PageComponent, @RemoteFunction, @RequiresPermission Detection: ProjectCompatibilityValidator scans for decorators not in Angular's standard set

    hasPathAliases: boolean

    Whether project uses TypeScript path aliases.

    Examples: @shared/, @domain/, @features/, @core/ Detection: ProjectCompatibilityValidator checks tsconfig.json compilerOptions.paths

    projectRoot: string

    Absolute path to project root directory