Паламар Роман 2acaf954d7 Fix: Preserve 'use client' directive in universal registry items (#8798)
* 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>
2026-01-17 13:12:01 +04:00
2025-12-12 21:01:44 +04:00
2025-12-12 21:01:44 +04:00
2023-04-19 15:01:29 +04:00
2023-01-24 19:51:29 +04:00
2023-01-24 19:51:29 +04:00
2025-12-12 21:01:44 +04:00
2023-10-19 21:12:17 +04:00
2025-01-14 10:50:19 +04:00
2025-10-29 20:50:55 +04:00
2025-10-29 20:50:55 +04:00
2023-01-27 16:02:33 +04:00
2025-12-12 21:01:44 +04:00
2025-10-29 21:38:18 +04:00
2023-01-24 19:51:29 +04:00
2025-12-12 21:01:44 +04:00

shadcn/ui

A set of beautifully designed components that you can customize, extend, and build on. Start here then make it your own. Open Source. Open Code. Use this to build your own component library.

hero

Documentation

Visit http://ui.shadcn.com/docs to view the documentation.

Contributing

Please read the contributing guide.

License

Licensed under the MIT license.

Description
Languages
TypeScript 89.8%
MDX 6.8%
CSS 3.3%