T-ROYV-design-language-layer-consumer-hygiene
Status: open/ready · Impact: medium · Complexity: small
Two costs @determined/ui imposes on every consumer, both found by the
zoo adoption review (#1509): the layer’s .stories.ts/.test.ts files
get swept into consumer typecheck programs (forcing per-app @types/*
additions and tsconfig excludes — zoo had to work around it), and a
consumer that also imports Tailwind itself ships the preflight/base layer
twice (zoo’s built CSS fell 422KB → 234KB when deduped; sdf desktop has
the same redundant import today). Fix both at the layer, once.
| Location | Role today |
|---|---|
packages/ts/ui/ | Ships stories/tests inside the layer dir with no consumer-side exclusion; ships main.css importing tailwindcss. |
apps/zoo/src-nuxt/nuxt.config.ts | Carries the workaround: typescript.tsConfig.exclude for the layer’s stories + added @types/node/@types/bun. |
solutions/ontological/desktop/src-nuxt/ | Still carries a redundant tailwind/@nuxt/ui import (same duplicate-preflight cost, unmeasured). |
Proposed
Section titled “Proposed”The layer excludes its stories/tests from consumer type programs itself
(tsconfig/layer config, so zoo’s workaround becomes deletable), and the
one-import rule for the layer’s CSS is enforced: consumers don’t import
tailwindcss/@nuxt/ui css that the layer already provides. sdf desktop’s
redundant import removed; other consumers audited.
Approach
Section titled “Approach”- Reproduce the consumer typecheck sweep in a minimal consumer; fix at
the layer (exclude patterns where the layer declares its files, or
move stories/tests out of the consumed
app/tree). - Delete zoo’s workaround; verify zoo CI still green.
- Sweep every consumer for duplicate tailwind/
@nuxt/uicss imports (desktop confirmed; check shell, suspenders, pumice, agentpants, learn_web, vimit_prototype, augmented_web); remove, measure built-CSS delta, screenshot parity per the repo rule. - Note the one-import rule in
design-system.md/ S-0010.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
packages/ts/ui/ | modify | stories/tests excluded from consumer programs |
apps/zoo/src-nuxt/nuxt.config.ts | modify | drop the workaround |
solutions/ontological/desktop/src-nuxt/ | modify | drop the redundant css import |
packages/ts/ui/docs/design-system.md | modify | one-import rule |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A consumer extending the layer typechecks without naming the
layer’s stories/tests or adding
@types/*for them. - AC-2: zoo’s workaround is gone and zoo CI is green.
- AC-3: No consumer ships the preflight twice (built-CSS spot checks; desktop’s redundant import removed with pixel parity).
Out of scope
Section titled “Out of scope”- The exports map (T-XIFP-design-language-ui-subpath-exports); rendering-mode ownership (T-NGOJ-design-language-layer-ssr-ownership).
Dependencies
Section titled “Dependencies”- Land after the Phase 3 adoption PRs merge (they add the consumers to audit, and zoo’s workaround lands in #1509).
Discovery context
Section titled “Discovery context”- Zoo adoption review (2026-08-28, #1509): CI-only typecheck failures from the layer’s stories/tests; 422KB → 234KB built CSS after deduping the preflight; desktop named as carrying the same pattern.