Releases: f0rmat1k/bemy
{{BlockName}}, {{ElemName}} and {{ModName}}
Added new placeholders. Useful when you need capitalized notation. For example, my template for react:
import React from 'react';
import b from 'b_';
import './{{blockName}}.css';
export default class {{BlockName}} extends React.Component {
constructor(props) {
super(props);
}
render() {
const {{blockName}} = b.with('{{blockName}}');
return (
<div className={{{blockName}}()}>
{{cursor}}
</div>
);
}
}
{{BlockName}}.contextTypes = {
bunker: React.PropTypes.object
};
`filename` option
New option in json filename
lets you set up your own resulting file name. Useful when you allways need index.css or index.jsx instead of BEM names.
New config option "auto_dir"
It let you set needed file types for autotask, when it is called on a directory.
Refactoring of templates
Hooks
I've added hooks calls for created files. Now you can set bash commands, which get path to created file with the first argument by replacing {{filePath}}
. Example:
"template": [ "tmp/js-template.js", "node examples/hook.js {{filePath}}" ]
It's useful when you need more than provide template replacers.
Create folder if it's necessary
Now Bemy able to create folders with "create", through bemy -t create -f b-test/__block js
;
thx to @iketari
Windows support
Added Windows support. Read more about peculiarities at relevant section of readme.md
.
Improved configs system
– Now config of bemy is named .bemy.json
.
– Now bemy will try to find .bemy.json
on the every previous level (like npm) until the root directory, so you can put .bemy.json
into your home directory or project directory if you need different options depend on project. Otherwise bemy will take .bemy.json
from own directory.
– Option output
renemed to debug
.
– Added --debug key.
– now bemy open existing file if there is -o key (bemy isn't rewriting existing files)
Fixed an important bug with deps
Before 2.2.2 deps files with array on the first level was processing incorrectly, e.g.
([
{
tech: 'js',
shouldDeps: [ { block: "foo", tech: "bemhtml" } ]
},
{
mustDeps: [],
shouldDeps: [
{ elems: ['foo', 'baz'] }
]
}
]);
Now it fixed.
Added output
Added output.
If you want it, you should set "output": true
in config.json
. Default is false
.