You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing a CLI, and would like for people to install it with pnpm add -g (and equivalents for other package managers). However, the HomePage.InstallPackage component only allows two types: init and add.
The text was updated successfully, but these errors were encountered:
To add a global installation option to your HomePage.InstallPackage component, you can modify the component to handle a new type, such as global, and then render the appropriate command based on this type. Here's an example of how you could update the component:
// Usage exampleimportReactfrom'react';importInstallPackagefrom'./HomePage/InstallPackage';constMyComponent: React.FC=()=>{return(<div><h1>Install My CLI</h1><InstallPackagetype="global"packageName="my-cli-package"/></div>);};exportdefaultMyComponent;
This modification introduces a global type to the InstallPackage component, allowing it to generate the global installation command for your CLI. You can extend this further for other package managers like npm or yarn by adding additional cases in the switch statement.
I'm developing a CLI, and would like for people to install it with
pnpm add -g
(and equivalents for other package managers). However, theHomePage.InstallPackage
component only allows two types:init
andadd
.The text was updated successfully, but these errors were encountered: