hngngn / shadcn-solid

shadcn/ui, but for Solid.
https://shadcn-solid.com
MIT License
188 stars 13 forks source link

[bug]: adding Card component fails with pnpm #105

Closed kylegl closed 2 weeks ago

kylegl commented 2 weeks ago

Describe the bug

When I run the command

npx shadcn-solid@latest add card

it fails.

> solid-playground@ shad:add /home/kylegl/solid-playground
> npx shadcn-solid@latest add "card"

Need to install the following packages:
shadcn-solid@0.7.4
Ok to proceed? (y) y
┌   shadcn-solid - 0.7.4 
│
◇  Component installed
│
◐  Installing .│
■  Command failed with exit code 1: pnpm add
│  
│  \u2009ERR_PNPM_MISSING_PACKAGE_NAME\u2009 `pnpm add` requires the package name
■  Canceled
 ELIFECYCLE  Command failed with exit code 1.

I've only seen this issue with this component so far. Button, Accordion work with no problem.

I looked into it a little. On line 190 of cli/commands/add.ts adds the dependencies with packageManager add ...dependencies. Button, for example, had 1 dependency @kobalte/core, but the Card component has 0 dependencies and thats causing the error.

Affected component/components

Card

How to reproduce

in terminal run npx shadcn-solid@latest add card

Codesandbox/StackBlitz link

https://stackblitz.com/~/github.com/kylegl/solid-playground?file=tsconfig.json

Logs

No response

System Info

latest chrome, see reproduction...

Before submitting

hngngn commented 2 weeks ago

Thanks for reporting this issue! I’ll look into it.

hngngn commented 2 weeks ago

Fixed. If you have any problems, feel free to reopen this issue.