Skip to content

Commit

Permalink
chore: update buf deps
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Oct 17, 2023
1 parent 4d1705d commit db9034c
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 32 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/extension-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- run: buf generate
working-directory: proto
- uses: pnpm/[email protected]
with:
version: 8
Expand All @@ -28,6 +25,8 @@ jobs:
cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
- run: pnpm install
working-directory: frontend/extension
- run: pnpm type-gen
working-directory: frontend/extension
- name: Run eslint check
run: pnpm lint
working-directory: frontend/extension
Expand All @@ -36,9 +35,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- run: buf generate
working-directory: proto
- uses: pnpm/[email protected]
with:
version: 8
Expand All @@ -49,6 +45,8 @@ jobs:
cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
- run: pnpm install
working-directory: frontend/extension
- run: pnpm type-gen
working-directory: frontend/extension
- name: Run extension build
run: pnpm build
working-directory: frontend/extension
10 changes: 4 additions & 6 deletions .github/workflows/frontend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- run: buf generate
working-directory: proto
- uses: pnpm/[email protected]
with:
version: 8
Expand All @@ -28,6 +25,8 @@ jobs:
cache-dependency-path: "frontend/web/pnpm-lock.yaml"
- run: pnpm install
working-directory: frontend/web
- run: pnpm type-gen
working-directory: frontend/web
- name: Run eslint check
run: pnpm lint
working-directory: frontend/web
Expand All @@ -36,9 +35,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- run: buf generate
working-directory: proto
- uses: pnpm/[email protected]
with:
version: 8
Expand All @@ -49,6 +45,8 @@ jobs:
cache-dependency-path: "frontend/web/pnpm-lock.yaml"
- run: pnpm install
working-directory: frontend/web
- run: pnpm type-gen
working-directory: frontend/web
- name: Run frontend build
run: pnpm build
working-directory: frontend/web
22 changes: 4 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
# Build protobuf.
FROM golang:1.21-alpine AS protobuf
WORKDIR /protobuf-generate

COPY . .

RUN GO111MODULE=on GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/[email protected]

WORKDIR /protobuf-generate/proto

RUN buf generate

# Build frontend dist.
FROM node:18-alpine AS frontend
WORKDIR /frontend-build

COPY ./frontend .

COPY --from=protobuf /protobuf-generate/frontend/web/src/types/proto ./web/src/types/proto
COPY . .

WORKDIR /frontend-build/web
WORKDIR /frontend-build/frontend/web

RUN corepack enable && pnpm i --frozen-lockfile
RUN corepack enable && pnpm i --frozen-lockfile && pnpm type-gen

RUN pnpm build

Expand All @@ -29,7 +15,7 @@ FROM golang:1.21-alpine AS backend
WORKDIR /backend-build

COPY . .
COPY --from=frontend /frontend-build/web/dist ./server/dist
COPY --from=frontend /frontend-build/frontend/web/dist ./server/dist

RUN CGO_ENABLED=0 go build -o slash ./bin/slash/main.go

Expand Down
4 changes: 3 additions & 1 deletion frontend/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "plasmo build",
"package": "plasmo package",
"lint": "eslint --ext .js,.ts,.tsx, src",
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix"
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix",
"type-gen": "cd ../../proto && buf generate"
},
"dependencies": {
"@emotion/react": "^11.11.1",
Expand All @@ -26,6 +27,7 @@
"zustand": "^4.4.1"
},
"devDependencies": {
"@bufbuild/buf": "^1.27.0",
"@trivago/prettier-plugin-sort-imports": "4.1.0",
"@types/chrome": "0.0.241",
"@types/lodash-es": "^4.17.9",
Expand Down
71 changes: 71 additions & 0 deletions frontend/extension/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion frontend/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"build": "tsc && vite build",
"serve": "vite preview",
"lint": "eslint --ext .js,.ts,.tsx, src",
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix"
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix",
"type-gen": "cd ../../proto && buf generate"
},
"dependencies": {
"@emotion/react": "^11.11.1",
Expand All @@ -32,6 +33,7 @@
"zustand": "^4.4.1"
},
"devDependencies": {
"@bufbuild/buf": "^1.27.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/lodash-es": "^4.17.9",
"@types/react": "^18.2.23",
Expand Down
71 changes: 71 additions & 0 deletions frontend/web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db9034c

Please sign in to comment.