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

Function resolveMonorepoTool

packages/ci/src/lib/monorepo/list-projects.ts:62–84  ·  view source on GitHub ↗
(
  settings: Settings,
  options: MonorepoHandlerOptions,
)

Source from the content-addressed store, hash-verified

60}
61
62async function resolveMonorepoTool(
63 settings: Settings,
64 options: MonorepoHandlerOptions,
65): Promise<MonorepoTool | null> {
66 if (!settings.monorepo) {
67 // shouldn't happen, handled by caller
68 throw new Error('Monorepo mode not enabled');
69 }
70
71 if (typeof settings.monorepo === 'string') {
72 logInfo(`Using monorepo tool "${settings.monorepo}" from inputs`);
73 return settings.monorepo;
74 }
75
76 const tool = await detectMonorepoTool(options.cwd);
77 if (tool) {
78 logInfo(`Auto-detected monorepo tool ${tool}`);
79 } else {
80 logInfo("Couldn't auto-detect any supported monorepo tool");
81 }
82
83 return tool;
84}
85
86function createMonorepoHandlerOptions({
87 task,

Callers 1

listMonorepoProjectsFunction · 0.85

Calls 2

detectMonorepoToolFunction · 0.90
logInfoFunction · 0.85

Tested by

no test coverage detected