chore: use git+https SDK dependency, drop proto codegen from prod build

This commit is contained in:
2026-08-17 14:13:57 +08:00
parent ae0e920b18
commit f2718c6c14
4 changed files with 4 additions and 16 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ Single-page Vue 3 app (JavaScript, no TypeScript). UI library is Element Plus, s
### gRPC-Web API layer ### gRPC-Web API layer
Backend communication uses ConnectRPC (gRPC-Web). Generated protobuf code lives in `src/gen/` — **gitignored**, produced at build time by `protoc` from `proto/yoresee_doc/v1/yoresee_doc.proto` (sibling repo directory). The production Dockerfile runs codegen before `npm run build`. Backend communication uses ConnectRPC (gRPC-Web). Generated protobuf code comes from the npm package `@yoresee-doc/sdk-node` (ESM/Connect build), pinned to tag `v0.1.0` in `package.json` (`git+https://git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#v0.1.0`). No local codegen required.
- `src/services/grpc_client.js` — transport, client instances, `unaryCall` wrapper, `messages` re-export - `src/services/grpc_client.js` — transport, client instances, `unaryCall` wrapper, `messages` re-export
- `src/services/api/*.js` — domain API functions that wrap `unaryCall` with protobuf request/response mappers - `src/services/api/*.js` — domain API functions that wrap `unaryCall` with protobuf request/response mappers
-12
View File
@@ -5,19 +5,7 @@ WORKDIR /app/frontend
COPY frontend/package*.json ./ COPY frontend/package*.json ./
RUN npm install RUN npm install
RUN apk add --no-cache protobuf
COPY frontend ./ COPY frontend ./
COPY proto /app/proto
RUN mkdir -p /app/frontend/src/gen
RUN protoc -I /app/proto \
--plugin=protoc-gen-es=/app/frontend/node_modules/.bin/protoc-gen-es \
--plugin=protoc-gen-connect-es=/app/frontend/node_modules/.bin/protoc-gen-connect-es \
--es_out=/app/frontend/src/gen --es_opt=target=js,import_extension=.js \
--connect-es_out=/app/frontend/src/gen --connect-es_opt=target=js,import_extension=.js \
/app/proto/yoresee_doc/v1/yoresee_doc.proto
RUN npm run build RUN npm run build
+2 -2
View File
@@ -23,7 +23,7 @@
"@tiptap/extension-underline": "^3.22.2", "@tiptap/extension-underline": "^3.22.2",
"@tiptap/starter-kit": "^3.22.2", "@tiptap/starter-kit": "^3.22.2",
"@tiptap/vue-3": "^3.22.2", "@tiptap/vue-3": "^3.22.2",
"@yoresee-doc/sdk-node": "git+ssh://git@git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#v0.1.0", "@yoresee-doc/sdk-node": "git+https://git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#v0.1.0",
"axios": "^1.13.5", "axios": "^1.13.5",
"codemirror": "^5.65.21", "codemirror": "^5.65.21",
"diff": "^8.0.4", "diff": "^8.0.4",
@@ -2239,7 +2239,7 @@
}, },
"node_modules/@yoresee-doc/sdk-node": { "node_modules/@yoresee-doc/sdk-node": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "git+ssh://git@git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#d4ffd77e1c1a71ec2008b3daa07ff4e4e22f70c0", "resolved": "git+https://git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#d4ffd77e1c1a71ec2008b3daa07ff4e4e22f70c0",
"dependencies": { "dependencies": {
"@bufbuild/protobuf": "^1.10.0", "@bufbuild/protobuf": "^1.10.0",
"@connectrpc/connect": "^1.7.0", "@connectrpc/connect": "^1.7.0",
+1 -1
View File
@@ -24,7 +24,7 @@
"@tiptap/extension-underline": "^3.22.2", "@tiptap/extension-underline": "^3.22.2",
"@tiptap/starter-kit": "^3.22.2", "@tiptap/starter-kit": "^3.22.2",
"@tiptap/vue-3": "^3.22.2", "@tiptap/vue-3": "^3.22.2",
"@yoresee-doc/sdk-node": "git+ssh://git@git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#v0.1.0", "@yoresee-doc/sdk-node": "git+https://git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#v0.1.0",
"axios": "^1.13.5", "axios": "^1.13.5",
"codemirror": "^5.65.21", "codemirror": "^5.65.21",
"diff": "^8.0.4", "diff": "^8.0.4",