diff --git a/src/cli/debug.ts b/src/cli/debug.ts index 801b0e71..d4a9b950 100644 --- a/src/cli/debug.ts +++ b/src/cli/debug.ts @@ -13,15 +13,20 @@ * limitations under the License. */ -import { readPackageJson } from '../lib/files'; -import { - warnAboutMissingPlugins, - warnAboutUnsupportedPlugins, -} from '../lib/options'; +import { isArray, isEmpty, mapValues } from 'lodash/fp'; + +import { getOptions } from '../lib/options'; +import * as logger from '../lib/logger'; export function debug(): void { - const packageJson = readPackageJson(); + const options = getOptions(); + + const stringifiedOptions = mapValues( + (value) => (isArray(value) && !isEmpty(value) ? value.join(', ') : value), + options, + ); - warnAboutUnsupportedPlugins(packageJson); - warnAboutMissingPlugins(packageJson); + logger.empty(); + logger.info('Detected configuration:'); + logger.table(stringifiedOptions); } diff --git a/src/lib/logger.ts b/src/lib/logger.ts index 30a2d165..a78e9312 100644 --- a/src/lib/logger.ts +++ b/src/lib/logger.ts @@ -58,3 +58,7 @@ export const debug = (arg: LogMessage): void => { export const empty = (): void => { console.log(''); }; + +export const table = (obj: Record): void => { + console.table(obj); +};