MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / detectBrighterScriptTemplateRoot

Function detectBrighterScriptTemplateRoot

src/scanner.ts:1369–1391  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

1367 * file serve as the structural signal instead.
1368 */
1369export async function detectBrighterScriptTemplateRoot(dir: string): Promise<boolean> {
1370 if (await hasRokuManifest(dir)) return false;
1371 const bsConfigPath = join(dir, "bsconfig.json");
1372 try {
1373 await stat(bsConfigPath);
1374 } catch {
1375 return false;
1376 }
1377 // Layout 1: rokucommunity template — manifest lives under src/
1378 if (await hasRokuManifest(join(dir, "src"))) return true;
1379 // Layout 2: channel-at-root without manifest — source/ or components/ with .brs
1380 const hasBrsIn = async (subdir: string): Promise<boolean> => {
1381 try {
1382 const entries = await readdir(join(dir, subdir), { withFileTypes: true });
1383 return entries.some((e) => e.isFile() && (e.name.endsWith(".brs") || e.name.endsWith(".bs")));
1384 } catch {
1385 return false;
1386 }
1387 };
1388 if (await hasBrsIn("source")) return true;
1389 if (await hasBrsIn("components")) return true;
1390 return false;
1391}
1392
1393/**
1394 * Detect a Roku multi-channel monorepo layout. 90% of Roku repos are

Callers 3

detectFrameworksFunction · 0.85
detectORMsFunction · 0.85
detectLanguageFunction · 0.85

Calls 3

hasRokuManifestFunction · 0.85
joinFunction · 0.85
hasBrsInFunction · 0.85

Tested by

no test coverage detected