Repository navigation
Conversation
Scan .ts/.tsx/.mts files for `registerAnchorNode(declaration, ...)` calls and register each declaration as a virtual component (excluded from output), so anchor nodes get component types, field types, and CreateObject validation. - Honor `excludeFromOutput` during build - Fix `getFile()` lookup of `virtual:/` files from uris so comment flags apply Refs #1895 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3izbnpnJn45fWn4Q9WiRF
Detect RSG 2.0 SDK descriptors wherever they are declared rather than only at registerAnchorNode call sites, so defineAnchorNode, declareTsComponent and descriptors imported from other files are all found. Map FieldType to the field types the device creates, include libraryName and position, and make sure the scanner always makes progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3izbnpnJn45fWn4Q9WiRF
Add a `rokuConfig` bsconfig option pointing at an RSG 2.0 SDK app's roku-config.ts. The config is read statically for `app.entryPoint` and `app.staticAssetsDir`, then relative imports are followed from the entry point to find the app's TypeScript sources, the XML components they import, and the anchor nodes they declare. The result is exposed as `program.rsgProject`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3izbnpnJn45fWn4Q9WiRF
Discovery only follows imports from `app.entryPoint`, so the static assets folder was read but never used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3izbnpnJn45fWn4Q9WiRF
This branch has not been deployed
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.
Refs #1895
Prototype for finding the anchor nodes an RSG 2.0 SDK app declares in TypeScript. The goal is to make them part of the BrightScript type system. This PR covers discovery only.
How it works
Add the app's
roku-config.tstobsconfig.json:{ "rootDir": "pkg", "rokuConfig": "./roku-config.ts" }roku-config.tsis read statically; it is never executed. Onlyapp.entryPointandbrsOnlyare read, and both are string/boolean literals in practice.import,export … from,import()andrequire(), with.js→.tsandindexresolution. Only files the app can reach are read, sonode_modulesand unused files cost nothing.componentNamestring plusextends,inputFieldsoroutputFields. This coversdefineAnchorNode, the deprecateddeclareTsComponent, and descriptors imported from another file.FieldType.*()values map to the field type the device creates.Numberbecomes integer,Floatfloat,Object/Nullassocarray,Arrayarray,Stringstring andBooleanboolean, matchingdeclareTsComponentin@roku-sdk/ts-core.The result is exposed as
program.rsgProject: source files, imported XML components, and anchor nodes with their file and position. The CLI logsFound N anchor node(s) in M TypeScript file(s).Results against the SDK examples
Running discovery from each example's own
roku-config.tsfound 33 anchor nodes in 32 apps, at 0–77 ms per app. That covers every descriptor in the examples except:focus/pooled/virtualvariants, which have their ownroku-config-*.ts, and each resolves its ownSlideshowApp;reactive-focus-pitfalls.tsx, which nothing imports.Raw parser throughput is about 14 MB/s. A quick text check skips about 97% of files before parsing.
Not done yet
Program, so no generated files are involved.FocusBoundaryBasefrom@roku-sdk/navigationdon't resolve. Imported XML components are collected but not loaded.GroupextendsagainstminFirmwareVersion.Other changes
Program.build()now honorsexcludeFromOutput. It was declared onBscFilebut never read.Program.getFile()now resolvesvirtual:/files from URIs, so comment flags such asbs:disablework in virtual files.Generated by Claude Code