<commit_before>var gulp = require("gulp");
var tsc=require('gulp-typescript');
var clean=require('gulp-clean');
var merge=require('merge2');
var concat=require('gulp-concat');
var sourcemaps=require('gulp-sourcemaps');
var using=require('gulp-using');
var webpack=require('gulp-webpack');
var ignore=require('gulp-ignore');
var watch=require('gulp-watch');
var connect=require('gulp-connect');
var minify=require('gulp-uglify');
var bower_files=['jQuery/dist/jquery.js'];
var bower_prefix='bower_components/';
/***********************************
* Typescript compile configuration**
************************************/
var tsProj=tsc.createProject({
  target:"ES5",
  module:"commonjs",
  declarationFiles:true,
  sourceRoot:"jThree/src/",
  noExternalResolve:true,
  noEmitOnError:true,
  typescript:require('typescript')
});

gulp.task('compile',function(){
  console.log('Typescript Compile Task');
  var tsResult=gulp.src(["jThree/src/**/*.ts"]).pipe(using({})).pipe(tsc(tsProj));
  return merge([
    tsResult.dts.pipe(gulp.dest('jThree/bin/def')),
    tsResult.js.pipe(gulp.dest('jThree/bin/js'))
  ]);
});

//Move bower files into build directory
gulp.task('move-refs',function(){
  for (var i = 0; i < bower_files.length; i++) {
    bower_files[i]=bower_prefix+bower_files[i];
  };
  gulp.src(bower_files).pipe(gulp.dest('jThree/bin/js'));
  gulp.src('jThree/src/static/**/*.*').pipe(gulp.dest('jThree/bin/js/static'))
});

gulp.task('webpack',['compile','move-refs'],function(){
  console.log('Webpack Task');
  // return gulp.src('jThree/bin/js/jThree.js').pipe(browserify({
  //         insertGlobals : true,
  //         shim:{
  //           jquery: {
  //               path: './jThree/bin/js/jquery.js',
  //               exports: 'jquery'
  //           }
  //         },
  //         basedir:'jThree/bin/js'
  //       })).pipe(gulp.dest('bin/product'));
  return gulp.src(['jThree/bin/js/**/*.js','jThree/bin/js/**/*.json','!jThree/bin/js/jThree.js'])
    .pipe(using({}))
    .pipe(webpack({
      entry:{
        jThree:'./jThree/bin/js/jThree.js'
      },
      output:{
        filename:'j3.js'
      },
      resolve:{
        alias:{
        'j3':'Core/JThreeContext.js',
        'jquery':'jquery.js'
        }
      },
      root:'./jThree/bin/js'
    },
    module:{
      loaders:[
        {test:/\.json$/,loader:'json'}
      ]
    }
    }))
    .pipe(gulp.dest("jThree/bin/product")).pipe(connect.reload());
});

gulp.task('clean',function(){
  gulp.src("jThree/src/*.js").pipe(clean());
  gulp.src("jThree/src/*.js.map").pipe(clean());
  gulp.src("jThree/src/*/*.js").pipe(clean());
  gulp.src("jThree/src/*/*.js").pipe(clean());
  gulp.src("jThree/bin/js/*.*").pipe(clean());
  gulp.src("jThree/bin/def/*.*").pipe(clean());
});

gulp.task('watch',['server'],function()
{
  gulp.watch('jThree/src/**/*.ts',['build']);
  gulp.watch(['jThree/*.html','jThree/*.css','jThree/**/*.goml'],['reload']);

});

gulp.task('reload',function()
{
  gulp.src('jThree/**.*').pipe(connect.reload());
});

gulp.task('build',['webpack'],function(){
  gulp.src('jThree/bin/product/j3.js').pipe(gulp.dest('jThree/'));
});

gulp.task('minify',['build'],function(){
  return gulp.src('bin/product/j3.js').
    pipe(minify())
    .pipe(gulp.dest('jThree/bin/product/min'));
});

gulp.task('server',['build'],function(){
  connect.server({
    root:'./jThree',
    livereload:true
  });
});

gulp.task('travis',['build'],function(){

});
<commit_msg>fix travis<commit_after>var gulp = require("gulp");
var tsc=require('gulp-typescript');
var clean=require('gulp-clean');
var merge=require('merge2');
var concat=require('gulp-concat');
var sourcemaps=require('gulp-sourcemaps');
var using=require('gulp-using');
var webpack=require('gulp-webpack');
var ignore=require('gulp-ignore');
var watch=require('gulp-watch');
var connect=require('gulp-connect');
var minify=require('gulp-uglify');
var bower_files=['jQuery/dist/jquery.js'];
var bower_prefix='bower_components/';
/***********************************
* Typescript compile configuration**
************************************/
var tsProj=tsc.createProject({
  target:"ES5",
  module:"commonjs",
  declarationFiles:true,
  sourceRoot:"jThree/src/",
  noExternalResolve:true,
  noEmitOnError:true,
  typescript:require('typescript')
});

gulp.task('compile',function(){
  console.log('Typescript Compile Task');
  var tsResult=gulp.src(["jThree/src/**/*.ts"]).pipe(using({})).pipe(tsc(tsProj));
  return merge([
    tsResult.dts.pipe(gulp.dest('jThree/bin/def')),
    tsResult.js.pipe(gulp.dest('jThree/bin/js'))
  ]);
});

//Move bower files into build directory
gulp.task('move-refs',function(){
  for (var i = 0; i < bower_files.length; i++) {
    bower_files[i]=bower_prefix+bower_files[i];
  };
  gulp.src(bower_files).pipe(gulp.dest('jThree/bin/js'));
  gulp.src('jThree/src/static/**/*.*').pipe(gulp.dest('jThree/bin/js/static'))
});

gulp.task('webpack',['compile','move-refs'],function(){
  console.log('Webpack Task');
  // return gulp.src('jThree/bin/js/jThree.js').pipe(browserify({
  //         insertGlobals : true,
  //         shim:{
  //           jquery: {
  //               path: './jThree/bin/js/jquery.js',
  //               exports: 'jquery'
  //           }
  //         },
  //         basedir:'jThree/bin/js'
  //       })).pipe(gulp.dest('bin/product'));
  return gulp.src(['jThree/bin/js/**/*.js','jThree/bin/js/**/*.json','!jThree/bin/js/jThree.js'])
    .pipe(using({}))
    .pipe(webpack({
      entry:{
        jThree:'./jThree/bin/js/jThree.js'
      },
      output:{
        filename:'j3.js'
      },
      resolve:{
        alias:{
        'j3':'Core/JThreeContext.js',
        'jquery':'jquery.js'
      },
      root:'./jThree/bin/js'
    }
    ,
    module:{
      loaders:[
        {test:/\.json$/,loader:'json'}
      ]
    }
    }))
    .pipe(gulp.dest("jThree/bin/product")).pipe(connect.reload());
});

gulp.task('clean',function(){
  gulp.src("jThree/src/*.js").pipe(clean());
  gulp.src("jThree/src/*.js.map").pipe(clean());
  gulp.src("jThree/src/*/*.js").pipe(clean());
  gulp.src("jThree/src/*/*.js").pipe(clean());
  gulp.src("jThree/bin/js/*.*").pipe(clean());
  gulp.src("jThree/bin/def/*.*").pipe(clean());
});

gulp.task('watch',['server'],function()
{
  gulp.watch('jThree/src/**/*.ts',['build']);
  gulp.watch(['jThree/*.html','jThree/*.css','jThree/**/*.goml'],['reload']);

});

gulp.task('reload',function()
{
  gulp.src('jThree/**.*').pipe(connect.reload());
});

gulp.task('build',['webpack'],function(){
  gulp.src('jThree/bin/product/j3.js').pipe(gulp.dest('jThree/'));
});

gulp.task('minify',['build'],function(){
  return gulp.src('bin/product/j3.js').
    pipe(minify())
    .pipe(gulp.dest('jThree/bin/product/min'));
});

gulp.task('server',['build'],function(){
  connect.server({
    root:'./jThree',
    livereload:true
  });
});

gulp.task('travis',['build'],function(){

});
<|endoftext|>


<commit_before>// generic tools
var del = require('del');
var browserify = require('browserify');
var watchify = require('watchify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var _ = require('underscore');
var runSequence = require('run-sequence');
var notifier = require('node-notifier');
var minifycss = require('gulp-minify-css');

// for mock requests
var bodyParser = require('body-parser');
var mockMiddleware = require('./mocks/mock_middleware');

// gulp and gulp plugins
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();

// CONFIGS
var env = process.env.NODE_ENV || 'development';
var isProd = env === 'production';

var paths = {};
paths.jsDir = './app/scripts';
paths.jsFiles = paths.jsDir + '/**/*.js';
paths.jsEntry = paths.jsDir + '/main.js';
paths.jsOut = 'bundle.js';

paths.scssDir = './app/styles';
paths.scssFiles = paths.scssDir + '/**/*.scss';
paths.scssEntry = paths.scssDir + '/main.scss';
paths.cssOut = 'styles.css';

paths.html = './app/index.html';
paths.buildDir = isProd ? './dist' : './build';
paths.cssBuildDir = paths.buildDir + '/styles';
paths.script = '/scripts';

// MAIN TASKS
gulp.task('default', ['build']);
/**
 * run task in sequence:
 * clear build folder then check style and only then build app
 */
gulp.task('build', function() {
  runSequence(
    'cleanBuildFolder',
    'scriptsStyleguideFull',
    ['buildHtml', 'buildStyles', 'buildScripts'],
    notifySuccess);
});
/**
* start web server and watchers to recompile on file changes
*/
gulp.task('serve', ['startDevServer', 'browserifyWatch', 'appWatch']);

// SUB TASKS
// clean folders
gulp.task('cleanBuildFolder', function() {
  del(paths.buildDir);
});

gulp.task('appWatch', function() {
  gulp.watch(paths.jsFiles, ['scriptsStyleguideBrief']);
  gulp.watch(paths.scssFiles, ['buildStyles']);
});

gulp.task('startDevServer', function() {
  gulp.src(paths.buildDir)
    .pipe($.webserver({
      port: 3000,
      middleware: [bodyParser.json(), mockMiddleware],
      livereload: true
    }));
});

// CSS
gulp.task('buildStyles', function() {
  return gulp.src(paths.scssFiles)
    .pipe($.if(!isProd, $.sourcemaps.init()))
    .pipe($.sass())

    // todo: clean this task minification process
    .pipe($.autoprefixer({browsers: ['> 5%', 'last 2 versions']}))
    .pipe($.if(!isProd, $.sourcemaps.write()))
    .pipe($.if(isProd, minifycss()))
    .pipe(gulp.dest(paths.cssBuildDir));
});

// code healthiness
/**
 * only JSCS
 * should not take much time to run
 * use in watcher
 */
gulp.task('scriptsStyleguideBrief', function() {
  return gulp.src(paths.jsFiles).pipe($.jscs());
});

/**
 * both JSCS and ESLINT
 * takes quite some time due to babel parser
 * use in builds
 */
gulp.task('scriptsStyleguideFull', function() {
  return gulp.src(paths.jsFiles)
    .pipe($.jscs())
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.eslint.failOnError());
});

// HTML
// note - for now just copies html,
// in future will be used to change content of html
gulp.task('buildHtml', function() {
  return gulp.src(paths.html)
    .pipe($.useref())
    .pipe(gulp.dest(paths.buildDir))
    .pipe($.size());
});

// BROWSERIFY
var browserifyOptions = {
  entries: [paths.jsEntry],
  debug: !isProd,
  fullPaths: true,
  transform: [babelify]
};

var watchifyOptions = _.extend({
  cache: {},
  packageCache: {}
}, browserifyOptions);

var bundler = browserify(browserifyOptions);
var watchBundler = watchify(browserify(watchifyOptions));

gulp.task('buildScripts', function() {
  return bundler.bundle()
    .pipe(source(paths.jsOut))
    .pipe(gulp.dest(paths.buildDir + paths.script));
});

gulp.task('browserifyWatch', function() {
  watchBundler.on('update', watchifyBundle);
  return watchBundler.bundle(); // needed too keep process running
});

