open-index/open-npm huggingface dataset:
npm package: @loafmarkets/shared-types
Description: Shared contracts for Loaf Markets frontend, backend, and matching engine.
Author: Cohen
Latest version: 1.0.89

# 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.json
```

## Getting started

```bash
# Install dependencies
pnpm install

# Build once to emit dist/
pnpm run build
```

## Consuming the package

In any Loaf service repo:

```bash
pnpm add @loafmarkets/shared-types@<version>
```

Then import types from TypeScript:

```ts
import type { OrderApiRequestBody, propertySchema } from '@loafmarkets/shared-types';
```

To use the protobuf definition (for gRPC or codegen):

```
node_modules/@loafmarkets/shared-types/proto/trading.proto
```

## Making changes

1. **Modify contracts** in `src/index.ts` (TypeScript) or `proto/trading.proto`.
2. **Run tests/build** locally:
   ```bash
   pnpm run build
   ```

## Release process
Assuming you have not added, committed, pushed, tagged, published anything yet:

```bash
# 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 public
```

Once published, update each consumer repository:

```bash
pnpm add @loafmarkets/shared-types@<version>
rm -rf node_modules 
pnpm install
```

## Notes

- Use Renovate/Dependabot later to automate dependency bump PRs in downstream repos.