Architecture
Boundaries
| Part | Path | Owns | Reads |
|---|---|---|---|
| Specification | packages/system/DESIGN.md, CONFORMANCE.yaml | Every value, and Studio's outcome for each rule of Design Standard 2.0.0 | vendor/design-standard@2.0.0/ |
| studio-system | packages/system | The generator, the studio command, generated tokens, base and component CSS, fonts | The spec, fonts/fonts.json |
| studio-react | packages/react | React components that render Studio's markup | studio-system's CSS and tokens.js |
| studio-portico | packages/portico | Studio's binding for Portico's navigation contract | studio-system's tokens; Portico 3.0.0 |
| StudioKit | packages/swift | SwiftUI components and the type, colour and material helpers | The generated StudioTokens.swift and the bundled TrueType fonts |
| Web worked example | apps/web | The prototype's five pages (Home, Analytics, Link, QR, Page editor) on studio-react, built static into public/app/ | studio-react, studio-system |
| Studio app | apps/apple | One multiplatform SwiftUI target for iPhone, iPad and Mac | StudioKit |
| Gallery | demos/gallery | Every component in its states, built into public/components/ | studio-react |
| Site | public/, index.html | The public surface (Station 1.2.1, section 6), generated by tools/site.mjs except assets/site.css | Every part above |
The root DESIGN.md and CONFORMANCE.yaml are synced copies of the package's (tools/sync-package.mjs), so a reader finds the spec at the top. Navigation is never Studio's CSS: it is Portico's, bound by studio-portico (ADR 0004).
Contracts
- The spec's frontmatter and
yaml-extensionblocks are the only inputs to every generator. Role names are the portable vocabulary shared with Neue (ADR 0003); a product may add roles in itsoverrides.jsonbut never redefine a system role. - Generated files carry a header and a
--checkmode.make validatefails when any is stale:studio tokens --check,studio swift --check,sync-package --check,sync-fonts --check,gallery --check,site --check. - Portico's contract (
@stationmodules/portico/contract) is checked byportico check-bindingin light and dark. - The Swift token API is described at the top of
StudioTokens.swiftand in Tokens. - No HTTP API. Studio serves nothing; there is no
api/openapi.yaml.
Data model
There is no runtime data. The model is the token graph: colour roles (light, with dark values in themes.dark), aliases, spacing, radii, type roles, motion, z-order, elevation tiers, materials, density modes and components. References ({colors.surface}) stay references in CSS (var(--color-surface)) so themes, density and product overrides cascade; JSON, JavaScript and Swift get resolved values. Fonts are files with recorded PostScript names and checksums (packages/system/fonts/fonts.json).
Surfaces
| Surface | How it is built | How it is checked |
|---|---|---|
CSS (dist/*.css, css/*.css) | studio tokens; base and component CSS by hand | drift; tools/check-css.mjs (no raw values, no side stripes, no sideways shadows) |
JavaScript and JSON (dist/tokens.*) | studio tokens | drift; unit tests |
React (packages/react/dist) | tsc | tools/check-react-build.mjs; make typecheck; browser checks |
Swift (StudioTokens.swift, StudioKit, the app) | studio swift; StudioKit and the app by hand | drift; tools/swift-syntax.mjs (tree-sitter parse). Compiled only by Xcode on a Mac (Apple) |
Web example (public/app/) | its workspace's build script, called by npm run build | browser checks over http and from disk |
Site (public/, index.html) | tools/site.mjs | site --check; .github/check.mjs; link test |
public/ is one static folder: no server, no CDN, relative links, classic scripts only, so it opens from disk.
Testing strategy
- Without a browser (
make validate): the Station quick audit, lockfile platforms, vendored checksums, every drift check, the spec against the Standard (check-design.mjs), CSS rules, the Portico binding, the Swift syntax gate, the site, dev logins, TypeScript, ESLint and the unit tests intest/node/. A step that cannot run yet reports SKIPPED with its reason;STRICT=1fails on it. - In Chromium (
make e2e):test/browser/, both themes, phone (390 px) and desktop (1440 px) widths, axe, keyboard contracts, and the site fromfile://. - On a Mac (
make apple,.github/workflows/apple.yml):swift build,swift test, andxcodebuildfor the iOS Simulator and macOS. Not run in this repository's Linux environment.