Skip to content

Commit

Permalink
Merge pull request #2333 from crowbartools/v5
Browse files Browse the repository at this point in the history
v5.60.0
  • Loading branch information
zunderscore committed Jan 5, 2024
2 parents 529daa5 + 200e38b commit 648043a
Show file tree
Hide file tree
Showing 585 changed files with 16,688 additions and 10,135 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
root = true

[*.{js,css,scss,sass,mjs}]
[*.{js,ts,tsx,css,scss,sass,mjs}]
charset = utf-8
end_of_line = lf
insert_final_newline = false
Expand Down
35 changes: 29 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
"use strict";

module.exports = {
"root": true,

// Extend from recommened eslint rules
// Indicated by a wrench @ https://eslint.org/docs/rules/
"extends": "eslint:recommended",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],

"parser": "@typescript-eslint/parser",

// "parser": "babel-parser",
"parserOptions": {
// "parser": "babel-parser",
"ecmaVersion": "2020"
"ecmaVersion": "2022"
},

"plugins": ["@typescript-eslint"],

"env": {
"node": true,
"browser": true,
Expand Down Expand Up @@ -45,7 +54,7 @@ module.exports = {
"no-prototype-builtins": "off",

// Deviation from < https://eslint.org/docs/rules/#strict-mode >
"strict": "warn", // require strict mode
"strict": "off", // disabled b/c typescript

// Deviation from < https://eslint.org/docs/rules/#variables >
"no-use-before-define": "warn", // require vars to be defined before use
Expand All @@ -62,7 +71,7 @@ module.exports = {
"comma-style": "warn", // See: https://eslint.org/docs/rules/comma-style
"computed-property-spacing": "warn", // No whitespace when using object[thing]
"curly": "warn", // Must wrap blocks with {}
"indent": ["warn", 4], // Four-space indentions
"indent": "off", // Superseded by TS
"key-spacing": ["warn", {mode: "strict" }], // Exactly one space after object key colons
"keyword-spacing": "warn", // Spaces around keywords
"linebreak-style": "warn", // Line breaks must be \n
Expand All @@ -83,7 +92,21 @@ module.exports = {
"no-var": "warn", // Use let/const instead of var

// Other deviations
"no-unused-vars": "off",
"prefer-template": "warn", // Use template strings instead of + concat
"template-curly-spacing": ["warn", "never"],
"no-useless-concat": "error", // no concat'ing literal strings
"no-empty": ["error", {"allowEmptyCatch": true }],
"no-debugger": "warn",
"no-warning-comments": ["warn", {"terms": ["todo", "to do", "fix", "fixme", "fix me", "need"], "location": "start"}], // warn about todo comments
"no-unused-vars": ["warn"]

// typescript
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/indent": ["warn", 4],
"@typescript-eslint/ban-types": "warn"
}
};
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*.sql text
*.styl text
*.tag text
*.ts text
*.ts text eol=lf
*.tsx text
*.xml text
*.xhtml text
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/test-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,22 @@ on:

jobs:
test:
name: Lint and Test Scss
name: Lint
runs-on: 'ubuntu-latest'
steps:
- name: Setup Nodejs
uses: 'actions/setup-node@v1'
uses: 'actions/setup-node@v3'
with:
node-version: "14.x"
node-version: "18.17.1"

- name: Install Correct NPM Version
run: npm install -g npm@8.16.0
run: npm install -g npm@10.2.4

- name: Checkout branch
uses: 'actions/checkout@v2'
uses: 'actions/checkout@v3'

- name: Run Test Dependencies
run: npm install --global --production eslint@^8.3.0 node-sass@^4.14.1
- name: Install Dependencies
run: npm install

- name: Run Linter
run: eslint . --quiet

- name: Compile GUI CSS
run: node-sass --quiet --source-map=false ./src/gui/scss/ --output=./src/gui/css

- name: Compile Overlay CSS
run: node-sass --quiet --source-map=false ./src/resources/overlay/scss/ --output=./src/resources/overlay/css/
- name: Lint
run: npx --no-install eslint . --quiet
9 changes: 4 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"files.eol": "\n"
},
"editor.formatOnSave": true,
"conventionalCommits.scopes": [
"effects",
Expand All @@ -27,5 +23,8 @@
"ui",
"overlay",
"scripts"
]
],
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
18 changes: 9 additions & 9 deletions grunt/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ grunt cleanup:install

'use strict';
const path = require('path');
const fs = require('fs-extra');
const fs = require('fs');
module.exports = function (grunt) {
grunt.registerTask('cleanup', function (area) {

// Removes /dist/ directory
// Removes /build/ directory
if (area == null || area === '') {
fs.removeSync(path.join(__dirname, '../dist'));
fs.removeSync(path.join(__dirname, '../build'));
fs.rmSync(path.join(__dirname, '../dist'), { recursive: true, force: true });
fs.rmSync(path.join(__dirname, '../build'), { recursive: true, force: true });

// Removes compiled css directories
} else if (area === 'css') {
fs.removeSync(path.join(__dirname, '../build/gui/css'));
fs.removeSync(path.join(__dirname, '../build/resources/overlay/css'));
fs.rmSync(path.join(__dirname, '../build/gui/css'), { recursive: true, force: true });
fs.rmSync(path.join(__dirname, '../build/resources/overlay/css'), { recursive: true, force: true });

// Removes /dist/
} else if (area === 'dist') {
fs.removeSync(path.join(__dirname, '../dist'));
fs.rmSync(path.join(__dirname, '../dist'), { recursive: true, force: true });

// Removes /dist/pack/
} else if (area === 'pack') {
fs.removeSync(path.join(__dirname, '../dist/pack'));
fs.rmSync(path.join(__dirname, '../dist/pack'), { recursive: true, force: true });

// Removes /dist/install/
} else if (area === 'install') {
fs.removeSync(path.join(__dirname, '../dist/install'));
fs.rmSync(path.join(__dirname, '../dist/install'), { recursive: true, force: true });

// Remove /build
} else if (area === 'build') {
fs.removeSync(path.join(__dirname, '../build'));
fs.rmSync(path.join(__dirname, '../build'), { recursive: true, force: true });

} else {
grunt.fail.fatal(new Error('unknown cleanup property'), 1);
Expand Down
22 changes: 11 additions & 11 deletions grunt/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-compress');
let compileCommand;
switch (grunt.config.get('platform')) {
case 'win64':
compileCommand = 'create-windows-installer:win64';
break;
case 'win64':
compileCommand = 'create-windows-installer:win64';
break;

case 'linux':
compileCommand = 'compress:linux';
break;
case 'linux':
compileCommand = 'compress:linux';
break;

case 'darwin':
compileCommand = 'shell:compile-darwin';
break;
case 'darwin':
compileCommand = 'shell:compile-darwin';
break;

default:
throw new Error('unknonw platform');
default:
throw new Error('unknonw platform');
}
grunt.registerTask('compile', ['cleanup:install', compileCommand]);
};
12 changes: 6 additions & 6 deletions grunt/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ grunt copy
*/

'use strict';
const fs = require('fs-extra');
const fs = require('fs');
const path = require('path');

function remFiles(scope) {
const dir = path.join(__dirname, `../dist/pack/Firebot-${scope}-x64/resources/`);

fs.removeSync(path.join(dir, './overlay/'));
fs.removeSync(path.join(dir, './overlay.html'));
fs.removeSync(path.join(dir, './firebot-setup-file-icon.ico'));
fs.removeSync(path.join(dir, './kbm-java/'));
fs.removeSync(path.join(dir, './ffmpeg/'));
fs.rmSync(path.join(dir, './overlay/'), { recursive: true, force: true });
fs.rmSync(path.join(dir, './overlay.html'), { recursive: true, force: true });
fs.rmSync(path.join(dir, './firebot-setup-file-icon.ico'), { recursive: true, force: true });
fs.rmSync(path.join(dir, './kbm-java/'), { recursive: true, force: true });
fs.rmSync(path.join(dir, './ffmpeg/'), { recursive: true, force: true });
}

module.exports = function (grunt) {
Expand Down
4 changes: 2 additions & 2 deletions grunt/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const formatIgnoreList = ignoreList => {
throw new Error('invalid ignore path');
}

const escapedPath = item.path.replace(/[()[\]{}.?+*\\/^$]/, char => ('\\' + char));
const escapedPath = item.path.replace(/[()[\]{}.?+*\\/^$]/, char => (`\\${char}`));

return `--ignore="^[\\\\\\/]?${escapedPath}` + (item.isFile ? '$"' : '(?:$|[\\\\\\/])"');
return `--ignore="^[\\\\\\/]?${escapedPath}${item.isFile ? '$"' : '(?:$|[\\\\\\/])"'}`;
});
};

Expand Down
6 changes: 3 additions & 3 deletions grunt/secrets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const path = require('path');
const fs = require('fs');
const fs = require("fs");
const gpgBase = `gpg --cipher-algo AES256 --passphrase ${process.env.PASSKEY_FOR_FIREBOT_SECRETS} --pinentry-mode loopback`;

module.exports = function (grunt) {
Expand All @@ -26,7 +26,7 @@ module.exports = function (grunt) {
}

if (fs.existsSync(path.join(__dirname, '../secrets.gpg'))) {
fs.unlink('../secrets.gpg');
fs.unlinkSync('../secrets.gpg');
}

grunt.task.run('shell:encryptsecrets');
Expand All @@ -37,7 +37,7 @@ module.exports = function (grunt) {
}

if (fs.existsSync(path.join(__dirname, '../src/secrets.json'))) {
fs.unlink('../src/secrets.json');
fs.unlinkSync('../src/secrets.json');
}

grunt.task.run('shell:decryptsecrets');
Expand Down
Loading

0 comments on commit 648043a

Please sign in to comment.