Skip to content

Commit 7e5bd1d

Browse files
Update Project
1 parent dd84ade commit 7e5bd1d

File tree

24 files changed

+2680
-3360
lines changed

24 files changed

+2680
-3360
lines changed

.env.docker

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
NODE_ENV=dev
22

33
PORT=3000
4-
5-
POSTGRES_USER=dev_db
6-
POSTGRES_PASSWORD=123
7-
POSTGRES_HOST=db
8-
POSTGRES_DATABSE=dev_db

.eslintrc.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"parserOptions": {
5-
"project": "tsconfig.json",
6-
"sourceType": "module"
7-
},
8-
"plugins": ["import-helpers"],
93
"extends": [
104
"@techmmunity/eslint-config/common",
115
"@techmmunity/eslint-config/typescript",

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## What this PR introduces?
22

3-
<!-- Please, includes adescription of this pull request -->
3+
<!-- Please, includes a description of this pull request -->
44

55
## PR Checklist
66

@@ -12,7 +12,7 @@ Please check if your PR fulfills the following requirements:
1212
- [ ] Swagger Docs for all the possible requests and responses have been added / updated
1313
- [ ] Mocks fot the database have been added / updated
1414
- [ ] Lib of the service have been updated
15-
- [ ] Lib package.json version have been increased and follow semantiic versioning
15+
- [ ] Lib package.json version have been increased and follow semantic versioning
1616

1717
## PR Type
1818

.github/workflows/tests.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,16 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616

17-
- name: Add SSH Key
18-
uses: webfactory/ssh-agent@v0.5.2
19-
with:
20-
ssh-private-key: ${{ secrets.CORE_REPOSITORY_SSH_KEY }}
21-
22-
- name: Clone Core Repository
23-
run: |
24-
git clone git@github.com:techmmunity/core.git
25-
mv core/src src/core
26-
rm -rf core
27-
2817
- name: Install Dependencies
2918
run: |
3019
yarn
3120
32-
- name: Test TypeScript Syntax
21+
- name: Run Tests
3322
run: |
34-
yarn temp:test-tsc
35-
36-
# - name: Run Tests
37-
# run: |
38-
# yarn test:cov
23+
yarn test:cov
3924
40-
# - name: Colect Coverage
41-
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
42-
# uses: coverallsapp/github-action@v1.1.2
43-
# with:
44-
# github-token: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Colect Coverage
26+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
27+
uses: coverallsapp/github-action@v1.1.2
28+
with:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14
1+
v16.13.2

.vscode/extensions.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
{
2-
"recommendations": [
3-
"editorconfig.editorconfig",
4-
"irongeek.vscode-env",
5-
"dbaeumer.vscode-eslint",
6-
"eamodio.gitlens",
7-
"bierner.markdown-preview-github-styles",
8-
"pkief.material-icon-theme",
9-
"esbenp.prettier-vscode",
10-
"gruntfuggly.todo-tree",
11-
"shardulm94.trailing-spaces"
12-
]
2+
"recommendations": ["techmmunity.extensions", "techmmunity.keymap"]
133
}

.vscode/settings.json

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
{
22
// ================== Editor General Config =====================
33

4+
// Defines Prettier as Default Formatter
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
7+
// Add a vertical line on the 80 characters limit
8+
"editor.rulers": [80],
9+
410
// Define Tab Size = 2 Spaces (Half of the Default Size)
511
"editor.tabSize": 2,
612

713
// Disable Tab To Space Conversion
814
"editor.insertSpaces": false,
915

16+
// Disable Identation Detection,
17+
// Because All The Indentations MUST BE
18+
// Tabs With 2 Spaces (ノ °益°)ノ 彡 ┻━┻
19+
// Setted to true because some
20+
// OS projects use 4 spaces ou 2 tabs, etc
21+
"editor.detectIndentation": true,
22+
1023
// Config Default End Of Line Formatting
1124
"files.eol": "\n",
1225

@@ -18,53 +31,40 @@
1831
"source.fixAll.eslint": true
1932
},
2033

34+
// Icons
35+
"workbench.iconTheme": "material-icon-theme",
36+
2137
// Color of Comments
2238
"editor.tokenColorCustomizations": {
2339
"comments": "#00a0eb"
2440
},
2541

2642
// Make VSCode understand this files as files of this languages
2743
"files.associations": {
44+
".sequelizerc": "javascript",
2845
".prettierignore": "ignore",
2946
".lintstagedrc": "json",
3047
".env.*": "env"
3148
},
32-
"material-icon-theme.languages.associations": {
33-
"env": "tune"
34-
},
3549

3650
// ======================= Formatters ===========================
3751

52+
// Disable prettier on files that conclict with eslint
3853
"[javascript]": {
39-
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
54+
"editor.defaultFormatter": null
4055
},
4156
"[typescript]": {
42-
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
57+
"editor.defaultFormatter": null
4358
},
4459
"[javascriptreact]": {
45-
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
60+
"editor.defaultFormatter": null
4661
},
4762
"[typescriptreact]": {
48-
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
63+
"editor.defaultFormatter": null
4964
},
5065

5166
// ================ Languages General Config ====================
5267

53-
// TypeScript
54-
"typescript.updateImportsOnFileMove.enabled": "always",
55-
"typescript.tsserver.log": "verbose",
56-
"typescript.suggest.autoImports": true,
57-
// JavaScript
58-
"javascript.updateImportsOnFileMove.enabled": "always",
59-
"javascript.suggest.autoImports": true,
60-
61-
// =========== Plugins & Extensions General Config ===============
62-
63-
// GitLens
64-
"gitlens.codeLens.recentChange.enabled": false,
65-
"gitlens.codeLens.authors.enabled": true,
66-
"gitlens.codeLens.enabled": false,
67-
6868
// Eslint
6969
"eslint.packageManager": "yarn",
7070
"eslint.validate": [
@@ -81,7 +81,8 @@
8181
"redux": "redux-actions",
8282
"modules": "generator",
8383
"entities": "class",
84-
"migrations": "database"
84+
"migrations": "database",
85+
"@helpers": "utils"
8586
},
8687
"material-icon-theme.files.associations": {
8788
"*.controller.ts": "nest-controller",
@@ -96,14 +97,15 @@
9697
"*.interceptor.ts": "nest-guard",
9798
"*.resolver.ts": "graphql",
9899
"*.input.ts": "graphql",
99-
"*.return.ts": "graphql",
100-
"docker-compose.hmg.yml": "docker",
101-
".env.hmg": "tune",
102-
".env.docker": "tune"
100+
"*.return.ts": "graphql"
101+
},
102+
"material-icon-theme.languages.associations": {
103+
"env": "tune"
103104
},
104105

105106
// TODO Tree
106107
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)",
107108
"todo-tree.general.tags": ["BUG", "HACK", "FIXME", "TODO", "[ ]"],
108-
"todo-tree.tree.showScanModeButton": false
109+
"todo-tree.tree.showScanModeButton": false,
110+
"cSpell.words": ["nestjs", "techmmunity"]
109111
}

