single source of truth
The one agreed place where a piece of information is maintained, so every copy is generated from it rather than edited by hand.
In more detail
For a design system the token files are the single source of truth for visual values, and the package exports map is the single source of truth for what a library exposes. Everything else is generated or derived. This prevents copies from drifting apart.
Examples
A shared schema or OpenAPI document from which types, validators and clients are generated.In the stream lessons the Kafka topic is the source of truth and every view is a derived cache.In React the owner component holds the state and passes it down as props.Related terms
- design token — A named design decision, such as a colour, font size or spacing value, stored as data so every platform can use the same value.
- design drift — The slow divergence of what products look like from what the design system specifies, as teams copy and tweak values by hand.
- exports field — The package.json field that lists exactly which files a package exposes, by path such as "." or "./button", and which file to use in each situation.
- API contract — The written promise an API makes about its operations, inputs, outputs and errors, which callers rely on while the code behind it changes.
- validation schema — A description of what valid data looks like, checked by code while the program runs so bad data is rejected at the door.
- code generation — Producing client or server code automatically from a machine-readable contract such as an OpenAPI document or a Protocol Buffers file.
- materialised view — A stored table of results computed from other data, kept so queries do not have to recompute them.
- replay — Delivering or returning something again: a stored result for a repeated request, or past events for a client that missed them.
- lifting state up — Moving state from several child components into their closest common parent so they can share it.
- derived state — A value that can be calculated from existing props or state, so it should be computed during render instead of stored as separate state.
- schema drift — Copies of the same data shape slowly becoming different as one is changed and the others are forgotten.
- OpenAPI — A standard, language-neutral format for describing an HTTP API: its paths, operations, parameters, request and response schemas, errors and security.
- utility types — Generic types built into TypeScript, such as Partial, Pick and ReturnType, that compute a new type from an existing one.
Taught in
- Design Tokens: W3C Specs, Global, Semantic & Component Tokens — Design Systems & Component Engineering
- Component Packaging: Dual ESM/CJS Builds & Package Exports — Design Systems & Component Engineering
- End-to-End Type Safety: Shared Schemas & DTOs — Production Full-Stack Engineering
- API Contract Architecture: OpenAPI 3.1 & Schema Truth — Production Full-Stack Engineering
- Materialised Views From A Stream — Apache Kafka & Event Streaming
- Lifting State Up: Colocation, Ownership, And Data Flow — React 19 & Modern Component Architecture
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript
- The Spine Artifact: Generating Typed Models From OpenAPI — Production TypeScript