remove gulp dependency, move to npm scripts

This commit is contained in:
Vladimir Polyakov 2015-12-12 15:36:18 +03:00
parent b1d1a056ee
commit cb67114cd3
18 changed files with 24 additions and 102 deletions

4
.gitignore vendored
View File

@ -3,9 +3,7 @@ test/workspace
test/distributor/workspace
test/repos/mercurial/
test/repos/git/
static/css/**/*.css
static/fonts
static/js/*
static/*
data/projects/**/workspace
data/builds
static/index.html

View File

@ -27,7 +27,8 @@
"globals": {
"describe": false,
"it": false,
"before": false,
"after": false
"document": false,
"before": false,
"after": false
}
}

View File

@ -30,7 +30,6 @@ var routes = (
);
connect.io.on('connect', function() {
console.log('on connect');
Router.run(routes, Router.HistoryLocation, function(Handler) {
ReactDOM.render(
React.createElement(Handler),

View File

@ -8,8 +8,6 @@ var React = require('react'),
var Component = React.createClass({
componentDidMount: function() {
console.log('read all projects in component');
console.log(ProjectActions);
ProjectActions.readAll();
},
render: function() {

View File

@ -1,7 +1,6 @@
.builds
if !this.state.items.length
p Build history is empty
- console.log('>>>> builds = ', JSON.stringify(this.state.items).length, this.state.items)
each build, index in this.state.items
Item(build=build, key=build.id)

View File

@ -4,7 +4,6 @@ var Reflux = require('reflux'),
ProjectActions = require('../actions/project'),
resource = require('../resources').projects;
console.log('resource', resource);
var Store = Reflux.createStore({
listenables: ProjectActions,
onRun: function(projectName) {
@ -13,7 +12,6 @@ var Store = Reflux.createStore({
});
},
onReadAll: function(params) {
console.log('on read all in store');
var self = this;
resource.sync('readAll', params, function(err, projects) {
if (err) throw err;

View File

@ -6,22 +6,22 @@
@import "@{libPath}/bootstrap/less/bootstrap.less";
/*//flatly*/
@import "./sources/common/variables-flatly.less";
@import "./common/variables-flatly.less";
//font-awesome
@import "@{libPath}/font-awesome/less/font-awesome.less";
//variables
@import "./sources/common/variables.less";
@import "./common/variables.less";
//fonts
@import "./sources/common/fonts.less";
@import "./common/fonts.less";
//layout
@import "./sources/components/layout.less";
@import "./components/layout.less";
//components
@import "./sources/components/builds.less";
@import "./sources/components/projects.less";
@import "./sources/components/terminal.less";
@import "./components/builds.less";
@import "./components/projects.less";
@import "./components/terminal.less";

View File

@ -1,31 +0,0 @@
{
"name": "nci",
"version": "0.0.0",
"homepage": "https://github.com/okv/nci",
"authors": [],
"dependencies": {
"underscore": "1.8.2",
"moment": "2.10.6",
"react": "0.13.2",
"requirejs": "2.1.17",
"jquery": "1.10.2",
"reflux": "0.2.7",
"bootstrap": "3.3.4",
"font-awesome": "4.3.0",
"react-router": "0.13.3",
"ansi_up": "1.2.1",
"almond": "0.3.1"
},
"moduleType": [
"amd"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"app/components/",
"test",
"tests"
]
}

View File

@ -1,42 +0,0 @@
'use strict';
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var less = require('gulp-less');
var gulpReactJade = require('gulp-react-jade-amd');
var mainBowerFiles = require('main-bower-files');
gulp.task('react-jade', function() {
return gulp.src('static/js/**/*.jade')
.pipe(gulpReactJade())
.pipe(gulp.dest('static/js/templates'));
});
gulp.task('less', function () {
return gulp.src('static/css/index.less')
.pipe(less('index.css'))
.pipe(gulp.dest('./static/css'));
});
gulp.task('fonts', function() {
return gulp.src(mainBowerFiles({filter: /.*fonts.*/i}))
.pipe(gulp.dest('static/fonts/'));
});
gulp.task('develop', function() {
gulp.watch('static/js/app/**/*.jade', ['react-jade']);
gulp.watch('static/css/**/*.less', ['less']);
return nodemon({
ignore: ['static/**/*.js', 'app/**/*.js', 'node_modules/**', 'data/**'],
script: 'app.js',
ext: 'js'
});
});
gulp.task('default', [
'react-jade',
'less',
'fonts',
'develop'
]);

View File

@ -8,14 +8,17 @@
"scripts": {
"makeTestRepos": "rm -rf test/repos/{mercurial,git}; cd test/repos/ && tar -xf mercurial.tar.gz && tar -xf git.tar.gz",
"test": "npm run makeTestRepos && mocha --bail --reporter=spec --timeout 4000",
"watchLess": "catw -c 'lessc static/css/index.less' 'static/css/**/*.less' > static/css/index.css",
"watchJs": "watchify app/app.js -t ./transforms/jade.js -o static/js/app.build.js -dv",
"dev": "npm run watchLess & npm run watchJs & nodemon app.js",
"sync": "npm install && npm prune && bower install && bower prune",
"buildJs": "r.js -o static/js/requirejs/buid.js",
"buildClean": "rm static/index.html",
"buildHtml": "jade views/index.jade --obj '{\"env\": \"production\"}' -o static/",
"build": "gulp less && gulp fonts && gulp react-jade && npm run buildJs && npm run buildHtml && git checkout static/js/app.build.js"
"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",
"watch-less": "nodemon --ext less --watch app/styles --exec 'npm run less'",
"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",
"dev": "npm run build-fonts && npm run watch-less & npm run watch-js & npm run watch-server",
"sync": "npm install && npm prune",
"build-fonts": "cp ./node_modules/bootstrap/fonts/* ./static/fonts/ & cp ./node_modules/font-awesome/fonts/* ./static/fonts/",
"build-clean": "rm static/index.html",
"build-html": "jade views/index.jade --obj '{\"env\": \"production\"}' -o static/",
"build": "npm run build-fonts && npm run build-js && npm run build-less && npm run build-html"
},
"repository": {
"type": "git",
@ -67,7 +70,6 @@
"underscore": "1.8.3"
},
"devDependencies": {
"catw": "^1.0.1",
"expect.js": "0.3.1",
"jade": "1.11.0",
"jshint": "^2.9.1-rc1",
@ -77,6 +79,7 @@
"nodemon": "1.3.7",
"nrun": "0.1.4",
"sinon": "1.14.1",
"uglifyjs": "^2.4.10",
"watchify": "^3.6.1"
}
}

View File

@ -7,5 +7,4 @@ html
body
#content
script
include ../static/js/app.build.js
script(src="/js/app.build.js")