feat(storybook): shadcn migrations, continuous update strategy#430
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
Consolidates the Tailwind/shadcn theme plumbing into a single _core/tailwind-setup.css, adds a shadcn reference theme (zinc), introduces a dev-plugin Nx generator (theme-sync) that validates theme completeness and emits themes.css / themes-meta.ts for Storybook, upgrades all shadcn components to nova-style templates (with the new radix-ui umbrella import and updated class strings), and wires up an Nx-managed Storybook 10 app with stories, MDX docs and a Theme Overview.
Changes:
- New
tools/dev-pluginNx plugin with thetheme-syncsync generator, registered as a global sync generator and on Storybook targets. - Theme refactor: all themes import
_core/tailwind-setup.css; newshadcnandpayload-adminstandalone themes; CMScustom.cssreduced to a single import. - Upgrades shadcn components to nova style, adds storybook stories/MDX for all of them, plus the Storybook app, preview decorator, Introduction MDX and Theme Overview story.
Reviewed changes
Copilot reviewed 107 out of 113 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/dev-plugin/** | New Nx plugin hosting the theme-sync generator + tests, project/tsconfig wiring. |
| tools/dev-plugin/src/generators/theme-sync/theme-sync.ts | Validates theme tokens against _core blueprints, auto-detects dark strategy, emits themes.css & themes-meta.ts. |
| libs/shared/theme/src/lib/_core/** | New consolidated tailwind-setup.css, prose/typography modules. |
| libs/shared/theme/src/lib/{shadcn,payload-admin}/** | New reference and CMS admin themes. |
| libs/shared/theme/src/lib/{spotlight,codeware}/** | Migrated to share _core/tailwind-setup.css; brand/core/prose tokens normalized. |
| libs/shared/theme/src/lib/core/** (deleted) | Old theme-map-* and layer-base.css removed; replaced by _core/tailwind-setup.css. |
| libs/shared/ui/shadcn/src/lib/components/** | shadcn components upgraded to nova style; switched to radix-ui umbrella import. |
| libs/shared/ui/shadcn/src/lib/*.stories.tsx & *.mdx | New Storybook stories + MDX docs for all shadcn components. |
| libs/shared/ui/{primitives,icon-picker,color-picker,code}/src/lib/*.{stories.tsx,mdx} | Stories and docs for shared UI primitives. |
| apps/storybook/** | New Nx project for Storybook 10 with preview, mermaid head, Theme Overview, Introduction MDX. |
| apps/storybook/.storybook/themes-meta.ts, themes.css | Generated outputs from theme-sync. |
| apps/cms/src/app/(payload)/custom.css | Replaced inline shadcn tokens with shared theme import + .twp rem/spacing overrides. |
| apps/cms/src/app/(site)/spotlight.css, apps/cms/src/app/(frontend)/globals.css | Switched to _core typography and theme imports. |
| apps/web/app/tailwind.css | Same migration to _core typography. |
| package.json, nx.json, tsconfig.base.json | Storybook + vitest 4 + radix-ui + dev-plugin path/plugin registrations. |
| project.json | New shadcn:update target; description tweak for shadcn:add. |
| components.json | shadcn style changed to "nova". |
| libs/shared/util/payload-types/src/lib/payload-types.ts | Regenerated payload types (formatting only). |
| packages/{fly-deployment-action,fly...,nx-migrate-action,deploy-env-action,core} & lefthook.yml & .verdaccio/config.yml & tools/payload-proxy/docker-compose.yml & vitest.shims.d.ts & apps/web/server.ts & libs/shared/feature/infisical/** | Quote-style and vitest v4 mock-shape adjustments; minor formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- fix 'zink' -> 'zinc' typos in theme-light.css comments - remove duplicate package.json glob in dev-plugin eslint config - replace fragile node -p pipeline with jq in shadcn:update - add missing shadcn:info target referenced in Introduction.mdx - fix detectDarkStrategy to match .dark robustly via regex - fix extractBlock to track brace depth instead of using lastIndexOf - fix extractThemeInlineTokens to use matchAll for multiple @theme inline blocks - fix --sidebar token misclassification in SHADCN_TOKENS vs SIDEBAR_TOKENS
|
View your CI Pipeline Execution ↗ for commit 5b30b7b
☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 7e5bc97
☁️ Nx Cloud last updated this comment at |
1 similar comment
|
View your CI Pipeline Execution ↗ for commit 7e5bc97
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 107 out of 113 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
tools/dev-plugin/src/generators/theme-sync/theme-sync.ts:45
extractBlockparses braces character-by-character without skipping over string literals or comments. CSScontent: "}"or block comments containing{/}would corrupt the depth counter and yield an incorrect block. While the current theme files don't trigger this, the function is used as a generic block extractor and could break silently when themes add comments orcontentrules. Consider stripping comments first (asextractDefinedTokensdoes) before counting braces, and document that string literals are not supported.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
==========================================
- Coverage 91.11% 85.66% -5.46%
==========================================
Files 29 61 +32
Lines 563 1109 +546
Branches 148 235 +87
==========================================
+ Hits 513 950 +437
- Misses 50 159 +109 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a730417 to
a7f3a16
Compare
|
✨ Your pull request projects are ready for preview
|
Summary
_core/tailwind-setup.cssas the single source for dark variant, nova data-attribute variants, and@theme inlinemappings — imported by all themesshadcnas a 4th reference theme (zinc palette) for verifying components against the upstream default before applying project-specific themesshadcn:updatetargettheme-syncgenerator todev-pluginthat validates completeness against_core/tailwind-setup.cssand_core/typography-prose.jsblueprints, auto-detects dark strategy, and generatesthemes.css+themes-meta.tsIntroduction.mdxwith Mermaid diagrams, GFM tables, and up-to-date architecture documentationTest plan
pnpm nx storybookand verify Introduction page renders with Mermaid diagrams and tablespnpm nx sync— passes with no drift detectedpnpm nx shadcn:updateon a clean branch — diff reflects only upstream changes🤖 Generated with Claude Code