Skip to content

Commit 8afe58c

Browse files
committed
Update basic configuration
1 parent 7c3605c commit 8afe58c

File tree

5 files changed

+28
-17
lines changed

5 files changed

+28
-17
lines changed

.editorconfig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ root = true
55

66
# Unix-style newlines with a newline ending every file
77
[*]
8-
end_of_line = lf
98
charset = utf-8
10-
insert_final_newline = true
11-
indent_style = space
9+
end_of_line = lf
1210
indent_size = 2
13-
14-
# Matches the exact files either package.json or .travis.yml
15-
[{package.json,.travis.yml}]
1611
indent_style = space
17-
indent_size = 2
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
[Makefile]
16+
indent_size = 4
17+
indent_style = tab

.husky/pre-commit

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx sync-dotenv
54
yarn lint-staged
5+
6+
# check if the .env file exist
7+
if [ ! -f .env ]; then
8+
exit 0
9+
fi
10+
11+
npx sync-dotenv

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"semi": true,
33
"trailingComma": "none",
44
"singleQuote": true,
5-
"printWidth": 80,
5+
"printWidth": 120,
66
"parser": "typescript",
77
"tabWidth": 2
88
}

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help prepare-dev test lint run
1+
.PHONY: help clean
22
.DEFAULT_GOAL := help
33

44
define BROWSER_PYSCRIPT
@@ -22,7 +22,9 @@ endef
2222
export PRINT_HELP_PYSCRIPT
2323

2424
clean: ## Remove log file.
25-
rm -rf logs/**.log logs/**.json build
25+
@rm -rf logs/*.{log,json}
26+
@rm -rf build
27+
@echo "Clean Successful."
2628

27-
help:
29+
help: ## Help
2830
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ Starter for Node.js Express API in Typescript with jsonwebtoken, joi, Knex, Obje
1919
Clone the repository, install the dependencies.
2020

2121
```bash
22+
# Clone repository
2223
$ git clone git@github.com:cham11ng/typescript-api-starter.git <application-name>
2324

2425
$ cd <application-name>
2526

26-
$ cp .env.example .env # Update database credentials
27+
# Update database credentials
28+
$ cp .env.example .env
2729

2830
$ yarn migrate
2931
```
3032

31-
Load fake data in database.
32-
3333
```bash
34+
# Load fake data in database.
3435
$ yarn load:fake <FactoryName> <Number>
3536
```
3637

@@ -41,9 +42,11 @@ $ yarn load:fake <FactoryName> <Number>
4142
Start the application.
4243

4344
```bash
44-
$ yarn build # For production
45+
# For production
46+
$ yarn build
4547

46-
$ yarn start # For development
48+
# For development
49+
$ yarn dev
4750
```
4851

4952
<p align="center">

0 commit comments

Comments
 (0)