SAM-types
The TypeScript types shared by SAM-api and its clients: SAM-admin-v2, SAM-superadmin-frontend, SAM-webcalc-v2 and MyPage. Requests, responses, error keys and enums live here once, so the API and every client agree on what goes over the wire.
Published to npm as @fragus/sam-types.
Using it
Each consumer pins an exact version in its package.json:
"@fragus/sam-types": "1.1.9"
Import from the package root:
import { ContractState, INoContractsAvailableErrorParams } from '@fragus/sam-types'
Prerequisites
- Node.js: the version in
.nvmrc - npm
Getting started
npm install
npm run tsc # npm run tsc-win on Windows without bash
npm run tsc deletes the compiled .js files and builds the package again. CI runs the same build on
every push.
Docs
- Adding and changing types: where a type goes, naming, exports, and the TypeScript 3.3 limit
- Testing in a consumer before release:
file:../SAM-typesand how to undo it - Releasing: versioning, the GitHub release that publishes to npm, and bumping the consumers
- Code conventions: idioms, naming and the review bar for changes in this repo
Branches
fix/, feature/ or backmerge/ plus a kebab-case description. PRs target develop.