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
The utility is published as a npm package. You can install it with the following command in terminal:
npm install -g @orgware/ow-cli
You can install it with development mode. In this case, you should cone its repository.
git clone git@github.com:OrgwareHQ/OcCliTS.git <target-directory>
cd <target-directory>
npm install
npm run dev
And in an other terminal:
npm link
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
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
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.
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
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
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
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
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
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
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
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
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
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