generator-homebase

0.2.0 • Public • Published

generator-homebase NPM version Build Status Dependency Status

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 components
  • i18next internationalization example via useTranslation

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 git@github.com:workclout/generators.git
  • run npm link
  • link package in app project via npm 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

Readme

Keywords

Package Sidebar

Install

npm i generator-homebase

Weekly Downloads

1

Version

0.2.0

License

none

Unpacked Size

13.5 kB

Total Files

12

Last publish

Collaborators

  • ilaiwi