import { TaskContext } from './task_context' ; import { checkCompatibleTypeDescriptor } from '../check_collector_integrity' ; export function checkCompatibleTypesTask ( { reporter , roots } ) { return roots . map ( ( root ) => ( { task : async ( ) => { if ( root . parsedCollections ) { const differences = checkCompatibleTypeDescriptor ( root . parsedCollections ) ; const reporterWithContext = reporter . withContext ( { name : root . config . root } ) ; if ( differences . length ) { reporterWithContext . report ( `${ JSON . stringify ( differences , null , 2 ) }. \nPlease fix the collectors and run the check again.` ) ; throw reporter ; } } } , title : `Checking in ${ root . config . root }` , } ) ) ; }