import {formatUtils} from '@yarnpkg/core';
import {OperationReporter} from "./operation-reporter";


export class WarnOperationReporter extends OperationReporter {
    reportOperation(): void {
        const {operation, target, formattedFields, workspace: {project: {configuration}}} = this;
        const warningText = formatUtils.pretty(configuration, formatUtils.applyStyle(configuration, 'Warning:', 2), 'red');

        console.log(formatUtils.pretty(configuration, `${warningText} you will ${operation} ${formattedFields.dependency} but ${target} are indicated as sealed in ${formattedFields.workspace}.`, 'yellow'));
    }

}