/** * @angular-modernizer/plugin-angular - Sequential Await Transform Rule * * Thin rule wrapper. All logic in SequentialAwaitTransformOrchestrator. */ import type { TransformRule, TransformContext, TransformResult, } from '@angular-modernizer/plugin-system'; import type { PublicApi } from '@angular-modernizer/api'; import { SequentialAwaitTransformOrchestrator } from '../orchestrators/sequential-await-transform.orchestrator.js'; export class SequentialAwaitTransformRule implements TransformRule { public readonly id = 'angular:sequential-await-to-forkjoin'; public readonly name = 'Sequential Await to forkJoin'; public readonly description = 'Converts sequential independent await calls to parallel forkJoin() execution'; public readonly category = 'refactoring'; public readonly tags = [ 'angular', 'rxjs', 'observable', 'promise', 'performance', 'forkjoin', ]; private readonly orchestrator = new SequentialAwaitTransformOrchestrator(); async transform( context: TransformContext, ): Promise { const pluginConfig = context.config[ '@angular-modernizer/plugin-angular' ] as Record | undefined; if ( pluginConfig?.['transformationType'] !== 'sequential-await-to-forkjoin' ) { return { ruleId: this.id, modified: false, message: 'Transformation type not applicable', filePath: context.filePath, }; } return this.orchestrator.run(context); } }