1.0.8 • Published 5 years ago
@tealink/ui-generators v1.0.8
@tealink/ui-generators
Global CLI generators for scaffolding ui based on https://plopjs.com/
Install
npm install --save-dev @tealink/ui-generatorsAdd the following scripts in package.json:
"scripts": {
"generate": "ui-generators",
"g": "npm run generate"
},Generate!
npm run g cCommands
Create component
npm run g cor
npm run generate componentThis will create a react functional component in /components folder and export it
Create page
npm run g por
npm run generate pageThis will create a react functional component including portals in /pages folder and export it. It will also generate a navigation entrance in the sidebar and add routing.
Create sub-page
npm run g spor
npm run generate subpageThis will create a react functional component in /pages/ROOT/ folder and export it, where root is an already exisiting page. It will also add routing under /ROOT/name.
Create hook
npm run g hor
npm run generate hookCreates a hook in /hooks folder
Create service
npm run g sor
npm run generate serviceCreates a service in /services folder
Development
cd example
npm install ../
npm run g cPublish
By versioning the library, it will automatically be pushed to your remote branch. The library is published automatically to npm when merged to master.
npm version patch