gulp-bem / gulp-bem-bundle-builder

DEPRECATED repository, moved to https://github.com/bem/gulp-bem/tree/master/packages/gulp-bem-bundle-builder
Other
3 stars 1 forks source link

Normalize decl v2 #5

Closed aledovskikh closed 8 years ago

aledovskikh commented 8 years ago

Maybe we should normalize bem decl with new notation?

const decl = require('bem-decl').normalizer('v2'); ... const declNormalize = data => decl(data).map(e => (e.entity.tech = e.tech, e.entity)); bundle.decl = declNormalize(bundle.decl); ...

skad0 commented 8 years ago

Here we only build bundles. Normalization is in bem-deps.parse, which called from bem-deps.load method in gulp-bem-src or in development gulp-bem-src.

qfox commented 8 years ago

Maybe we should normalize bem decl with new notation?

I guess we should do it in fs-bundler or bem-bundle package.

const declNormalize = data => decl(data).map(e => (e.entity.tech = e.tech, e.entity));

It's a big question what fields we should left in bem-entity object by default. But it's an off-topic for this module.

qfox commented 8 years ago

Feels like we have found a form: {entity: {block: String, elem: String, mod: {name: String, val: String}}, tech: String} but still need a name.

At the moment we want to name it BemCell or BemCytos, but it's another story ;-)