naming.file.stringify: using a custom naming convention
const bemNaming = require('@bem/sdk.naming.entity'); // This is required, cause RunKit cannot load this package itself.
const options = {
fs: { scheme: 'flat' }
};
const originFlatNaming = require('@bem/sdk.naming.presets/create')(options);
const stringify = require('@bem/sdk.naming.file.stringify')(originFlatNaming);
const BemFile = require('@bem/sdk.file');
var myFile;
myFile = BemFile.create({block: 'my-block', tech: 'css' });
stringify(myFile);
myFile = BemFile.create({block: 'my-block',
tech: 'js',
level: 'bem-files'});
stringify(myFile);
myFile = BemFile.create({block: 'my-block',
tech: 'css',
layer: 'desktop',
level: 'bem-files'});
stringify(myFile);
myFile = BemFile.create({block: 'my-block',
tech: 'css',
level: 'my-project/bem-files'});
stringify(myFile);
myFile = BemFile.create({block: 'my-block',
mod: 'my-modifier',
val: 'some-value',
tech: 'css',
level: 'bem-files'});
stringify(myFile);
myFile = BemFile.create({block: 'my-block',
elem: 'my-element',
mod: 'my-modifier',
tech: 'css',
level: 'bem-files' });
stringify(myFile);
no comments