open-index/open-npm huggingface dataset:
npm package: @sm_npm_2025/contracts
Description: Shared Zod schemas and types for SoccerMatters app
Latest version: 0.0.67

# Workflow: Using `@sm/contracts`

This package (`sm-contracts`) contains shared Zod schemas and TypeScript types for the SoccerMatters app.  
It is consumed by both **sm-frontend** and **sm-backend** via pnpm workspaces.

## Development Workflow

👉 Whenever you **add or update** a Zod schema or type in `sm-contracts`, you need to rebuild it so that downstream apps (`sm-frontend`, `sm-backend`) pick up the latest changes.

### Steps

1. Navigate to the workspace root (the parent folder containing all repos):

```bash
cd ~/Dropbox/dev/clients/soccermatters
```

2. Build the contracts package:

```bash
pnpm --filter @sm/contracts build
```

3. Reinstall dependencies across the workspace (ensures symlinks are fresh):

```bash
pnpm install
```

4. (Optional) If frontend/backend are already running in dev, restart them to pick up changes.

---

## Quick Command

To rebuild and refresh everything in one go:

```bash
pnpm --filter @sm/contracts build && pnpm install
```

---

## Notes

- Do **not** import from relative paths like `../../sm-contracts` inside frontend or backend.  
  Always import using the package name:

```ts
import { VoteStatusData, VoteStatusMatch } from "@sm/contracts";
```

- Only commit generated files in `dist/` if you are publishing this package to a registry.  
  For workspaces, you normally add `dist/` to `.gitignore`.