bb-plugin-add

0.4.1 • Public • Published

bb-plugin-add

npm version Build Status

A self-defining module generator plugin for bb-mt

Get Start

First, you should install bb and this plugin:

$ npm install -g bb-mt bb-plugin-add

Next, create your own project folder and run init:

$ mkdir my-project && cd my-project
$ bb init

Now, We find .tpl in root path.

cd .tpl

Then, create config.json:

# config.json 
{
  "my-component":{
    "path":"./my-component"
  }
}

Usage

bb add component MyComponent

Keywords

# For example, edit template file like this 
# Entity name is ${name} 
export { default as ${name}} from "${name}"

Build-in Keywords

You can use build-in keywords below:

  • name Your entity name.
  • datetime Datetime in os.
  • fullname Username in os.
  • gitname Username in git.
  • email Email of git.

Self-defining Keywords

You can set up self-defining keywords in config.json

Build-in Functions

  • UPPERCASE MyComponent - MYCOMPONENT
  • LOWERCASE MyComponent - mycomponent
  • HEAD_UPPER myComponent - MyComponent
  • HEAD_LOWER MyComponent - myComponent
  • GAP_HYPHEN MyComponent - -my-component
  • GAP_UNDERSCORE MyComponent - _my_component
  • CSS_CLASS_HYPHEN_STYLE MyComponent - my-component

Thanks

@feyy

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i bb-plugin-add

Weekly Downloads

0

Version

0.4.1

License

ISC

Unpacked Size

200 kB

Total Files

36

Last publish

Collaborators

  • ranrantu