-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CI: Updates GitHub Actions workflows * SYNTAX: Corrects some syntax mistakes * DOC: Adds support me on buttons
- Loading branch information
1 parent
12354e2
commit cf58d01
Showing
16 changed files
with
271 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
module.exports = { | ||
overrides: [ | ||
{ | ||
files: [ | ||
"js/widget.js", | ||
"js/util.js", | ||
"js/settings.js", | ||
"js/backend.js", | ||
"js/translator.js", | ||
"test/util.test.js", | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: "module", | ||
}, | ||
ecmaFeatures: { | ||
impliedStrict: true, | ||
}, | ||
env: { | ||
browser: true, | ||
es2022: true, | ||
jest: true, | ||
}, | ||
extends: ["eslint:recommended"], | ||
rules: { | ||
semi: "error", | ||
indent: ["error", 2], | ||
"no-multi-spaces": "error", | ||
"space-in-parens": "error", | ||
"no-multiple-empty-lines": "error", | ||
"prefer-const": "error", | ||
"no-use-before-define": "error", | ||
"no-console": "error", | ||
curly: "error", | ||
"no-undef-init": "error", | ||
"init-declarations": ["error", "always"], | ||
quotes: ["error", "backtick"], | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
"build/version-update.js", | ||
"build/version-check.js", | ||
"build/notarize.js", | ||
"js/auto-update.js", | ||
"js/logger.js", | ||
"js/preload.js", | ||
"main.js", | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2022, | ||
}, | ||
ecmaFeatures: { | ||
impliedStrict: true, | ||
}, | ||
env: { | ||
browser: true, | ||
node: true, | ||
es2022: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings", | ||
], | ||
rules: { | ||
semi: "error", | ||
indent: ["error", 2], | ||
"no-multi-spaces": "error", | ||
"space-in-parens": "error", | ||
"no-multiple-empty-lines": "error", | ||
"prefer-const": "error", | ||
"no-use-before-define": "error", | ||
"no-console": "error", | ||
curly: "error", | ||
"no-undef-init": "error", | ||
"init-declarations": ["error", "always"], | ||
quotes: ["error", "backtick"], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Check the source code | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21.1.0' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run linter | ||
run: npm run lint | ||
|
||
version-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21.1.0' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Check README files version | ||
run: npm run version-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
node_modules/ | ||
coverage/ | ||
.vscode/ | ||
.eslintrc.js | ||
package-lock.json | ||
*.code-workspace | ||
out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const fs = require(`fs`); | ||
const path = require(`path`); | ||
|
||
const RED = `\x1b[1;91m`; | ||
const YELLOW = `\x1b[1;93m`; | ||
const GREEN = `\x1b[1;92m`; | ||
const RESET = `\x1b[0m`; | ||
|
||
console.log(`Current package.json version is: ${YELLOW}${process.env.npm_package_version}${RESET}\n`); | ||
|
||
let countOldVersion = 0; | ||
|
||
const readmeFiles = [ | ||
path.join(process.cwd(), `README.md`), | ||
path.join(process.cwd(), `docs`, `README.it.md`), | ||
path.join(process.cwd(), `docs`, `README.pl.md`), | ||
path.join(process.cwd(), `docs`, `README.ru.md`), | ||
]; | ||
|
||
readmeFiles.forEach((file) => { | ||
try { | ||
const readmeContent = fs.readFileSync(file, `utf-8`); | ||
const linksInFileArray = readmeContent.match(/\d\.\d\.\d-beta/g); | ||
|
||
let hasOldVersion = false; | ||
|
||
linksInFileArray.some((linkVersion) => { | ||
if (linkVersion != process.env.npm_package_version) { | ||
hasOldVersion = true; | ||
countOldVersion++; | ||
} | ||
return hasOldVersion; | ||
}); | ||
|
||
if (hasOldVersion) { | ||
console.log(`${RED}${path.relative(process.cwd(), file)}${RESET} is outdated`); | ||
} else { | ||
console.log(`${GREEN}${path.relative(process.cwd(), file)}${RESET} is ok`); | ||
} | ||
} catch (error) { | ||
console.error(`${RED}Error reading file: ${path.relative(process.cwd(), file)}${RESET}: \n${error}`); | ||
} | ||
}); | ||
|
||
console.log(`\nVersion-check job is done`); | ||
|
||
if (countOldVersion > 0) { | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.