|
|
|
@ -4,6 +4,7 @@ var path = require("path");
|
|
|
|
|
var xtend = require("xtend");
|
|
|
|
|
var rfr = require("rfr");
|
|
|
|
|
|
|
|
|
|
var riot = require("gulp-riot");
|
|
|
|
|
var sass = require("gulp-sass");
|
|
|
|
|
var jade = require("gulp-jade");
|
|
|
|
|
var babel = require("gulp-babel");
|
|
|
|
@ -24,6 +25,7 @@ var loggerOptions = {
|
|
|
|
|
var babelLogger = namedLog("babel", loggerOptions);
|
|
|
|
|
var jadeLogger = namedLog("jade", loggerOptions);
|
|
|
|
|
var sassLogger = namedLog("sass", loggerOptions);
|
|
|
|
|
var riotLogger = namedLog("riot", loggerOptions);
|
|
|
|
|
var electronLogger = namedLog("electron", loggerOptions);
|
|
|
|
|
var livereloadLogger = namedLog("livereload", loggerOptions);
|
|
|
|
|
|
|
|
|
@ -33,7 +35,8 @@ var sources = {
|
|
|
|
|
"babel-main": "app.js",
|
|
|
|
|
"babel-lib": "src/**/*.js",
|
|
|
|
|
"jade-views": "src/views/**/*.jade",
|
|
|
|
|
"sass-main": "src/stylesheets/**/*.scss"
|
|
|
|
|
"sass-main": "src/stylesheets/**/*.scss",
|
|
|
|
|
"riot-components": "src/components/**/*.tag"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getLiveReloadStream() {
|
|
|
|
@ -44,7 +47,7 @@ function getLiveReloadStream() {
|
|
|
|
|
return lr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gulp.task("electron", ['babel-lib', 'babel-main', 'jade-views', 'sass-main'], function() {
|
|
|
|
|
gulp.task("electron", ['babel-lib', 'babel-main', 'jade-views', 'sass-main', 'riot-components'], function() {
|
|
|
|
|
var electronProcess = runProcess(path.join(__dirname, "node_modules/.bin/electron"), [__dirname], {
|
|
|
|
|
logger: electronLogger,
|
|
|
|
|
env: xtend(process.env, {
|
|
|
|
@ -94,6 +97,20 @@ gulp.task("sass-main", function() {
|
|
|
|
|
.pipe(gulp.dest("lib/stylesheets/"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gulp.task("riot-components", function() {
|
|
|
|
|
return gulp.src(sources["riot-components"])
|
|
|
|
|
.pipe(plumber(riotLogger.error))
|
|
|
|
|
.pipe(cache("riot-components"))
|
|
|
|
|
.pipe(riot({
|
|
|
|
|
type: "babel",
|
|
|
|
|
template: "jade",
|
|
|
|
|
style: "scss"
|
|
|
|
|
}))
|
|
|
|
|
.pipe(riotLogger.stream())
|
|
|
|
|
.pipe(getLiveReloadStream())
|
|
|
|
|
.pipe(gulp.dest("lib/components/"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gulp.task('watch', function () {
|
|
|
|
|
livereload.listen();
|
|
|
|
|
|
|
|
|
@ -101,6 +118,7 @@ gulp.task('watch', function () {
|
|
|
|
|
gulp.watch(sources["babel-main"], ["babel-main"]);
|
|
|
|
|
gulp.watch(sources["jade-views"], ["jade-views"]);
|
|
|
|
|
gulp.watch(sources["sass-main"], ["sass-main"]);
|
|
|
|
|
gulp.watch(sources["riot-components"], ["riot-components"]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gulp.task('default', ['watch', 'electron']);
|
|
|
|
|