Skip to content

fix(shadcn): keep cn in lib/utils.ts when publishing to livekit/web - #1522

Closed
thomasyuill-livekit wants to merge 1 commit into
mainfrom
fix/shadcn-publish-livekit-web-cn
Closed

thomasyuill-livekit wants to merge 1 commit into
mainfrom
fix/shadcn-publish-livekit-web-cn

Conversation

@thomasyuill-livekit

@thomasyuill-livekit thomasyuill-livekit commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Do not merge this PR before livekit/web#7381 merges.

pnpm shadcn:publish:livekit-web fails, so no registry update can reach livekit/web. The public shadcn registry now imports cn from the cn package. shadcn add --overwrite rewrites src/lib/utils.ts in the livekit/web checkout to export { cn } from "cn". It also writes import { cn } from "cn" into the ui components. The livekit/web build adds a class inside twMerge(clsx(inputs)) in that file, and it stops with expected `twMerge(clsx(inputs))` in lib/utils.ts.

Change

publish-livekit-web.ts no longer calls the livekit/web update script, because that script fails between its own steps. It runs the same three steps itself: shadcn add, codegen, format. Between shadcn add and codegen, it does these steps:

  • It restores the livekit/web copy of src/lib/utils.ts.
  • It points each from "cn" import in src back at @/lib/utils.
  • It removes the cn dependency from package.json, then runs pnpm install.

Verified

  • pnpm shadcn:publish:livekit-web with "n" at the prompt:
    • The script restored the import in 7 ui files.
    • codegen and format passed.
    • The script got to "Create this PR?". Before the change, it stopped in codegen.
  • The diff that the script offered had no change to utils.ts, package.json or the lockfile of the agents-ui package.

Not done yet

  • livekit/web#7381 changes the livekit/web update script so that it works with the cn import. After that PR merges, this script can call update again.

🤖 Generated with Claude Code

The public shadcn registry now imports cn from the cn package, so
shadcn add rewrote lib/utils.ts and the ui components in the
livekit/web checkout, and its build stopped.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
components-js-storybook-5kld Ready Ready Preview Nov 20, 2026 3:33pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
LiveKitRoom only 7.88 KB (0%)
LiveKitRoom with VideoConference 32.63 KB (0%)
All exports 44.4 KB (0%)

@thomasyuill-livekit

Copy link
Copy Markdown
Contributor Author

Closing. The update script in livekit/web gets the fix instead, so the publish script needs no change.

@thomasyuill-livekit
thomasyuill-livekit deleted the fix/shadcn-publish-livekit-web-cn branch November 20, 2026 19:20

This branch was successfully deployed

1 active deployment
Preview — d76f19c0 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant