Angular Modernizer
    Preparing search index...

    Transformation Coordinator

    The central orchestrator for all transformation operations in the Angular Modernization Platform. This class is responsible for:

    1. Plugin Discovery: Finding transformation rules across all loaded plugins
    2. Context Management: Creating appropriate TransformContext objects
    3. Execution Coordination: Delegating to TransformExecutionEngine for actual work
    4. Result Aggregation: Collecting and summarizing transformation results
    5. Error Handling: Managing transformation failures and rollbacks

    The coordinator follows the "Coordinator Pattern" where it:

    • Knows WHAT needs to be done (orchestration)
    • Doesn't know HOW it's done (delegation)
    • Manages the overall workflow
    • Handles cross-cutting concerns (logging, error handling)
    const coordinator = new TransformationCoordinator(plugins, publicApi);
    const result = await coordinator.transformFile(
    sourceFile,
    project,
    { dryRun: false }
    );
    Index

    Constructors

    Methods

    Constructors

    • Creates a new TransformationCoordinator.

      Parameters

      • plugins: Plugin[]

        Array of loaded plugins to search for transformation rules

      • api: unknown

        Public API instance for transformation rules

      Returns TransformationCoordinator

    Methods

    • Transform a single source file using all applicable transformation rules.

      This is the main entry point for file-level transformations. It:

      1. Discovers all transformation rules from loaded plugins
      2. Creates a TransformContext for the file
      3. Executes all applicable rules
      4. Aggregates and returns the results

      Parameters

      • sourceFile: SourceFile

        The source file to transform

      • project: Project

        The ts-morph project instance

      • config: TransformationConfig = {}

        Transformation configuration

      Returns Promise<TransformationResult>

      Promise resolving to transformation result

      const result = await coordinator.transformFile(
      sourceFile,
      project,
      { dryRun: false, autoSave: true }
      );

      if (result.success) {
      console.info(`Transformed ${result.ruleResults.length} rules`);
      } else {
      console.error('Transformation failed:', result.errors);
      }