feat: add some dev tools in the docker compose (#2309)
* Add some dev tools in the docker compose * Merge tsc and lint
This commit is contained in:
parent
c72f221fc0
commit
255254eb69
2 changed files with 41 additions and 1 deletions
|
|
@ -34,3 +34,43 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./web:/work
|
- ./web:/work
|
||||||
- ./.air/node_modules/:/work/node_modules/ # Cache for Node Modules
|
- ./.air/node_modules/:/work/node_modules/ # Cache for Node Modules
|
||||||
|
|
||||||
|
# Services below are used for developers to run once
|
||||||
|
#
|
||||||
|
# You can just run `docker compose run --rm SERVICE_NAME` to use
|
||||||
|
# For example:
|
||||||
|
# To regenerate typescript code of gRPC proto
|
||||||
|
# Just run `docker compose run --rm buf`
|
||||||
|
#
|
||||||
|
# All of theses services belongs to profile 'tools'
|
||||||
|
# This will prevent to launch by normally `docker compose up` unexpectly
|
||||||
|
|
||||||
|
# Generate typescript code of gRPC proto
|
||||||
|
buf:
|
||||||
|
profiles: ["tools"]
|
||||||
|
image: bufbuild/buf
|
||||||
|
working_dir: /work/proto
|
||||||
|
command: generate
|
||||||
|
volumes:
|
||||||
|
- ./proto:/work/proto
|
||||||
|
- ./web/src/types/:/work/web/src/types/
|
||||||
|
|
||||||
|
# Do golang static code check before create PR
|
||||||
|
golangci-lint:
|
||||||
|
profiles: ["tools"]
|
||||||
|
image: golangci/golangci-lint:v1.54.2
|
||||||
|
working_dir: /work/
|
||||||
|
command: golangci-lint run -v
|
||||||
|
volumes:
|
||||||
|
- $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host
|
||||||
|
- .:/work/
|
||||||
|
|
||||||
|
# Do javascript lint before create PR
|
||||||
|
lint:
|
||||||
|
profiles: ["tools"]
|
||||||
|
image: node:18-alpine
|
||||||
|
working_dir: /work
|
||||||
|
command: npm run lint
|
||||||
|
volumes:
|
||||||
|
- ./web:/work
|
||||||
|
- ./.air/node_modules/:/work/node_modules/
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"lint": "eslint --ext .js,.ts,.tsx, src",
|
"lint": "tsc && eslint --ext .js,.ts,.tsx, src",
|
||||||
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix"
|
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@8.7.0",
|
"packageManager": "pnpm@8.7.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue