Skip to content

Commit

Permalink
Merge pull request #407 from georgejecook/fix/minor-fixes
Browse files Browse the repository at this point in the history
chore: minor fixes
  • Loading branch information
georgejecook authored Aug 14, 2023
2 parents 055598d + b4d09b5 commit 2c78729
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "Test",
"stopOnEntry": false,
"preLaunchTask": "build-test",
"rendezvousTracking": false,
"envFile": "${workspaceFolder}/.vscode/.env",
"host": "${env:ROKU_DEV_TARGET}",
"password": "${env:ROKU_DEVPASSWORD}",
Expand All @@ -29,6 +30,7 @@
"request": "launch",
"name": "Sample App",
"preLaunchTask": "sample-app",
"rendezvousTracking": false,
"internalConsoleOptions": "neverOpen",
"envFile": "${workspaceFolder}/.vscode/.env",
"host": "${env:ROKU_DEV_TARGET}",
Expand All @@ -49,6 +51,7 @@
"name": "OPEN TEST FILES",
"stopOnEntry": false,
"preLaunchTask": "build-tdd",
"rendezvousTracking": false,
"enableDebugProtocol": true,
"envFile": "${workspaceFolder}/.vscode/.env",
"host": "${env:ROKU_DEV_TARGET}",
Expand Down
32 changes: 32 additions & 0 deletions scripts/maestro-ropm-hook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-disable github/array-foreach */
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
const fs = require('fs-extra');
const path = require('path');

function fixPackagePath(sourceDir) {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
fs.readdirSync(sourceDir).forEach((file) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const filePath = path.join(sourceDir, file);
if (fs.statSync(filePath).isDirectory()) {
fixPackagePath(filePath);
} else if (filePath.endsWith('.xml') || filePath.endsWith('.brs') || filePath.endsWith('.d.bs')) {
let text = fs.readFileSync(filePath, 'utf8');
let r = /\/roku_modules\/undefined\/bslib/gim;
text = text.replace(
r,
'/roku_modules/rokucommunity_bslib/bslib'
);
r = /\/roku_modules\/undefined/gim;
text = text.replace(r, '/roku_modules/maestro');

fs.writeFileSync(filePath, text);
}
});
} catch (e) { }
}

let sourceDir = path.join(__dirname, '..', 'src', 'components', 'roku_modules');
fixPackagePath(sourceDir);
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AdvancedAnimationExampleScreen extends mv.BaseScreen
blendColor: "#0000aa"
opacity: 0
size: [60, 60]
uri: "pkg:/images/button-circle.png"
uri: "pkg:/images/backgrounds/button-circle.png"
},
{
id: "labelBackground"
Expand Down Expand Up @@ -66,7 +66,7 @@ class AdvancedAnimationExampleScreen extends mv.BaseScreen
translation: [340, 0]
blendColor: "#0000aa"
size: [60, 60]
uri: "pkg:/images/button-circle.png"
uri: "pkg:/images/backgrounds/button-circle.png"
},
]
}
Expand Down
1 change: 1 addition & 0 deletions src-ml-test-app/source/debug-screens/TextInputScreen.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "pkg:/source/view/KeyboardDialogUtils.bs"

@node("TextInputScreen", "mv_BaseScreen")
class TextInputScreen extends mv.BaseScreen

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++ Views
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
4 changes: 2 additions & 2 deletions src-ml-test-app/source/debug-screens/list/DisneyHeroScreen.bs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DisneyHeroScreen extends mv.BaseScreen
})
mioc.setInstance("list", m.list)
m.loadingIndicator = m.createSGNode("LoadingIndicator", m.top, "loadingIndicator", {
isActive: true
isActive: false
width: 1920
height: 1080
backgroundVisible: false
Expand Down Expand Up @@ -79,7 +79,7 @@ class DisneyHeroScreen extends mv.BaseScreen
timer.log("makeData")
m.setFocus(m.loadingIndicator)
content@.appendChildren(items)
m.list.content = content
m.list@.setContent(content)
timer.log("set content")
if m.list.state = "rendered"
m.onListRenderState("rendered")
Expand Down

0 comments on commit 2c78729

Please sign in to comment.