@togatherlabs/shared-protos
v2.1.93
Published
Generated TypeScript gRPC definitions for Togather shared protos
Readme
ToGather Shared Protos
This repository contains the common .proto definitions used across all ToGather microservices.
It serves as the single source of truth for shared gRPC and ConnectRPC message schemas, ensuring consistency and type safety between backend services and clients.
Overview
The ToGather Shared Protos package centralizes all protocol buffer (.proto) files.
Each microservice can import the generated TypeScript or Python code directly from this package to avoid duplication and version drift.
Installation
pnpm add @togatherlabs/shared-protosUsage
Import the generated types in your service:
import { AdminService } from "@togatherlabs/shared-protos/authservice/admin/v1";
import { UserService } from "@togatherlabs/shared-protos/userservice/user/v1";Development Workflow
For detailed workflow instructions, see WORKFLOW.md
Quick Start
- Update proto definitions in the
proto/folder - Generate TypeScript files:
pnpm build - Commit your changes:
git add . pnpm commit - Publish to npm:
pnpm run publish
Important Notes
- Use
pnpm run publishto publish (notpnpm publishdirectly) - The script automatically bumps the version and publishes
- No need to manually run
npm version patch
Updating Dependencies
After a new version is published, update in dependent services:
pnpm update @togatherlabs/shared-protosTechnology Stack
- Buf – Proto management and linting
- ConnectRPC – RPC code generation
- TypeScript – Generated bindings
- pnpm – Package management
- Commitizen – Commit message consistency
Best Practices
- Always update
.protofiles before generating new code - Use
pnpmfor all dependency management - Do not manually modify generated files – regenerate instead
- Ensure consistent naming and versioning for services (see Best Practices)
Project Structure
togather-shared-protos/
├── proto/ # Proto definitions
│ ├── authservice/
│ └── userservice/
├── packages/
│ └── typescript/ # Generated TypeScript package (published to npm)
│ ├── dist/ # Compiled JavaScript
│ └── package.json # Version gets bumped here
├── scripts/
│ ├── generate_and_prepare.js # Generates TypeScript code
│ └── publish_typescript.js # Publishes to npm
└── package.json # Root package (NOT published)What Gets Published
Only the TypeScript package (packages/typescript/) gets published to npm as @togatherlabs/shared-protos.
The root package is NOT published to npm.
Contributing
All services depending on this package should use the same version to ensure consistent proto definitions.
Made with ❤️ by the ToGather Team