// TODO : exit process somehow
function watchifyBundle() {
  return watchBundler.bundle()
    .on('error', $.util.log.bind($.util, 'Browserify Error'))
    .pipe(source(paths.jsOut))
    .pipe(gulp.dest(paths.buildDir + paths.script));
}

// BROWSERIFY EVENTS
bundler.on('error', $.util.log.bind($.util, 'Browserify Error'));

watchBundler.on('time', function(time) {
  $.util.log('Browserify rebundle finished after ' + $.util.colors.magenta(time + ' ms'));
});

/**
 * small desktop popup with result of a build
 */
function notifySuccess(err) {
  notifier.notify({
    title: 'GULP BUILD ' + (err ? 'FAILED' : 'SUCCESS'),
    message: err ? 'at ' + err.message : '✔ ' + env
  });
}
<commit_msg>prevent sass exiting serve on error<commit_after>// generic tools
var del = require('del');
var browserify = require('browserify');
var watchify = require('watchify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var _ = require('underscore');
var runSequence = require('run-sequence');
var notifier = require('node-notifier');
var minifycss = require('gulp-minify-css');

// for mock requests
var bodyParser = require('body-parser');
var mockMiddleware = require('./mocks/mock_middleware');

// gulp and gulp plugins
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();

// CONFIGS
var env = process.env.NODE_ENV || 'development';
var isProd = env === 'production';

var paths = {};
paths.jsDir = './app/scripts';
paths.jsFiles = paths.jsDir + '/**/*.js';
paths.jsEntry = paths.jsDir + '/main.js';
paths.jsOut = 'bundle.js';

paths.scssDir = './app/styles';
paths.scssFiles = paths.scssDir + '/**/*.scss';
paths.scssEntry = paths.scssDir + '/main.scss';
paths.cssOut = 'styles.css';

paths.html = './app/index.html';
paths.buildDir = isProd ? './dist' : './build';
paths.cssBuildDir = paths.buildDir + '/styles';
paths.script = '/scripts';

// MAIN TASKS
gulp.task('default', ['build']);
/**
 * run task in sequence:
 * clear build folder then check style and only then build app
 */
gulp.task('build', function() {
  runSequence(
    'cleanBuildFolder',
    'scriptsStyleguideFull',
    ['buildHtml', 'buildStyles', 'buildScripts'],
    notifySuccess);
});
/**
* start web server and watchers to recompile on file changes
*/
gulp.task('serve', ['startDevServer', 'browserifyWatch', 'appWatch']);

// SUB TASKS
// clean folders
gulp.task('cleanBuildFolder', function() {
  del(paths.buildDir);
});

gulp.task('appWatch', function() {
  gulp.watch(paths.jsFiles, ['scriptsStyleguideBrief']);
  gulp.watch(paths.scssFiles, ['buildStyles']);
});

gulp.task('startDevServer', function() {
  gulp.src(paths.buildDir)
    .pipe($.webserver({
      port: 3000,
      middleware: [bodyParser.json(), mockMiddleware],
      livereload: true
    }));
});

// CSS
gulp.task('buildStyles', function() {
  return gulp.src(paths.scssFiles)
    .pipe($.if(!isProd, $.sourcemaps.init()))
    .pipe($.sass().on('error', $.sass.logError))

    // todo: clean this task minification process
    .pipe($.autoprefixer({browsers: ['> 5%', 'last 2 versions']}))
    .pipe($.if(!isProd, $.sourcemaps.write()))
    .pipe($.if(isProd, minifycss()))
    .pipe(gulp.dest(paths.cssBuildDir));
});

// code healthiness
/**
 * only JSCS
 * should not take much time to run
 * use in watcher
 */
gulp.task('scriptsStyleguideBrief', function() {
  return gulp.src(paths.jsFiles).pipe($.jscs());
});

/**
 * both JSCS and ESLINT
 * takes quite some time due to babel parser
 * use in builds
 */
gulp.task('scriptsStyleguideFull', function() {
  return gulp.src(paths.jsFiles)
    .pipe($.jscs())
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.eslint.failOnError());
});

// HTML
// note - for now just copies html,
// in future will be used to change content of html
gulp.task('buildHtml', function() {
  return gulp.src(paths.html)
    .pipe($.useref())
    .pipe(gulp.dest(paths.buildDir))
    .pipe($.size());
});

// BROWSERIFY
var browserifyOptions = {
  entries: [paths.jsEntry],
  debug: !isProd,
  fullPaths: true,
  transform: [babelify]
};

var watchifyOptions = _.extend({
  cache: {},
  packageCache: {}
}, browserifyOptions);

var bundler = browserify(browserifyOptions);
var watchBundler = watchify(browserify(watchifyOptions));

gulp.task('buildScripts', function() {
  return bundler.bundle()
    .pipe(source(paths.jsOut))
    .pipe(gulp.dest(paths.buildDir + paths.script));
});

gulp.task('browserifyWatch', function() {
  watchBundler.on('update', watchifyBundle);
  return watchBundler.bundle(); // needed too keep process running
});

// TODO : exit process somehow
function watchifyBundle() {
  return watchBundler.bundle()
    .on('error', $.util.log.bind($.util, 'Browserify Error'))
    .pipe(source(paths.jsOut))
    .pipe(gulp.dest(paths.buildDir + paths.script));
}

// BROWSERIFY EVENTS
bundler.on('error', $.util.log.bind($.util, 'Browserify Error'));

watchBundler.on('time', function(time) {
  $.util.log('Browserify rebundle finished after ' + $.util.colors.magenta(time + ' ms'));
});

/**
 * small desktop popup with result of a build
 */
function notifySuccess(err) {
  notifier.notify({
    title: 'GULP BUILD ' + (err ? 'FAILED' : 'SUCCESS'),
    message: err ? 'at ' + err.message : '✔ ' + env
  });
}
<|endoftext|>


<commit_before>'use strict';

var del = require('del');
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
var cssnano = require('gulp-cssnano');
var postcss = require('gulp-postcss');
var sorting = require('postcss-sorting');

// Config
var build = {
  css: './assets/css',
	scss: './src/scss/'
};

var AUTOPREFIXER_BROWSERS = [
  'ie >= 11',
  'edge >= 12',
  'ff >= 38',
  'chrome >= 35',
  'safari >= 8',
  'opera >= 35',
  'ios >= 8'
];

gulp.task('css', function () {
  var css = gulp
  .src(build.scss + '*.scss')
  .pipe(sourcemaps.init())
  .pipe(sass({
    indentType: 'tab',
    indemtWidth: 1,
    outputStyle: 'expanded',
    precision: 10,
    onError: console.error.bind(console, 'Sass error:')
  }))
  .pipe(autoprefixer(AUTOPREFIXER_BROWSERS))
})<commit_msg>modified task css<commit_after>'use strict';

var del = require('del');
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
var cssnano = require('gulp-cssnano');
var postcss = require('gulp-postcss');
var sorting = require('postcss-sorting');

// Config
var build = {
  css: './assets/css',
	scss: './src/scss/'
};

var AUTOPREFIXER_BROWSERS = [
  'ie >= 11',
  'edge >= 12',
  'ff >= 38',
  'chrome >= 35',
  'safari >= 8',
  'opera >= 35',
  'ios >= 8'
];

gulp.task('css', function () {
  var css = gulp
  .src(build.scss + '*.scss')
  .pipe(sourcemaps.init())
  .pipe(sass({
    indentType: 'tab',
    indemtWidth: 1,
    outputStyle: 'expanded',
    precision: 10,
    onError: console.error.bind(console, 'Sass error:')
  }))
  .pipe(autoprefixer(AUTOPREFIXER_BROWSERS))
  .pipe(
    postcss([
      sorting(sortOrder),
      torem({
        rootValue: 16,
        unitPrecision: 7,
        propWhiteList: [
          'font',
          'font-size',
          'margin',
          'margin-left',
          'margin-right',
          'margin-top',
          'margin-bottom',
          'padding',
          'padding-left',
          'padding-right',
          'padding-top',
          'padding-bottom'],
        selectorBlackList: [],
        replace: true,
        mediaQuery: false,
        minPixelValue: 0
      })
    ])
  )
})<|endoftext|>


<commit_before>"use strict";

const autoprefixer = require("autoprefixer");
const gulp = require("gulp");
const sass = require("node-sass");
const inlineTemplates = require("gulp-inline-ng2-template");
const exec = require("child_process").exec;
const fs = require("fs");

function compileSass(path, ext, file, callback) {
    let compiledCss = sass.renderSync({
        file: path,
        outputStyle: "compressed"
    });
    callback(null, autoprefixer.process(compiledCss.css, { browsers: ["last 2 versions"] }).css);
}

const INLINE_TEMPLATES = {
    SRC: "./src/**/*.ts",
    DIST: "./tmp/src-inlined",
    CONFIG: {
        base: "/src",
        target: "es6",
        useRelativePaths: true,
        styleProcessor: compileSass
    }
};

const FONTS = {
    SRC: [
        "node_modules/material-design-icons/iconfont/*.{woff,woff2,ttf}",
        "src/fonts/titillium/*.ttf",
        "src/fonts/titillium/*.txt"
    ],
    DIST: "dist/fonts"
};

gulp.task("make-packagejson", () => {
    fs.readFile("package.json", "utf8", (err, data) => {
        if (err) throw err;

        data = JSON.parse(data.trim());
        delete data.scripts;
        delete data.devDependencies;
        data.peerDependencies = data.dependencies;
        delete data.dependencies;

        fs.writeFile("dist/package.json", JSON.stringify(PACKAGE_JSON, null, 4), "utf8", (err) => {
            if (err) throw err;
        });
    });
});

gulp.task("build-style", () => {
    let result = sass.renderSync({
        file: "src/themes/zero-blocks.scss",
        outputStyle: "compressed",
        includePaths: ["./src/themes"],
        outFile: "dist/zero-blocks.css"
    });

    fs.writeFile("dist/zero-blocks.css", autoprefixer.process(result.css, { browsers: ["last 2 versions"] }).css, (err) => {
        if (err) throw err;
    });

    return gulp.src(FONTS.SRC)
        .pipe(gulp.dest(FONTS.DIST));
});

gulp.task("inline-templates", () => {
    return gulp.src(INLINE_TEMPLATES.SRC)
        .pipe(inlineTemplates(INLINE_TEMPLATES.CONFIG))
        .pipe(gulp.dest(INLINE_TEMPLATES.DIST));
});

gulp.task("build:esm", ["inline-templates"], (callback) => {
    exec("npm run ngcompile", function(err, stdout, stderr) {
        console.log(stdout, stderr);
        callback(err);
    });
});

gulp.task("build:esm:watch", ["build:esm"], () => {
    gulp.watch("src/**/*", ["build:esm", "build-style"]);
});
<commit_msg>Gulpfile changes<commit_after>"use strict";

const autoprefixer = require("autoprefixer");
const gulp = require("gulp");
const sass = require("node-sass");
const inlineTemplates = require("gulp-inline-ng2-template");
const exec = require("child_process").exec;
const fs = require("fs");

function compileSass(path, ext, file, callback) {
    let compiledCss = sass.renderSync({
        file: path,
        outputStyle: "compressed"
    });
    callback(null, autoprefixer.process(compiledCss.css, { browsers: ["last 2 versions"] }).css);
}

const INLINE_TEMPLATES = {
    SRC: "./src/**/*.ts",
    DIST: "./tmp/src-inlined",
    CONFIG: {
        base: "/src",
        target: "es6",
        useRelativePaths: true,
        styleProcessor: compileSass
    }
};

const FONTS = {
    SRC: [
        "node_modules/material-design-icons/iconfont/*.{woff,woff2,ttf}",
        "src/fonts/titillium/*.ttf",
        "src/fonts/titillium/*.txt"
    ],
    DIST: "dist/fonts"
};

gulp.task("make-packagejson", () => {
    fs.readFile("package.json", "utf8", (err, data) => {
        if (err) throw err;

        data = JSON.parse(data.trim());
        delete data.scripts;
        delete data.devDependencies;
        data.peerDependencies = data.dependencies;
        delete data.dependencies;

        fs.writeFile("dist/package.json", JSON.stringify(data, null, 4), "utf8", (err) => {
            if (err) throw err;
        });
    });
});

