Skip to content
Studio

Architecture

Boundaries

PartPathOwnsReads
Specificationpackages/system/DESIGN.md, CONFORMANCE.yamlEvery value, and Studio's outcome for each rule of Design Standard 2.0.0vendor/design-standard@2.0.0/
studio-systempackages/systemThe generator, the studio command, generated tokens, base and component CSS, fontsThe spec, fonts/fonts.json
studio-reactpackages/reactReact components that render Studio's markupstudio-system's CSS and tokens.js
studio-porticopackages/porticoStudio's binding for Portico's navigation contractstudio-system's tokens; Portico 3.0.0
StudioKitpackages/swiftSwiftUI components and the type, colour and material helpersThe generated StudioTokens.swift and the bundled TrueType fonts
Web worked exampleapps/webThe prototype's five pages (Home, Analytics, Link, QR, Page editor) on studio-react, built static into public/app/studio-react, studio-system
Studio appapps/appleOne multiplatform SwiftUI target for iPhone, iPad and MacStudioKit
Gallerydemos/galleryEvery component in its states, built into public/components/studio-react
Sitepublic/, index.htmlThe public surface (Station 1.2.1, section 6), generated by tools/site.mjs except assets/site.cssEvery 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-extension blocks are the only inputs to every generator. Role names are the portable vocabulary shared with Neue (ADR 0003); a product may add roles in its overrides.json but never redefine a system role.
  • Generated files carry a header and a --check mode. make validate fails 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 by portico check-binding in light and dark.
  • The Swift token API is described at the top of StudioTokens.swift and 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

SurfaceHow it is builtHow it is checked
CSS (dist/*.css, css/*.css)studio tokens; base and component CSS by handdrift; tools/check-css.mjs (no raw values, no side stripes, no sideways shadows)
JavaScript and JSON (dist/tokens.*)studio tokensdrift; unit tests
React (packages/react/dist)tsctools/check-react-build.mjs; make typecheck; browser checks
Swift (StudioTokens.swift, StudioKit, the app)studio swift; StudioKit and the app by handdrift; 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 buildbrowser checks over http and from disk
Site (public/, index.html)tools/site.mjssite --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 in test/node/. A step that cannot run yet reports SKIPPED with its reason; STRICT=1 fails on it.
  • In Chromium (make e2e): test/browser/, both themes, phone (390 px) and desktop (1440 px) widths, axe, keyboard contracts, and the site from file://.
  • On a Mac (make apple, .github/workflows/apple.yml): swift build, swift test, and xcodebuild for the iOS Simulator and macOS. Not run in this repository's Linux environment.
Contents