generator-terminus-ui
v0.1.17
Published
A generator for adding new components to the Terminus UI library.
Downloads
38
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-ui
Usage
Component
# Generate a new component
$ yo terminus-ui:component my-button
The 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: MyButtonComponent
This 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
TsMyButtonModule
module inside./terminus-ui/src/module.ts
- Add the
TsMyButtonModule
module to the imports array in./terminus-ui/src/module.ts
- Add the
TsMyButtonModule
module to the exports array in./terminus-ui/src/module.ts
- Export the
TsMyButtonModule
module from./terminus-ui/src/index.ts
- Create the
MyButtonComponent
for development at./src/app/components/my-button.component.ts
- Add the
MyButtonComponent
component 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