Adds roku (Brightscript/BrighterScript and SceneGraph) support#37
Merged
Houseofmvps merged 3 commits intoHouseofmvps:mainfrom Apr 21, 2026
Merged
Adds roku (Brightscript/BrighterScript and SceneGraph) support#37Houseofmvps merged 3 commits intoHouseofmvps:mainfrom
Houseofmvps merged 3 commits intoHouseofmvps:mainfrom
Conversation
Contributor
Author
|
Fixes #36 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full codesight support for Roku apps. Anchors project detection on the plain-text
manifestfile (the same file Roku itself uses), adds three new regex-based extractors (BrightScript, BrighterScript, SceneGraph XML), and wires all 8 detectors to map Roku idioms onto codesight's existing data model.Closes #.
Layouts supported:
kernel-roku-style):manifest+source/+components/at the repo root.rokucommunity/brighterscript-template):bsconfig.jsonat root, channel rooted undersrc/. Detected as a single channel, not promoted to a monorepo.roku-deploy+gulpmerging a sharedcommon/layer): each channel registered as its own workspace. Strict structural signal (no root manifest +roku-deployin deps +common/+ ≥2 sibling-channel dirs with manifests) so an ordinary single-channel repo that happens to haveroku-deployis never mis-labeled.Mapping:
idin a Scene XML's<children>becomes a route.method = VIEWby default, upgraded toMODALwhen a configurable navigation helper (default set coversShowScreen,pushScreen,NavigateTo,showView, plus camelCase variants) is called with a literaltruesecond arg. Works on projects with no helper at all.orm: "scenegraph"models from every component XML with a non-empty<interface>. Field types normalized (String→string,assocarray→object,node→node-ref, etc.)..brsfunctions/subs;.bsadds classes, namespaces, enums, interfaces on top. Files undercomponents/are skipped (handler code, not libs).observeFieldsubscriptions,m.global.AddFieldregistrations. BugsnagTask / RudderstackTask recognized when present.<script uri="pkg:/...">in XML +import "pkg:/..."in.bs, with a suffix-match resolver for nested channel layouts.system: scenegraph-observer) + Rudderstack event names (system: rudderstack).manifestkeys surfaced asmanifest.<name>pseudo env-vars.Changes
types.ts— addsFramework: "roku-scenegraph",ComponentFramework: "scenegraph",ORM: "scenegraph",language: "brightscript",EventInfo.system: "scenegraph-observer" | "rudderstack", and aCodesightConfig.rokuScreenHelpers?: string[]option.scanner.ts— adds.brs,.bs,.xmltoCODE_EXTENSIONS; baremanifestadded as a non-extension exception;roku_modules+.roku-deploy-stagingadded toIGNORE_DIRS; newhasRokuManifest(),detectBrighterScriptTemplateRoot(), anddetectRokuMonorepo()helpers (structuralcommon/+ ≥2 channels +roku-deploysignal); Roku language/framework/ORM + component framework branches; workspace discovery wires the monorepo detector in front of the generic depth-2 fallback.ast/extract-scenegraph.ts— new file. Parses<component>,<interface>fields + functions,<script uri>includes,<children>. ExposesextractSceneGraphComponent,extractMainSceneScreens,isSceneGraphXml.ast/extract-brightscript.ts— new file.extractBrightScriptFunctions,extractBrightScriptObservers,extractBrightScriptNavigationCalls(configurable helper names),extractBrightScriptShowScreenCalls(back-compat wrapper),extractBrightScriptGraphqlCalls,extractBrightScriptGlobalFields,extractBrightScriptRudderstackEvents,extractFindNodeBindings.ast/extract-brighterscript.ts— new file.extractBrighterScriptImports+extractBrighterScriptExports(classes, namespaces, enums, interfaces; composes with BrightScript extractor for functions/subs).detectors/routes.ts— newcase "roku-scenegraph"branch +detectRokuScreens()helper. Children-first:<children>slots are the primary route surface; helper-call sites are optional enrichment that can flip VIEW→MODAL.detectors/schema.ts— newcase "scenegraph"branch +detectSceneGraphSchemas()helper.detectors/components.ts— newcase "scenegraph"branch +detectSceneGraphComponents()helper.detectors/libs.ts—.brs/.bsadded to lib filter; dispatches to the new extractors. Filter now compares against the project-relative path, fixing a latent bug where any project hosted under a parenttests/directory had all its lib files silently dropped.detectors/middleware.ts— emitsobserveField+m.global.AddFieldas custom middleware, BugsnagTask as error-handler, RudderstackTask as logging.detectors/graph.ts— extended to.brs/.bs/.xml; newextractSceneGraphImportsInline+extractBrighterScriptImportsInlinewith a suffix-match resolver forpkg:/...URIs.detectors/events.ts— extended to.brs/.bs; emits scenegraph-observer + rudderstack events.detectors/config.ts— surfacesmanifestinconfigFilesand manifest keys asmanifest.<name>env vars.README.md— adds BrightScript/BrighterScript to the Works-with line, updates the Supported Stacks table, adds a## Roku / BrightScript / SceneGraphsection that leads with the standard single-channel layout, documents the BrighterScript template variant, and calls out the multi-channel monorepo as an explicit exception with the structural signal described. Documents therokuScreenHelpersconfig option.Tests
New
Roku SceneGraph Detectionsuite intests/detectors.test.tswith four fixtures and assertions:<children>alone, repo is not flagged as a monorepo.bsconfig.json+src/manifest) — asserts root is identified as the Roku channel, schemas + components includesrc/-rooted paths, not promoted to monorepo.roku-deployin deps but only one channel — asserts the structural signal does not fire, repo is single-channel..brs+.bslib exports, script-include + import dependency edges, manifest config surfacing, and observeField/m.global middleware.Full suite: 58/58 pass (54 pre-existing + 4 new).
Real-world smoke tests:
roku-scenegraph | scenegraph | brightscript, not a monorepo, 2 VIEW routes pulled from<children>alone.