Better debugging
This commit is contained in:
1 parent
ce04a1af1a
commit
21593001ae
7 files changed
+44
-7
No files matched your search
Vendored
+2
-1
@@ -11,13 +11,14 @@
|
|||||||
"enableDebuggerAutoRecovery": false,
|
"enableDebuggerAutoRecovery": false,
|
||||||
"stopDebuggerOnAppExit": false,
|
"stopDebuggerOnAppExit": false,
|
||||||
"rootDir": "${workspaceFolder}/dist/build",
|
"rootDir": "${workspaceFolder}/dist/build",
|
||||||
"preLaunchTask": "build",
|
"preLaunchTask": "build-dev",
|
||||||
"name": "Launch playlet (dev)",
|
"name": "Launch playlet (dev)",
|
||||||
"injectRdbOnDeviceComponent": true
|
"injectRdbOnDeviceComponent": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "brightscript",
|
"type": "brightscript",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
"envFile": "${workspaceFolder}/.vscode/.env",
|
||||||
"host": "${env:ROKU_DEV_TARGET}",
|
"host": "${env:ROKU_DEV_TARGET}",
|
||||||
"password": "${env:ROKU_DEVPASSWORD}",
|
"password": "${env:ROKU_DEVPASSWORD}",
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,13 +2,13 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "build",
|
"label": "build-dev",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"close": true,
|
"close": true,
|
||||||
"reveal": "silent",
|
"reveal": "silent",
|
||||||
"revealProblems": "onProblem"
|
"revealProblems": "onProblem"
|
||||||
},
|
},
|
||||||
"script": "build",
|
"script": "build:dev",
|
||||||
"type": "npm"
|
"type": "npm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-1
@@ -28,7 +28,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rm -rf dist",
|
"prebuild": "rm -rf dist",
|
||||||
"build": "bsc",
|
"build": "bsc",
|
||||||
"build:prod": "npm run build -- --sourceMap=false",
|
"build:dev": "npm run manifest-symbols -- DEBUG=true && npm run build",
|
||||||
|
"build:prod": "npm run manifest-symbols -- DEBUG=false && npm run build -- --sourceMap=false",
|
||||||
"build:release": "npm run format:fix && npm run lint:fix && npm run manifest-version && npm run generate-images && npm run build:prod && npm run zip-package",
|
"build:release": "npm run format:fix && npm run lint:fix && npm run manifest-version && npm run generate-images && npm run build:prod && npm run zip-package",
|
||||||
"lint": "bslint --project config/bsconfig.lint.json --lintConfig config/bslint.jsonc",
|
"lint": "bslint --project config/bsconfig.lint.json --lintConfig config/bslint.jsonc",
|
||||||
"lint:fix": "npm run lint -- --fix",
|
"lint:fix": "npm run lint -- --fix",
|
||||||
@@ -39,6 +40,7 @@
|
|||||||
"manifest-version": "node scripts/update-manifest-version.js",
|
"manifest-version": "node scripts/update-manifest-version.js",
|
||||||
"zip-package": "node scripts/zip-package.js",
|
"zip-package": "node scripts/zip-package.js",
|
||||||
"screenshot": "node scripts/screenshot.js",
|
"screenshot": "node scripts/screenshot.js",
|
||||||
|
"manifest-symbols": "node scripts/update-manifest-symbols.js",
|
||||||
"postinstall": "npx ropm copy"
|
"postinstall": "npx ropm copy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
if (process.argv.length < 3) {
|
||||||
|
console.error("Invalid usage! usage: npm run manifest-symbols -- SYMBOL1=true [SYMBOL2=false]")
|
||||||
|
exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function argsToSymbolsObject(arr) {
|
||||||
|
return arr.reduce(function (acc, value) {
|
||||||
|
keyValue = value.split("=")
|
||||||
|
acc[keyValue[0]] = keyValue[1]
|
||||||
|
return acc
|
||||||
|
}, {})
|
||||||
|
}
|
||||||
|
|
||||||
|
const newSymbols = argsToSymbolsObject(process.argv.slice(2))
|
||||||
|
let currentSymbols = {}
|
||||||
|
|
||||||
|
const appManifestLines = fs.readFileSync("./src/manifest", { encoding: 'utf8', flag: 'r' }).split('\n')
|
||||||
|
const bsConstIndex = appManifestLines.findIndex(line => line.startsWith("bs_const="))
|
||||||
|
if (bsConstIndex !== -1) {
|
||||||
|
let bsConst = appManifestLines[bsConstIndex]
|
||||||
|
bsConst = bsConst.substring("bs_const=".length)
|
||||||
|
currentSymbols = argsToSymbolsObject(bsConst.split(";"))
|
||||||
|
}
|
||||||
|
|
||||||
|
mergedSymbols = {...currentSymbols, ...newSymbols}
|
||||||
|
|
||||||
|
bsConst = "bs_const=" + Object.keys(mergedSymbols).map(key => `${key}=${mergedSymbols[key]}`).join(";")
|
||||||
|
|
||||||
|
appManifestLines[bsConstIndex] = bsConst
|
||||||
|
|
||||||
|
fs.writeFileSync("./src/manifest", appManifestLines.join("\n"))
|
||||||
@@ -37,7 +37,7 @@ function WebServerLoop()
|
|||||||
m.server.UseRouter(new Http.StateApiRouter())
|
m.server.UseRouter(new Http.StateApiRouter())
|
||||||
m.server.UseRouter(new Http.InvidiousRouter())
|
m.server.UseRouter(new Http.InvidiousRouter())
|
||||||
m.server.UseRouter(new Http.HttpStaticFilesRouter("/", m.settings.WwwRoot))
|
m.server.UseRouter(new Http.HttpStaticFilesRouter("/", m.settings.WwwRoot))
|
||||||
#if WEB_SERVER_PACKAGE_DEBUG
|
#if DEBUG
|
||||||
m.server.UseRouter(new Http.HttpStaticFilesRouter("/debug/pkg", "pkg:/", true, true))
|
m.server.UseRouter(new Http.HttpStaticFilesRouter("/debug/pkg", "pkg:/", true, true))
|
||||||
m.server.UseRouter(new Http.HttpStaticFilesRouter("/debug/tmp", "tmp:/", true, true))
|
m.server.UseRouter(new Http.HttpStaticFilesRouter("/debug/tmp", "tmp:/", true, true))
|
||||||
m.server.UseRouter(new Http.HttpStaticFilesRouter("/debug/cachefs", "cachefs:/", true, true))
|
m.server.UseRouter(new Http.HttpStaticFilesRouter("/debug/cachefs", "cachefs:/", true, true))
|
||||||
|
|||||||
+1
-1
@@ -21,4 +21,4 @@ splash_screen_sd=pkg:/images/splash-screen_sd.jpg
|
|||||||
splash_color=#242424
|
splash_color=#242424
|
||||||
splash_min_time=0
|
splash_min_time=0
|
||||||
|
|
||||||
bs_const=WEB_SERVER_BASIC_AUTH=false;WEB_SERVER_PACKAGE_DEBUG=false;DASH_THUMBNAILS=false
|
bs_const=DEBUG=true;WEB_SERVER_BASIC_AUTH=false;DASH_THUMBNAILS=false
|
||||||
+2
-1
@@ -9,8 +9,9 @@ function main() as void
|
|||||||
|
|
||||||
' The following comment is to enable the SceneGraph inspector
|
' The following comment is to enable the SceneGraph inspector
|
||||||
' on the VSCode BrightScript plugin.
|
' on the VSCode BrightScript plugin.
|
||||||
|
#if DEBUG
|
||||||
' vscode_rdb_on_device_component_entry
|
' vscode_rdb_on_device_component_entry
|
||||||
|
#end if
|
||||||
|
|
||||||
while true
|
while true
|
||||||
msg = wait(0, m.port)
|
msg = wait(0, m.port)
|
||||||
|
|||||||
Reference in new issue
Block a user