Skip to content

fix: pin brighterscript to 1.0.0-alpha.52; fix #167 example bsconfig collisions - #177

Merged
markwpearce merged 1 commit into
mainfrom
fix-167-and-pin-brighterscript
Aug 30, 2026
Merged

fix: pin brighterscript to 1.0.0-alpha.52; fix #167 example bsconfig collisions#177
markwpearce merged 1 commit into
mainfrom
fix-167-and-pin-brighterscript

Conversation

@markwpearce

Copy link
Copy Markdown
Owner

Summary

  1. Pin brighterscript to exact 1.0.0-alpha.52 (no caret) in every package.json — engine root, every examples/*, and scripts/exampleTemplate/scripts/ropmConsumerFixture. The old ^1.0.0-alpha.50 range already resolved to alpha.52 (confirmed via node_modules), but as a floating prerelease range it could silently drift to a newer alpha later — bslint+rooibos-roku (together): pre-existing file can't resolve a symbol from a brand-new file #175's bslint+rooibos-roku interaction bug is already known to be sensitive to exact alpha generation, so pin it everywhere instead of relying on install-time luck.

  2. Fixes Example template bsconfig.json breaks build for every example except scenegraph #167: every example's bsconfig.json (and the exampleTemplate scaffold used by create-example) copied the engine's plain source and its SceneGraph component code-behind files into one shared destination folder. Component files declare same-named subs (redraw, init, onRenderComplete, etc.) that BrighterScript treats as global, so mixing them together caused ~33 duplicate-function errors the moment any example needed the engine's Shapes components (examples/scenegraph was the only example that already split them correctly).

    Fix: split every example's file copy into separate source and components destinations, matching examples/scenegraph's existing (correct) config. controller's prior components-exclusion workaround and special controller-web copy entry are no longer needed (the split copy already lands controller-web at the right destination) and have been removed.

A wrong turn worth flagging

I first tried nesting each destination under roku_modules/<packagename> to mirror exactly what a real ropm install produces (verified the real layout by packing the engine and installing it into a scratch consumer project). That version passed bsc --validate and npm run check:all cleanly — but failed to compile on a real Roku device: Install Failure: Compilation Failed. ShapeRenderTask (a SceneGraph Task node). Completely invisible to static analysis. Reverted to the flatter source/components destinations (still fully separating source from components, still fixing the actual collision) and confirmed both examples/scenegraph and examples/controller sideload and run cleanly on the same real device.

Verification

  • npm run check:all (lint, validate, headless tests, validate every example) passes clean.
  • npm run build-examples packages all 19 examples with no errors.
  • Sideloaded examples/scenegraph and examples/controller to a real Roku: both install and run correctly (controller's QR code, ship, and controller-web server all confirmed on screen via screenshot).

🤖 Generated with Claude Code

…collisions

Two changes:

1. Pin `brighterscript` to exact "1.0.0-alpha.52" (no caret) in every
   package.json - the engine and every example/script project - instead
   of the floating "^1.0.0-alpha.50" range. That range already happened
   to resolve to alpha.52 today (confirmed via node_modules), but as a
   floating prerelease range it could silently drift to a newer alpha
   later. #175's bslint+rooibos-roku interaction bug is already known to
   be sensitive to exact alpha generation, so pin it everywhere rather
   than rely on install-time luck.

2. Fixes #167: every example's bsconfig.json (and the exampleTemplate
   scaffold used by `create-example`) copied the engine's entire src/
   tree - both plain source and SceneGraph component code-behind files
   - into one shared destination folder. Component files declare
   same-named subs (redraw, init, onRenderComplete, etc.) that BrighterScript
   treats as global, so flattening them together caused ~33
   duplicate-function errors the moment any example needed the engine's
   Shapes components (examples/scenegraph was the only example that
   already split them correctly).

   Fix: split each example's file copy into separate "source" and
   "components" destinations, matching examples/scenegraph's existing
   (correct) config - same pattern, just applied everywhere. controller's
   prior components-exclusion workaround and special controller-web copy
   are no longer needed (the split copy already lands controller-web at
   the right destination) and have been removed.

   Verified this needed a real device, not just bsc --validate: a first
   attempt at also nesting each dest under roku_modules/<packagename>
   (mirroring exactly what a real `ropm install` produces, confirmed by
   packing and installing the engine into a scratch consumer) validated
   fine via bsc/npm run check:all but failed to compile on a real Roku
   with "Install Failure: Compilation Failed. ShapeRenderTask" - a
   SceneGraph Task node quirk invisible to any static check. Reverted to
   the flatter destinations (still fully separating source from
   components, still fixing the collision) and confirmed both
   examples/scenegraph and examples/controller sideload and run cleanly
   on the same real device.

Verification:
- npm run check:all (lint, validate, headless tests, validate every
  example) passes clean.
- npm run build-examples packages all 19 examples with no errors.
- Sideloaded examples/scenegraph and examples/controller to a real Roku:
  both install and run correctly (controller's QR code, ship, and
  controller-web server all confirmed on screen).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@markwpearce
markwpearce enabled auto-merge August 30, 2026 22:06
@markwpearce
markwpearce merged commit 1f2e4d0 into main Aug 30, 2026
3 checks passed
@markwpearce
markwpearce deleted the fix-167-and-pin-brighterscript branch August 30, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example template bsconfig.json breaks build for every example except scenegraph

1 participant