bem2ng
Create Angular 2 component from BEM blocks. Components will be created with selected language, Dart or TypeScript.
Installation
npm install bem2ng
Features
❤ Bem2ng have two command
create - [Create Angular2 component from BEM block] update - [Update Angular2 component]
> and five options
-b --block - [Use BEM block's name to create Angular2 component. Only `create` command] -t --teplate - [Update only template file of Angular2 component] -s --style - [Update only style file of Angular2 component] -a --all - [Update style & template files of Angular2 component] --global-style - [Copy global styles from BEM SRC to Angular2 SRC indicating relative path to folder where it will be created]
Examples
Create/Update component
# Create component bem2ng create -b input # Update component bem2ng update -s --block=inputbem2ng update -t --block=inputbem2ng update -a --block=input # Copy Global Style bem2ng create --global-style=web/
Note: When you first start bem2ng checks if configuration file (.bem2ngrc) exists, otherwise the program will try to create it and ask you to enter in terminal the requested data. The path of these directories should be relative.
Create file configuration
$ bem2ng create -b input* Missing or not correctly configured .bem2ngrc file? Specify language from the list of available [ en, ru, ro ] default is: ? Specify location of the Angular project: ng-app/? Specify language is used in Angular project [ dart, ts ]: dart? Specify location of the BEM project: blocks/? Specify location of the collected html BEM project: bundles/* The module works with PostCSS? Specify by order used plugins separated by a comma: postcss-nested, pobem? Specify postcss parser
License
MIT