Skip to content

GetTerminus/generator-terminus-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terminus UI Component Generator

CircleCI NPM version semantic-release MIT License

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:

  1. 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
  2. Import the TsMyButtonModule module inside ./terminus-ui/src/module.ts
  3. Add the TsMyButtonModule module to the imports array in ./terminus-ui/src/module.ts
  4. Add the TsMyButtonModule module to the exports array in ./terminus-ui/src/module.ts
  5. Export the TsMyButtonModule module from ./terminus-ui/src/index.ts
  6. Create the MyButtonComponent for development at ./src/app/components/my-button.component.ts
  7. Add the MyButtonComponent component to the demo navigation array in ./src/app/components/components.component.ts
  8. Add the new component as a scope MyButton

License

MIT © Terminus

TODO

  • Pipe generator
  • Service generator
  • SCSS helper generator