Skip to content

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

@mw10013

Description

@mw10013

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions