@loafmarkets/shared-types
v1.0.30
Published
Shared contracts for Loaf Markets frontend, backend, and matching engine.
Readme
Shared Types
Shared contracts (TypeScript interfaces + protobuf schemas) used by the Loaf Markets backend, frontend, and matching engine.
Repository layout
Shared-Types/
├── proto/ # trading.proto (matching engine contracts)
├── src/
│ └── index.ts # TypeScript schemas and interfaces shared across services
├── dist/ # Build output (generated via `pnpm run build`)
├── package.json # npm package settings
└── tsconfig.jsonGetting started
# Install dependencies
pnpm install
# Build once to emit dist/
pnpm run buildConsuming the package
In any Loaf service repo:
pnpm add @loafmarkets/shared-types@<version>Then import types from TypeScript:
import type { OrderApiRequestBody, propertySchema } from '@loafmarkets/shared-types';To use the protobuf definition (for gRPC or codegen):
node_modules/@loafmarkets/shared-types/proto/trading.protoMaking changes
- Modify contracts in
src/index.ts(TypeScript) orproto/trading.proto. - Run tests/build locally:
pnpm run build
Release process
Assuming you have not added, committed, pushed, tagged, published anything yet:
# Login to npm
pnpm login
# Ensure working tree is clean
git status
# Build artifacts
pnpm run build
# Add and commit
git commit -am "feat: add XYZ contract"
# Bump version (automatically creates new tag in package.json and commits)
pnpm version patch
# Push tag
git push origin main --follow-tags
# Publish to registry
pnpm publish --access publicOnce published, update each consumer repository:
pnpm add @loafmarkets/shared-types@<version>
rm -rf node_modules
pnpm installNotes
- Use Renovate/Dependabot later to automate dependency bump PRs in downstream repos.