Skip to content

Commit

Permalink
Version 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevils committed May 26, 2014
1 parent 91d52e9 commit 567b8cd
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Версия 0.12.0:
* Новые моки для `fs`.
* Автоматически создаем директории для страниц.

Версия 0.11.0:
* Моки для `fs`.
* Отмечаем ряд технологий, как `deprecated`.

Версия 0.10.0:
* Добавлена опция `--dir`.

Expand Down
25 changes: 25 additions & 0 deletions lib/build-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var BuildFlow = inherit( /** @lends BuildFlow.prototype */ {
this._methods = {};
this._staticMethods = {};
this._deprecationNotice = null;
this._optionAliases = {};
this._prepareFunc = function () {};
this._buildFunc = function () {
throw new Error('You should declare build function using "build" method of BuildFlow.');
Expand Down Expand Up @@ -114,6 +115,18 @@ var BuildFlow = inherit( /** @lends BuildFlow.prototype */ {
});
},

/**
* Объявляет алиас для опции.
*
* @param {String} optionName
* @param {String} aliasName
*/
optionAlias: function (optionName, aliasName) {
return this._copyAnd(function (buildFlow) {
buildFlow._optionAliases[aliasName] = optionName;
});
},

/**
* Требует список файлов по суффиксу или суффиксам.
* Например, .useFileList("js") добавит в аргументы билдеру список файлов с расширением js.
Expand Down Expand Up @@ -385,6 +398,10 @@ var BuildFlow = inherit( /** @lends BuildFlow.prototype */ {
Object.keys(staticMethods).forEach(function (methodName) {
result._staticMethods[methodName] = staticMethods[methodName];
});
var optionAliases = this._optionAliases;
Object.keys(optionAliases).forEach(function (optionName) {
result._optionAliases[optionName] = optionAliases[optionName];
});
return result;
},

Expand Down Expand Up @@ -503,6 +520,7 @@ var BuildFlow = inherit( /** @lends BuildFlow.prototype */ {
var methods = this._methods;
var staticMethods = this._staticMethods;
var deprecationNotice = this._deprecationNotice;
var optionAliases = this._optionAliases;
if (!name) {
throw new Error('You should declare tech name using "name" method of BuildFlow.');
}
Expand All @@ -513,6 +531,13 @@ var BuildFlow = inherit( /** @lends BuildFlow.prototype */ {
configure: function () {
var _this = this;
var node = this.node;
Object.keys(optionAliases).forEach(function (aliasName) {
if (this._options.hasOwnProperty(aliasName)) {
var optionName = optionAliases[aliasName];
this._options[optionName] = this._options[aliasName];
delete this._options[aliasName];
}
}, this);
this._optionFieldNames = {};
Object.keys(options).forEach(function (optName) {
var option = options[optName];
Expand Down
8 changes: 6 additions & 2 deletions lib/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ module.exports = inherit( /** @lends MakePlatform.prototype */ {
/**
* Устанавливает логгер для сборки.
* Позволяет перенаправить вывод процесса сборки.
* @param logger
*
* @param {Logger} logger
*/
setLogger: function (logger) {
this._logger = logger;
Expand All @@ -300,7 +301,10 @@ module.exports = inherit( /** @lends MakePlatform.prototype */ {
node.setLogger(this._logger.subLogger(nodePath));
node.setBuildGraph(this._graph);
this._nodes[nodePath] = node;
this._nodeInitPromises[nodePath] = Vow.when(nodeConfig.exec())
this._nodeInitPromises[nodePath] = vowFs.makeDir(nodePath)
.then(function () {
return Vow.when(nodeConfig.exec());
})
.then(function () {
return Vow.all(_this._projectConfig.getNodeMaskConfigs(nodePath).map(function (nodeMaskConfig) {
return nodeMaskConfig.exec([], nodeConfig);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": "Marat Dulin <[email protected]>",
"description": "Faster BEM tools",
"description": "Faster BEM/BEViS assembler",
"name": "enb",
"version": "0.11.1",
"repository": "https://github.com/enb-make/enb",
Expand Down
2 changes: 1 addition & 1 deletion techs/js-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var vow = require('vow');
var vowFs = require('../lib/fs/async-fs');

module.exports = require('../lib/build-flow').create()
.name('js')
.name('js-test')
.target('target', '?.test.js')
.useFileList('test.js')
.defineOption('fileMask', /.*/, '_fileMask')
Expand Down

0 comments on commit 567b8cd

Please sign in to comment.