From 90a28c84bc53dcb329932ee663ea521ef00e1973 Mon Sep 17 00:00:00 2001 From: Nick Wallace Date: Mon, 20 Apr 2026 16:05:00 -0500 Subject: [PATCH 1/2] Adds roku (Brightscript/BrighterScript and SceneGraph) support --- README.md | 52 ++++-- src/ast/extract-brighterscript.ts | 95 +++++++++++ src/ast/extract-brightscript.ts | 255 ++++++++++++++++++++++++++++++ src/ast/extract-scenegraph.ts | 182 +++++++++++++++++++++ src/detectors/components.ts | 39 +++++ src/detectors/config.ts | 67 ++++++++ src/detectors/events.ts | 29 +++- src/detectors/graph.ts | 79 ++++++++- src/detectors/libs.ts | 19 ++- src/detectors/middleware.ts | 49 ++++++ src/detectors/routes.ts | 102 ++++++++++++ src/detectors/schema.ts | 37 +++++ src/scanner.ts | 107 ++++++++++++- src/types.ts | 10 +- tests/detectors.test.ts | 213 +++++++++++++++++++++++++ 15 files changed, 1314 insertions(+), 21 deletions(-) create mode 100644 src/ast/extract-brighterscript.ts create mode 100644 src/ast/extract-brightscript.ts create mode 100644 src/ast/extract-scenegraph.ts diff --git a/README.md b/README.md index ce492bf..58ca3bf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **Zero dependencies. AST precision. 30+ framework detectors. 13 ORM parsers. 13 MCP tools. One `npx` call.** -**Works with TypeScript, JavaScript, Python, Go, Ruby, Elixir, Java, Kotlin, Rust, PHP, Dart, Swift, and C#.** TypeScript projects get full AST precision. Everything else uses battle-tested regex detection across the same 30+ frameworks. +**Works with TypeScript, JavaScript, Python, Go, Ruby, Elixir, Java, Kotlin, Rust, PHP, Dart, Swift, C#, and BrightScript/BrighterScript (Roku).** TypeScript projects get full AST precision. Everything else uses battle-tested regex detection across the same 30+ frameworks. [![npm version](https://img.shields.io/npm/v/codesight?style=for-the-badge&logo=npm&color=CB3837)](https://www.npmjs.com/package/codesight) [![npm downloads](https://img.shields.io/npm/dm/codesight?style=for-the-badge&logo=npm&color=blue&label=Monthly%20Downloads)](https://www.npmjs.com/package/codesight) @@ -487,19 +487,53 @@ Each detector type maps to a measured token cost that an AI would spend to disco The 1.3x multiplier accounts for AI revisiting files during multi-turn conversations. These estimates are conservative. A developer manually verified that Claude Code spends 40-70K tokens exploring the same projects that codesight summarizes in 3-5K tokens. +## Roku / BrightScript / SceneGraph + +codesight treats Roku channels as first-class projects. The `manifest` file at the channel root anchors detection; multi-creator monorepos with channels under `src/apps//` are picked up as separate workspaces. + +Mappings to codesight's data model: + +| codesight concept | Roku equivalent | +|---|---| +| Routes | Screens — each `ShowScreen(m.xxxView, modal?)` call-site in a Scene's `.brs`, resolved to the XML component that implements the view. `method = VIEW` or `MODAL`. | +| Schema | Every SceneGraph component XML whose `` has at least one `` — the typed contract is the model. | +| Components | Every `` XML (views, tasks, scenes, modals). Props = interface fields. | +| Libraries | `.brs` / `.bs` files under `source/` — top-level `function`/`sub` plus BrighterScript `class` / `namespace` / `enum` / `interface`. | +| Middleware | `observeField` subscriptions, `m.global.AddField` registrations, BugsnagTask, RudderstackTask. | +| Dependencies | `