fix typo in packeje.json, merge helpers

This commit is contained in:
Vladimir Polyakov 2015-12-12 15:55:41 +03:00
parent 60808be6ec
commit b481b242dc
5 changed files with 15 additions and 23 deletions

View File

@ -6,7 +6,7 @@ var _ = require('underscore'),
ProjectActions = require('../../../actions/project'), ProjectActions = require('../../../actions/project'),
BuildActions = require('../../../actions/build'), BuildActions = require('../../../actions/build'),
CommonComponents = require('../../common'), CommonComponents = require('../../common'),
utils = require('../../../utils'), utils = require('../../../../lib/utils'),
template = require('./index.jade'); template = require('./index.jade');
var Component = React.createClass({ var Component = React.createClass({

View File

@ -1,4 +1,4 @@
/*@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,cyrillic-ext);*/ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,cyrillic-ext);
@libPath: "../../node_modules"; @libPath: "../../node_modules";

View File

@ -1,16 +0,0 @@
'use strict';
var utils = {};
utils.prune = function(str, length) {
var result = '',
words = str.split(' ');
do {
result += words.shift() + ' ';
} while (words.length && result.length < length);
return result.replace(/ $/, words.length ? '...' : '');
};
module.exports = utils;

View File

@ -1,9 +1,6 @@
'use strict'; 'use strict';
var _ = require('underscore'), var _ = require('underscore');
sharedUtils = require('../app/utils');
_(exports).extend(sharedUtils);
exports.lpad = function(str, length, chr) { exports.lpad = function(str, length, chr) {
chr = chr || '0'; chr = chr || '0';
@ -11,6 +8,17 @@ exports.lpad = function(str, length, chr) {
return str; return str;
}; };
exports.prune = function(str, length) {
var result = '',
words = str.split(' ');
do {
result += words.shift() + ' ';
} while (words.length && result.length < length);
return result.replace(/ $/, words.length ? '...' : '');
};
exports.toNumberStr = function(number) { exports.toNumberStr = function(number) {
return exports.lpad(String(number), 20); return exports.lpad(String(number), 20);
}; };

View File

@ -10,7 +10,7 @@
"test": "npm run makeTestRepos && mocha --bail --reporter=spec --timeout 4000", "test": "npm run makeTestRepos && mocha --bail --reporter=spec --timeout 4000",
"build-less": "lessc app/styles/index.less > static/css/index.css", "build-less": "lessc app/styles/index.less > static/css/index.css",
"build-js": "browserify app/app.js -t ./transforms/jade.js | uglifyjs -mc > static/js/app.build.js", "build-js": "browserify app/app.js -t ./transforms/jade.js | uglifyjs -mc > static/js/app.build.js",
"watch-less": "nodemon --ext less --watch app/styles --exec 'npm run less'", "watch-less": "nodemon --ext less --watch app/styles --exec 'npm run build-less'",
"watch-js": "watchify app/app.js -t ./transforms/jade.js -o static/js/app.build.js -dv", "watch-js": "watchify app/app.js -t ./transforms/jade.js -o static/js/app.build.js -dv",
"watch-server": "nodemon --ignore app --ignore static --ignore node_modules --ignore data app.js", "watch-server": "nodemon --ignore app --ignore static --ignore node_modules --ignore data app.js",
"dev": "npm run build-fonts && npm run watch-less & npm run watch-js & npm run watch-server", "dev": "npm run build-fonts && npm run watch-less & npm run watch-js & npm run watch-server",