-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
49 changed files
with
2,716 additions
and
2,693 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
lib | ||
dist | ||
*.js |
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,18 +1,23 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"env": { | ||
"jest/globals": true | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"jest" | ||
], | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:jest/all" | ||
], | ||
"parserOptions": { | ||
"project": "tsconfig.json" | ||
}, | ||
"rules": { | ||
"class-methods-use-this": 0 | ||
} | ||
"@typescript-eslint", | ||
"jest" | ||
], | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:jest/all", | ||
"plugin:import/recommended" | ||
], | ||
"parserOptions": { | ||
"project": "tsconfig.json" | ||
}, | ||
"rules": { | ||
"class-methods-use-this": 0, | ||
"jest/require-hook": 0 | ||
} | ||
} |
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,70 @@ | ||
name: CI Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- ".github/workflows/ci.yml" | ||
- "src/**" | ||
- "tests/**" | ||
- "package.json" | ||
- "yarn.lock" | ||
- "tsconfig*" | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- ".github/workflows/ci.yml" | ||
- "src/**" | ||
- "tests/**" | ||
- "package.json" | ||
- "yarn.lock" | ||
- "tsconfig*" | ||
|
||
jobs: | ||
code_analysis: | ||
name: "Code Analysis" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout repository on branch ${{ github.ref }}" | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install packages | ||
run: yarn | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Test | ||
shell: bash | ||
run: | | ||
yarn test:ci | ||
- name: Build | ||
run: | | ||
yarn build | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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,28 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"eslint.validate": ["javascript", "typescript", "typescriptreact"], | ||
"eslint.alwaysShowStatus": true, | ||
} | ||
"typescript.referencesCodeLens.enabled": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"typescript", | ||
"typescriptreact" | ||
], | ||
"eslint.alwaysShowStatus": true, | ||
"eslint.packageManager": "yarn", | ||
"cSpell.language": "en,pt,pt_BR", | ||
"files.associations": { | ||
"*.env.dev": "env", | ||
"*.env.prod": "env", | ||
"*.env.prd": "env", | ||
"*.env.example": "env", | ||
}, | ||
"cSpell.words": [ | ||
"autoload", | ||
"firstdown", | ||
"inversify", | ||
"rotowire", | ||
"Rotowire", | ||
"tslog" | ||
] | ||
} |
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,10 @@ | ||
module.exports = { | ||
verbose: true, | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
transform: { '^.+\\.ts?$': 'ts-jest' }, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
coverageDirectory: 'coverage', | ||
reporters: ['default', 'jest-sonar'], | ||
testRegex: '(/tests/unit-tests.*|(\\.|/)(test|spec))\\.[jt]sx?$', | ||
}; |
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,14 +1,22 @@ | ||
{ | ||
"name": "nfl-telegram-bot", | ||
"version": "2.1.4", | ||
"version": "3.0.0", | ||
"description": "A Telegram bot that provides the latest news about the NFL", | ||
"repository": "github:jpmoura/nfl-news-for-telegram", | ||
"main": "index.ts", | ||
"main": "src/index.ts", | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">= 12.0.0" | ||
}, | ||
"scripts": { | ||
"prestart": "yarn build", | ||
"start": "node ./dist/index.js", | ||
"tsc": "tsc", | ||
"commit": "git-cz", | ||
"sonar": "node sonar-project.js" | ||
"prebuild": "npx rimraf dist", | ||
"build": "npx tsc --project ./tsconfig.build.json", | ||
"test": "jest", | ||
"test:cov": "jest --coverage", | ||
"test:ci": "yarn test:cov --maxWorkers=2", | ||
"lint": "npx eslint --ext .ts src/ tests/" | ||
}, | ||
"keywords": [ | ||
"NFL", | ||
|
@@ -33,28 +41,37 @@ | |
"axios": "^0.21.2", | ||
"cheerio": "^1.0.0-rc.5", | ||
"dotenv": "^6.1.0", | ||
"inversify": "^6.0.1", | ||
"nedb": "^1.8.0", | ||
"node-schedule": "^1.3.0", | ||
"reflect-metadata": "^0.1.13", | ||
"telegraf": "^3.25.0", | ||
"tslog": "^3.3.1", | ||
"twit": "^2.2.11" | ||
}, | ||
"devDependencies": { | ||
"@types/cheerio": "^0.22.22", | ||
"@types/dotenv": "^8.2.0", | ||
"@types/faker": "^5.5.9", | ||
"@types/inversify": "^2.0.33", | ||
"@types/jest": "^27.0.3", | ||
"@types/nedb": "^1.8.11", | ||
"@types/node-schedule": "^1.3.1", | ||
"@types/twit": "^2.2.28", | ||
"@typescript-eslint/eslint-plugin": "^4.8.1", | ||
"@typescript-eslint/parser": "^4.8.1", | ||
"@typescript-eslint/eslint-plugin": "^5.9.0", | ||
"@typescript-eslint/parser": "^5.9.0", | ||
"commitizen": "^4.2.2", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^7.14.0", | ||
"eslint-config-airbnb-typescript": "^12.0.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint": "^8.6.0", | ||
"eslint-config-airbnb-typescript": "^16.1.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jest": "^25.3.4", | ||
"faker": "^5.5.3", | ||
"husky": "^4.3.4", | ||
"jest": "^26.6.3", | ||
"sonarqube-scanner": "^2.8.0", | ||
"typescript": "^4.1.2" | ||
"jest": "^27.4.7", | ||
"jest-mock-extended": "^2.0.4", | ||
"jest-sonar": "^0.2.12", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^27.1.2", | ||
"typescript": "^4.5.4" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
sonar.projectKey=jpmoura_nfl-news-for-telegram | ||
sonar.organization=jpmoura-github | ||
sonar.projectName=nfl-telegram-bot | ||
sonar.sourceEncoding=UTF-8 | ||
sonar.sources=src | ||
sonar.exclusions="tests/**/*" | ||
sonar.tests="tests" | ||
sonar.testExecutionReportPaths="coverage/sonar-report.xml" | ||
sonar.javascript.lcov.reportPaths="coverage/lcov.info" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.