Coder Social home page Coder Social logo

generator-bem-ng's Introduction

generator-bem-ng Build Status

This README also available in russian.

Awesome Yeoman generator for your AngularJS flowered bem-projects. Wow!

You can

  • make pretty bem-project structure: yo bem-ng
  • create AngularJS modules: yo bem-ng:module users
  • develop you bem-project with Gulp (take instruction from console): gulp
  • distribute project with Gulp: gulp build
  • get it now: npm install -g generator-bem-ng

Paradigm

AngularJS modules is BEM blocks. Controllers, routes, services, directives and etc. is BEM elements. Elements required in modules by *.deps.js file.

Levels usage:

  • common.blocks - use for override blocks from connected libraries
  • service.blocks - use for new blocks on this service
  • application.blocks - use for AngularJS modules only
  • server.blocks - use for NodeJS server modules

Put all your CSS design to:

  • design/common.blocks - override libraries styles
  • design/service.blocks - only this service styles

module example:

application.blocks
    users
        __controllers
            _index
                users__controllers_index.js
                users__controllers_index.en.md
                users__controllers_index.ru.md
            _signin
                users__controllers_singin.js
            _signup
                users__controllers_singup.js
        __directives
            _awesome
                users__directives_awesome.js
        __factories
        __services
        __routes
            users__routes.js
        users.js
        users.en.md
        users.ru.md
        users.deps.js

Technologies

You can override them with bem-tools techs in .bem/levels/*.js files and also you can write you custom tech in .bem/levels/techs/*.js.

Dependencies

Project contain bem-core and bem-ng libs. bem-core was developed by guys from Yandex.

Authors

Ideas

Please, talk about your ideas by GitHub issues.

MIT License

Think better. Stay BEMed!

generator-bem-ng's People

Contributors

awinogradov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

generator-bem-ng's Issues

Переменные окружения

Думаю не верно указывать переменные окружения в make.js, будет правильно выделить их в документацию

export YENV=production
export XJST_ASYNCIFY=yes
export BEM_MAKE_NO_COLORS=yes
export BEM_MAKE_VERBOSITY=error

хотя, если они переопределяются то это не важно.

проблемка с созданием нового блока

$ sudo npm i verybigman/generator-bem -g
$ mkdir project && cd $_
$ yo bem && yo bem:init
$ bem make
$ bem create -l blocks -b test
Error: Tech module with path '/home/ilyar/project/libs/bem-core/.bem/techs/browser.js.js' not found on require search paths

$ node -v && npm -v && yo -v && bem -v
v0.10.26
1.4.3
1.1.2
0.7.8

проблема в файле .bem/levels/blocks.js:

var PATH = require('path'),
    environ = require('bem-environ'),
    join = PATH.join,

решается в сгенерированном проекте так:

var PATH = require('path'),
-    environ = require('bem-environ'),
+    environ = require('bem-environ')({ libDir: 'Значение из project.json:libDir' })
    join = PATH.join,

В проекте есть шаблон только для init/templates/_bundles.js, вероятно ..bem/levels/blocks.js берется как есть из project-stub, поэтому не понятно что пулреквестить.

Edit Gruntfile

Edit Grunfile for distribute project. Use borschik freeze for static. Optimize js, css, images.

Error Running "exec:mkdirs" (exec) task in windows

npm install -g yo generator-bem 
mkdir test_bem_gen && cd $_
yo bem
grunt

...

Running "exec:mkdirs" (exec) task
>> �訡�� � ᨭ⠪���� �������.
>> Exited with code: 1.
Warning: Task "exec:mkdirs" failed. Use --force to continue.

Aborted due to warnings.

Update to new structure

bem-protein by example
update to bem-core 2.0.0
update to new bem-components
use bem-techs and delete techs from .bem/techs
use gulp for create dist only
add to readme info about development with bem-server
add bem-tools-autoprefixer

Clone project-stub with git

Now project-stub structure located in the templates folder. And copied during execution generator. Bad way.

не изменяются путь на JS/CSS в dist/*.html

после выполнения сборки, путь на стили и скрипты остается прежним:

...
  <!--[if gt IE 9]><!-->
  <link rel="stylesheet" href="_index.css"/>
  <!--<![endif]--><!--[if gte IE 6]>
  <link rel="stylesheet" href="_index.ie.css"/><![endif]-->
...
<script src="_index.js"></script>
...

Вопрос о base

Release 1.0.0 😹 cool!

Я не понял назначение base и именно в ней описывается уровень *.blocks/base/.bem из этого следует что блоки создаются в ней bem create -l desktop.blocks/base -b myblock, какой work flow ты предполагаешь?

Integrate with Less

Add prompt for select pre-proccessor: less, stylus.
Add tech to make.js, levels/*.js, Gruntfile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.