0.4.1 • Published 5 years ago
bb-plugin-add v0.4.1
bb-plugin-add
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-addNext, create your own project folder and run init:
$ mkdir my-project && cd my-project
$ bb initNow, We find .tpl in root path.
$ cd .tplThen, create config.json:
# config.json
{
"my-component":{
"path":"./my-component"
}
}Usage
bb add component MyComponentKeywords
# 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:
nameYour entity name.datetimeDatetime in os.fullnameUsername in os.gitnameUsername in git.emailEmail of git.
Self-defining Keywords
You can set up self-defining keywords in config.json
Build-in Functions
UPPERCASEMyComponent - MYCOMPONENTLOWERCASEMyComponent - mycomponentHEAD_UPPERmyComponent - MyComponentHEAD_LOWERMyComponent - myComponentGAP_HYPHENMyComponent - -my-componentGAP_UNDERSCOREMyComponent - _my_componentCSS_CLASS_HYPHEN_STYLEMyComponent - my-component
Thanks
@feyy
License
MIT