Rename folder blocks → common.blocks
Needed to build it with webpack-bem-plugin.
Why?
- Plugin is built on bem-sdk — new version of bem-tools/bem-config
- Modern version of
bemrc(used by bem-sdk) should define level in a form{ layer: 'foo' }for folder "foo.blocks". Defining level with path property is deprecated - Naming presets also relay on layer property
There is no simple way to handle "bem-react-components" with custom folder "blocks" and build projects by webpack-bem-plugin or other builder using bem-sdk.
I've created an issue about it and found no other way. May be after this issue we can get better decision. For now is better to use simple approach: "If bem-react-components defines common blocks we put them in so called folder"
@awinogradov @Yeti-or check my PR please
сс @tadatuta
I think bem-config should support folders like blocks, blocks-common and all the other custom variations. will find out the way to support it.
bem-config is deprecated see subtitle at github page. I am talking about bem-sdk/config
@tadatuta reasonably noted that all we need is to declare a custom preset for "bem-react-components" like:
// based on react preset
module.exports = {
delims: {
elem: '-',
mod: { name: '_', val: '_' }
},
fs: {
delims: { elem: '' },
pattern: 'blocks/${entity}.${tech}',
scheme: 'nested'
},
wordPattern: '[a-zA-Z0-9]+'
};
But "bem-react-components" should be simple and such complex thing like full naming form is too much. May be we can give an option to define naming preset based on one of standard presets.
This is much simpler:
module.exports = {
basedOn: 'react',
fs: { patter: 'blocks/${entity}.${tech}' }
};
Actually, you can do this without basedOn field:
const { react } = '@bem/sdk.naming.presets';
module.exports = { ...react, fs: { ...react.fs, pattern: '${entity}.${tech}' } };
And path to library (or to level if you want) should contains blocks/.
btw. Do you want to join us at this weekend to dive into webpack world?
basedOn is shorter =) we can add it here
тогда уж extends