Enrollwise CLI for React code generation.
You can install CLI either globally or locally.
To install globally run yarn global add enrollwise-fe-cli
or npm i -g enrollwise-fe-cli
.
To install locally run yarn add -D enrollwise-fe-cli
or npm i --save-dev enrollwise-fe-cli
in the root of your project.
Create configuration file ew-react-codegen.config.json
in the root of your project.
Populate it with the following content:
{
"componentsFolderPath": "./your_path_goes_here",
"elementsFolderPath": "./your_path_goes_here",
"hooksFolderPath": "./your_path_goes_here",
"utilitiesFolderPath": "./your_path_goes_here"
}
If you've installed CLI locally, update your package.json scripts
property:
"scripts": {
"ew-react-codegen": "ew-react-codegen"
}
If you've installed CLI locally you will need to call commands using your package manager of choise, for example:
yarn ew-react-codegen component foo --props --tests
or npm ew-react-codegen component foo --props --tests
If you want to contribute or just simply try it out, follow these steps:
- Clone the repo:
[email protected]:blenderbox/enrollwise-fe-cli.git
- Install dependecies:
yarn install
ornpm install
- Install correct node version:
nvm use
- Run build:
yarn build
ornpm run build
- Globally link the package:
npm link
This will create a global symlink to the CLI. Now you're able to use the ew-react-codegen
command in your terminal.
Congratulations! You're ready to use commands and generate code!
CLI exposes following commands:
ew-react-codegen component
ew-react-codegen element
ew-react-codegen hook
ew-react-codegen utility
Creates new component with optional props, tests, stories and styles
Accepts following options:
--props
- Add props to the component--story
- Add story to the component--style
- Add style to the component--tests
- Add tests to the component
Creates new element with optional props, tests, stories and styles
Accepts following options:
--props
- Add props to the element--story
- Add story to the element--style
- Add style to the element--tests
- Add tests to the element
Creates new hook with optional props and tests
Accepts following options:
--props
- Add props to the hook--tests
- Add tests to the hook
Creates new utility with optional parameters and tests
Accepts following options:
--params
- Add params to the utility"--tests
- Add tests to the utility"
Provides command line help and description for the CLI commands.