This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'release-v0.5.31'

0.5.31
  • Loading branch information...
2 parents 494feba + 2174f15 commit f855e3fde9184e3ed9ff26fba9136eb79431f446 @scf2k scf2k committed Apr 24, 2013
Showing with 192 additions and 9 deletions.
  1. +7 −0 ChangeLog.md
  2. +14 −0 lib/levels/project.js
  3. +15 −0 lib/techs/blocks.js
  4. +15 −0 lib/techs/bundles.js
  5. +9 −0 lib/techs/dir.js
  6. +15 −0 lib/techs/examples.js
  7. +18 −0 lib/techs/level.js
  8. +77 −0 lib/techs/project.js
  9. +15 −6 lib/util.js
  10. +4 −1 npm-shrinkwrap.json
  11. +3 −2 package.json
View
@@ -1,5 +1,12 @@
bem-tools changelog
===================
+24.04.2013, Version 0.5.31 (stable)
+-----------------------------------
+
+- bem: Add additional techs and levels from abandoned introspect branch
+- API: Add mkdrip wrapper to util.js
+- bem: ie.css tech should pass absolute path for its chunks
+- bem make: Fix for "Coud not call for method of undefined" when using nodes from API
04.04.2013, Version 0.5.30 (stable)
-----------------------------------
View
@@ -0,0 +1,14 @@
+exports.baseLevelPath = require.resolve('./simple');
+
+exports.getTypes = function() {
+ return ['project'].concat(this.__base());
+};
+
+exports.getTechs = function() {
+
+ return {
+ 'blocks': 'blocks',
+ 'bundles': 'bundles'
+ };
+
+};
View
@@ -0,0 +1,15 @@
+var U = require('../util'),
+ PATH = require('path');
+
+exports.baseTechPath = require.resolve('./level.js');
+
+exports.techMixin = {
+
+ createLevel: function(opts, names) {
+
+ opts.level = PATH.resolve(U.findLevel(opts.outputDir, 'project'), '.bem/levels/blocks.js');
+ return this.__base(opts, names);
+
+ }
+
+};
View
@@ -0,0 +1,15 @@
+var U = require('../util'),
+ PATH = require('path');
+
+exports.baseTechPath = require.resolve('./level.js');
+
+exports.techMixin = {
+
+ createLevel: function(opts, names) {
+
+ opts.level = PATH.resolve(U.findLevel(opts.outputDir, 'project'), '.bem/levels/bundles.js');
+ return this.__base(opts, names);
+
+ }
+
+};
View
@@ -0,0 +1,9 @@
+var U = require('../util');
+
+exports.techMixin = {
+
+ storeCreateResult: function(path, suffix, res, force) {
+ return U.mkdirp(path);
+ }
+
+};
View
@@ -0,0 +1,15 @@
+var U = require('../util'),
+ PATH = require('path');
+
+exports.baseTechPath = require.resolve('./level.js');
+
+exports.techMixin = {
+
+ createLevel: function(opts, names) {
+
+ opts.level = PATH.resolve(U.findLevel(opts.outputDir, 'project'), '.bem/levels/examples.js');
+ return this.__base(opts, names);
+
+ }
+
+};
View
@@ -0,0 +1,18 @@
+var BEM = require('../..');
+
+exports.techMixin = {
+
+ createByDecl: function(item, level, opts) {
+
+ return this.createLevel({
+ outputDir: level.dir,
+ force: opts.force
+ }, [this.getPath(level.getRelByObj(item))]);
+
+ },
+
+ createLevel: function(opts, names) {
+ return BEM.api.create.level(opts, { names: names });
+ }
+
+};
View
@@ -0,0 +1,77 @@
+var U = require('../util'),
+ Q = require('q'),
+ PATH = require('path');
+
+exports.baseTechPath = require.resolve('./level.js');
+
+exports.techMixin = {
+
+ createByDecl: function(item, level, opts) {
+
+ var _this = this,
+ projectName = item.block;
+
+ return this.createLevel({
+ outputDir: level.dir,
+ force: opts.force,
+ level: 'project'
+ }, [projectName])
+ .then(function() {
+ return _this.createProject(PATH.join(level.dir, projectName), opts);
+ });
+
+ },
+
+ /**
+ * Create the following project structure
+ *
+ * .bem/
+ * levels/
+ * blocks.js
+ * bundles.js
+ * techs/
+ * level.js
+ *
+ * @param {String} path Absolute path to the project directory
+ * @param {Object} opts Options to the `bem create` command
+ * @return {Promise * Undefined}
+ */
+ createProject: function(path, opts) {
+
+ var bemDir = PATH.join(path, '.bem'),
+ levels = PATH.join(bemDir, 'levels'),
+
+ // .bem/levels/create blocks.js level prototype
+ blocks = this.createLevel({
+ forceTech: ['examples'],
+ outputDir: levels,
+ force: opts.force
+ }, ['blocks.js']),
+
+ // create .bem/levels/bundles.js level prototype
+ bundles = this.createLevel({
+ outputDir: levels,
+ force: opts.force
+ }, ['bundles.js']),
+
+ // create .bem/levels/examples.js level prototype
+ examples = bundles.then(function() {
+ return this.createLevel({
+ level: PATH.resolve(levels, 'bundles.js'),
+ outputDir: levels,
+ force: opts.force
+ }, ['examples.js'])
+ }.bind(this)),
+
+ // create .bem/techs directory
+ techs = U.mkdirp(PATH.join(bemDir, 'techs')),
+
+ // run `npm link bem` command
+ linkBem = U.exec('npm link bem', { cwd: path, env: process.env });
+
+ return Q.all([blocks, bundles, examples, techs, linkBem])
+ .then(function() {});
+
+ }
+
+};
View
@@ -5,7 +5,8 @@ var ASSERT = require('assert'),
FS = require('fs'),
VM = require('vm'),
UTIL = require('util'),
- ENV = require('./env');
+ ENV = require('./env'),
+ MKDIRP = require('mkdirp');
exports.nodeVer = process.version.substr(1)
.split('.')
@@ -215,11 +216,19 @@ exports.mkdir = function(path) {
} catch(ignore) {}
};
-exports.mkdirs = function(path) {
- if (PATH.existsSync(path)) return;
- exports.mkdirs(PATH.dirname(path));
- exports.mkdir(path);
-};
+/**
+ * Create directories.
+ *
+ * @return {String} First directory being created.
+ */
+exports.mkdirs = MKDIRP.sync;
+
+/**
+ * Create directories.
+ *
+ * @return {Promise * String} First directory being created.
+ */
+exports.mkdirp = Q.nfbind(MKDIRP);
exports.isExists = function(path) {
var d = Q.defer();
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
{
"name": "bem",
"description": "BEM Tools",
- "version": "0.5.30",
+ "version": "0.5.31",
"homepage": "http://github.com/bem/bem-tools",
"author": "Sergey Berezhnoy <veged@mail.ru> (http://github.com/veged)",
"maintainers": [
@@ -41,7 +41,8 @@
"borschik": "~0.2.8",
"apw": "~0.3.9",
"winston": ">= 0.5.0",
- "dom-js": "*"
+ "dom-js": "*",
+ "mkdirp": "~0.3.5"
},
"devDependencies": {
"mocha-coverjs": "*",

0 comments on commit f855e3f

Please sign in to comment.