Skip to content

Commit

Permalink
chore: update to bsc 0.45.3 (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook authored Feb 26, 2022
1 parent f38dbc1 commit c307c26
Show file tree
Hide file tree
Showing 24 changed files with 1,667 additions and 224 deletions.
622 changes: 622 additions & 0 deletions .vscode/brighterscript.code-snippets

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions .vscode/json.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"loading indicator": {
"prefix": "loadingindicator",
"description": "",
"body": [
"{",
" \"id\": \"$1\",",
" \"_type\": \"LoadingIndicator\",",
" \"width\": ${2:1920},",
" \"height\": ${3:1080},",
" \"backgroundVisible\": ${4|false,true|},",
" \"text\": \"$5\",",
" \"translation\": [${6:0}, ${7:0}]",
"}$0"
]
},
"maestro label": {
"prefix": "mlabel",
"description": "",
"body": [
"{",
" \"id\": \"${1}\",",
" \"_type\": \"m_Label\",",
" \"translation\": [${2}, ${3}],",
" \"size\": [${4:0}, ${5:0}],",
" \"fontKey\": \"${6:~fonts.}\",",
" \"color\": \"${7:~colors.dark}\",",
" \"horizAlign\": \"${8|left,center,right|}\",",
" \"vertlign\": \"${9|top,center,bottom|}\",",
" \"wrap\": ${10|true,false|},",
" \"maxLines\": ${11},",
" \"lineSpacing\": ${12},",
" \"text\": \"$13\"",
"}$0"
]
},
"maestro poster": {
"prefix": "mposter",
"description": "",
"body": [
"{",
" \"id\": \"$1\",",
" \"_type\": \"mv_Poster\",",
" \"size\": [$2, $3],",
" \"translation\": [$4, $5],",
" \"loadSync\": ${6|true,false|},",
" \"loadDisplayMode\": \"${7|limitSize,noScale,scaleToFit,scaleToFill,scaleToZoom|}\",",
" \"loadWidth\": $8,",
" \"loadHeight\": $9,",
" \"blendColor\": \"${10:~colors.}\",",
" \"uri\": \"$11\"",
"}$0"
]
},
"maestro rectangle": {
"prefix": "mrectangle",
"description": "",
"body": [
"{",
" \"id\": \"$1\"",
" \"_type\": \"mv_Rectangle\",",
" \"size\": [${2:1920}, ${3:1080}],",
" \"color\": \"~colors.$4\"",
"}$0,"
]
},
"maestro layoutGroup": {
"prefix": "layoutgroup",
"description": "",
"body": [
"{",
" \"id\": \"$1\",",
" \"_type\": \"mv_LayoutGroup\",",
" \"translation\":[$2, $3],",
" \"layoutDirection\": \"${4|vert,horiz|}\",",
" \"vertAlignment\": \"${5|top,center,bottom|}\",",
" \"horizAlignment\": \"${6|left,center,right|}\",",
" \"itemSpacings\": [$7]",
"}$0,"
]
},
"maestro controlGroup": {
"prefix": "controlgroup",
"description": "",
"body": [
"{",
" \"id\": \"$1\",",
" \"_type\": \"mv_ControlsGroup\",",
" \"translation\":[$2, $3],",
" \"layoutMode\": \"${4|none,vert,horiz|}\",",
" \"keyDirection\": \"${4|vert,horiz|}\",",
" \"vertAlignment\": \"${5|top,center,bottom|}\",",
" \"horizAlignment\": \"${6|left,center,right|}\",",
" \"useFootPrint\": \"${7|true,false|}\",",
" \"selectOnFocus\": \"${8|true,false|}\",",
" \"useSizeForlayout\": \"${9|true,false|}\",",
" \"itemSpacings\": [$10]",
"}$0,"
]
},
"SG group": {
"prefix": "group",
"description": "",
"body": [
"{",
" \"id\": \"$1\",",
" \"_type\": \"Group\",",
" \"translation\": [$2, $3]",
"}$0,"
]
}
}
171 changes: 160 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,160 @@
{
"jira-plugin.workingProject": "",
"workbench.colorCustomizations": {
"statusBar.background": "#551A8B",
"statusBar.debuggingBackground": "#551A8B",
"panelTitle.activeBorder": "#ff0000",
"activityBar.background": "#143141",
"titleBar.activeBackground": "#1D445B",
"titleBar.activeForeground": "#F7FBFD"
}
}
{
"cSpell.ignorePaths": [
"**/package-lock.json",
"**/node_modules/**",
"**/vscode-extension/**",
"**/.git/objects/**",
".vscode",
"dist",
"build"
],
"files.exclude": {
"build": true,
".history": true,
"node_modules": true,
"out": true,
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
"/tmp/**": true,
"**/dist": true,
"**/build": true,
"**/out": true
},
"search.exclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/.meteor/local": true,
"**/build/**": true,
"build/**": true,
"**/.history/**": true,
".history/**": true,
".history/**/*": true,
"out/**": true,
"**/out/**": true,
"/tmp/**": true,
"**/dist": true,
"**/build": true,
"**/out": true
},
"files.useExperimentalFileWatcher": true,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/.meteor/local": true,
"**/build/**": true,
"**/.history/**": true,
".history/**": true,
"**/out/**": true,
"**/dist": true,
"**/build": true,
"**/out": true
},
"cSpell.enableFiletypes": ["markdown"],

