Skip to content

Commit 47b52c2

Browse files
committed
build: update build script with cache generate and db refresh
1 parent c1541aa commit 47b52c2

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@
22

33
## Быстрый старт
44

5-
```bash
5+
##### Подготовка
6+
```shell script
67
# Установка зависимостей
78
npm install
89

910
# Сборка
1011
npm run build
12+
```
1113

12-
# Инициализация БД
13-
npm run db:refresh
14+
##### Запуск
1415

15-
# Запуск
16+
```shell script
1617
npm start
18+
# или node dist/main.js
19+
```
20+
21+
##### Разработка
1722

18-
#...или с watch и debug
23+
```shell script
1924
npm run start:debug
2025
```
2126

@@ -39,20 +44,12 @@ SECRET=secret_key
3944
## База Данных
4045

4146
Регенерация БД с тестовыми данными:
42-
```bash
47+
```shell script
4348
npm run db:refresh
4449
```
4550

4651
Тестовые данные описаны в `src/maintenance/seed-data.ts`.
4752

4853
## Документация API
4954

50-
http://localhost:3000/api
51-
52-
## Known issues
53-
54-
При автоматической генерации схемы БД не добавляются внешние ключи.
55-
После изменения схемы требуется перегенерировать и дополнить вручную `data/create-schema.sql`.
56-
57-
https://github.com/mikro-orm/mikro-orm/issues/464
58-
https://github.com/knex/knex/issues/3351
55+
http://localhost:3000/api

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "course-vue-backend",
3-
"version": "1.3.3",
3+
"version": "1.3.8",
44
"description": "API backend for learn.javascript.ru VueJS Course",
55
"author": "Grigorii K. Shartsev <me@shgk.me>",
66
"private": true,
77
"license": "MIT",
88
"scripts": {
99
"prebuild": "rimraf dist",
10-
"build": "nest build",
10+
"build": "nest build && mikro-orm cache:generate && npm run db:refresh",
1111
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
1212
"start": "node dist/main",
1313
"start:dev": "nest start --watch --exec \"node -r source-map-support/register\"",
@@ -18,9 +18,7 @@
1818
"test:cov": "jest --coverage",
1919
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
2020
"test:e2e": "jest --config ./test/jest-e2e.json",
21-
"db:refresh": "ts-node src/maintenance/db-refresh-cli.ts",
22-
"db:drop-query": "mikro-orm schema:drop --dump",
23-
"db:create-query": "mikro-orm schema:create --dump"
21+
"db:refresh": "ts-node src/maintenance/db-refresh-cli.ts"
2422
},
2523
"dependencies": {
2624
"@nestjs/common": "^7.0.0",

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function bootstrap() {
3535

3636
const options = new DocumentBuilder()
3737
.setTitle('Meetups API')
38-
.setVersion('1.3.3')
38+
.setVersion('1.3.8')
3939
.addSecurity('cookie-session', {
4040
type: 'apiKey',
4141
in: 'cookie',

0 commit comments

Comments
 (0)