import Table from 'cli-table3' ; import { RepoGenerator , NpmGenerator } from '../parse-generator' ; import { generatorList } from '../utils/generator-list' ; export function getRepoGeneratorName ( g ) { return `${ g . prefix === 'github' ? '' : `${ g . prefix }:` }${ g . user }/${ g . repo }` ; } export function getNpmGeneratorName ( g ) { return g . name . replace ( 'sao-' , '' ) ; } export function printGenerators ( ) { const table = new Table ( { head : [ 'Name' , 'Versions' ] , } ) ; for ( const [ name , generators ] of generatorList . groupedGenerators ) { table . push ( [ name , generators . map ( ( g ) => `${ g . version }` ) . join ( ', ' ) ] ) ; } console . log ( table . toString ( ) ) ; }