Skip to content

Commit

Permalink
Обновлены все модули, начат переезд на TS (#85)
Browse files Browse the repository at this point in the history
* feature: added typescript compiler, airbnb linter, updated to latest node lts

* style: linted src directory

* refactor: moved to typescript

* fix: finished convertion to ts of all infrastructure components

* Update .eslintrc

* fix: properly working with node env

* refactor: reduced the quantity of code entities
  • Loading branch information
atassis authored Dec 1, 2020
1 parent 0ab2f57 commit dab34a2
Show file tree
Hide file tree
Showing 91 changed files with 4,445 additions and 10,453 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,10 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
data
dist
.vscode
nodemon.json
codecov.yml
.travis.yml
.env
.env.example
27 changes: 24 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
{
"extends": "@atomix/eslint-config",
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint/eslint-plugin",
"@typescript-eslint",
"prettier"
],
"extends": [
"airbnb-typescript/base",
"eslint:recommended",
"prettier",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"root": true,
"env": {
"node": true
},
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"object-curly-newline": "off",
"object-curly-spacing": "off"
"import/prefer-default-export": "off"
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ $RECYCLE.BIN/
.chatlist.json
.idea
data
/src/.chatlist.json
/.chatlist.json

dist
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
sudo: off
node_js:
- 8.9.1
- 9.2.0
- lts/erbium

after_success: npm run coverage
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# ---- Base Node ----
FROM node:carbon-alpine as base
FROM node:fermium-alpine as base
# set working directory
WORKDIR /root/app
# Set entrypoint
ENTRYPOINT [ "npm", "run" ]
# copy project file
COPY package.json package-lock.json .sequelizerc ./
COPY . .

#
# ---- Dependencies ----
FROM base AS dependencies
# install node packages
RUN npm set progress=false && npm config set depth 0
RUN npm install --only=production
RUN npm install && npm run build

#
# ---- Release ----
FROM base AS release
# copy production node_modules
COPY --from=dependencies /root/app/node_modules ./node_modules
# copy app sources
COPY src src
COPY --from=base /root/app/dist ./dist
RUN npm install
# expose port and define CMD
EXPOSE 3000
CMD ["start"]
26 changes: 0 additions & 26 deletions Dockerfile-development

This file was deleted.

30 changes: 0 additions & 30 deletions docker-compose.infrastructure.yml

This file was deleted.

9 changes: 0 additions & 9 deletions docker-compose.override.yml

This file was deleted.

28 changes: 25 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,37 @@ services:
build: .
restart: on-failure
env_file:
- ./.env
- ./.env
environment:
- NODE_ENV=production
postgres:
image: postgres:9-alpine
restart: always
env_file:
- ./.env
- ./.env
volumes:
- ./data/pgsql/data:/var/lib/postgresql/data
- ./data/pgsql/config:/etc/postgresql
- ./data/pgsql/logs:/var/log/postgresql/
admin:
image: sosedoff/pgweb
restart: always
ports:
- 10000:8081
elasticsearch:
image: elasticsearch:7.9.2
restart: always
env_file:
- ./.env
environment:
- discovery.type=single-node
volumes:
- ./data/elastic:/usr/share/elasticsearch/data
kibana:
image: kibana:7.9.2
env_file:
- ./.env
ports:
- 5432:5432
- 10001:5601
links:
- elasticsearch
6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"watch": [],
"ext": ".ts,.js",
"ignore": [],
"exec": "ts-node ./src"
}
Loading

0 comments on commit dab34a2

Please sign in to comment.