1.1.10 • Published 6 years ago
@prodo/cli v1.1.10
@prodo/cli
This command-line interface (CLI) lets you import components created with Prodo into your React project.
Installation
Install the CLI with npm or yarn:
npm install -g @prodo/cliYou can then run prodo. Try:
prodo helpInitialization
First, initialize Prodo in your project directory (where your package.json file
is).
prodo initThis command
- Creates an empty
prodo.jsonfile that lists the components your project uses. - Adds a
postinstallscript to yourpackage.jsonfile that will install all of your Prodo components after runningnpm install. - Adds
@prodo/reactas a dependency. This package contains the necessary React hooks and HOCs to make your components state and actions work. - Adds
@prodo/clias a dev dependency. This means the rest of your team can use the Prodo components you have added without needing to poke them to install the CLI.
Adding and Using Components
To add a Prodo component run (replacing MyComponent with the name of your component and username with your username):
prodo add username.ComponentNameThe components can be used in your React project with:
import ComponentName from "@prodo/username.ComponentName";and used with
<ComponentName />The behavior you defined for your component will work out of the box!
Update a component to the latest version by running prodo add again.