MCPcopy Create free account
hub / github.com/code-pushup/cli / detectRecommended

Function detectRecommended

packages/create-cli/src/lib/setup/prompts.ts:50–63  ·  view source on GitHub ↗

* Calls each binding's `isRecommended` callback (if provided) * and collects the slugs of bindings that returned `true`.

(
  bindings: PluginSetupBinding[],
  targetDir: string,
)

Source from the content-addressed store, hash-verified

48 * and collects the slugs of bindings that returned `true`.
49 */
50async function detectRecommended(
51 bindings: PluginSetupBinding[],
52 targetDir: string,
53): Promise<Set<string>> {
54 const recommended = new Set<string>();
55 await Promise.all(
56 bindings.map(async ({ slug, isRecommended }) => {
57 if (isRecommended && (await isRecommended(targetDir))) {
58 recommended.add(slug);
59 }
60 }),
61 );
62 return recommended;
63}
64
65export async function promptPluginOptions(
66 descriptors: PluginPromptDescriptor[],

Callers 1

promptPluginSelectionFunction · 0.85

Calls 1

isRecommendedFunction · 0.50

Tested by

no test coverage detected