FAQ.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ yarn docker
1616
### How do I create a new migration?
1717

1818
- Run `yarn docker` to update your local database
19-
- Code the new entity (Look to the *.entity.ts files for some examples) or make the changes in an already existent entity
19+
- Code the new entity (Look to the \*.entity.ts files for some examples) or make the changes in an already existent entity
2020
- In another terminal, run `yarn docker db` and keep it running
2121
- Run `yarn migration:generate <MIGRATION_NAME>`
2222
- Kill the "`yarn docker db`" terminal
2323

2424
**WARNING:** Always check your migrations! Don't trust, verify!
2525

26-
## Enviroment Variables
26+
## Environment Variables
2727

28-
### How to add a new enviroment variable?
28+
### How to add a new environment variable?
2929

3030
- Update the `src/types/env.d.ts` with the new variable (all variables must have the `string` type)
3131
- Add the new env var in to `.env.docker` file (env vars with sensitive content **MUST** have no value, just the key or an example non-real value)
@@ -70,5 +70,5 @@ yarn docker
7070
- Delete the `src/<API_VERSION>/api/<ENTITY_NAME>/<ENTITY_NAME>.service.spec.ts` file
7171
- Add `@ApiTag` decorator in the controller of the new entity
7272
- Change the base url of the controller of the new entity to contain the api version (ApiConfig.version)
73-
- Save the file of the controller of the new entity to prettier automatilly format the file
74-
- Save the file of the module of the new entity to prettier automatilly format the file
73+
- Save the file of the controller of the new entity to prettier automatically format the file
74+
- Save the file of the module of the new entity to prettier automatically format the file

SETUP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Setup Project Details
22

3-
## Enviroment config
3+
## Environment config
44

55
- [Install yarn](https://classic.yarnpkg.com/en/docs/install/#debian-stable)
66
- [Install docker](https://docs.docker.com/engine/install/)
77
- [Install docker-compose](https://docs.docker.com/compose/install/)
8-
- [Do post-instalation docker steps](https://docs.docker.com/engine/install/linux-postinstall/)
8+
- [Do post-installation docker steps](https://docs.docker.com/engine/install/linux-postinstall/)
99
- [Install VSCode](https://code.visualstudio.com/Download)
1010
- Install **ALL** the extensions recommended in `.vscode/extensions.json`
1111
- **If the changes are not applied automatically** add the content of `.vscode/settings.json` in your personal settings.json

jest.config.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable multiline-comment-style */
2+
/* eslint-disable capitalized-comments */
3+
14
module.exports = {
25
moduleFileExtensions: ["js", "json", "ts"],
36
rootDir: "src",
@@ -16,14 +19,12 @@ module.exports = {
1619
testEnvironment: "node",
1720
moduleDirectories: ["node_modules", "src"],
1821
resetMocks: true,
19-
/*
20-
* CoverageThreshold: {
21-
* global: {
22-
* branches: 100,
23-
* functions: 100,
24-
* lines: 100,
25-
* statements: 100,
26-
* },
27-
* },
28-
*/
22+
// coverageThreshold: {
23+
// global: {
24+
// branches: 100,
25+
// functions: 100,
26+
// lines: 100,
27+
// statements: 100,
28+
// },
29+
// },
2930
};

0 commit comments

Comments
 (0)