shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
75.47k stars 4.73k forks source link

[feat]: add support for microsoft rush monorepo #5705

Open IceProgrammer15 opened 3 weeks ago

IceProgrammer15 commented 3 weeks ago

Feature description

Shadcn CLI does not support projects which are managed by @microsoft/rush mono repo.

Rush mono repo could be configured to use either npm, yarn or pnpm but it has its own way of managing dependencies (i.e npm install , yarn add or pnpm add are not used diectly.)

Problem: Because Rush is managing the dependencies differently, regardless of the Rush package manager config, none of the following Shadcn CLI commands works:

npx shadcn@latest add button
# or
npx shadcn@latest add button
# or
pnpm dlx shadcn@latest add button

running Shadcn CLI to add a component will cause error at installing dependencies step:

using npm image

using pnpm image

Proposed Solution

Shadcn CLI to detect if project is managed by Rush, and use rush cli to install dependencies. (Shadcn CLI currently supports npm, yarn, pnpm and bun )

Affected component/components

CLI

Additional Context

Additional details here...

Before submitting

IceProgrammer15 commented 3 weeks ago

I am not sure how features are prioritized , but I am going to open a pull request from my fork where I made this working with Rush. I believe my changes could make it easier to add other package managers down the road, for instance https://github.com/shadcn-ui/ui/issues/5529.