@orgware/ow-cli
v1.1.2
Published
Command generator utility for Orgware's React projects
Downloads
38
Readme
OwCli command line React generator
This command generator utility is used by Orgware's React developers.
It is responsible for generating different React elements:
- app
- assets
- components
- pages
- layouts
- forms
- states
- utility functions
- hooks
- routes
Installation
The utility is published as a npm package. You can install it with the following command in terminal:
npm install -g @orgware/ow-cli
Installation in develop mode
You can install it with development mode. In this case, you should cone its repository.
git clone [email protected]:OrgwareHQ/OcCliTS.git <target-directory>
cd <target-directory>
npm install
npm run dev
And in an other terminal:
npm link
Usage
The main usage is:
ow-cli <command> <options>
The utility has own help system.
ow-cli help
Usage: ow-cli <command> [options]
Command line generator for OrgwareConnectTS
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
app [options] Generate a React app
asset [options] Generate a new asset
component [options] Generate a new component
form [options] Generate a new form
page [options] Generate a new page
layout [options] Generate a new layout
hook [options] Generate a new custom hook
route [options] Generate a new route
state [options] Generate a new state
util [options] Generate a new utility function
help [command] display help for command
Naming conventions
The utility use kebab case format for all command and options. The generators convert these kebab case params to approprite format. Example:
ow-cli component -m my-time -n pie-chart
Modules
The generated code architecture is modular. Every item is generated in a module.
There is a main module named ow. We use it for those lements, which are used by other modules. If a module is also used by other applications, we create it the Orgware's common React library.
Commands
App generator
Usage: ow-cli app -n <name> -d
Generate a React app
Options:
-n, --name <name> Item name
-d, --directory Create app directory
-h, --help display help for command
Asset generator
Usage: ow-cli asset -m <module> -n <name>
Generate a new asset
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
Component generator
Usage: ow-cli component -m <module> -n <name>
Generate a new component
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
Form generator
Usage: ow-cli form -m <module> -n <name>
Generate a new form
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
Page generator
Usage: ow-cli page -m <module> -n <name>
Generate a new page
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
Layout generator
Usage: ow-cli layout -m <module> -n <name>
Generate a new layout
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
Custom hook generator
Usage: ow-cli hook -m <module> -n <name>
Generate a new custom hook
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
Route generator
Usage: ow-cli route -m <module> -n <name>
Generate a new route
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command
State generator
Usage: ow-cli state -m <module> -n <name> -p
Generate a new state
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-p, --persist Persist state
-h, --help display help for command
Utility function generator
Usage: ow-cli util -m <module> -n <name>
Generate a new utility function
Options:
-m, --module <module> Module name
-n, --name <name> Item name
-h, --help display help for command