bem2ng

2.0.1 • Public • Published

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=input
bem2ng update -t --block=input
bem2ng 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: (en)
? 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 if necessary: sugarss
? Specify the extension of your stylesheets: sss
 
✔ Configuration file .bem2ngrc created successfully
 
# content of the created configuration file 
# { 
#     "lang": "en", 
#     "src_ng2": "ng-app/", 
#     "tech_ng2": "dart", 
#     "src_bem": "blocks/", 
#     "out_bem": "bundles/", 
#     "postcss_plugins": "postcss-nested, pobem", 
#     "postcss_parser": "sugarss", 
#     "css_extension": "sss" 
# } 

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i bem2ng

Weekly Downloads

8

Version

2.0.1

License

MIT

Last publish

Collaborators

  • radxene