mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-02-09 02:49:29 +08:00
* fix: preserve 'use client' directive in universal registry items Universal items (registry:file and registry:item) are framework-agnostic components that can be installed without shadcn project initialization. However, the RSC transformer was incorrectly removing 'use client' directives from these files when config.rsc was false/undefined, breaking client-side functionality. This fix ensures transformers are skipped for universal items, preserving their original content including 'use client' directives, while regular shadcn components continue to have transformers applied as expected. Changes: - Skip all transformers for registry:file and registry:item types - Add tests to verify 'use client' preservation in universal items - Ensure regular components still have transformers applied Fixes issue where universal items would lose 'use client' directives when copied without a full shadcn project setup. * chore: changeset --------- Co-authored-by: shadcn <m@shadcn.com>