Permalink
Browse files

Merge branch 'techs-v2'

0.5.34
  • Loading branch information...
2 parents dd1f7b4 + d59d415 commit 0671b92a708aec8d7637fbf143a4af4128597a15 @scf2k scf2k committed Jun 10, 2013
Showing with 3,146 additions and 5,298 deletions.
  1. +4 −0 ChangeLog.md
  2. +11 −0 lib/base-server.js
  3. +2 −0 lib/coa.js
  4. +17 −2 lib/commands/build.js
  5. +11 −0 lib/default-arch.js
  6. +1 −0 lib/index.js
  7. +386 −12 lib/level.js
  8. +9 −0 lib/logger.js
  9. +20 −17 lib/nodes/build.js
  10. +14 −6 lib/nodes/bundle.js
  11. +5 −3 lib/nodes/level.js
  12. +33 −0 lib/nodes/target.js
  13. +1 −0 lib/nodes/workers/borschik.js
  14. +125 −0 lib/tech/index.js
  15. +37 −140 lib/{tech.js → tech/v1.js}
  16. +658 −0 lib/tech/v2.js
  17. +1 −1 lib/techs/bemdecl.js.js
  18. +0 −1 lib/techs/deps.js.js
  19. +90 −0 lib/techs/v2/bemdecl.js.js
  20. +34 −0 lib/techs/v2/css.js
  21. +532 −0 lib/techs/v2/deps.js.js
  22. +55 −0 lib/techs/v2/ie.css.js
  23. +18 −0 lib/techs/v2/ie6.css.js
  24. +1 −0 lib/techs/v2/ie7.css.js
  25. +1 −0 lib/techs/v2/ie8.css.js
  26. +1 −0 lib/techs/v2/ie9.css.js
  27. +16 −0 lib/techs/v2/js-i.js
  28. +16 −0 lib/techs/v2/js.js
  29. +90 −1 lib/util.js
  30. +2 −2 npm-shrinkwrap.json
  31. +2 −2 package.json
  32. +14 −0 test/data/make/project/.bem/make.js
  33. +1 −1 test/data/make/project/bem-bl
  34. +2 −4 test/data/make/project/pages-with-merged/.bem/level.js
  35. +9 −5 test/data/make/project/pages/.bem/level.js
  36. +0 −12 test/data/make/reference-result/.bem/cache/pages-with-merged/page1/page1.deps.js.meta.js
  37. +0 −10 test/data/make/reference-result/.bem/cache/pages-with-merged/page2/page2.deps.js.meta.js
  38. +0 −9 test/data/make/reference-result/.bem/cache/pages/client/client.bemhtml.meta.js
  39. +0 −6 test/data/make/reference-result/.bem/cache/pages/client/client.css.meta.js
  40. +0 −13 test/data/make/reference-result/.bem/cache/pages/client/client.deps.js.meta.js
  41. +0 −19 test/data/make/reference-result/.bem/cache/pages/client/client.i18n.js.meta.js
  42. +0 −1 test/data/make/reference-result/.bem/cache/pages/client/client.i18n.meta.js
  43. +0 −3 test/data/make/reference-result/.bem/cache/pages/client/client.ie.css.meta.js
  44. +0 −9 test/data/make/reference-result/.bem/cache/pages/example/example.bemhtml.meta.js
  45. +0 −6 test/data/make/reference-result/.bem/cache/pages/example/example.css.meta.js
  46. +0 −12 test/data/make/reference-result/.bem/cache/pages/example/example.deps.js.meta.js
  47. +0 −18 test/data/make/reference-result/.bem/cache/pages/example/example.i18n.js.meta.js
  48. +0 −1 test/data/make/reference-result/.bem/cache/pages/example/example.i18n.meta.js
  49. +0 −3 test/data/make/reference-result/.bem/cache/pages/example/example.ie.css.meta.js
  50. +15 −7 test/data/make/reference-result/pages-with-merged/merged/merged.deps.js
  51. +15 −7 test/data/make/reference-result/pages-with-merged/page1/page1.deps.js
  52. +15 −7 test/data/make/reference-result/pages-with-merged/page2/page2.deps.js
  53. +0 −701 test/data/make/reference-result/pages/client/__profile/_client__profile.bemhtml.js
  54. +86 −28 test/data/make/reference-result/pages/client/__profile/_client__profile.en.js
  55. +86 −28 test/data/make/reference-result/pages/client/__profile/_client__profile.js
  56. +86 −28 test/data/make/reference-result/pages/client/__profile/_client__profile.ru.js
  57. +0 −701 test/data/make/reference-result/pages/client/__profile/client__profile.bemhtml.js
  58. +15 −7 test/data/make/reference-result/pages/client/__profile/client__profile.deps.js
  59. +1 −1 test/data/make/reference-result/pages/client/__profile/client__profile.html
  60. +0 −819 test/data/make/reference-result/pages/client/_client.bemhtml.js
  61. +86 −28 test/data/make/reference-result/pages/client/_client.en.js
  62. +86 −28 test/data/make/reference-result/pages/client/_client.js
  63. +86 −28 test/data/make/reference-result/pages/client/_client.ru.js
  64. +0 −819 test/data/make/reference-result/pages/client/client.bemhtml.js
  65. +15 −7 test/data/make/reference-result/pages/client/client.deps.js
  66. +1 −1 test/data/make/reference-result/pages/client/client.html
  67. +0 −819 test/data/make/reference-result/pages/example/_example.bemhtml.js
  68. +86 −28 test/data/make/reference-result/pages/example/_example.en.js
  69. +86 −28 test/data/make/reference-result/pages/example/_example.js
  70. +86 −28 test/data/make/reference-result/pages/example/_example.ru.js
  71. +0 −819 test/data/make/reference-result/pages/example/example.bemhtml.js
  72. +15 −7 test/data/make/reference-result/pages/example/example.deps.js
  73. +1 −1 test/data/make/reference-result/pages/example/example.html
  74. +2 −0 test/level-nested.js
  75. +2 −0 test/level-simple.js
  76. +53 −1 test/level.js
  77. +2 −2 test/tech.js
  78. +1 −1 test/util.js
