Skip to content

feat(custom-apps): revamp templates based on ds (sloppified) - #267

Draft
Hari Harish (harisaiharish) wants to merge 2 commits into
hariharish/custom-apps-init-shadcn-addfrom
hariharish/revamp-ds-templates
Draft

feat(custom-apps): revamp templates based on ds (sloppified)#267
Hari Harish (harisaiharish) wants to merge 2 commits into
hariharish/custom-apps-init-shadcn-addfrom
hariharish/revamp-ds-templates

Conversation

@harisaiharish

@harisaiharish Hari Harish (harisaiharish) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Stacked on #260, which vendors the design system's tokens and theme. This one swaps the furniture: templates render the real Button, Text, Input, Select, Typeahead, Checkbox, Banner, Skeleton, Tooltip and friends instead of hand-built lookalikes.

The registry snapshot now lives once in internal/cmd/templates/design-system/ (make sync-design-system). apps init walks a template's import graph, copies only the files it reaches, and derives package.json from their imports — blank gets 3 packages, annotation-queue 9.

Fixed on the way: Tooltip crashed every IconButton without a Radix provider; chart series used a var(--series-N) the theme never defined; every tailwind.config.js shadowed the preset's spacing scale; tsconfig/@types/react were too old for shadcn add to typecheck.

All five templates build clean and were screenshot-verified in light and dark. Four new tests cover the invariants.

Templates now render the design system's own Button, Badge, Text, Input,
Textarea, Select, Typeahead, Checkbox, Banner, Skeleton, Spinner,
LinearProgress, Tooltip, Divider and Kbd instead of lookalikes built from
tokens.

The registry snapshot moves to internal/cmd/templates/design-system/
(one copy, refreshed by "make sync-design-system") and apps init resolves
the import graph of a template's source to copy only the design-system
files it reaches, deriving package.json from the bare imports in those
files. That drops the theme and preset duplicated across all five
templates, and keeps per-template dependencies to what each one uses.

Fixes found on the way:

- Tooltip is Radix-based and threw without a provider, so IconButton
  crashed at render. entry.tsx now mounts one (DesignSystemProvider).
- experiment-comparison's chart series used var(--series-N), which the
  theme does not define, so every series color resolved to nothing.
- Each template's tailwind.config.js re-declared theme.extend with a
  stale spacing scale, silently overriding the preset's.
- tsconfig targeted ES2020 with @types/react 18; design-system source
  needs ES2022 and React 19 types, so "shadcn add" failed typecheck.
- feedbackColors.ts reimplemented the design system's color hash.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@harisaiharish Hari Harish (harisaiharish) changed the title feat(custom-apps): build templates on real design-system components [LSDK-331] feat(custom-apps): revamp templates based on ds (sloppified) Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant