ui icon indicating copy to clipboard operation
ui copied to clipboard

[bug]: Cli `add` seems to strip jsdoc comments at the beginning of `content` in a registry item.

Open mw10013 opened this issue 1 month ago • 0 comments

Describe the bug

The registry item https://oui.mw10013.workers.dev/r/oui-index.json has a jsdoc comment at the beginning of content.

Adding it with pnpm dlx shadcn@latest add --overwrite @oui/oui-index seems to strip the jsdoc comment and the first line ends up being the export statement. Note that the jsdoc comment underneath the first export is preserved.

Naturally, I would prefer not to have redundant comments, but that seems to be a workaround for now.

Also note that if content begins with "use client", a jsdoc comment underneath is preserved.

For reference, here is the source file, corresponding registry item json, and result of running the add command.

Affected component/components

cli

How to reproduce

  1. pnpm dlx shadcn@latest add --overwrite @oui/oui-index

Codesandbox/StackBlitz link

No response

Logs


System Info

Latest version of shadcn cli

Before submitting

  • [x] I've made research efforts and searched the documentation
  • [x] I've searched for existing issues

mw10013 avatar Nov 13 '25 05:11 mw10013