@sm_npm_2025/contracts
v0.0.67
Published
Shared Zod schemas and types for SoccerMatters app
Readme
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
- Navigate to the workspace root (the parent folder containing all repos):
cd ~/Dropbox/dev/clients/soccermatters- Build the contracts package:
pnpm --filter @sm/contracts build- Reinstall dependencies across the workspace (ensures symlinks are fresh):
pnpm install- (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:
pnpm --filter @sm/contracts build && pnpm installNotes
- Do not import from relative paths like
../../sm-contractsinside frontend or backend.
Always import using the package name:
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 adddist/to.gitignore.
