Skip to content

Commit

Permalink
a bunch of improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mvshmakov committed Nov 14, 2020
1 parent 6d1f4d9 commit 740cf1d
Show file tree
Hide file tree
Showing 36 changed files with 6,430 additions and 7,266 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
"no-var": "error",
"no-console": "error",
"@typescript-eslint/explicit-function-return-type": "error"
},
"ignorePatterns": ["admin", "configs"]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ dist
src/__tests__/__coverage__
admin/.ipynb_checkpoints
admin/firebase-users-dumps

tsconfig.ts-check.json
21 changes: 21 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require("fs");

const generateTSConfig = (stagedFilenames) => {
const tsconfig = JSON.parse(fs.readFileSync("tsconfig.json", "utf8"));
tsconfig.include = stagedFilenames;
fs.writeFileSync("tsconfig.ts-check.json", JSON.stringify(tsconfig));
return "tsc --noEmit -p tsconfig.ts-check.json";
};

module.exports = {
"*.{js,ts}": [
"eslint --ext .js,.ts --fix --ignore-pattern '!<relative/path/to/filename>'",
generateTSConfig,
"npm run type-check",
"npm run prettier:check",
"npm run lint",
"npm run test:coverage -- --passWithNoTests",
"npm audit fix",
"git add .",
],
};
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
[![dependencies Status](https://david-dm.org/mvshmakov/hse-military-bot/master/status.svg)](https://david-dm.org/mvshmakov/hse-military-bot/master)
[![devDependencies Status](https://david-dm.org/mvshmakov/hse-military-bot/master/dev-status.svg)](https://david-dm.org/mvshmakov/hse-military-bot/master?type=dev)

[Project website](https://hse-military-bot.herokuapp.com/)
[Documentation](https://mvshmakov.github.io/hse-military-bot/)
## [Project website](https://hse-military-bot.herokuapp.com/)

Simply access HSE Military Training Center schedule, prepare news for informating comrades and receive full pack of stickers with people you know well.
## [Documentation](https://mvshmakov.github.io/hse-military-bot/)

Simply access HSE Military Training Center schedule, prepare news for informing comrades and receive full pack of stickers with people you know well.
Stack of technologies used:

- Awesome [Telegraf](http://telegraf.js.org/) wrapper for [Telegram API](https://core.telegram.org/).
Expand All @@ -29,7 +30,7 @@ Stack of technologies used:

## To run an app on local machine:

##### 1) Run `npm i` to install all dependences.
##### 1) Run `npm i` to install all dependencies.

##### 2) Add an `.env` file in root directory with following fields:

Expand Down Expand Up @@ -103,6 +104,6 @@ TODO:

- Правильный хендл всех ошибок про асинхронщину (async/await)

Обязательно используем 14 ноду (хипдамп может не собраться)
Обязательно используем Node.js v14 (хипдамп может не собраться)
Разработка из-под впн (vpnbook)
jupyter lab (не notebook)
2 changes: 2 additions & 0 deletions configs/jest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"testEnvironment": "node",
"rootDir": "..",
"coveragePathIgnorePatterns": ["/node_modules/"],
"coverageDirectory": "<rootDir>/src/__tests__/__coverage__/",
"roots": ["<rootDir>/src/"],
"moduleFileExtensions": ["ts", "tsx", "js", "jsx"],
Expand Down
26 changes: 22 additions & 4 deletions configs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,31 @@ module.exports = {
{
test: /\.tsx?$/,
use: ["babel-loader", "ts-loader"],
exclude: /node_modules/,
exclude: [/node_modules/, /__tests__/],
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
"file-loader?hash=sha512&digest=hex&name=img/[hash].[ext]",
"image-webpack-loader?bypassOnDebug&optipng.optimizationLevel=7&gifsicle.interlaced=false",
rules: [
{
loader: "file-loader",
options: {
name: "img/[hash].[ext]",
hash: "sha512",
digest: "hex",
},
},
{
loader: "image-webpack-loader",
options: {
bypassOnDebug: true,
optipng: {
optimizationLevel: 7,
},
gifsicle: {
interlaced: false,
},
},
},
],
},
{
Expand Down

0 comments on commit 740cf1d

Please sign in to comment.