"xml.fileAssociations": [
{
"systemId": ".vscode/project.xsd",
"pattern": "**/*.xml"
}
],
"xml.format.splitAttributes": true,
"xml.validation.enabled": false,
"xml.format.preserveEmptyContent": true,
"xml.preferences.quoteStyle": "single",
"xml.format.enforceQuoteStyle": "preferred",
"editor.tabSize": 4,
"[brightscript]": {
"editor.tabSize": 2
},
"[brighterscript]": {
"editor.tabSize": 2
},
"[xml]": {
"editor.tabSize": 2
},
"editor.insertSpaces": true,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"files.trimTrailingWhitespace": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true,
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.colorCustomizations": {
"statusBar.background": "#FF4658",
"statusBar.debuggingBackground": "#932b35",
"panelTitle.activeBorder": "#ff0000",
"activityBar.background": "#304f7d",
"titleBar.activeBackground": "#6A9CE6",
"titleBar.activeForeground": "#FAFBFE"
},
"launches": {
"Run": "Run"
},
"eslint.validate": ["javascript", "typescript"],
"eslint.format.enable": true,
// "eslint.format.enable": true
"gotoNextPreviousMember.symbolKinds": [
"constructor",
"function",
"method",
"module",
"namespace",
"class",
"struct",
"interface"
],
"cSpell.enabledLanguageIds": [
"brightscript",
"javascript",
"markdown",
"plaintext",
"text",
"typescript",
"yml",
"brighterscript"
],
"brightscript.output.clearOnLaunch": true,
"brightscript.output.focusOnLaunch": true,
"brightscript.format.removeTrailingWhiteSpace": false,
"brightscript.output.includeStackTraces": true,
"brightscript.debug.enableDebugProtocol": false,
"brightscript.outputPanelStartupBehavior": "focus",
"brightscript.format.keywordCase": "lower",
"brightscript.enableLanguageServer": true,
"brightscript.deviceDiscovery.enabled": false,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.brs,punctuation.decorator.brs",
"settings": {
"foreground": "#34BEB0",
"fontStyle": ""
}
}
]
},
"brightscript.bsdk": "node_modules/brighterscript",
"brightscript.output.hyperlinkFormat": "FilenameAndFunction",
"cx.server": {
"url": "https://checkmarx.nba-hq.com/",
"alias": "nba",
"username": "",
"password": "",
"project_id": 0,
"team_id": 0,
"project_name": ""
}
}
1 change: 1 addition & 0 deletions bsc-plugin/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-vars': 'off',
Expand Down
6 changes: 5 additions & 1 deletion bsc-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/sinon": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.1",
"brighterscript": "^0.39.0",
"brighterscript": "0.45.3",
"chai": "^4.2.0",
"chai-files": "^1.4.0",
"chai-subset": "^1.6.0",
Expand All @@ -41,10 +41,14 @@
"roku-deploy": "^3.2.4",
"sinon": "^9.0.2",
"source-map-support": "^0.5.13",
"trim-whitespace": "^1.3.3",
"ts-node": "^9.0.0",
"typescript": "^3.8.3",
"typescript-formatter": "^7.2.2"
},
"peerDependencies": {
"brighterscript": "^0.45.3"
},
"scripts": {
"clean": "rm -rf ./dist && mkdir dist",
"compile": "npm run clean && tsc -p .",
Expand Down
2 changes: 1 addition & 1 deletion bsc-plugin/src/lib/rooibos/Annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class RooibosAnnotation {
let noCatch = false;
let noEarlyExit = false;
let nodeName = null;
let tags = [];
let tags = [] as string[];
if (statement.annotations?.length) {
let describeAnnotations = statement.annotations.filter((a) => getAnnotationType(a.name) === AnnotationType.Describe);
if (describeAnnotations.length > 1) {
Expand Down
10 changes: 7 additions & 3 deletions bsc-plugin/src/lib/rooibos/FileFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class FileFactory {
public sourcePath = path.join(__dirname, '../framework');
private targetPath = 'source/rooibos/';
private targetCompsPath = 'components/rooibos/';
public addedFrameworkFiles = [];

public getFrameworkFiles(): FileObj[] {
let files: FileObj[] = [];
Expand All @@ -44,19 +45,20 @@ export class FileFactory {
}

public addFrameworkFiles(program: Program) {
this.addedFrameworkFiles = [];
for (let fileName of this.frameworkFileNames) {
let sourcePath = path.resolve(path.join(this.sourcePath, `${fileName}.bs`));
let fileContents = fs.readFileSync(sourcePath, 'utf8');
let destPath = path.join(this.targetPath, `${fileName}.bs`);
let entry = { src: sourcePath, dest: destPath };

program.addOrReplaceFile(entry, fileContents);
this.addedFrameworkFiles.push(program.setFile(entry, fileContents));
}

let sourcePath = path.resolve(path.join(this.sourcePath, `RooibosScene.xml`));
let destPath = path.join(this.targetCompsPath, `RooibosScene.xml`);
let entry = { src: sourcePath, dest: destPath };
program.addOrReplaceFile(entry, this.createTestXML('TestsScene', 'Scene'));
this.addedFrameworkFiles.push(program.setFile(entry, this.createTestXML('TestsScene', 'Scene')));
}

public createTestXML(name: string, baseName: string, useBs = true): string {
Expand Down Expand Up @@ -99,7 +101,9 @@ ${scriptImports.join('\n')}

public addFile(program, projectPath: string, contents: string) {
try {
return program.addOrReplaceFile({ src: path.resolve(projectPath), dest: projectPath }, contents);
const file = program.setFile({ src: path.resolve(projectPath), dest: projectPath }, contents);
this.addedFrameworkFiles.push(file);
return file;
} catch (error) {
console.error(`Error adding framework file: ${projectPath} : ${error.message}`);
}
Expand Down
Loading

0 comments on commit c307c26

Please sign in to comment.