How gympass/yoga works
High-Level File Structure
• Top-level tooling and config: Lerna, Yarn workspaces, Babel, TypeScript, ESLint, Prettier, Jest, GitHub workflows, custom scripts.
• packages/ (each a separately versioned npm package):
• yoga (main component library)
• system (style utility functions, theming engine)
• common (shared helpers)
• illustrations (SVG illustration library)
• helpers (runtime helper functions)
• labnative (RN example/app for mobile showcase)
• doc (Gatsby/MDX documentation site)
• examples/ (Next.js usage examples)
• scripts/ (CLI generators, build/publish helpers)
• jest/ (test configs and mocks)
Key Architectural Insights from README
• Monorepo powered by Lerna & Yarn workspaces.
• Core theming via a single ThemeProvider that leverages tokens and system packages.
• Components live in packages/yoga, split into Web and Native entry points.
• Documentation site (packages/doc) renders MDX examples, building against the published packages.
• Mobile demonstration app (packages/labnative) consumes the same library packages to showcase components in a real RN environment.
Main Components & Their Relationships
• Design Tokens (packages/tokens) → consumed by → Styling System (packages/system) → consumed by → Component Library (packages/yoga)
• Common Helpers (packages/common, packages/helpers) → used by → system & yoga packages
• Component Library → packaged for →
• Web (React + styled-components)
• Native (React Native)
• Documentation Site (packages/doc) → imports → component library, tokens, system to auto-generate MDX docs
• Mobile Demo App (packages/labnative) → imports → component library, tokens, system for real-device previews
• Examples (examples/with-next) → demonstrates Web usage in a Next.js setup
Architectural Patterns & Technologies
• Monorepo (Lerna + Yarn workspaces) for cross-package versioning and dependency linking
• Component-driven architecture: all UI components live in a single package with separate web/native entry points
• Theming: Single source of truth via tokens + ThemeProvider (styled-components under the hood)
• Documentation as Code: Gatsby + MDX site consuming live components
• CI/CD: GitHub Actions for linting, testing, publishing