gulp.task("build-style", () => {
    let result = sass.renderSync({
        file: "src/themes/zero-blocks.scss",
        outputStyle: "compressed",
        includePaths: ["./src/themes"],
        outFile: "dist/zero-blocks.css"
    });

    fs.writeFile("dist/zero-blocks.css", autoprefixer.process(result.css, { browsers: ["last 2 versions"] }).css, (err) => {
        if (err) throw err;
    });

    return gulp.src(FONTS.SRC)
        .pipe(gulp.dest(FONTS.DIST));
});

gulp.task("inline-templates", () => {
    return gulp.src(INLINE_TEMPLATES.SRC)
        .pipe(inlineTemplates(INLINE_TEMPLATES.CONFIG))
        .pipe(gulp.dest(INLINE_TEMPLATES.DIST));
});

gulp.task("build:esm", ["inline-templates"], (callback) => {
    exec("npm run ngcompile", function(err, stdout, stderr) {
        console.log(stdout, stderr);
        callback(err);
    });
});

gulp.task("build:esm:watch", ["build:esm"], () => {
    gulp.watch("src/**/*", ["build:esm", "build-style"]);
});
<|endoftext|>


<commit_before><commit_msg>added parsing of date related fields in v5 cif files<commit_after><|endoftext|>


<commit_before><commit_msg>put logging in cif parser behind Debug flag<commit_after><|endoftext|>


