@prodo/cli
v1.1.10
Published
This command-line interface (CLI) lets you import components created with [Prodo](https://prodo.dev) into your React project.
Downloads
3
Keywords
Readme
@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/cli
You can then run prodo
. Try:
prodo help
Initialization
First, initialize Prodo in your project directory (where your package.json
file
is).
prodo init
This command
- Creates an empty
prodo.json
file that lists the components your project uses. - Adds a
postinstall
script to yourpackage.json
file that will install all of your Prodo components after runningnpm install
. - Adds
@prodo/react
as a dependency. This package contains the necessary React hooks and HOCs to make your components state and actions work. - Adds
@prodo/cli
as 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.ComponentName
The 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.