import BaseTask from './base-task' ; import { TaskContext , TaskResultOptions } from './types/tasks' ; const merge = require ( 'lodash.merge' ) ; export type FeatureId = string ; export type Feature = { featureName : string ; message : string ; helpUri : string ; } ; param migrationName param pluginName param context export default abstract class BaseMigrationTask extends BaseTask { protected features : Map < FeatureId , Feature > ; readonly memberof get featureNames ( ) { return [ ... new Set ( [ ... this . features . values ( ) ] . map ( ( ruleMetadata ) => ruleMetadata . featureName ) ) , ] ; } param migrationName param pluginName param context constructor ( public migrationName , pluginName , context ) { super ( pluginName , context ) ; this . features = new Map < FeatureId , Feature > ( ) ; } /**
     * Adds componennt data to the rule metadata.
     */ protected addRuleComponentMetadata ( ) { this . addRule ( { properties : { component : { name : 'migration' , options : { sortBy : 'value' , sortDirection : 'desc' , } , } , } , } ) ; } param featureId param feature param feature . feature param feature . message param feature . helpUri protected addFeature ( featureId , feature ) { this . features . set ( featureId , feature ) ; this . addRuleProperties ( { features : this . featureNames , } ) ; } param feature param feature . feature param feature . message param feature . helpUri param options param options . location param options . properties protected addFeatureResult ( feature , options ? ) { this . addResult ( `${ this . migrationName } | ${ feature . featureName } : ${ feature . message }. More info: ${ feature . helpUri }` , 'review' , 'warning' , merge ( { } , options , { properties : { migration : { name : this . migrationName , featureName : feature . featureName , } , } , } ) ) ; } }