@@ -32,6 +32,7 @@ import type {
3232 PluginCodegenResult ,
3333 PluginSetupBinding ,
3434 ScopedPluginResult ,
35+ Tree ,
3536 WriteContext ,
3637} from './types.js' ;
3738import { createTree } from './virtual-fs.js' ;
@@ -57,19 +58,19 @@ export async function runSetupWizard(
5758 const format = await promptConfigFormat ( targetDir , cliArgs ) ;
5859 const ciProvider = await promptCiProvider ( cliArgs ) ;
5960
61+ const tree = createTree ( await getGitRoot ( ) ) ;
62+
6063 const resolved : ScopedPluginResult [ ] = await asyncSequential (
6164 selectedBindings ,
6265 async binding => ( {
6366 scope : binding . scope ?? 'project' ,
64- result : await resolveBinding ( binding , cliArgs , targetDir ) ,
67+ result : await resolveBinding ( binding , cliArgs , targetDir , tree ) ,
6568 } ) ,
6669 ) ;
6770
6871 const packageJson = await readPackageJson ( targetDir ) ;
6972 const isEsm = packageJson . type === 'module' ;
7073 const configFilename = resolveFilename ( 'code-pushup.config' , format , isEsm ) ;
71-
72- const tree = createTree ( await getGitRoot ( ) ) ;
7374 const writeContext : WriteContext = { tree, format, configFilename, isEsm } ;
7475
7576 await ( context . mode === 'monorepo' && context . tool != null
@@ -103,13 +104,14 @@ async function resolveBinding(
103104 binding : PluginSetupBinding ,
104105 cliArgs : CliArgs ,
105106 targetDir : string ,
107+ tree : Pick < Tree , 'read' | 'write' > ,
106108) : Promise < PluginCodegenResult > {
107109 const descriptors = binding . prompts ? await binding . prompts ( targetDir ) : [ ] ;
108110 const answers =
109111 descriptors . length > 0
110112 ? await promptPluginOptions ( descriptors , cliArgs )
111113 : { } ;
112- return binding . generateConfig ( answers ) ;
114+ return binding . generateConfig ( answers , tree ) ;
113115}
114116
115117async function writeStandaloneConfig (
0 commit comments