@@ -2,6 +2,7 @@ import { loadConfig } from './config'
22import type { Logger } from 'winston'
33import util from 'util'
44import { formatPluginTree } from './messages'
5+ import { loadHookInstallations } from './install'
56
67export { runTasks } from './tasks'
78export { shouldDisableNativeFetch } from './fetch'
@@ -20,3 +21,23 @@ export async function printConfig(logger: Logger): Promise<void> {
2021
2122 logger . info ( util . inspect ( config , { depth : null , colors : true } ) )
2223}
24+
25+ export async function printMergedOptions ( logger : Logger ) : Promise < void > {
26+ const config = await loadConfig ( logger , { validate : true , root : process . cwd ( ) } )
27+ const hookInstallations = ( await loadHookInstallations ( logger , config ) ) . unwrap ( 'invalid hooks' )
28+
29+ const mergedOptions = {
30+ hooks : hookInstallations . map ( ( h ) => h . options ) ,
31+ plugins : Object . fromEntries (
32+ Object . entries ( config . pluginOptions ) . map ( ( [ pluginId , optionsForPlugin ] ) => [
33+ pluginId ,
34+ optionsForPlugin . options
35+ ] )
36+ ) ,
37+ tasks : Object . fromEntries (
38+ Object . entries ( config . taskOptions ) . map ( ( [ taskId , optionsForTask ] ) => [ taskId , optionsForTask . options ] )
39+ )
40+ }
41+
42+ logger . info ( util . inspect ( mergedOptions , { depth : null , colors : true } ) )
43+ }
0 commit comments