import { TaskContext } from './task_context' ; import { generateMapping } from '../manage_schema' ; export function generateSchemasTask ( { roots } ) { return roots . map ( ( root ) => ( { task : ( ) => { if ( ! root . parsedCollections || ! root . parsedCollections . length ) { return ; } const mapping = generateMapping ( root . parsedCollections ) ; root . mapping = mapping ; } , title : `Generating mapping for ${ root . config . root }` , } ) ) ; }