View
@@ -1,5 +1,9 @@
bem-tools changelog
===================
+10.06.2013, Version 0.5.34 (stable)
+----------------------------------
+
+- speed optimizations with techs API V2
30.05.2013, Version 0.5.33 (stable)
----------------------------------
View
@@ -9,6 +9,7 @@ var INHERIT = require('inherit'),
PATH = require('./path'),
MAKE = require('./make'),
LOGGER = require('./logger'),
+ LEVEL = require('./level')
U = require('./util');
var defaultDocument = 'index.html';
@@ -141,6 +142,8 @@ exports.Server = INHERIT({
}
},
+ _targetsInProcess: 0,
+
createRequestHandler: function(root, runner) {
var _this = this;
@@ -167,10 +170,18 @@ exports.Server = INHERIT({
.then(function(id) {
if (!id) return;
+ _this._targetsInProcess++;
+
// found, run build
LOGGER.fverbose('*** node found, building "%s"', id);
+ LOGGER.fdebug('targets: %s', _this._targetsInProcess);
LOGGER.time('[t] Build total for "%s"', id);
return runner.process(id).fin(function() {
+ _this._targetsInProcess--;
+
+ if (_this._targetsInProcess === 0) LEVEL.resetLevelsCache();
+
+ LOGGER.fdebug('targets: %s', _this._targetsInProcess);
LOGGER.timeEnd('[t] Build total for "%s"', id);
});
})
View
@@ -2,6 +2,8 @@ var Q = require('q'),
CP = require('child_process'),
PATH = require('./path');
+Q.longStackJumpLimit = 0;
+
module.exports = require('coa').Cmd()
.name(PATH.basename(process.argv[1]))
.title(['Tools to work with files written using the BEM-method.', '' +
View
@@ -1,6 +1,7 @@
var Q = require('q'),
PATH = require('../path'),
- createLevel = require('../level').createLevel,
+ LEVEL = require('../level'),
+ createLevel = LEVEL.createLevel,
Context = require('../context').Context,
U = require('../util');
@@ -17,6 +18,15 @@ module.exports = function() {
.req()
.end()
.opt()
+ .name('forceCache').title('Force level cache')
+ .long('force-cache')
+ .flag()
+ .def(false)
+ .val(function(force) {
+ if (force) LEVEL.setCachePolicy(true);
+ })
+ .end()
+ .opt()
.name('level').short('l').long('level')
.title('override level, can be used many times')
.val(function (l) {
@@ -64,6 +74,11 @@ module.exports = function() {
.name('val').short('v').long('val')
.title('modifier value')
.end()
+ .opt()
+ .name('force').title('Force build')
+ .long('force')
+ .flag()
+ .end()
.act(function(opts, args) {
if (opts.outputLevel) {
@@ -87,7 +102,7 @@ module.exports = function() {
return context.getTech(techIdent)
.buildByDecl(opts.declaration, context.getLevels(),
- PATH.resolve(opts.outputDir, opts.outputName));
+ PATH.resolve(opts.outputDir, opts.outputName), opts);
})).get(0);
View
@@ -5,6 +5,7 @@ var INHERIT = require('inherit'),
LOGGER = require('./logger'),
Q = require('qq'),
registry = require('./nodesregistry'),
+ level = require('./level'),
node = require('./nodes/node'),
levelNodes = require('./nodes/level'),
@@ -22,6 +23,9 @@ registry.decl('Arch', {
this.arch = arch;
this.root = opts.root;
this.opts = opts;
+
+ var policy = this.getLevelCachePolicy();
+ level.setCachePolicy(policy.cache, policy.except);
},
bundlesLevelsRegexp: /^(pages.*|bundles.*)/i,
@@ -33,6 +37,13 @@ registry.decl('Arch', {
return this.libraries;
},
+ getLevelCachePolicy: function() {
+ return {
+ cache: false,
+ except: []
+ }
+ },
+
alterArch: function() {
var _this = this;
View
@@ -10,6 +10,7 @@ exports.nodes = require('./nodes');
exports.Context = require('./context').Context;
exports.Tech = TECH.Tech;
+exports.TechV2 = TECH.TechV2;
exports.getTechClass = TECH.getTechClass;
exports.createTech = TECH.createTech;
Oops, something went wrong.

0 comments on commit 0671b92

Please sign in to comment.