feat(cli): add Connect RPC and Protocol Buffers support - #1120
MrPinguiiin wants to merge 3 commits into
Conversation
- Add gRPC as a new API option in CLI prompts - Implement compatibility rules to restrict gRPC usage with Workers runtime and certain frontends - Extend dependency management to include Connect, Buf, and related packages for gRPC - Add gRPC-specific template files for server, React web, native clients, and fullstack Next.js - Generate gRPC proto files, codegen config, and type declarations - Include gRPC icon and update UI to support gRPC tech badge and tech icon rendering - Add comprehensive tests for gRPC API integration with various backends and runtimes - Provide error validations for incompatible configurations with gRPC API - Update constants and utilities to handle gRPC API option and dependencies
- Delete local SVG files for oRPC and tRPC icons - Change icon paths to use ICON_BASE_URL for remote icon loading - Update constants to reference new icon URLs instead of local paths
|
@MrPinguiiin is attempting to deploy a commit to the Better T Stack Team on Vercel. A member of the Team first needs to authorize it. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (7)
WalkthroughChangesgRPC support
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
apps/cli/test/grpc-api.test.ts (1)
31-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert concrete generated files for every supported combination.
The Hono case only checks that
src/generatedexists, while the Express, Fastify, Next.js, and React Router cases only callexpectSuccess. SinceexpectSuccessonly verifies creation success and a result object (apps/cli/test/test-utils.ts:152-162), missing or empty Connect output could still pass. Add shared assertions for concrete generated files and backend route artifacts.Also applies to: 64-150
packages/template-generator/templates/api/grpc/server/tsconfig.json.hbs (1)
3-10: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPin the TypeScript target and libraries.
The generated
context.ts.hbsandindex.ts.hbsusePromise,Headers, and an async generator, but this standalone config relies on compiler defaults. TypeScript derives default libraries fromtarget, and async iterable declarations require ES2018-era libraries; pin a supported runtime baseline instead of relying on the installed TypeScript version. (typescriptlang.org)Suggested configuration
"compilerOptions": { + "target": "ES2022", + "lib": ["ES2022", "DOM"], "strict": true,Source: MCP tools
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cb3132a2-6e35-4448-90a2-a0d589604a3f
⛔ Files ignored due to path filters (4)
apps/web/public/icon/grpc.svgis excluded by!**/*.svgpackages/template-generator/src/templates.generated.tsis excluded by!**/*.generated.*packages/template-generator/templates/api/grpc/server/src/generated/service_connect.ts.hbsis excluded by!**/generated/**packages/template-generator/templates/api/grpc/server/src/generated/service_pb.ts.hbsis excluded by!**/generated/**
📒 Files selected for processing (30)
apps/cli/src/prompts/api.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/test/grpc-api.test.tsapps/web/src/app/(home)/new/_components/tech-icon.tsxapps/web/src/app/(home)/new/_components/utils.tsapps/web/src/app/layout.tsxapps/web/src/components/ui/tech-badge.tsxapps/web/src/lib/constant.tspackages/template-generator/src/processors/api-deps.tspackages/template-generator/src/processors/backend-deps.tspackages/template-generator/src/template-handlers/api.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/templates/api/grpc/fullstack/next/src/app/api/connect/\[...path\]/route.ts.hbspackages/template-generator/templates/api/grpc/native/utils/connect.ts.hbspackages/template-generator/templates/api/grpc/server/_gitignorepackages/template-generator/templates/api/grpc/server/buf.gen.yaml.hbspackages/template-generator/templates/api/grpc/server/buf.yaml.hbspackages/template-generator/templates/api/grpc/server/package.json.hbspackages/template-generator/templates/api/grpc/server/proto/service.proto.hbspackages/template-generator/templates/api/grpc/server/scripts/generate.mjspackages/template-generator/templates/api/grpc/server/src/context.ts.hbspackages/template-generator/templates/api/grpc/server/src/index.ts.hbspackages/template-generator/templates/api/grpc/server/src/routers/index.ts.hbspackages/template-generator/templates/api/grpc/server/tsconfig.json.hbspackages/template-generator/templates/api/grpc/web/react/base/src/utils/connect.ts.hbspackages/template-generator/templates/backend/server/elysia/src/index.ts.hbspackages/template-generator/templates/backend/server/express/src/index.ts.hbspackages/template-generator/templates/backend/server/fastify/src/index.ts.hbspackages/template-generator/templates/backend/server/hono/src/index.ts.hbspackages/types/src/schemas.ts
💤 Files with no reviewable changes (1)
- apps/web/src/app/layout.tsx
Summary
This PR adds gRPC-compatible API generation using Connect RPC and Protocol Buffers.
Changes
grpcas a supported API option in the CLI and shared schemas.HealthGreetListItemslocalstorage-filewarning.Validation
The following checks pass:
bun run checkbun run build:clibun run typecheckinpackages/template-generatorbun run check-typesinapps/clibun test apps/cli/test/grpc-api.test.tsHealthGreetListItemsScope
This implementation provides Connect RPC and Protocol Buffers support for TypeScript projects.
Supported client templates currently include React web and native frontends. Nuxt, Svelte, Solid, and Astro are intentionally rejected for gRPC until dedicated client templates are available.
Summary by CodeRabbit
New Features
Bug Fixes
Tests