Generate React components, hooks, Next.JS pages, and API services in line with biproxi conventions with a simple command.
npm i biproxi-template-generator --save-dev
- Install the library.
- Make an npm script for each template you want to build.
- ???
- Profit
{
scripts:
"buildComponent": "node ./node_modules/biproxi-template-generator/scripts/buildTemplate.js build component -n $npm_config_name -p $INIT_CWD",
"buildPage": ...
...
}
Run the script from the directory you want to generate the template in, specifying a name:
node run buildComponent --name=Button
- Common imports
- Styled container for component
- Typing for component props
- Component with State, Hooks, Actions, GraphQL, Effects, and Render sections
- Default export
- Add Next.JS pages
- Add hooks
- Clean up this README
- Add API services and sub-components