generator-homebase
v0.2.0
Published
generators for workclout homebase codebase
Downloads
4
Readme
generator-homebase
generators for workclout homebase codebase
Installation
First, install Yeoman and generator-homebase using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-homebase
Templates
Component generator
Generates a function component in src/components
with the following features:
- Simple Card component with some info and click event.
- All typescript annotations needed for props and component.
styled
file for you styled-components and rebass components.- Storybook example ready to be consumed by storybook
tests
file for unit tests. It contains 4 basic unit test that should pass for the generated componentsi18next
internationalization example viauseTranslation
To run inside the app
project run
npm run generate:component
To run via yeomen
yo homebase:component
note: you will be promot to enter a component name. Please enter CamelCase name for the template to work.
note: This generator doesn't have an option to generate a class component since we now have react hooks there is no need for class components.
Dev
Local development on existing template.
git clone [email protected]:workclout/generators.git
- run
npm link
- link package in
app
project vianpm link generator-homebase
- run
npm run generate:${template name}
script.
Add a new template
- create a new folder inside
generators
with the name of your template. - create index.js with yeomen class. (checkout
generators/component
generator) - create your templates in
generators/${generator name}/templates
.
Publish
to publish you need to:
- Increase the package version in
package.json
- Run
npm publish
- Install package in your project with
npm i -D generator-homebase@latest
Future work
- add options for styled/i18next.
- add templates to generate scenes.
- semantic releases and publish package on commit to master
License
© ilaiwi