Skip to content

🎨 Roadmap: extract packages/ui-kit β€” a real buildable design-system packageΒ #4867

Description

@JSONbored

apps/ui (the TanStack Start frontend, folded into this repo 2026-07 via monorepo consolidation) is a product application, not a redistributable package β€” it's the sole consumer of its own components, so it has no library build: no dist/, no main/module/exports/types fields in package.json, vite build bundles the whole SSR app (routes, nitro, Cloudflare Worker output), not a component entry point.

That's not a defect β€” most product frontends never need to be importable libraries. But it became a real blocker while wiring this repo up to Claude Design (claude.ai/design)'s /design-sync tool, which needs exactly that shape (dist/ + per-component .d.ts) to compile a live, importable component bundle the design agent can actually build with. Without it, only a degraded fallback is available: scanning src/ directly with weaker type contracts, and real friction for any component entangled with app-level context (TanStack Router, React Query) that a standalone bundle doesn't have. An interim, non-live stopgap (raw token + component source files pushed to a Claude Design project, no rendered previews, no live bundle) is in place in the meantime.

This epic tracks extracting the actual reusable design-system layer β€” tokens + presentational components β€” out of apps/ui into a real workspace package, packages/ui-kit, following the existing precedent already in this repo: root package.json declares "workspaces": ["apps/ui", "packages/client", "packages/contract"], and packages/client (@jsonbored/metagraphed) already builds with tsup --format esm,cjs --dts --dts-resolve --clean --treeshake and ships proper main/module/types/exports. packages/ui-kit is the same pattern, applied to the frontend's component layer.

Value independent of Claude Design: this also enforces a real separation between presentational components and app/business logic β€” today apps/ui/src/components/metagraphed/ mixes true design-system pieces (chips.tsx, kbd.tsx, panel-shell.tsx, page-section.tsx, chart primitives) with deep product components (subnet-masthead.tsx, validator-nominators-table.tsx, nav-mega-menu.tsx, resource-explorer.tsx) in one undifferentiated 136-file directory, per [design-system-tokens]'s existing rule that UI work must use centralized tokens/primitives, never one-off values β€” that rule currently has no structural enforcement.

Tracked centrally here. maintainer-only β€” this is architecture/infra work, not offered through the Gittensor contributor flow.

Phase 0 β€” Audit (gates everything else)

Phase 1 β€” Package foundation

Phase 2 β€” Component migration (scope set by Phase 0's audit)

Phase 3 β€” Guardrail + validation

Evidence gathered (2026-07-11)

  • apps/ui/package.json: no main/module/exports/types fields; "build": "vite build"; no dist/ present.
  • apps/ui/vite.config.ts: TanStack Start app (tanstackStart, nitro: true forced on for Cloudflare Worker deploy output) β€” confirmed application shape, not library mode.
  • apps/ui/src/styles.css (1205 lines): the full "Bone & Ink" token system β€” OKLCH colors, --font-display/sans/mono, layout/spacing tokens, health-status + curation-tier + chart-ramp tokens, wired through Tailwind v4 @theme inline.
  • apps/ui/src/components/ui/: 8 files (Radix-wrapper primitives). apps/ui/src/components/metagraphed/: 136 files incl. charts/ (12), states/ (1), analytics/ (12) β€” undifferentiated design-system vs. app-logic.
  • Root package.json workspaces + package-lock.json confirm npm-workspaces monorepo; packages/client's tsup-based build is the direct precedent for this package's tooling.

Expected end state

packages/ui-kit is a real, CI-built, import-boundary-enforced npm workspace package holding the design system's tokens and presentational components. apps/ui consumes it like any other workspace dependency. Claude Design's /design-sync runs against it in full high-fidelity mode β€” no fallback, no interim stopgap.

Metadata

Metadata

Assignees

Labels

frontendFrontend / metagraphed-ui workmaintainer-onlyOwner-only work β€” yields no Gittensor points.roadmapRoadmap epic / tracking

Projects

Status
Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions