( binding: PluginSetupBinding, cliArgs: CliArgs, targetDir: string, tree: Pick<Tree, 'read' | 'write'>, )
| 87 | } |
| 88 | |
| 89 | async function resolveBinding( |
| 90 | binding: PluginSetupBinding, |
| 91 | cliArgs: CliArgs, |
| 92 | targetDir: string, |
| 93 | tree: Pick<Tree, 'read' | 'write'>, |
| 94 | ): Promise<PluginCodegenResult> { |
| 95 | if (!binding.prompts) { |
| 96 | return binding.generateConfig({ |
| 97 | tree, |
| 98 | targetDir, |
| 99 | cliArgs, |
| 100 | answers: {}, |
| 101 | }); |
| 102 | } |
| 103 | logger.newline(); |
| 104 | logger.info(ansis.bold(binding.title)); |
| 105 | const descriptors = await binding.prompts(targetDir); |
| 106 | const answers = |
| 107 | descriptors.length > 0 |
| 108 | ? await promptPluginOptions(descriptors, cliArgs) |
| 109 | : {}; |
| 110 | return binding.generateConfig({ tree, targetDir, cliArgs, answers }); |
| 111 | } |
| 112 | |
| 113 | async function writeStandaloneConfig( |
| 114 | { tree, format, configFilename }: WriteContext, |
no test coverage detected