generator-terminus-ui
v0.1.17
Published
A generator for adding new components to the Terminus UI library.
Downloads
43
Maintainers
Readme
Terminus UI Component Generator
Generate new components for the Terminus UI library.
Table of Contents
Installation
# Install yeoman
$ npm i -g yo
# Install this generator
$ npm i -g generator-terminus-uiUsage
Component
# Generate a new component
$ yo terminus-ui:component my-buttonThe generator expects a dash-separated all-lowercase component name and will generate the correct module and component names.
# Example names based off of the passed in name:
$ yo terminus-ui:component my-button
# Module name: TsMyButtonModule
# Component name: TsMyButtonComponent
# Demo component name: MyButtonComponentThis will stub in a new component in the UI library and demo app. The exact changes are listed below:
- Generate UI component files:
./terminus-ui/src/my-button/my-button.module.ts./terminus-ui/src/my-button/my-button.component.ts./terminus-ui/src/my-button/my-button.component.spec.ts./terminus-ui/src/my-button/my-button.component.scss./terminus-ui/src/my-button/my-button.component.html
- Import the
TsMyButtonModulemodule inside./terminus-ui/src/module.ts - Add the
TsMyButtonModulemodule to the imports array in./terminus-ui/src/module.ts - Add the
TsMyButtonModulemodule to the exports array in./terminus-ui/src/module.ts - Export the
TsMyButtonModulemodule from./terminus-ui/src/index.ts - Create the
MyButtonComponentfor development at./src/app/components/my-button.component.ts - Add the
MyButtonComponentcomponent to the demo navigation array in./src/app/components/components.component.ts - Add the new component as a scope
MyButton
License
MIT © Terminus
TODO
- Pipe generator
- Service generator
- SCSS helper generator
