generator-bem-stub
is a generator of BEM projects for Yeoman.
Introduction
There are several assemblers for BEM projects โ bem-tools and ENB. What does any developer do by starting a new BEM project? First and foremost, a developer creates a configuration file for an assembler which he is going to use. Unfortunately it is rather time-consuming and prone to error process both for bem-tools and ENB.
In order to save time and decrease barrier to entry into the tools for assembly, we decided to create a generator of configuration files which allows a developer to configure the assembly without immersion into tools' API. This generator provides you the ability to get the base of BEM project in few minutes by answering the simple questions.
Install
To install the generator run:
$ npm install -g generator-bem-stub
Usage
Run:
$ yo bem-stub
To create the config file fitting for your project, the generator will ask several questions. Note that some of them depend on the previous ones, for example:
-
If you have chosen library bem-components,
generator-bem-stub
will choose Autoprefixer and CSS preprocessor Stylus as default. -
You can choose template engine BH only if you have chosen assembler ENB.
-
If you have not chosen technology BEMJSON, bundles will be assembled from BEMDECL.
-
You can build HTML only if you have chosen technology BEMJSON and template engine BEMHTML or BH.
-
You will be able to choose which separate files to minimize only if you have chosen assembler ENB (bem-tools does not support configuration of minimization, all possible files are minimized by borschik).
What does generator-bem-stub support?
- Assemblers:
- bem-tools
- ENB
- Libraries:
- bem-core
- bem-components
- Platforms:
- desktop
- touch-pad
- touch-phone
- CSS preprocessors:
- Stylus
- Less
- Autoprefixer
- Technologies:
- BEMJSON
- BEMTREE
- BEMDECL
- node.js
- browser.js
- Template engines:
- BEMHTML
- BH (only in ENB)
- Building of HTML
- Minimization of separate files (only in ENB)
Installation of dependencies
generator-bem-stub
will install all dependencies and libraries after generation of the project.
If you do not want to install dependencies and libraries, use the option --skip-install
:
$ yo bem-stub --skip-install
Versions
You can check in the file app/config/versions.js which versions of the dependencies and libraries generator-bem-stub
uses.