Skip to content

Commit

Permalink
fix: 🐛 update prisma, use node 18, use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
yeukfei02 committed Sep 17, 2023
1 parent 5156e7c commit c7d5ac7
Show file tree
Hide file tree
Showing 5 changed files with 7,582 additions and 6,826 deletions.
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@ Api for playing around with dummy data. Feel free to use it in your demo project

- listing api default page = 1, default per page = 20

swagger: <http://localhost:3000/api/>

documentation: <https://documenter.getpostman.com/view/3827865/Uyr8kHHD>

## Requirement

- install yarn
- install node (v14+)
- install pnpm
- install node (v18+)

## Testing and run

```zsh
// test api in local
$ yarn run start:dev
$ pnpm run start:dev

// run in production
$ yarn run start:prod
$ pnpm run start:prod

// lint code
$ yarn run lint
$ pnpm run lint

// format code
$ yarn run format
$ pnpm run format

// run test case
$ yarn run test
$ pnpm run test

// create module
$ nest g module <module-name>
Expand All @@ -43,34 +45,34 @@ $ nest g controller <controller-name>
$ nest g service <service-name>

// generate schema.prisma and prisma client
$ yarn run prisma:generate
$ pnpm run prisma:generate

// create migration file if schema.prisma changed
$ yarn run prisma:migrate:dev
$ pnpm run prisma:migrate:dev

// reset database
$ yarn run prisma:migrate:reset
$ pnpm run prisma:migrate:reset

// apply pending migrations in the production/staging database
$ yarn run prisma:migrate:deploy
$ pnpm run prisma:migrate:deploy

// check migrations status in the production/staging database
$ yarn run prisma:migrate:status
$ pnpm run prisma:migrate:status

// push schema.prisma state to database
$ yarn run prisma:db:push
$ pnpm run prisma:db:push

// seed data to database
$ yarn run prisma:db:seed
$ pnpm run prisma:db:seed

// validate schema.prisma
$ yarn run prisma:validate
$ pnpm run prisma:validate

// format schema.prisma
$ yarn run prisma:format
$ pnpm run prisma:format

// open prisma studio
$ yarn run prisma:studio
$ pnpm run prisma:studio
```
## Docker
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
"author": "Donald Wu <yeukfei02@gmail.com>",
"license": "MIT",
"engines": {
"node": "14.18.0",
"npm": "6.14.15",
"yarn": ">=1.22.0"
"node": "18.17.0",
"pnpm": ">=8.7.0"
},
"dependencies": {
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^2.1.0",
"@nestjs/core": "^8.0.0",
"@nestjs/platform-express": "^8.0.0",
"@nestjs/swagger": "^5.2.1",
"@prisma/client": "^4.11.0",
"@prisma/client": "^5.3.1",
"@sentry/node": "^6.19.7",
"@sentry/tracing": "^6.19.7",
"axios": "^0.26.1",
Expand Down Expand Up @@ -58,7 +57,7 @@
"husky": "^7.0.0",
"jest": "^27.2.5",
"prettier": "^2.3.2",
"prisma": "^4.11.0",
"prisma": "^5.3.1",
"source-map-support": "^0.5.20",
"standard-version": "^9.3.2",
"supertest": "^6.1.3",
Expand Down
Loading

0 comments on commit c7d5ac7

Please sign in to comment.