nextui-org / nextui-cli

⌨️ A CLI tool that unlocks seamless NextUI integration.
MIT License
46 stars 14 forks source link

[Feature Request] Option to Skip Installation #110

Open oclyke opened 1 week ago

oclyke commented 1 week ago

Is your feature request related to a problem? Please describe.

Hi.

I have a problem with my monorepo where nextui add <component> will always fail in the execution of npm install.

My NextUI app is one of several workspaces -- some workspaces are managed using Yarn and the NextUI app is managed with NPM (because of other issues with Yarn PnP not seeming to play nicely with NextUI).

When I install dependencies for this app (with npm install) I have to specify the --workspaces=false option to avoid an error about another workspace using an invalid URL format (this is unrelated to NextUI).

The issue is that nextui CLI tool calls npm install (AFAICT) without any way to pass options to that command.

Describe the solution you'd like

The simplest way to solve this for me is to make it so that nextui add does not perform the actual installation.

This could be done by default and docs updated to show users that they need to run dependency installation manually.

Although I would prefer the above option (decouple nextui add from the job of installation) it would also work for me just to get a --no-install flag or something like that.

Describe alternatives you've considered

Maybe nextui add is complex and can't assume just one invocation of npm install at the end of the task... maybe the steps to install a new component are convoluted. If this is the case then I would like an option for nextui add to just write out the instructions of what is necessary to install the component. This would be an option of the user (e.g. nextui add <component-name> --dry-run-show-steps)

Screenshots or Videos

Screenshot 2024-11-08 at 9 42 52 AM
winchesHe commented 1 week ago

@oclyke Thanks you reported, you can use option --debug to avoid install now

winchesHe commented 1 week ago

But you also need to manual add @nextui-org/slider in your pacakge.json and run install