<commit_before>var gulp = require('gulp'),
    less = require('gulp-less'),
    path = require('path'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss = require('gulp-minify-css'),
    jshint = require('gulp-jshint'),
    uglify = require('gulp-uglify'),
    imagemin = require('gulp-imagemin'),
    rename = require('gulp-rename'),
    concat = require('gulp-concat'),
    notify = require('gulp-notify'),
    cache = require('gulp-cache'),
    livereload = require('gulp-livereload'),
    sourcemaps = require('gulp-sourcemaps'),
    vulcanize = require('gulp-vulcanize'),
    webserver = require('gulp-webserver'),
    del = require('del');

//TODO: add sourcemaps for js
//TODO: finish configuring webserver & livereload
//TODO: html task

gulp.task('js', function () {
  return gulp.src('app/js/**/*.js')
      //.pipe(jshint('.jshintrc'))
      .pipe(jshint.reporter('default'))
      .pipe(concat('main.js'))
      .pipe(gulp.dest('dist/js'))
      .pipe(rename({suffix: '.min'}))
      .pipe(uglify())
      .pipe(gulp.dest('dist/js'))
      .pipe(notify({message: 'Scripts task complete'}));
});

gulp.task('less', function () {
  return gulp.src('./app/css/**/*.less')
      .pipe(sourcemaps.init())
      .pipe(less({
        paths: [path.join(__dirname, 'less', 'includes')]
      }))
      .pipe(sourcemaps.write())
      .pipe(gulp.dest('./dist/css'));
});

gulp.task('images', function () {
  return gulp.src('app/img/**/*')
      .pipe(imagemin({optimizationLevel: 3, progressive: true, interlaced: true}))
      .pipe(gulp.dest('dist/img'))
      .pipe(notify({message: 'Images task complete'}));
});

gulp.task('clean', function (cb) {
  del(['dist/css', 'dist/js', 'dist/img'], cb)
});

gulp.task('vulcanize', function () {
  return gulp.src('app/components/index.html')
      .pipe(vulcanize({dest: 'dist/components'}))
      .pipe(gulp.dest('dist/components'));
})

gulp.task('default', ['clean'], function () {
  gulp.start('less', 'js', 'images');
});

gulp.task('watch', function () {
  gulp.watch('app/css/**/*.scss', ['styles']);
  gulp.watch('app/js/**/*.js', ['scripts']);
  gulp.watch('app/img/**/*', ['images']);
});

gulp.task('webserver', function() {
  gulp.src('dist')
      .pipe(webserver({
        livereload: true,
        directoryListing: true,
        open: true
      }));
});<commit_msg>* configured sourcemaps for js<commit_after>var gulp = require('gulp'),
    less = require('gulp-less'),
    path = require('path'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss = require('gulp-minify-css'),
    jshint = require('gulp-jshint'),
    uglify = require('gulp-uglify'),
    imagemin = require('gulp-imagemin'),
    rename = require('gulp-rename'),
    concat = require('gulp-concat'),
    notify = require('gulp-notify'),
    cache = require('gulp-cache'),
    livereload = require('gulp-livereload'),
    sourcemaps = require('gulp-sourcemaps'),
    vulcanize = require('gulp-vulcanize'),
    webserver = require('gulp-webserver'),
    del = require('del');

//TODO: finish configuring webserver & livereload
//TODO: html task
//TODO: errors task

gulp.task('js', function () {
  return gulp.src('app/js/**/*.js')
      //.pipe(jshint('.jshintrc'))
      .pipe(sourcemaps.init())
      .pipe(jshint.reporter('default'))
      .pipe(concat('main.js'))
      .pipe(gulp.dest('dist/js'))
      .pipe(rename({suffix: '.min'}))
      .pipe(uglify())
      .pipe(sourcemaps.write())
      .pipe(gulp.dest('dist/js'))
      .pipe(notify({message: 'JS task complete'}));
});

gulp.task('less', function () {
  return gulp.src('./app/css/**/*.less')
      .pipe(sourcemaps.init())
      .pipe(less({
        paths: [path.join(__dirname, 'less', 'includes')]
      }))
      .pipe(sourcemaps.write())
      .pipe(gulp.dest('./dist/css'))
      .pipe(notify({message: 'Less task complete'}));
});

gulp.task('img', function () {
  return gulp.src('app/img/**/*')
      .pipe(imagemin({optimizationLevel: 3, progressive: true, interlaced: true}))
      .pipe(gulp.dest('dist/img'))
      .pipe(notify({message: 'Images task complete'}))
      .pipe(notify({message: 'Img task complete'}));
});

gulp.task('clean', function (cb) {
  del(['dist/css', 'dist/js', 'dist/img'], cb)
});

gulp.task('default', ['clean'], function () {
  gulp.start('less', 'js', 'img', 'vulcanize');
});

gulp.task('vulcanize', function () {
  return gulp.src('app/components/index.html')
      .pipe(vulcanize({dest: 'dist/components'}))
      .pipe(gulp.dest('dist/components'))
      .pipe(notify({message: 'Vulcanize task complete'}));
});

gulp.task('watch', function () {
  gulp.watch('app/css/**/*.scss', ['styles']);
  gulp.watch('app/js/**/*.js', ['scripts']);
  gulp.watch('app/img/**/*', ['images']);
});

gulp.task('webserver', function() {
  gulp.src('dist')
      .pipe(webserver({
        livereload: true,
        directoryListing: true,
        open: true
      }));
});<|endoftext|>


<commit_before>// ===================================================
// Settings
// ===================================================

var gulp            = require('gulp'),
    gulpLoadPlugins = require('gulp-load-plugins'),
    $               = gulpLoadPlugins({
                        rename: {
                          'gulp-minify-css'  : 'mincss',
                          'gulp-minify-html' : 'minhtml',
                          'gulp-gh-pages'    : 'ghPages',
                          'gulp-foreach'     : 'foreach',
                          'gulp-mocha'       : 'mocha',
                          'gulp-if'          : 'if'
                        }
                      }),
    assemble        = require('assemble'),
    del             = require('del'),
    merge           = require('merge-stream'),
    basename        = require('path').basename,
    extname         = require('path').extname;

$.exec   = require('child_process').exec;
$.fs     = require('fs');

// ===================================================
// Configin'
// ===================================================

var env_flag = false;

var asset_dir = {
  site: 'site',
  templates : 'templates',
  data: 'data',
  dist: 'dist',
  js: 'js',
  css: 'css',
  sass: 'src'
};

var path = {
  site: asset_dir.site,
  data: asset_dir.data,
  templates: asset_dir.site + '/' + asset_dir.templates,
  dist: asset_dir.dist,
  js: asset_dir.site + '/' + asset_dir.js,
  css: asset_dir.site + '/' + asset_dir.css,
  sass: asset_dir.site + '/' + asset_dir.css + '/' + asset_dir.sass
};

var glob = {
  html: path.site + '/*.html',
  css: path.css + '/*.css',
  sass: path.sass + '/**/*.scss',
  js: path.js + '/src/**/*.js',
  jslibs : path.js + '/lib/**/*.js',
  layouts: path.templates + '/layouts/*.{md,hbs}',
  pages: path.templates + '/pages/**/*.{md,hbs}',
  includes: path.templates + '/includes/**/*.{md,hbs}',
  data: path.data + '/**/*.{json,yaml}',
  rootData: ['site.yaml', 'package.json']
};

// ===================================================
// Developing
// ===================================================

gulp.task('serve', ['assemble'], function() {
  $.connect.server({
    root: [path.site],
    port: 5000,
    livereload: true,
    middleware: function(connect) {
      return [
        connect().use(connect.query())
      ];
    }
  });

  $.exec('open http://localhost:5000');
});

// ===================================================
// Previewing
// ===================================================

gulp.task('preview', function() {
  $.connect.server({
    root: [path.dist],
    port: 5001
  });

  $.exec('open http://localhost:5001');
});

// ===================================================
// Testing
// ===================================================

gulp.task('mocha', function () {
  return gulp.src('test/*.js', {read: false})
    .pipe($.mocha({ reporter: 'nyan' }));
});

// ===================================================
// Styling
// ===================================================

gulp.task('sass', function() {
  var stream = gulp.src(glob.sass)
    .pipe($.sass())
    .pipe($.autoprefixer({
      browsers: ['last 2 versions'],
      cascade: false
    }))
    .pipe(gulp.dest(path.css))
    .pipe($.connect.reload());

  return stream;
});

// ===================================================
// Templating
// ===================================================

// Pull #3. Also see https://github.com/assemble/assemble/issues/715
// create a `categories` object to keep categories in (e.g. 'clients')
// categories: {
//  clients: {
//    "polyon": { ... }
//  }
// };
assemble.set('categories', {});

/**
 Populate categories with pages that specify the categories they belong to.
 When the onLoad middleware runs for a single file, it looks at the file's front-matter (file.data) to see if it contains a categories property. This property can be a string or an array of strings. If it exists, then the middleware updates the categories object for each category in the array. In the case of polyon.hbs, there is only 1 category called client, so the categories object becomes:

categories: {
 clients: {
   "polyon": { ... }
 }
};
 */

assemble.onLoad(/\.hbs/, function(file, next) {
  // if the file doesn't have a data object or
  // doesn't contain `categories` in it's
  // front-matter, move on.
  if (!file.data || !file.data.categories) {
    return next();
  }

  // use the default `renameKey` function to store
  // pages on the `categories` object
  var renameKey = assemble.option('renameKey');

  // get the categories object
  var categories = assemble.get('categories');

  // figure out which categories this file belongs to
  var cats = file.data.categories;
  cats = Array.isArray(cats) ? cats : [cats];

  // add this file's data (file object) to each of
  // it's catogories
  cats.forEach(function(cat) {
    categories[cat] = categories[cat] || [];
    categories[cat][renameKey(file.path)] = file;
  });

  // done
  next();
});

/**
 * Handlebars helper to iterate over an object of pages for a specific category
 *
 * ```
 * {{#category "clients"}}
 *   <li>{{data.summary}}</li>
 * {{/category}}
 * ```
 */

assemble.helper('category', function(category, options) {
  var pages = this.app.get('categories.' + category);
  if (!pages) {
    return '';
  }
  return Object.keys(pages).map(function(page) {
    // this renders the block between `{{#category}}` and `{{category}}` passing the
    // entire page object as the context.
    // If you only want to use the page's front-matter, then change this to something like
    // return options.fn(pages[page].data);
    return options.fn(pages[page]).toLowerCase();
  }).join('\n');
});

/**
 * Load data onto assemble cache.
 * This loads data from `glob.data` and `glob.rootData`.
 * When loading `glob.rootData`, use a custom namespace function
 * to return `pkg` for `package.json`.
 *
 * After all data is loaded, process the data to resolve templates
 * in values.
 * @doowb PR: https://github.com/grayghostvisuals/grayghostvisuals/pull/5
 */

function loadData() {
  assemble.data(glob.data);
  assemble.data(assemble.plasma(glob.rootData, {namespace: function (fp) {
    var name = basename(fp, extname(fp));
    if (name === 'package') return 'pkg';
    return name;
  }}));
  assemble.data(assemble.process(assemble.data()));
}

// Placing assemble setups inside the task allows
// live reloading/monitoring for files changes.
gulp.task('assemble', function() {
  assemble.option('production', env_flag);
  assemble.option('layout', 'default');
  assemble.layouts(glob.layouts);
  assemble.partials(glob.includes);
  loadData();

  var stream = assemble.src(glob.pages)
    .pipe($.extname())
    .pipe(assemble.dest(path.site))
    .pipe($.connect.reload());

  return stream;
});

// ===================================================
// Optimizing
// ===================================================

gulp.task('svgstore', function() {
  return gulp
    .src(path.site + '/img/icons/linear/*.svg')
    .pipe($.svgmin({
      plugins: [{
        removeDoctype: true
      }]
    }))
    .pipe($.svgstore())
    .pipe($.cheerio(function($) {
      $('svg').attr('style', 'display:none');
    }))
    .pipe(gulp.dest(path.templates + '/includes/atoms/svg-sprite.svg'));
});

// ===================================================
// Minifying
// ===================================================

gulp.task('cssmin', ['sass'], function() {
  var stream = gulp.src(glob.css)
    .pipe($.mincss({ keepBreaks:true }))
    .pipe(gulp.dest(path.css));

  return stream;
});

// ===================================================
// Building
// ===================================================

/*
 * foreach is because usemin 0.3.11 won't manipulate
 * multiple files as an array.
 */

gulp.task('usemin', ['assemble', 'cssmin'], function() {
  return gulp.src(glob.html)
    .pipe($.foreach(function(stream, file) {
      return stream
        .pipe($.usemin({
          assetsDir: path.site,
          css: [ $.rev() ],
          html: [ $.minhtml({ empty: true }) ],
          js: [ $.uglify(), $.rev() ]
        }))
        .pipe(gulp.dest(path.dist));
    }));
});

// ===================================================
// Duplicating
// ===================================================

gulp.task('copy', ['usemin'], function() {
  return merge(
    gulp.src([path.site + '/{img,bower_components,js/lib}/**/*'])
        .pipe(gulp.dest(path.dist)),

    gulp.src([
        'webhook.php',
        path.site + '/*.{ico,png,txt}',
        path.site + '/.htaccess',
      ]).pipe(gulp.dest(path.dist))
  );
});

// ===================================================
// Releasing
// ===================================================

gulp.task('deploy', function() {
  return gulp.src([path.dist + '/**/*', path.dist + '/.htaccess' ])
             .pipe($.ghPages(
                $.if(env_flag === false,
                { branch: 'staging' },
                { branch: 'master'  })
             ));
});

// ===================================================
// Cleaning
// ===================================================

gulp.task('clean', function(cb) {
  del([
    'dist',
    glob.css,
    path.site + '/client',
    glob.html
  ], cb);
});

// ===================================================
// Monitoring
// ===================================================

gulp.task('watch', function() {
  gulp.watch([
    path.dist + '/**/*.scss',
    glob.sass
  ], ['sass']);

  gulp.watch([
    glob.includes,
    glob.pages,
    glob.layouts
  ], ['assemble']);
});

// ===================================================
// Tasks
// ===================================================

gulp.task('build', [ 'copy','usemin' ]);
gulp.task('default', [ 'sass','assemble','serve','watch' ]);
<commit_msg>remove watch on sass files in dist dir<commit_after>// ===================================================
// Settings
// ===================================================

var gulp            = require('gulp'),
    gulpLoadPlugins = require('gulp-load-plugins'),
    $               = gulpLoadPlugins({
                        rename: {
                          'gulp-minify-css'  : 'mincss',
                          'gulp-minify-html' : 'minhtml',
                          'gulp-gh-pages'    : 'ghPages',
                          'gulp-foreach'     : 'foreach',
                          'gulp-mocha'       : 'mocha',
                          'gulp-if'          : 'if'
                        }
                      }),
    assemble        = require('assemble'),
    del             = require('del'),
    merge           = require('merge-stream'),
    basename        = require('path').basename,
    extname         = require('path').extname;

$.exec   = require('child_process').exec;
$.fs     = require('fs');

// ===================================================
// Configin'
// ===================================================

var env_flag = false;

var asset_dir = {
  site: 'site',
  templates : 'templates',
  data: 'data',
  dist: 'dist',
  js: 'js',
  css: 'css',
  sass: 'src'
};

var path = {
  site: asset_dir.site,
  data: asset_dir.data,
  templates: asset_dir.site + '/' + asset_dir.templates,
  dist: asset_dir.dist,
  js: asset_dir.site + '/' + asset_dir.js,
  css: asset_dir.site + '/' + asset_dir.css,
  sass: asset_dir.site + '/' + asset_dir.css + '/' + asset_dir.sass
};

var glob = {
  html: path.site + '/*.html',
  css: path.css + '/*.css',
  sass: path.sass + '/**/*.scss',
  js: path.js + '/src/**/*.js',
  jslibs : path.js + '/lib/**/*.js',
  layouts: path.templates + '/layouts/*.{md,hbs}',
  pages: path.templates + '/pages/**/*.{md,hbs}',
  includes: path.templates + '/includes/**/*.{md,hbs}',
  data: path.data + '/**/*.{json,yaml}',
  rootData: ['site.yaml', 'package.json']
};

// ===================================================
// Developing
// ===================================================

gulp.task('serve', ['assemble'], function() {
  $.connect.server({
    root: [path.site],
    port: 5000,
    livereload: true,
    middleware: function(connect) {
      return [
        connect().use(connect.query())
      ];
    }
  });

  $.exec('open http://localhost:5000');
});

// ===================================================
// Previewing
// ===================================================

gulp.task('preview', function() {
  $.connect.server({
    root: [path.dist],
    port: 5001
  });

  $.exec('open http://localhost:5001');
});

// ===================================================
// Testing
// ===================================================

gulp.task('mocha', function () {
  return gulp.src('test/*.js', {read: false})
    .pipe($.mocha({ reporter: 'nyan' }));
});

// ===================================================
// Styling
// ===================================================

gulp.task('sass', function() {
  var stream = gulp.src(glob.sass)
    .pipe($.sass())
    .pipe($.autoprefixer({
      browsers: ['last 2 versions'],
      cascade: false
    }))
    .pipe(gulp.dest(path.css))
    .pipe($.connect.reload());

  return stream;
});

// ===================================================
// Templating
// ===================================================

// Pull #3. Also see https://github.com/assemble/assemble/issues/715
// create a `categories` object to keep categories in (e.g. 'clients')
// categories: {
//  clients: {
//    "polyon": { ... }
//  }
// };
assemble.set('categories', {});

/**
 Populate categories with pages that specify the categories they belong to.
 When the onLoad middleware runs for a single file, it looks at the file's front-matter (file.data) to see if it contains a categories property. This property can be a string or an array of strings. If it exists, then the middleware updates the categories object for each category in the array. In the case of polyon.hbs, there is only 1 category called client, so the categories object becomes:

categories: {
 clients: {
   "polyon": { ... }
 }
};
 */

assemble.onLoad(/\.hbs/, function(file, next) {
  // if the file doesn't have a data object or
  // doesn't contain `categories` in it's
  // front-matter, move on.
  if (!file.data || !file.data.categories) {
    return next();
  }

  // use the default `renameKey` function to store
  // pages on the `categories` object
  var renameKey = assemble.option('renameKey');

  // get the categories object
  var categories = assemble.get('categories');

  // figure out which categories this file belongs to
  var cats = file.data.categories;
  cats = Array.isArray(cats) ? cats : [cats];

  // add this file's data (file object) to each of
  // it's catogories
  cats.forEach(function(cat) {
    categories[cat] = categories[cat] || [];
    categories[cat][renameKey(file.path)] = file;
  });

  // done
  next();
});

/**
 * Handlebars helper to iterate over an object of pages for a specific category
 *
 * ```
 * {{#category "clients"}}
 *   <li>{{data.summary}}</li>
 * {{/category}}
 * ```
 */

assemble.helper('category', function(category, options) {
  var pages = this.app.get('categories.' + category);
  if (!pages) {
    return '';
  }
  return Object.keys(pages).map(function(page) {
    // this renders the block between `{{#category}}` and `{{category}}` passing the
    // entire page object as the context.
    // If you only want to use the page's front-matter, then change this to something like
    // return options.fn(pages[page].data);
    return options.fn(pages[page]).toLowerCase();
  }).join('\n');
});

/**
 * Load data onto assemble cache.
 * This loads data from `glob.data` and `glob.rootData`.
 * When loading `glob.rootData`, use a custom namespace function
 * to return `pkg` for `package.json`.
 *
 * After all data is loaded, process the data to resolve templates
 * in values.
 * @doowb PR: https://github.com/grayghostvisuals/grayghostvisuals/pull/5
 */

function loadData() {
  assemble.data(glob.data);
  assemble.data(assemble.plasma(glob.rootData, {namespace: function (fp) {
    var name = basename(fp, extname(fp));
    if (name === 'package') return 'pkg';
    return name;
  }}));
  assemble.data(assemble.process(assemble.data()));
}

// Placing assemble setups inside the task allows
// live reloading/monitoring for files changes.
gulp.task('assemble', function() {
  assemble.option('production', env_flag);
  assemble.option('layout', 'default');
  assemble.layouts(glob.layouts);
  assemble.partials(glob.includes);
  loadData();

  var stream = assemble.src(glob.pages)
    .pipe($.extname())
    .pipe(assemble.dest(path.site))
    .pipe($.connect.reload());

  return stream;
});

// ===================================================
// Optimizing
// ===================================================

gulp.task('svgstore', function() {
  return gulp
    .src(path.site + '/img/icons/linear/*.svg')
    .pipe($.svgmin({
      plugins: [{
        removeDoctype: true
      }]
    }))
    .pipe($.svgstore())
    .pipe($.cheerio(function($) {
      $('svg').attr('style', 'display:none');
    }))
    .pipe(gulp.dest(path.templates + '/includes/atoms/svg-sprite.svg'));
});

// ===================================================
// Minifying
// ===================================================

gulp.task('cssmin', ['sass'], function() {
  var stream = gulp.src(glob.css)
    .pipe($.mincss({ keepBreaks:true }))
    .pipe(gulp.dest(path.css));

  return stream;
});

// ===================================================
// Building
// ===================================================

/*
 * foreach is because usemin 0.3.11 won't manipulate
 * multiple files as an array.
 */

gulp.task('usemin', ['assemble', 'cssmin'], function() {
  return gulp.src(glob.html)
    .pipe($.foreach(function(stream, file) {
      return stream
        .pipe($.usemin({
          assetsDir: path.site,
          css: [ $.rev() ],
          html: [ $.minhtml({ empty: true }) ],
          js: [ $.uglify(), $.rev() ]
        }))
        .pipe(gulp.dest(path.dist));
    }));
});

// ===================================================
// Duplicating
// ===================================================

gulp.task('copy', ['usemin'], function() {
  return merge(
    gulp.src([path.site + '/{img,bower_components,js/lib}/**/*'])
        .pipe(gulp.dest(path.dist)),

    gulp.src([
        'webhook.php',
        path.site + '/*.{ico,png,txt}',
        path.site + '/.htaccess',
      ]).pipe(gulp.dest(path.dist))
  );
});

// ===================================================
// Releasing
// ===================================================

gulp.task('deploy', function() {
  return gulp.src([path.dist + '/**/*', path.dist + '/.htaccess' ])
             .pipe($.ghPages(
                $.if(env_flag === false,
                { branch: 'staging' },
                { branch: 'master'  })
             ));
});

// ===================================================
// Cleaning
// ===================================================

gulp.task('clean', function(cb) {
  del([
    'dist',
    glob.css,
    path.site + '/client',
    glob.html
  ], cb);
});

// ===================================================
// Monitoring
// ===================================================

gulp.task('watch', function() {
  gulp.watch([
    glob.sass
  ], ['sass']);

  gulp.watch([
    glob.includes,
    glob.pages,
    glob.layouts
  ], ['assemble']);
});

// ===================================================
// Tasks
// ===================================================

gulp.task('build', [ 'copy','usemin' ]);
gulp.task('default', [ 'sass','assemble','serve','watch' ]);
<|endoftext|>


<commit_before><commit_msg>removed unused assignment<commit_after><|endoftext|>


<commit_before>var gulp      = require('gulp'),
    concat    = require('gulp-concat'),
    plumber   = require('gulp-plumber'),
    rename    = require('gulp-rename'),
    stylus    = require('gulp-stylus'),
    uglify    = require('gulp-uglify'),
    path      = require('path'),
    run       = require('gulp-run'),
    sequence  = require('run-sequence'),
    kssnode   = __dirname + '/node_modules/.bin/kss',
    kss       = require('kss');

var cfg = {
    bowerDir: 'bower_components/',
    fontsDir: 'assets/fonts/',
    cssDir: 'assets/styl/',
    jsDir: 'assets/js/',
    docDir: 'styleguide/',
    distDir: 'dist/',
    stylusPattern: '**/*.styl',
    jsPattern: '**/*.js'
};

// css
gulp.task('styles', function()
{
    return gulp.src(cfg.cssDir + 'colette.styl')
        .pipe(stylus({
            compress: true,
            linenos: false,
            use: [require('nib')()],
            import: ['nib']
        }))
        .pipe(rename('colette.min.css'))
        .pipe(gulp.dest(cfg.distDir + 'css'));
});

// js
gulp.task('scripts', function()
{
    return gulp.src([
            cfg.bowerDir + 'headroom.js/dist/headroom.min.js',
            cfg.jsDir + 'colette/js/colette.js'
        ])
        .pipe(plumber())
        .pipe(concat('colette.min.js'))
        .pipe(gulp.dest(cfg.distDir + 'js'))
        .pipe(uglify());
});

// assets
gulp.task('assets', function() {
    // Retrieve fonts into dist/ directory
    gulp.src(cfg.fontsDir + '*')
        .pipe(gulp.dest(cfg.distDir + 'fonts'));
});

// kss
gulp.task('kss', function () {
    // generate doc
    kss(require('./kss.json'));

    // retrieve dist directory
    gulp.src(cfg.distDir + '*/**')
        .pipe(gulp.dest(cfg.docDir + 'dist/'));

});

// watch
gulp.task('watch', function() {
    gulp.watch(cfg.cssDir + cfg.stylusPattern, ['styles', 'kss']);
    gulp.watch(cfg.jsDir + cfg.jsPattern, ['scripts']);
});

// build
gulp.task('build', ['styles', 'scripts', 'assets']);
<commit_msg>remove old kssnode variable<commit_after>var gulp      = require('gulp'),
    concat    = require('gulp-concat'),
    plumber   = require('gulp-plumber'),
    rename    = require('gulp-rename'),
    stylus    = require('gulp-stylus'),
    uglify    = require('gulp-uglify'),
    path      = require('path'),
    run       = require('gulp-run'),
    sequence  = require('run-sequence'),
    kss       = require('kss');

var cfg = {
    bowerDir: 'bower_components/',
    fontsDir: 'assets/fonts/',
    cssDir: 'assets/styl/',
    jsDir: 'assets/js/',
    docDir: 'styleguide/',
    distDir: 'dist/',
    stylusPattern: '**/*.styl',
    jsPattern: '**/*.js'
};

// css
gulp.task('styles', function()
{
    return gulp.src(cfg.cssDir + 'colette.styl')
        .pipe(stylus({
            compress: true,
            linenos: false,
            use: [require('nib')()],
            import: ['nib']
        }))
        .pipe(rename('colette.min.css'))
        .pipe(gulp.dest(cfg.distDir + 'css'));
});

// js
gulp.task('scripts', function()
{
    return gulp.src([
            cfg.bowerDir + 'headroom.js/dist/headroom.min.js',
            cfg.jsDir + 'colette/js/colette.js'
        ])
        .pipe(plumber())
        .pipe(concat('colette.min.js'))
        .pipe(gulp.dest(cfg.distDir + 'js'))
        .pipe(uglify());
});

// assets
gulp.task('assets', function() {
    // Retrieve fonts into dist/ directory
    gulp.src(cfg.fontsDir + '*')
        .pipe(gulp.dest(cfg.distDir + 'fonts'));
});

// kss
gulp.task('kss', function () {
    // generate doc
    kss(require('./kss.json'));

    // retrieve dist directory
    gulp.src(cfg.distDir + '*/**')
        .pipe(gulp.dest(cfg.docDir + 'dist/'));

});

// watch
gulp.task('watch', function() {
    gulp.watch(cfg.cssDir + cfg.stylusPattern, ['styles', 'kss']);
    gulp.watch(cfg.jsDir + cfg.jsPattern, ['scripts']);
});

// build
gulp.task('build', ['styles', 'scripts', 'assets']);
<|endoftext|>


<commit_before>var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');

var paths = {
  scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'],
  images: 'client/img/**/*'
};

gulp.task('travis', ['build', 'testServerJS'], function(){
  process.exit(0);
});

// Not all tasks need to use streams
// A gulpfile is just another node program and you can use any package available on npm
gulp.task('clean', function() {
  // You can use multiple globbing patterns as you would with `gulp.src`
  return del(['build']);
});

gulp.task('scripts', ['clean'], function() {
  // Minify and copy all JavaScript (except vendor scripts)
  // with sourcemaps all the way down
  return gulp.src(paths.scripts)
    .pipe(sourcemaps.init())
    .pipe(coffee())
    .pipe(uglify())
    .pipe(concat('all.min.js'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('build/js'));
});

// Copy all static images
gulp.task('images', ['clean'], function() {
  return gulp.src(paths.images)
  // Pass in options to the task
    .pipe(imagemin({optimizationLevel: 5}))
    .pipe(gulp.dest('build/img'));
});

// Rerun the task when a file changes
gulp.task('watch', function() {
  gulp.watch(paths.scripts, ['scripts']);
  gulp.watch(paths.images, ['images']);
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', ['watch', 'scripts', 'images']);<commit_msg>Travis test<commit_after>var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');

var paths = {
  scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'],
  images: 'client/img/**/*'
};

gulp.task('travis', ['build', 'testServerJS'], function(){
  process.exit(0);

});

// Not all tasks need to use streams
// A gulpfile is just another node program and you can use any package available on npm
gulp.task('clean', function() {
  // You can use multiple globbing patterns as you would with `gulp.src`
  return del(['build']);
});

gulp.task('scripts', ['clean'], function() {
  // Minify and copy all JavaScript (except vendor scripts)
  // with sourcemaps all the way down
  return gulp.src(paths.scripts)
    .pipe(sourcemaps.init())
    .pipe(coffee())
    .pipe(uglify())
    .pipe(concat('all.min.js'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('build/js'));
});

// Copy all static images
gulp.task('images', ['clean'], function() {
  return gulp.src(paths.images)
  // Pass in options to the task
    .pipe(imagemin({optimizationLevel: 5}))
    .pipe(gulp.dest('build/img'));
});

// Rerun the task when a file changes
gulp.task('watch', function() {
  gulp.watch(paths.scripts, ['scripts']);
  gulp.watch(paths.images, ['images']);
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', ['watch', 'scripts', 'images']);<|endoftext|>


<commit_before>var browserify = require('browserify');
var shim = require('browserify-shim');
var gulp = require('gulp');
var concat = require('gulp-concat');
var derequire = require('gulp-derequire');
var mocha = require('gulp-mocha');
var rename = require('gulp-rename');
var source = require('vinyl-source-stream');
var streamify = require('gulp-streamify');
var typescript = require('gulp-tsc');
var uglify = require('gulp-uglify');

var tests = [
	{ name: 'NavigationRouting', to: 'navigationRouting.test.js' },
	{ name: 'StateInfo', to: 'stateInfo.test.js' },
	{ name: 'Navigation', to: 'navigation.test.js' },
	{ name: 'NavigationData', to: 'navigationData.test.js' }
];
var plugins = [
	require('./build/npm/navigation-react/package.json'),
	require('./build/npm/navigation-knockout/package.json'),
	require('./build/npm/navigation-angular/package.json')
];
var testTasks = [];
function testTask(from, to) {
	return browserify(from)
		.plugin('tsify')
		.bundle()
		.pipe(source(to))
		.pipe(rename(to))
		.pipe(gulp.dest('./build/dist'))
        .pipe(mocha());
}
for (var i = 0; i < tests.length; i++) {
	(function (test) {
		gulp.task('Test' + test.name, function () {
			return testTask('./NavigationJS/test/' + test.name + 'Test.ts', test.to)
		});
	})(tests[i]);
	testTasks.push('Test' + tests[i].name);
}
gulp.task('test', testTasks);

var buildTasks = ['BuildNavigation'];
var packageTasks = ['PackageNavigation'];
gulp.task('BuildNavigation', function () {
	return buildTask('Navigation', './NavigationJS/src/Navigation.ts', 'navigation.js');
});
gulp.task('PackageNavigation', function () {
	return packageTask('Navigation', './NavigationJS/src/Navigation.ts');
})
function buildTask(name, from, to) {
	return browserify(from, { standalone: name })
		.plugin('tsify')
		.transform(shim)
		.bundle()
		.pipe(source(to))
		.pipe(rename(to))
		.pipe(derequire())
		.pipe(gulp.dest('./build/dist'))
		.pipe(rename(to.replace(/js$/, 'min.js')))
		.pipe(streamify(uglify()))
		.pipe(gulp.dest('./build/dist'));
}
function packageTask(name, from) {
	return gulp.src(from)
		.pipe(typescript())
		.pipe(gulp.dest('./build/lib/' + name));
}

for (var i = 0; i < plugins.length; i++) {
	var name = plugins[i].name.replace('/b./g', function(val){ return val.toUpperCase(); }).replace('-', '');
	var tsFrom = './' + name + '/src/' + name + '.ts';
	var jsTo = plugins[i].name.replace('-', '.') + '.js';
	(function (name, tsFrom, jsTo) {
		gulp.task('Build' + name, function () {
			return buildTask(name, tsFrom, jsTo);
		});
		gulp.task('Package' + name, function () {
			return packageTask(name, tsFrom);
		});
	})(name, tsFrom, jsTo);
	buildTasks.push('Build' + name);
	packageTasks.push('Package' + name);
}
gulp.task('build', buildTasks);
gulp.task('package', packageTasks);
<commit_msg>Renamed reserved word 'from'<commit_after>var browserify = require('browserify');
var shim = require('browserify-shim');
var gulp = require('gulp');
var concat = require('gulp-concat');
var derequire = require('gulp-derequire');
var mocha = require('gulp-mocha');
var rename = require('gulp-rename');
var source = require('vinyl-source-stream');
var streamify = require('gulp-streamify');
var typescript = require('gulp-tsc');
var uglify = require('gulp-uglify');

var tests = [
	{ name: 'NavigationRouting', to: 'navigationRouting.test.js' },
	{ name: 'StateInfo', to: 'stateInfo.test.js' },
	{ name: 'Navigation', to: 'navigation.test.js' },
	{ name: 'NavigationData', to: 'navigationData.test.js' }
];
var plugins = [
	require('./build/npm/navigation-react/package.json'),
	require('./build/npm/navigation-knockout/package.json'),
	require('./build/npm/navigation-angular/package.json')
];
var testTasks = [];
function testTask(file, to) {
	return browserify(file)
		.plugin('tsify')
		.bundle()
		.pipe(source(to))
		.pipe(rename(to))
		.pipe(gulp.dest('./build/dist'))
        .pipe(mocha());
}
for (var i = 0; i < tests.length; i++) {
	(function (test) {
		gulp.task('Test' + test.name, function () {
			return testTask('./NavigationJS/test/' + test.name + 'Test.ts', test.to)
		});
	})(tests[i]);
	testTasks.push('Test' + tests[i].name);
}
gulp.task('test', testTasks);

var buildTasks = ['BuildNavigation'];
var packageTasks = ['PackageNavigation'];
gulp.task('BuildNavigation', function () {
	return buildTask('Navigation', './NavigationJS/src/Navigation.ts', 'navigation.js');
});
gulp.task('PackageNavigation', function () {
	return packageTask('Navigation', './NavigationJS/src/Navigation.ts');
})
function buildTask(name, file, to) {
	return browserify(file, { standalone: name })
		.plugin('tsify')
		.transform(shim)
		.bundle()
		.pipe(source(to))
		.pipe(rename(to))
		.pipe(derequire())
		.pipe(gulp.dest('./build/dist'))
		.pipe(rename(to.replace(/js$/, 'min.js')))
		.pipe(streamify(uglify()))
		.pipe(gulp.dest('./build/dist'));
}
function packageTask(name, file) {
	return gulp.src(file)
		.pipe(typescript())
		.pipe(gulp.dest('./build/lib/' + name));
}

for (var i = 0; i < plugins.length; i++) {
	var name = plugins[i].name.replace('/b./g', function(val){ return val.toUpperCase(); }).replace('-', '');
	var tsFrom = './' + name + '/src/' + name + '.ts';
	var jsTo = plugins[i].name.replace('-', '.') + '.js';
	(function (name, tsFrom, jsTo) {
		gulp.task('Build' + name, function () {
			return buildTask(name, tsFrom, jsTo);
		});
		gulp.task('Package' + name, function () {
			return packageTask(name, tsFrom);
		});
	})(name, tsFrom, jsTo);
	buildTasks.push('Build' + name);
	packageTasks.push('Package' + name);
}
gulp.task('build', buildTasks);
gulp.task('package', packageTasks);
<|endoftext|>


<commit_before>var gulp = require("gulp");
var connect = require("gulp-connect");

gulp.task("build", function(){
  return gulp.src("src/**/*.md")
    .pipe( require("gulp-front-matter")({remove: true}) )
    .pipe( require("gulp-plumber")() )
    .pipe( require("gulp-textlint")({formatterName: "pretty-error"}) )
    .pipe( require("gulp-markdown")() )
    .pipe( require("gulp-layout")(function(file){
      var params = file.frontMatter;
      var now = new Date;
      params["year"] = now.getFullYear();
      params["month"] = now.getMonth() + 1;
      params["day"] = now.getDate();
      return params;
    }) )
    .pipe( gulp.dest("public/") );
});

gulp.task("html", function(){
  gulp.src("public/**/*.html")
    .pipe( connect.reload() )
});

gulp.task("livereload", function(){
  connect.server({
    port: 8000,
    root: "public/",
    livereload: true
  });
  gulp.watch("src/**/*.md",["build"]);
  gulp.watch("public/**/*.html",["html"]);
});
<commit_msg>fix plumber position #gulpfile<commit_after>var gulp = require("gulp");
var connect = require("gulp-connect");

gulp.task("build", function(){
  return gulp.src("src/**/*.md")
    .pipe( require("gulp-plumber")() )
    .pipe( require("gulp-front-matter")({remove: true}) )
    .pipe( require("gulp-textlint")({formatterName: "pretty-error"}) )
    .pipe( require("gulp-markdown")() )
    .pipe( require("gulp-layout")(function(file){
      var params = file.frontMatter;
      var now = new Date;
      params["year"] = now.getFullYear();
      params["month"] = now.getMonth() + 1;
      params["day"] = now.getDate();
      return params;
    }) )
    .pipe( gulp.dest("public/") );
});

gulp.task("html", function(){
  gulp.src("public/**/*.html")
    .pipe( connect.reload() )
});

gulp.task("livereload", function(){
  connect.server({
    port: 8000,
    root: "public/",
    livereload: true
  });
  gulp.watch("src/**/*.md",["build"]);
  gulp.watch("public/**/*.html",["html"]);
});
<|endoftext|>


<commit_before>var gulp = require('gulp');
var concat = require('gulp-concat-util');
var connect = require('gulp-connect');
var rename = require('gulp-rename');
var size = require('gulp-size');
var terser = require('gulp-terser');
var changed = require('gulp-changed');
var plumber = require('gulp-plumber');
var preprocess = require('gulp-preprocess');

var Server = require('karma').Server;
var package = require('./package.json');

// Enables/Disables visual debugging in Kontra
var VISUAL_DEBUG = false;

// Enables/Disables DEBUG mode in Kontra
var DEBUG = false;

gulp.task('scripts', function() {
  return gulp.src(['src/core.js', 'src/keyboard.js', 'src/sprite.js', 'src/gameLoop.js'])
    .pipe(concat('kontra.js'))
    .pipe(gulp.dest('.'))
    .pipe(gulp.dest('./docs/js'))
    .pipe(preprocess({context: { DEBUG: DEBUG, VISUAL_DEBUG: VISUAL_DEBUG}}))
    .pipe(plumber())
    .pipe(terser())
    .pipe(plumber.stop())
    .pipe(rename('kontra.min.js'))
    .pipe(size({
      showFiles: true
    }))
    .pipe(size({
      showFiles: true,
      gzip: true
    }))
    .pipe(gulp.dest('.'))
    .pipe(connect.reload());
});

gulp.task('dist', function() {
  return gulp.src('src/*.js')
    .pipe(preprocess({context: { DEBUG: DEBUG, VISUAL_DEBUG: VISUAL_DEBUG}}))
    .pipe(changed('./dist'))
    .pipe(plumber())
    .pipe(terser())
    .pipe(plumber.stop())
    .pipe(size({
      showFiles: true
    }))
    .pipe(size({
      showFiles: true,
      gzip: true
    }))
    .pipe(gulp.dest('./dist'));
});

gulp.task('connect', function() {
  connect.server({
    livereload: true
  });
});

gulp.task('watch', function() {
  gulp.watch('src/*.js', ['dist', 'scripts']);
});

gulp.task('test', function(done) {
  new Server({
    basePath: '',
    frameworks: ['mocha', 'chai', 'sinon'],
    files: [
      // assets
      'test/phantom.polyfill.js',
      'src/*.js',
      'test/*.js'
    ],
    browsers: ['Chrome', 'Firefox', 'Safari', 'IE']
  }, done).start();
});

gulp.task('default', ['scripts', 'connect', 'watch']);
<commit_msg>revert gulpfile file changes<commit_after>var gulp = require('gulp');
var concat = require('gulp-concat-util');
var connect = require('gulp-connect');
var rename = require('gulp-rename');
var size = require('gulp-size');
var terser = require('gulp-terser');
var changed = require('gulp-changed');
var plumber = require('gulp-plumber');
var preprocess = require('gulp-preprocess');

var Server = require('karma').Server;
var package = require('./package.json');

// Enables/Disables visual debugging in Kontra
var VISUAL_DEBUG = false;

// Enables/Disables DEBUG mode in Kontra
var DEBUG = false;

gulp.task('scripts', function() {
  return gulp.src(['src/core.js', 'src/*.js'])
    .pipe(concat('kontra.js'))
    .pipe(gulp.dest('.'))
    .pipe(gulp.dest('./docs/js'))
    .pipe(preprocess({context: { DEBUG: DEBUG, VISUAL_DEBUG: VISUAL_DEBUG}}))
    .pipe(plumber())
    .pipe(terser())
    .pipe(plumber.stop())
    .pipe(rename('kontra.min.js'))
    .pipe(size({
      showFiles: true
    }))
    .pipe(size({
      showFiles: true,
      gzip: true
    }))
    .pipe(gulp.dest('.'))
    .pipe(connect.reload());
});

gulp.task('dist', function() {
  return gulp.src('src/*.js')
    .pipe(preprocess({context: { DEBUG: DEBUG, VISUAL_DEBUG: VISUAL_DEBUG}}))
    .pipe(changed('./dist'))
    .pipe(plumber())
    .pipe(terser())
    .pipe(plumber.stop())
    .pipe(size({
      showFiles: true
    }))
    .pipe(size({
      showFiles: true,
      gzip: true
    }))
    .pipe(gulp.dest('./dist'));
});

gulp.task('connect', function() {
  connect.server({
    livereload: true
  });
});

gulp.task('watch', function() {
  gulp.watch('src/*.js', ['dist', 'scripts']);
});

gulp.task('test', function(done) {
  new Server({
    basePath: '',
    frameworks: ['mocha', 'chai', 'sinon'],
    files: [
      // assets
      'test/phantom.polyfill.js',
      'src/*.js',
      'test/*.js'
    ],
    browsers: ['Chrome', 'Firefox', 'Safari', 'IE']
  }, done).start();
});

gulp.task('default', ['scripts', 'connect', 'watch']);
<|endoftext|>


<commit_before>'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var wrench = require('wrench');

var $ = require('gulp-load-plugins')({lazy: true});

var options = {
  src: 'src/client',
  dist: 'dist',
  tmp: '.tmp',
  e2e: 'e2e',
  errorHandler: function(title) {
    return function(err) {
      gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
      this.emit('end');
    };
  },
  wiredep: {
    directory: 'bower_components',
    exclude: [/jquery/]
  }
};

wrench.readdirSyncRecursive('./gulp').filter(function(file) {
  return (/\.(js|coffee)$/i).test(file);
}).map(function(file) {
  require('./gulp/' + file)(options);
});

/**
 * --verbose  : Various tasks will produce more output to the console.
 */

gulp.task('default', ['clean'], function () {
    gulp.start('build');
});

/**
 * List the available gulp tasks
 */
gulp.task('help', $.taskListing);
<commit_msg>update gulpfile: build folder<commit_after>'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var wrench = require('wrench');

var $ = require('gulp-load-plugins')({lazy: true});

var options = {
  src: 'src/client',
  dist: 'dist/client',
  tmp: '.tmp',
  e2e: 'e2e',
  errorHandler: function(title) {
    return function(err) {
      gutil.log(gutil.colors.red('[' + title + ']'), err.toString());
      this.emit('end');
    };
  },
  wiredep: {
    directory: 'bower_components',
    exclude: [/jquery/]
  }
};

wrench.readdirSyncRecursive('./gulp').filter(function(file) {
  return (/\.(js|coffee)$/i).test(file);
}).map(function(file) {
  require('./gulp/' + file)(options);
});

/**
 * --verbose  : Various tasks will produce more output to the console.
 */

gulp.task('default', ['clean'], function () {
    gulp.start('build');
});

/**
 * List the available gulp tasks
 */
gulp.task('help', $.taskListing);
<|endoftext|>


<commit_before>var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
// var pleeease = require('gulp-pleeease');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var browserSync = require('browser-sync');
var reload      = browserSync.reload;
var ejs = require("gulp-ejs");
var plumber = require("gulp-plumber");

// Sass

gulp.task('sass', function () {
    gulp.src('sass/**/*.scss')
        .pipe(sourcemaps.init())
        .pipe(sass({errLogToConsole: true})) // Keep running gulp even though occurred compile error
        // .pipe(pleeease({
        //     autoprefixer: {
        //         browsers: ['last 2 versions']
        //     }
        // }))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('build/css'))
        .pipe(reload({stream:true}));
});

// Js-concat-uglify

gulp.task('js', function() {
    gulp.src(['js/*.js'])
        .pipe(concat('scripts.js'))
        .pipe(uglify({preserveComments: 'some'})) // Keep some comments
        .pipe(gulp.dest('build/js'))
        .pipe(reload({stream:true}));
});

// Imagemin

gulp.task('imagemin', function() {
    gulp.src(['images/**/*.{png,jpg,gif,svg}'])
        .pipe(imagemin({optimizationLevel: 7}))
        .pipe(gulp.dest('build/images'));
});

// ejs

var fs = require('fs');
var json = JSON.parse(fs.readFileSync("site.json")); // parse json
gulp.task("ejs", function() {
    gulp.src(['templates/*.ejs','!' + 'templates/_*.ejs']) // Don't build html which starts from underline
        .pipe(plumber())
        .pipe(ejs(json))
        .pipe(gulp.dest('./'))
});

// Static server

gulp.task('browser-sync', function() {
    browserSync({
        server: {
            baseDir: "./", //　Target directory
            index  : "index.html" // index file
        }
    });
});

// Reload all browsers

gulp.task('bs-reload', function () {
    browserSync.reload();
});

// Task for `gulp` command

gulp.task('default',['browser-sync'], function() {
    gulp.watch('sass/**/*.scss',['sass']);
    gulp.watch('js/*.js',['js']);
    gulp.watch('images/**/*.{png,jpg,gif,svg}',['imagemin']);
    gulp.watch("./*.html", ['bs-reload']);
    gulp.watch(['templates/*.ejs', 'site.json'], ['ejs']);
});<commit_msg>gulp 起動時にsourcemapsが動くように<commit_after>var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
// var pleeease = require('gulp-pleeease');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var browserSync = require('browser-sync');
var reload      = browserSync.reload;
var ejs = require("gulp-ejs");
var plumber = require("gulp-plumber");

// Sass

gulp.task('sass', function () {
    gulp.src('sass/**/*.scss')
        .pipe(sourcemaps.init())
        .pipe(sass({errLogToConsole: true})) // Keep running gulp even though occurred compile error
        // .pipe(pleeease({
        //     autoprefixer: {
        //         browsers: ['last 2 versions']
        //     }
        // }))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('build/css'))
        .pipe(reload({stream:true}));
});

// Js-concat-uglify

gulp.task('js', function() {
    gulp.src(['js/*.js'])
        .pipe(concat('scripts.js'))
        .pipe(uglify({preserveComments: 'some'})) // Keep some comments
        .pipe(gulp.dest('build/js'))
        .pipe(reload({stream:true}));
});

// Imagemin

gulp.task('imagemin', function() {
    gulp.src(['images/**/*.{png,jpg,gif,svg}'])
        .pipe(imagemin({optimizationLevel: 7}))
        .pipe(gulp.dest('build/images'));
});

// ejs

var fs = require('fs');
var json = JSON.parse(fs.readFileSync("site.json")); // parse json
gulp.task("ejs", function() {
    gulp.src(['templates/*.ejs','!' + 'templates/_*.ejs']) // Don't build html which starts from underline
        .pipe(plumber())
        .pipe(ejs(json))
        .pipe(gulp.dest('./'))
});

// Static server

gulp.task('browser-sync', function() {
    browserSync({
        server: {
            baseDir: "./", //　Target directory
            index  : "index.html" // index file
        }
    });
});

// Reload all browsers

gulp.task('bs-reload', function () {
    browserSync.reload();
});

// Task for `gulp` command

gulp.task('default',['browser-sync', 'sass'], function() {
    gulp.watch('sass/**/*.scss',['sass']);
    gulp.watch('js/*.js',['js']);
    gulp.watch('images/**/*.{png,jpg,gif,svg}',['imagemin']);
    gulp.watch("./*.html", ['bs-reload']);
    gulp.watch(['templates/*.ejs', 'site.json'], ['ejs']);
});<|endoftext|>


<commit_before>/* global require */

var gulp = require('gulp');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var uglify = require('gulp-uglify');
var del = require('del');
var fs = require('fs');
var merge = require('merge2');

// See the uglify documentation for more details
var uglifySettings = {
    compress: {
        comparisons: true,
        conditionals: true,
        dead_code: true,
        drop_console: true,
        unsafe: true,
        unused: true
    }
};

// Assets for the project
var Assets = {
    dest: 'dist',
    main: 'pubsub.js',
    minified: 'pubsub.min.js',
};

// Clean the 'dist' directory
gulp.task('clean', function (cb) {
    del([Assets.dest + '/*.js'], cb);
});

// Run the babel transpiler to convert from ES2015 to ES5
gulp.task('es6to5', function () {
    return gulp.src('./' + Assets.main)
        .pipe(babel())
        .pipe(gulp.dest('./' + Assets.dest));
});

// Check the code meets the following standards outlined in .jshintrc
gulp.task('jshint', function () {
    return gulp.src('./' + Assets.main)
        .pipe(jshint())
        .pipe(jshint.reporter('jshint-stylish'));
});

// Uglify aka minify the main file
gulp.task('uglify', ['clean', 'es6to5'], function () {
    return gulp.src('./' + Assets.dest + '/' + Assets.main)
        .pipe(concat(Assets.minified))
        .pipe(uglify(uglifySettings))
        .pipe(rename(Assets.minified))
        .pipe(gulp.dest('./' + Assets.dest));
});

// Watch for changes to the main file
gulp.task('watch', function () {
    gulp.watch('./' + Assets.main, ['jshint', 'uglify']);
});

// Update version numbers based on the main file version comment
gulp.task('version', function () {
    var reVersion = /\n\s*\*\s+Version:\s+((?:\d+\.){2}\d+)/;
    var version = fs.readFileSync('./' + Assets.main, {
            encoding: 'utf8'
        })
        // Match is found in the 2nd element
        .match(reVersion)[1];

    var streams = merge();

    // SemVer matching is done using (?:\d+\.){2}\d+

    // Main file VERSION constant
    streams.add(
        gulp.src('./' + Assets.main)
        .pipe(replace(/VERSION\s+=\s+'(?:\d+\.){2}\d+';/, 'VERSION = \'' + version + '\';'))
        .pipe(gulp.dest('./'))
    );

    // package.json version property
    streams.add(
        gulp.src('./package.json')
        .pipe(replace(/"version":\s+"(?:\d+\.){2}\d+",/, '"version": "' + version + '",'))
        .pipe(gulp.dest('./'))
    );

    // README.md version number
    streams.add(
        gulp.src('./README.md')
        .pipe(replace(/^#\s+(\w+)\s+-\s+v(?:\d+\.){2}\d+/, '# $1 - v' + version))
        .pipe(gulp.dest('./'))
    );

    return streams;
});

// Register the default task
gulp.task('default', ['version', 'jshint', 'uglify']);

// 'gulp es6to5' to transpile from ES2015 to ES5
// 'gulp jshint' to check the syntax
// 'gulp uglify' to uglify the main file
// 'gulp watch' to watch for changes to the main file
// 'gulp version' to update the version numbers based on the main file version comment
<commit_msg>Updated regex for the version number in the README<commit_after>/* global require */

var gulp = require('gulp');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var uglify = require('gulp-uglify');
var del = require('del');
var fs = require('fs');
var merge = require('merge2');

// See the uglify documentation for more details
var uglifySettings = {
    compress: {
        comparisons: true,
        conditionals: true,
        dead_code: true,
        drop_console: true,
        unsafe: true,
        unused: true
    }
};

// Assets for the project
var Assets = {
    dest: 'dist',
    main: 'pubsub.js',
    minified: 'pubsub.min.js',
};

// Clean the 'dist' directory
gulp.task('clean', function (cb) {
    del([Assets.dest + '/*.js'], cb);
});

// Run the babel transpiler to convert from ES2015 to ES5
gulp.task('es6to5', function () {
    return gulp.src('./' + Assets.main)
        .pipe(babel())
        .pipe(gulp.dest('./' + Assets.dest));
});

// Check the code meets the following standards outlined in .jshintrc
gulp.task('jshint', function () {
    return gulp.src('./' + Assets.main)
        .pipe(jshint())
        .pipe(jshint.reporter('jshint-stylish'));
});

// Uglify aka minify the main file
gulp.task('uglify', ['clean', 'es6to5'], function () {
    return gulp.src('./' + Assets.dest + '/' + Assets.main)
        .pipe(concat(Assets.minified))
        .pipe(uglify(uglifySettings))
        .pipe(rename(Assets.minified))
        .pipe(gulp.dest('./' + Assets.dest));
});

// Watch for changes to the main file
gulp.task('watch', function () {
    gulp.watch('./' + Assets.main, ['jshint', 'uglify']);
});

// Update version numbers based on the main file version comment
gulp.task('version', function () {
    var reVersion = /\n\s*\*\s+Version:\s+((?:\d+\.){2}\d+)/;
    var version = fs.readFileSync('./' + Assets.main, {
            encoding: 'utf8'
        })
        // Match is found in the 2nd element
        .match(reVersion)[1];

    var streams = merge();

    // SemVer matching is done using (?:\d+\.){2}\d+

    // Main file VERSION constant
    streams.add(
        gulp.src('./' + Assets.main)
        .pipe(replace(/VERSION\s+=\s+'(?:\d+\.){2}\d+';/, 'VERSION = \'' + version + '\';'))
        .pipe(gulp.dest('./'))
    );

    // package.json version property
    streams.add(
        gulp.src('./package.json')
        .pipe(replace(/"version":\s+"(?:\d+\.){2}\d+",/, '"version": "' + version + '",'))
        .pipe(gulp.dest('./'))
    );

    // README.md version number
    streams.add(
        gulp.src('./README.md')
        .pipe(replace(/^#\s+([\w\-]+)\s+-\s+v(?:\d+\.){2}\d+/, '# $1 - v' + version))
        .pipe(gulp.dest('./'))
    );

    return streams;
});

// Register the default task
gulp.task('default', ['version', 'jshint', 'uglify']);

// 'gulp es6to5' to transpile from ES2015 to ES5
// 'gulp jshint' to check the syntax
// 'gulp uglify' to uglify the main file
// 'gulp watch' to watch for changes to the main file
// 'gulp version' to update the version numbers based on the main file version comment
<|endoftext|>


<commit_before>/* global require: true, __dirname: true */

var gulp = require('gulp');
var less = require('gulp-less');
var minifyCSS = require('gulp-minify-css');
var prefix = require('gulp-autoprefixer');
var watch = require('gulp-watch');
var rename = require('gulp-rename');
var path = require('path');

gulp.task('styles', function () {
  gulp.src('./src/*.less')
    .pipe(less({
      paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(prefix('last 2 version', 'android 2.1'))
    .pipe(gulp.dest('./'))
    .pipe(minifyCSS())
    .pipe(rename({suffix: '.min'}))
    .pipe(gulp.dest('./'));
});

gulp.task('watch', function() {
  gulp.src('./src/**/*.less')
    .pipe(watch({ emit: 'all' }, function(files) {
      gulp.run('styles');
    }));
});
<commit_msg>Rename build task<commit_after>/* global require: true, __dirname: true */

var gulp = require('gulp');
var less = require('gulp-less');
var minifyCSS = require('gulp-minify-css');
var prefix = require('gulp-autoprefixer');
var watch = require('gulp-watch');
var rename = require('gulp-rename');
var path = require('path');

gulp.task('build', function () {
  gulp.src('./src/*.less')
    .pipe(less({
      paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(prefix('last 2 version', 'android 2.1'))
    .pipe(gulp.dest('./'))
    .pipe(minifyCSS())
    .pipe(rename({suffix: '.min'}))
    .pipe(gulp.dest('./'));
});

gulp.task('watch', function() {
  gulp.src('./src/**/*.less')
    .pipe(watch({ emit: 'all' }, function(files) {
      gulp.run('build');
    }));
});
<|endoftext|>


<commit_before>var gulp = require('gulp');

var imagemin = require('gulp-imagemin');
var jsonminify = require('gulp-jsonminify');
var minifycss = require('gulp-minify-css');
var minifyhtml = require('gulp-minify-html');
var nib = require('nib');
var stylus = require('gulp-stylus');
var zip = require('gulp-zip');

var version = '1.0.5';

var paths = {
  html: './*.html',
  stylus: './css/*.styl',
  js: './js/*.js',
  json: 'manifest.json',
  img: './img/*.png',
  vendor: [
    './bower_components/angular/angular-csp.css',
    './bower_components/jquery/dist/jquery.min.js',
    './bower_components/angular/angular.min.js',
    './bower_components/Sortable/Sortable.min.js',
    './bower_components/Sortable/ng-sortable.js'
  ]
};

var dest = './dist';

gulp.task('html', function () {
  return gulp.src(paths.html)
    .pipe(minifyhtml())
    .pipe(gulp.dest(dest));
});

gulp.task('css', function () {
  return gulp.src(paths.stylus)
    .pipe(stylus({use: [nib()], errors: true}))
    .pipe(minifycss())
    .pipe(gulp.dest(dest));
});

gulp.task('js', function () {
  return gulp.src(paths.js)
    .pipe(gulp.dest(dest));
});

gulp.task('json', function () {
  return gulp.src(paths.json)
    .pipe(jsonminify())
    .pipe(gulp.dest(dest));
})

gulp.task('img', function () {
  return gulp.src(paths.img)
    .pipe(imagemin())
    .pipe(gulp.dest(dest + '/img'));
});

gulp.task('vendor', function () {
  return gulp.src(paths.vendor)
    .pipe(gulp.dest(dest + '/vendor'));
});

gulp.task('watch', function () {
  gulp.watch(paths.html, ['html']);
  gulp.watch(paths.stylus, ['css']);
  gulp.watch(paths.js, ['js']);
  gulp.watch(paths.json, ['json']);
  gulp.watch(paths.img, ['img']);
  gulp.watch(paths.vendor, ['vendor']);
})

gulp.task('build', ['watch', 'html', 'css', 'js', 'json', 'img', 'vendor']);

gulp.task('zip', function () {
  return gulp.src(dest + '/*')
    .pipe(zip('tabio-' + version + '.zip'))
    .pipe(gulp.dest(dest));
});

/*
gulp.task('stylus', function () {
  gulp.src(paths.stylus)
    .pipe(stylus({use: [nib()], errors: true}))
    .pipe(gulp.dest('./css'));
});

gulp.task('minify', function() {
  gulp.src(paths.css)
    .pipe(minify())
    .pipe(gulp.dest('./css'));
});

gulp.task('watch', function () {
  gulp.watch(paths.stylus, ['stylus']);
  gulp.watch(paths.css, ['minify']);
});

gulp.task('default', ['watch', 'stylus', 'minify']);
*/
<commit_msg>Move zip files to project directory<commit_after>var gulp = require('gulp');

var imagemin = require('gulp-imagemin');
var jsonminify = require('gulp-jsonminify');
var minifycss = require('gulp-minify-css');
var minifyhtml = require('gulp-minify-html');
var nib = require('nib');
var stylus = require('gulp-stylus');
var zip = require('gulp-zip');

var version = '1.0.5';

var paths = {
  html: './*.html',
  stylus: './css/*.styl',
  js: './js/*.js',
  json: 'manifest.json',
  img: './img/*.png',
  vendor: [
    './bower_components/angular/angular-csp.css',
    './bower_components/jquery/dist/jquery.min.js',
    './bower_components/angular/angular.min.js',
    './bower_components/Sortable/Sortable.min.js',
    './bower_components/Sortable/ng-sortable.js'
  ]
};

var dest = './dist';

gulp.task('html', function () {
  return gulp.src(paths.html)
    .pipe(minifyhtml())
    .pipe(gulp.dest(dest));
});

gulp.task('css', function () {
  return gulp.src(paths.stylus)
    .pipe(stylus({use: [nib()], errors: true}))
    .pipe(minifycss())
    .pipe(gulp.dest(dest));
});

gulp.task('js', function () {
  return gulp.src(paths.js)
    .pipe(gulp.dest(dest));
});

gulp.task('json', function () {
  return gulp.src(paths.json)
    .pipe(jsonminify())
    .pipe(gulp.dest(dest));
})

gulp.task('img', function () {
  return gulp.src(paths.img)
    .pipe(imagemin())
    .pipe(gulp.dest(dest + '/img'));
});

gulp.task('vendor', function () {
  return gulp.src(paths.vendor)
    .pipe(gulp.dest(dest + '/vendor'));
});

gulp.task('watch', function () {
  gulp.watch(paths.html, ['html']);
  gulp.watch(paths.stylus, ['css']);
  gulp.watch(paths.js, ['js']);
  gulp.watch(paths.json, ['json']);
  gulp.watch(paths.img, ['img']);
  gulp.watch(paths.vendor, ['vendor']);
})

gulp.task('build', ['watch', 'html', 'css', 'js', 'json', 'img', 'vendor']);

gulp.task('zip', function () {
  return gulp.src(dest + '/*')
    .pipe(zip('tabio-' + version + '.zip'))
    .pipe(gulp.dest('./'));
});

/*
gulp.task('stylus', function () {
  gulp.src(paths.stylus)
    .pipe(stylus({use: [nib()], errors: true}))
    .pipe(gulp.dest('./css'));
});

gulp.task('minify', function() {
  gulp.src(paths.css)
    .pipe(minify())
    .pipe(gulp.dest('./css'));
});

gulp.task('watch', function () {
  gulp.watch(paths.stylus, ['stylus']);
  gulp.watch(paths.css, ['minify']);
});

gulp.task('default', ['watch', 'stylus', 'minify']);
*/
<|endoftext|>


<commit_before>var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var webpackConfig = require('./webpack.config.js');
var karma = require('karma').server;

gulp.task('styles', function () {
  return gulp
    .src('src/styles/*.scss')
    .pipe($.sass({ outputStyle: 'compressed' }))
    .pipe($.autoprefixer('last 2 version'))
    .pipe(gulp.dest('dist'));
});

gulp.task('scripts', function () {
  return gulp
    .src('src/app/app.js')
    .pipe($.webpack(webpackConfig))
    .pipe(gulp.dest('dist'));
});

gulp.task('lint', function () {
  return gulp
    .src(['src/app/**/*.js'])
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.eslint.failOnError());
});

gulp.task('watch', function () {
  gulp.watch('src/styles/*.scss', ['styles']);
  gulp.watch('src/**/*.js', ['scripts']);
});

gulp.task('test', function (done) {
  karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true
  }, done);
});

gulp.task('serve', ['default'], function () {
  browserSync({
    notify: false,
    port: 9000,
    server: {
      baseDir: ['.']
    }
  });

  gulp.watch(['dist/*.css', 'dist/*.js', 'index.html']).on('change', reload);
  gulp.run('watch');
});

gulp.task('default', ['styles', 'scripts']);
<commit_msg>[chore] add lint task to watch<commit_after>var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var webpackConfig = require('./webpack.config.js');
var karma = require('karma').server;

gulp.task('styles', function () {
  return gulp
    .src('src/styles/*.scss')
    .pipe($.sass({ outputStyle: 'compressed' }))
    .pipe($.autoprefixer('last 2 version'))
    .pipe(gulp.dest('dist'));
});

gulp.task('scripts', function () {
  return gulp
    .src('src/app/app.js')
    .pipe($.webpack(webpackConfig))
    .pipe(gulp.dest('dist'));
});

gulp.task('lint', function () {
  return gulp
    .src(['src/app/**/*.js'])
    .pipe($.eslint())
    .pipe($.eslint.format())
    /*.pipe($.eslint.failOnError())*/;
});

gulp.task('watch', function () {
  gulp.watch('src/styles/*.scss', ['styles']);
  gulp.watch('src/**/*.js', ['scripts']);
  gulp.watch('dist/app.min.js', ['lint']);
});

gulp.task('test', function (done) {
  karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true
  }, done);
});

gulp.task('serve', ['default'], function () {
  browserSync({
    notify: false,
    port: 9000,
    server: {
      baseDir: ['.']
    }
  });

  gulp.watch(['dist/*.css', 'dist/*.js', 'index.html']).on('change', reload);
  gulp.run('watch');
});

gulp.task('default', ['styles', 'scripts']);
<|endoftext|>


<commit_before>/*
 * Gulp tasks for compiling CSS and JavaScript.
 */

// Polyfill promises

require('es6-promise').polyfill()

var autoprefixer = require('autoprefixer')
  , browserify = require('browserify')
  , browserifyShim = require('browserify-shim')
  , buffer = require('vinyl-buffer')
  , del = require('del')
  , gulp = require('gulp')
  , postcss = require('gulp-postcss')
  , sass = require('gulp-sass')
  , source = require('vinyl-source-stream')
  , uglify = require('gulp-uglify')

// Change 'themeName' if you rename your theme

var themeName = 'finding-beyond'
  , srcPath = './public/app/themes/' + themeName + '/assets'
  , trgPath = './public/app/themes/' + themeName + '/assets/build'

// Removed compiled JavaScript

gulp.task('clean:js', function () {
    return del([trgPath + '/js/**'])
})

// Compile JavaScript with Browserify

gulp.task('build:js', ['clean:js'], function () {
    return browserify(srcPath + '/js/main.js')
        .transform(browserifyShim, { global: true })
        .bundle()
        .pipe(source('main.js'))
        .pipe(buffer())
        .pipe(uglify())
        .pipe(gulp.dest(trgPath + '/js'))
})

// Remove compiled CSS

gulp.task('clean:css', function () {
    return del([trgPath + '/css/**'])
})

// Compile Sass

gulp.task('build:css', ['clean:css'], function () {
    return gulp.src(srcPath + '/css/main.scss')
        .pipe(sass({
            includePaths: './node_modules/bootstrap/scss'
          , outputStyle: 'compressed'
        }).on('error', sass.logError))
        .pipe(postcss([
            autoprefixer({
                browsers: ['last 2 versions']
            })
        ]))
        .pipe(gulp.dest(trgPath + '/css'))
})

// Copy fonts

gulp.task('copy:fonts', ['clean:fonts'], function() {
    return gulp.src(srcPath + 'fonts/**')
        .pipe(gulp.dest(trgPath + 'fonts/'))
})

// Clean Fonts

gulp.task('clean:fonts', function(){
    return del([trgPath + '/fonts/**'])
})

// Main build task. Compile everything

gulp.task('build', ['build:js', 'build:css', 'copy:fonts'])

// Watch assets in development

gulp.task('watch', function () {
    gulp.watch(srcPath + '/js/**', ['build:js'])
    gulp.watch(srcPath + '/css/**', ['build:css'])
})

// Default task is build

gulp.task('default', ['build'])
<commit_msg>fonts copy gulp fix<commit_after>/*
 * Gulp tasks for compiling CSS and JavaScript.
 */

// Polyfill promises

require('es6-promise').polyfill()

var autoprefixer = require('autoprefixer')
  , browserify = require('browserify')
  , browserifyShim = require('browserify-shim')
  , buffer = require('vinyl-buffer')
  , del = require('del')
  , gulp = require('gulp')
  , postcss = require('gulp-postcss')
  , sass = require('gulp-sass')
  , source = require('vinyl-source-stream')
  , uglify = require('gulp-uglify')

// Change 'themeName' if you rename your theme

var themeName = 'finding-beyond'
  , srcPath = './public/app/themes/' + themeName + '/assets'
  , trgPath = './public/app/themes/' + themeName + '/assets/build'

// Removed compiled JavaScript

gulp.task('clean:js', function () {
    return del([trgPath + '/js/**'])
})

// Compile JavaScript with Browserify

gulp.task('build:js', ['clean:js'], function () {
    return browserify(srcPath + '/js/main.js')
        .transform(browserifyShim, { global: true })
        .bundle()
        .pipe(source('main.js'))
        .pipe(buffer())
        .pipe(uglify())
        .pipe(gulp.dest(trgPath + '/js'))
})

// Remove compiled CSS

gulp.task('clean:css', function () {
    return del([trgPath + '/css/**'])
})

// Compile Sass

gulp.task('build:css', ['clean:css'], function () {
    return gulp.src(srcPath + '/css/main.scss')
        .pipe(sass({
            includePaths: './node_modules/bootstrap/scss'
          , outputStyle: 'compressed'
        }).on('error', sass.logError))
        .pipe(postcss([
            autoprefixer({
                browsers: ['last 2 versions']
            })
        ]))
        .pipe(gulp.dest(trgPath + '/css'))
})

// Copy fonts

gulp.task('copy:fonts', ['clean:fonts'], function() {
    return gulp.src(srcPath + '/fonts/**')
        .pipe(gulp.dest(trgPath + '/fonts/'))
})

// Clean Fonts

gulp.task('clean:fonts', function(){
    return del([trgPath + '/fonts/**'])
})

// Main build task. Compile everything

gulp.task('build', ['build:js', 'build:css', 'copy:fonts'])

// Watch assets in development

gulp.task('watch', function () {
    gulp.watch(srcPath + '/js/**', ['build:js'])
    gulp.watch(srcPath + '/css/**', ['build:css'])
})

// Default task is build

gulp.task('default', ['build'])
<|endoftext|>