<commit_before>/**
 * gulpfile.js - Gulp-based build
 *
 * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
 */
"use strict";

var ARGV = require("yargs").
    usage("$0 [options] task [task ...]").
    option("browsers", {
      type: "string",
      describe: "browsers to run tests in",
      default: ""
    }).
    option("sauce", {
      type: "boolean",
      describe: "use SauceLabs for tests/reporting",
      default: false
    }).
    help("help").
    argv;

var browserify = require("browserify"),
    clone = require("lodash.clone"),
    gulp = require("gulp"),
    karma = require("karma"),
    merge = require("lodash.merge"),
    mocha = require("gulp-mocha"),
    istanbul = require("gulp-istanbul"),
    del = require("del"),
    runSequence = require("run-sequence");

// ### 'CONSTANTS' ###
var SOURCES = ["./lib/**/*.js", "!(./lib/old/**/*.js)"],
    TESTS = "./test/**/*-test.js";

// ### HELPERS ###
var MOCHA_CONFIG = {
  timeout: 600000
};

// ### LINT TASKS ###
function doEslint() {
  var eslint = require("gulp-eslint");

  return gulp.src([
    "lib/**/*.js",
    "test/**/*.js",
    "gulpfile.js"
  ])
    .pipe(eslint())
    .pipe(eslint.format());
}

gulp.task("eslint", function() {
  return doEslint();
});

gulp.task("test:lint", function() {
  var eslint = require("gulp-eslint");
  return doEslint()
    .pipe(eslint.failOnError());
});

// ### CLEAN TASKS ###
gulp.task("clean:coverage:nodejs", function() {
  del("coverage/nodejs");
});
gulp.task("clean:coverage:browser", function() {
  del("coverage/browser");
});
gulp.task("clean:coverage", function() {
  del("coverage");
});

gulp.task("clean:dist", function() {
  del("dist");
});

// ### NODEJS TASKS ###
function doTestsNodejs() {
  return gulp.src(TESTS).
              pipe(mocha(MOCHA_CONFIG));
}

gulp.task("test:nodejs:single", function() {
  return doTestsNodejs();
});

gulp.task("cover:nodejs", function() {
  return gulp.src(SOURCES).
              pipe(istanbul()).
              pipe(istanbul.hookRequire()).
              on("finish", function() {
                doTestsNodejs().
                pipe(istanbul.writeReports({
                  dir: "./coverage/nodejs",
                  reporters: ["html", "text-summary"]
                }));
              });
});

gulp.task("test:nodejs", function(cb) {
  runSequence("test:lint",
              "test:nodejs:single",
              cb);
});

// ### BROWSER TASKS ###
function doBrowserify(suffix, steps) {
  var source = require("vinyl-source-stream"),
      buffer = require("vinyl-buffer"),
      sourcemaps = require("gulp-sourcemaps");

  var pkg = require("./package.json");

  suffix = suffix || ".js";
  steps = steps || [];

  var stream = browserify({
    entries: require("path").resolve(pkg.main),
    standalone: "jose"
  }).bundle().
  pipe(source(pkg.name + suffix)).
  pipe(buffer());

  steps.forEach(function(s) {
    stream = stream.pipe(s);
  });

  return stream.pipe(sourcemaps.init({ loadMaps: true })).
                pipe(sourcemaps.write("./")).
                pipe(gulp.dest("./dist"));
}

gulp.task("bundle", function() {
  return doBrowserify();
});

gulp.task("minify", function() {
  var uglify = require("gulp-uglify");

  return doBrowserify(".min.js", [
    uglify()
  ]);
});

var KARMA_CONFIG = {
  frameworks: ["mocha", "browserify"],
  basePath: ".",
  browserDisconnectTolerance: 1,
  browserDisconnectTimeout: 600000,
  browserNoActivityTimeout: 600000,
  client: {
    mocha: MOCHA_CONFIG
  },
  preprocessors: {
    "test/**/*-test.js": ["browserify"]
  },
  reporters: ["mocha"],
  browserify: {
    debug: true
  },
  customLaunchers: {
    "SL_Chrome": {
      base: "SauceLabs",
      browserName: "chrome"
    },
    "SL_Firefox": {
      base: "SauceLabs",
      browserName: "firefox"
    },
    "SL_Safari": {
      base: "SauceLabs",
      platform: "OS X 10.9",
      browserName: "safari",
      version: "7"
    },
    "SL_IE": {
      base: "SauceLabs",
      browserName: "internet explorer",
      version: "10"
    }
  },
  captureTimeout: 600000,
  sauceLabs: {
    testName: "node-jose",
    commandTimeout: 300
  },
  files: [TESTS]
};
var KARMA_BROWSERS = {
  local: ["Chrome", "Firefox"],
  saucelabs: ["SL_Chrome", "SL_Firefox", "SL_IE", "SL_Safari"]
};
// allow for IE on windows
if (/^win/.test(process.platform)) {
  KARMA_BROWSERS.local.push("IE");
}
// allow for Safari on Mac OS X
if (/^darwin/.test(process.platform)) {
  KARMA_BROWSERS.local.push("Safari");
}

gulp.task("test:browser:single", function(done) {
  var browsers = ARGV.browsers.split(/\s*,\s*/g).
                 filter(function (v) { return v; });

  var config = merge({}, KARMA_CONFIG, {
    singleRun: true
  });
  if (ARGV.sauce) {
    config = merge(config, {
      reporters: ["mocha", "saucelabs"],
      browsers: KARMA_BROWSERS.saucelabs
    });
  } else {
    config.browsers = KARMA_BROWSERS.local;
  }
  if (browsers.length) {
    config.browsers = config.browsers.filter(function(b) {
      b = b.replace("SL_", "");
      return -1 !== browsers.indexOf(b);
    });
  }

  karma.server.start(config, done);
});

gulp.task("test:browser:watch", function(done) {
  var config = clone(KARMA_CONFIG);

  karma.server.start(config, done);
});

gulp.task("test:browser", function(cb) {
  runSequence("test:lint",
              "test:browser:single",
              cb);
});

// ### MAIN TASKS ###
gulp.task("test", function(cb) {
  runSequence("test:lint",
              "test:browser:single",
              "test:nodejs:single",
              cb);
});
gulp.task("coverage", function(cb) {
  runSequence("test:lint",
              "cover:nodejs",
              cb);
});
gulp.task("clean", ["clean:coverage", "clean:dist"]);
gulp.task("dist", function(cb) {
  runSequence("clean:dist",
              "test:lint",
              "test:browser",
              ["bundle", "minify"],
              cb);
});

// ### MAIN WATCHERS ###
gulp.task("watch:test", ["test"], function() {
  return gulp.watch([SOURCES, TESTS], ["test:nodejs", "test:browser"]);
});

// ### DEFAULT ###
gulp.task("default", ["test"]);
<commit_msg>Build: expand the saucelabs platforms<commit_after>/**
 * gulpfile.js - Gulp-based build
 *
 * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
 */
"use strict";

var ARGV = require("yargs").
    usage("$0 [options] task [task ...]").
    option("browsers", {
      type: "string",
      describe: "browsers to run tests in",
      default: ""
    }).
    option("sauce", {
      type: "boolean",
      describe: "use SauceLabs for tests/reporting",
      default: false
    }).
    help("help").
    argv;

var browserify = require("browserify"),
    clone = require("lodash.clone"),
    gulp = require("gulp"),
    karma = require("karma"),
    merge = require("lodash.merge"),
    mocha = require("gulp-mocha"),
    istanbul = require("gulp-istanbul"),
    del = require("del"),
    runSequence = require("run-sequence");

// ### 'CONSTANTS' ###
var SOURCES = ["./lib/**/*.js", "!(./lib/old/**/*.js)"],
    TESTS = "./test/**/*-test.js";

// ### HELPERS ###
var MOCHA_CONFIG = {
  timeout: 600000
};

// ### LINT TASKS ###
function doEslint() {
  var eslint = require("gulp-eslint");

  return gulp.src([
    "lib/**/*.js",
    "test/**/*.js",
    "gulpfile.js"
  ])
    .pipe(eslint())
    .pipe(eslint.format());
}

gulp.task("eslint", function() {
  return doEslint();
});

gulp.task("test:lint", function() {
  var eslint = require("gulp-eslint");
  return doEslint()
    .pipe(eslint.failOnError());
});

// ### CLEAN TASKS ###
gulp.task("clean:coverage:nodejs", function() {
  del("coverage/nodejs");
});
gulp.task("clean:coverage:browser", function() {
  del("coverage/browser");
});
gulp.task("clean:coverage", function() {
  del("coverage");
});

gulp.task("clean:dist", function() {
  del("dist");
});

// ### NODEJS TASKS ###
function doTestsNodejs() {
  return gulp.src(TESTS).
              pipe(mocha(MOCHA_CONFIG));
}

gulp.task("test:nodejs:single", function() {
  return doTestsNodejs();
});

gulp.task("cover:nodejs", function() {
  return gulp.src(SOURCES).
              pipe(istanbul()).
              pipe(istanbul.hookRequire()).
              on("finish", function() {
                doTestsNodejs().
                pipe(istanbul.writeReports({
                  dir: "./coverage/nodejs",
                  reporters: ["html", "text-summary"]
                }));
              });
});

gulp.task("test:nodejs", function(cb) {
  runSequence("test:lint",
              "test:nodejs:single",
              cb);
});

// ### BROWSER TASKS ###
function doBrowserify(suffix, steps) {
  var source = require("vinyl-source-stream"),
      buffer = require("vinyl-buffer"),
      sourcemaps = require("gulp-sourcemaps");

  var pkg = require("./package.json");

  suffix = suffix || ".js";
  steps = steps || [];

  var stream = browserify({
    entries: require("path").resolve(pkg.main),
    standalone: "jose"
  }).bundle().
  pipe(source(pkg.name + suffix)).
  pipe(buffer());

  steps.forEach(function(s) {
    stream = stream.pipe(s);
  });

  return stream.pipe(sourcemaps.init({ loadMaps: true })).
                pipe(sourcemaps.write("./")).
                pipe(gulp.dest("./dist"));
}

gulp.task("bundle", function() {
  return doBrowserify();
});

gulp.task("minify", function() {
  var uglify = require("gulp-uglify");

  return doBrowserify(".min.js", [
    uglify()
  ]);
});

var KARMA_CONFIG = {
  frameworks: ["mocha", "browserify"],
  basePath: ".",
  browserDisconnectTolerance: 1,
  browserDisconnectTimeout: 600000,
  browserNoActivityTimeout: 600000,
  client: {
    mocha: MOCHA_CONFIG
  },
  preprocessors: {
    "test/**/*-test.js": ["browserify"]
  },
  reporters: ["mocha"],
  browserify: {
    debug: true
  },
  customLaunchers: {
    "SL_Chrome": {
      base: "SauceLabs",
      browserName: "chrome"
    },
    "SL_Firefox": {
      base: "SauceLabs",
      browserName: "firefox"
    },
    "SL_Safari_7": {
      base: "SauceLabs",
      platform: "OS X 10.9",
      browserName: "safari",
      version: "7"
    },
    "SL_Safari_8": {
      base: "SauceLabs",
      platform: "OS X 10.10",
      browserName: "safari",
      version: "8"
    },
    "SL_Safari_9": {
      base: "SauceLabs",
      platform: "OS X 10.11",
      browserName: "safari",
      version: "9"
    },
    "SL_IE_10": {
      base: "SauceLabs",
      browserName: "internet explorer",
      version: "10"
    },
    "SL_IE_11": {
      base: "SauceLabs",
      browserName: "internet explorer",
      platform: "Windows 8.1",
      version: "11"
    },
    "SL_EDGE": {
      base: "SauceLabs",
      browserName: "microsoftedge",
      platform: "Windows 10"
    }
  },
  captureTimeout: 600000,
  sauceLabs: {
    testName: "node-jose",
    commandTimeout: 300
  },
  files: [TESTS]
};
var KARMA_BROWSERS = {
  local: ["Chrome", "Firefox"],
  saucelabs: ["SL_Chrome", "SL_Firefox", "SL_Safari_7", "SL_Safari_8", "SL_Safari_9", "SL_IE_10", "SL_IE_11"]
};
// allow for IE on windows
if (/^win/.test(process.platform)) {
  KARMA_BROWSERS.local.push("IE");
}
// allow for Safari on Mac OS X
if (/^darwin/.test(process.platform)) {
  KARMA_BROWSERS.local.push("Safari");
}

gulp.task("test:browser:single", function(done) {
  var browsers = ARGV.browsers.split(/\s*,\s*/g).
                 filter(function (v) { return v; });

  var config = merge({}, KARMA_CONFIG, {
    singleRun: true
  });
  if (ARGV.sauce) {
    config = merge(config, {
      reporters: ["mocha", "saucelabs"],
      browsers: KARMA_BROWSERS.saucelabs
    });
  } else {
    config.browsers = KARMA_BROWSERS.local;
  }
  if (browsers.length) {
    config.browsers = config.browsers.filter(function(b) {
      b = b.replace("SL_", "").toLowerCase();
      var found = false,
          asked;
      for (var idx = 0; !found && browsers.length > idx; idx++) {
        asked = browsers[idx].toLowerCase();
        found = (0 === b.indexOf(asked));
      }
      return found;
    });
  }

  karma.server.start(config, done);
});

gulp.task("test:browser:watch", function(done) {
  var config = clone(KARMA_CONFIG);

  karma.server.start(config, done);
});

gulp.task("test:browser", function(cb) {
  runSequence("test:lint",
              "test:browser:single",
              cb);
});

// ### MAIN TASKS ###
gulp.task("test", function(cb) {
  runSequence("test:lint",
              "test:browser:single",
              "test:nodejs:single",
              cb);
});
gulp.task("coverage", function(cb) {
  runSequence("test:lint",
              "cover:nodejs",
              cb);
});
gulp.task("clean", ["clean:coverage", "clean:dist"]);
gulp.task("dist", function(cb) {
  runSequence("clean:dist",
              "test:lint",
              "test:browser",
              ["bundle", "minify"],
              cb);
});

// ### MAIN WATCHERS ###
gulp.task("watch:test", ["test"], function() {
  return gulp.watch([SOURCES, TESTS], ["test:nodejs", "test:browser"]);
});

// ### DEFAULT ###
gulp.task("default", ["test"]);
<|endoftext|>


<commit_before>/**
 * Gulp tasks for development and production.
 *
 * Run
 *
 *      $ ./node_modules/.bin/gulp
 *
 * for development and
 *
 *      $ ./node_modules/.bin/gulp --production
 *
 * for production mode.
 */

// TODO: Remove the next line when support for Node 0.10.x is dropped.
// See https://github.com/postcss/postcss#nodejs-010-and-the-promise-api
require('es6-promise').polyfill();

var argv = require('yargs').argv,
    gulp = require('gulp'),
    concat = require('gulp-concat'),
    cssnano = require('gulp-cssnano'),
    gulpif = require('gulp-if'),
    gettext = require('gulp-angular-gettext'),
    jshint = require('gulp-jshint'),
    mainBowerFiles = require('main-bower-files'),
    path = require('path'),
    rename = require('gulp-rename'),
    sourcemaps = require('gulp-sourcemaps'),
    templateCache = require('gulp-angular-templatecache'),
    through = require('through2'),
    uglify = require('gulp-uglify'),
    vsprintf = require('sprintf-js').vsprintf;

// Directory where the results go to
var output_directory = path.join('openslides', 'static');

/**
 * Default tasks to be run before start.
 */

// Catches all JavaScript files from all core apps and concats them to one
// file js/openslides.js. In production mode the file is uglified.
gulp.task('js', function () {
    return gulp.src(path.join('openslides', '*', 'static', 'js', '**', '*.js'))
        .pipe(sourcemaps.init())
        .pipe(concat('openslides.js'))
        .pipe(sourcemaps.write())
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'js')));
});

// Catches all JavaScript files from all bower components and concats them to
// one file js/openslides-libs.js. In production mode the file is uglified.
gulp.task('js-libs', function () {
    return gulp.src(mainBowerFiles({
            filter: /\.js$/
        }))
        .pipe(sourcemaps.init())
        .pipe(concat('openslides-libs.js'))
        .pipe(sourcemaps.write())
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'js')));
});

// Catches all template files from all core apps and concats them to one
// file js/openslides-templates.js. In production mode the file is uglified.
gulp.task('templates', function () {
    return gulp.src(path.join('openslides', '*', 'static', 'templates', '**', '*.html'))
        .pipe(templateCache('openslides-templates.js', {
            module: 'OpenSlidesApp-templates',
            standalone: true,
            moduleSystem: 'IIFE',
            transformUrl: function (url) {
                var pathList = url.split(path.sep);
                pathList.shift();
                return pathList.join(path.sep);
            },
        }))
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'js')));
});

// Catches all CSS files from all bower components and concats them to one file
// css/openslides-libs.css. In production mode the file is uglified.
gulp.task('css-libs', function () {
    return gulp.src(mainBowerFiles({
            filter: /\.css$/
        }))
        .pipe(concat('openslides-libs.css'))
        .pipe(gulpif(argv.production, cssnano({discardUnused: false})))
        .pipe(gulp.dest(path.join(output_directory, 'css')));
});

// Catches all font files from all bower components.
gulp.task('fonts-libs', function() {
    return gulp.src(mainBowerFiles({
            filter: /\.(eot)|(svg)|(ttf)|(woff)|(woff2)$/
        }))
        .pipe(gulp.dest(path.join(output_directory, 'fonts')));
});

// Catches image files for angular-chosen.
gulp.task('angular-chosen-img', function () {
    return gulp.src(path.join('bower_components', 'chosen', '*.png'))
        .pipe(gulp.dest(path.join(output_directory, 'css')));
});

// Catches all skins files for TinyMCE editor.
gulp.task('tinymce-skins', function () {
    return gulp.src(path.join('bower_components', 'tinymce-dist', 'skins', '**'))
        .pipe(gulp.dest(path.join(output_directory, 'tinymce', 'skins')));
});

// Catches all required i18n files for TinyMCE editor.
gulp.task('tinymce-i18n', function () {
    return gulp.src([
            'bower_components/tinymce-i18n/langs/en_GB.js',
            'bower_components/tinymce-i18n/langs/cs.js',
            'bower_components/tinymce-i18n/langs/de.js',
            'bower_components/tinymce-i18n/langs/es.js',
            'bower_components/tinymce-i18n/langs/fr_FR.js',
            'bower_components/tinymce-i18n/langs/pt_PT.js',
            ])
        .pipe(rename(function (path) {
            if (path.basename === 'en_GB') {
                path.basename = 'en';
            } else if (path.basename === 'fr_FR') {
                path.basename = 'fr';
            } else if (path.basename === 'pt_PT') {
                path.basename = 'pt';
            }
        }))
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'tinymce', 'i18n')));
});

// Combines all TinyMCE related tasks.
gulp.task('tinymce', ['tinymce-skins', 'tinymce-i18n'], function () {});

// Compiles translation files (*.po) to *.json and saves them in the directory
// openslides/static/i18n/.
gulp.task('translations', function () {
    return gulp.src(path.join('openslides', 'locale', 'angular-gettext', '*.po'))
        .pipe(gettext.compile({
            format: 'json'
        }))
        .pipe(gulp.dest(path.join(output_directory, 'i18n')));
});

// Gulp default task. Runs all other tasks before.
gulp.task('default', ['js', 'js-libs', 'templates', 'css-libs', 'fonts-libs', 'tinymce', 'angular-chosen-img', 'translations'], function () {});

/**
 * Extra tasks that have to be called manually. Useful for development.
 */

// Watches changes in JavaScript and templates.
gulp.task('watch', ['js', 'templates'], function () {
    gulp.watch(path.join('openslides', '*', 'static', 'js', '**', '*.js'), ['js']);
    gulp.watch(path.join('openslides', '*', 'static', 'templates', '**', '*.html'), ['templates']);
});

// Extracts translatable strings using angular-gettext and saves them in file
// openslides/locale/angular-gettext/template-en.pot.
gulp.task('pot', function () {
    return gulp.src([
            'openslides/core/static/templates/*.html',
            'openslides/*/static/templates/*/*.html',
            'openslides/*/static/js/*/*.js',
        ])
        .pipe(gettext.extract('template-en.pot', {}))
        .pipe(gulp.dest('openslides/locale/angular-gettext/'));
});

// Checks JavaScript using JSHint
gulp.task('jshint', function () {
    return gulp.src([
            'gulpfile.js',
            path.join( 'openslides', '*', 'static', '**', '*.js' ),
        ])
        .pipe(jshint())
        .pipe(jshint.reporter('default'))
        .pipe(jshint.reporter('fail'));
});

// Extracts names, URLs and licensed of all uses bower components and prints
// it to the console. This is useful to update the README.rst during release
// process.
gulp.task('bower-components-for-readme', function () {
    var files = [];
    return gulp.src([
            path.join('bower_components', '*', 'bower.json'),
            path.join('bower_components', '*', 'package.json'),
            path.join('bower_components', '*', 'component.json'),
        ])
        .pipe(
            through.obj(
                function (chunk, encoding, callback) {
                    files.push(chunk);
                    callback();
                },
                function (callback) {
                    // Extract JSON from bower.json or components.json file.
                    var extracted = [];
                    for (var index = 0; index < files.length; index++) {
                        extracted.push(JSON.parse(files[index].contents.toString()));
                    }
                    // Sort files.
                    extracted.sort(function (a, b) {
                        return a.name < b.name ? -1 : 1;
                    });
                    // Print out line for README.rst.
                    for (var index2 = 0; index2 < extracted.length; index2++) {
                        var data = [
                            extracted[index2].name,
                            extracted[index2].homepage,
                            extracted[index2].license,
                        ];
                        console.log(vsprintf('  * `%s <%s>`_, License: %s', data));
                    }
                    // End stream without further file processing.
                    callback();
                }
            )
        );
});
<commit_msg>Fixed tinymce gulp task<commit_after>/**
 * Gulp tasks for development and production.
 *
 * Run
 *
 *      $ ./node_modules/.bin/gulp
 *
 * for development and
 *
 *      $ ./node_modules/.bin/gulp --production
 *
 * for production mode.
 */

// TODO: Remove the next line when support for Node 0.10.x is dropped.
// See https://github.com/postcss/postcss#nodejs-010-and-the-promise-api
require('es6-promise').polyfill();

var argv = require('yargs').argv,
    gulp = require('gulp'),
    concat = require('gulp-concat'),
    cssnano = require('gulp-cssnano'),
    gulpif = require('gulp-if'),
    gettext = require('gulp-angular-gettext'),
    jshint = require('gulp-jshint'),
    mainBowerFiles = require('main-bower-files'),
    path = require('path'),
    rename = require('gulp-rename'),
    sourcemaps = require('gulp-sourcemaps'),
    templateCache = require('gulp-angular-templatecache'),
    through = require('through2'),
    uglify = require('gulp-uglify'),
    vsprintf = require('sprintf-js').vsprintf;

// Directory where the results go to
var output_directory = path.join('openslides', 'static');

/**
 * Default tasks to be run before start.
 */

// Catches all JavaScript files from all core apps and concats them to one
// file js/openslides.js. In production mode the file is uglified.
gulp.task('js', function () {
    return gulp.src(path.join('openslides', '*', 'static', 'js', '**', '*.js'))
        .pipe(sourcemaps.init())
        .pipe(concat('openslides.js'))
        .pipe(sourcemaps.write())
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'js')));
});

// Catches all JavaScript files from all bower components and concats them to
// one file js/openslides-libs.js. In production mode the file is uglified.
gulp.task('js-libs', function () {
    return gulp.src(mainBowerFiles({
            filter: /\.js$/
        }))
        .pipe(sourcemaps.init())
        .pipe(concat('openslides-libs.js'))
        .pipe(sourcemaps.write())
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'js')));
});

// Catches all template files from all core apps and concats them to one
// file js/openslides-templates.js. In production mode the file is uglified.
gulp.task('templates', function () {
    return gulp.src(path.join('openslides', '*', 'static', 'templates', '**', '*.html'))
        .pipe(templateCache('openslides-templates.js', {
            module: 'OpenSlidesApp-templates',
            standalone: true,
            moduleSystem: 'IIFE',
            transformUrl: function (url) {
                var pathList = url.split(path.sep);
                pathList.shift();
                return pathList.join(path.sep);
            },
        }))
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'js')));
});

// Catches all CSS files from all bower components and concats them to one file
// css/openslides-libs.css. In production mode the file is uglified.
gulp.task('css-libs', function () {
    return gulp.src(mainBowerFiles({
            filter: /\.css$/
        }))
        .pipe(concat('openslides-libs.css'))
        .pipe(gulpif(argv.production, cssnano({discardUnused: false})))
        .pipe(gulp.dest(path.join(output_directory, 'css')));
});

// Catches all font files from all bower components.
gulp.task('fonts-libs', function() {
    return gulp.src(mainBowerFiles({
            filter: /\.(eot)|(svg)|(ttf)|(woff)|(woff2)$/
        }))
        .pipe(gulp.dest(path.join(output_directory, 'fonts')));
});

// Catches image files for angular-chosen.
gulp.task('angular-chosen-img', function () {
    return gulp.src(path.join('bower_components', 'chosen', '*.png'))
        .pipe(gulp.dest(path.join(output_directory, 'css')));
});

// Catches all skins files for TinyMCE editor.
gulp.task('tinymce-skins', function () {
    return gulp.src(path.join('bower_components', 'tinymce', 'skins', '**'))
        .pipe(gulp.dest(path.join(output_directory, 'tinymce', 'skins')));
});

// Catches all required i18n files for TinyMCE editor.
gulp.task('tinymce-i18n', function () {
    return gulp.src([
            'bower_components/tinymce-i18n/langs/en_GB.js',
            'bower_components/tinymce-i18n/langs/cs.js',
            'bower_components/tinymce-i18n/langs/de.js',
            'bower_components/tinymce-i18n/langs/es.js',
            'bower_components/tinymce-i18n/langs/fr_FR.js',
            'bower_components/tinymce-i18n/langs/pt_PT.js',
            ])
        .pipe(rename(function (path) {
            if (path.basename === 'en_GB') {
                path.basename = 'en';
            } else if (path.basename === 'fr_FR') {
                path.basename = 'fr';
            } else if (path.basename === 'pt_PT') {
                path.basename = 'pt';
            }
        }))
        .pipe(gulpif(argv.production, uglify()))
        .pipe(gulp.dest(path.join(output_directory, 'tinymce', 'i18n')));
});

// Combines all TinyMCE related tasks.
gulp.task('tinymce', ['tinymce-skins', 'tinymce-i18n'], function () {});

// Compiles translation files (*.po) to *.json and saves them in the directory
// openslides/static/i18n/.
gulp.task('translations', function () {
    return gulp.src(path.join('openslides', 'locale', 'angular-gettext', '*.po'))
        .pipe(gettext.compile({
            format: 'json'
        }))
        .pipe(gulp.dest(path.join(output_directory, 'i18n')));
});

// Gulp default task. Runs all other tasks before.
gulp.task('default', ['js', 'js-libs', 'templates', 'css-libs', 'fonts-libs', 'tinymce', 'angular-chosen-img', 'translations'], function () {});

/**
 * Extra tasks that have to be called manually. Useful for development.
 */

// Watches changes in JavaScript and templates.
gulp.task('watch', ['js', 'templates'], function () {
    gulp.watch(path.join('openslides', '*', 'static', 'js', '**', '*.js'), ['js']);
    gulp.watch(path.join('openslides', '*', 'static', 'templates', '**', '*.html'), ['templates']);
});

// Extracts translatable strings using angular-gettext and saves them in file
// openslides/locale/angular-gettext/template-en.pot.
gulp.task('pot', function () {
    return gulp.src([
            'openslides/core/static/templates/*.html',
            'openslides/*/static/templates/*/*.html',
            'openslides/*/static/js/*/*.js',
        ])
        .pipe(gettext.extract('template-en.pot', {}))
        .pipe(gulp.dest('openslides/locale/angular-gettext/'));
});

// Checks JavaScript using JSHint
gulp.task('jshint', function () {
    return gulp.src([
            'gulpfile.js',
            path.join( 'openslides', '*', 'static', '**', '*.js' ),
        ])
        .pipe(jshint())
        .pipe(jshint.reporter('default'))
        .pipe(jshint.reporter('fail'));
});

// Extracts names, URLs and licensed of all uses bower components and prints
// it to the console. This is useful to update the README.rst during release
// process.
gulp.task('bower-components-for-readme', function () {
    var files = [];
    return gulp.src([
            path.join('bower_components', '*', 'bower.json'),
            path.join('bower_components', '*', 'package.json'),
            path.join('bower_components', '*', 'component.json'),
        ])
        .pipe(
            through.obj(
                function (chunk, encoding, callback) {
                    files.push(chunk);
                    callback();
                },
                function (callback) {
                    // Extract JSON from bower.json or components.json file.
                    var extracted = [];
                    for (var index = 0; index < files.length; index++) {
                        extracted.push(JSON.parse(files[index].contents.toString()));
                    }
                    // Sort files.
                    extracted.sort(function (a, b) {
                        return a.name < b.name ? -1 : 1;
                    });
                    // Print out line for README.rst.
                    for (var index2 = 0; index2 < extracted.length; index2++) {
                        var data = [
                            extracted[index2].name,
                            extracted[index2].homepage,
                            extracted[index2].license,
                        ];
                        console.log(vsprintf('  * `%s <%s>`_, License: %s', data));
                    }
                    // End stream without further file processing.
                    callback();
                }
            )
        );
});
<|endoftext|>


<commit_before>"use strict";

var path = {
  from: {
    protos: {
      css: './css/*.css'
    },
    src: {
      html: './src/*.html',
      css: './src/css/*.css',
      img: './src/img/*.*',
      js: './src/js/*.*'
    },
    examples: {
      html: './examples/*.html',
      css: './examples/css/*.css',
      img: './examples/img/*.*',
      js: './npm /js/*.*'
    }
  },
  dest: {
    protos_build: {
      css: './src/css'
    },
    protos_examples: {
      css: './examples/css'
    },
    src: {
      html: './build/',
      css: './build/css',
      img: './build/img',
      js: './build/js'
    },
    examples: {
      html: './build-examples/',
      css: './build-examples/css',
      img: './build-examples/img',
      js:'./build-examples/js'
    },
  }
}

var gulp = require('gulp');
var rigger = require('gulp-rigger');
var watch = require('gulp-watch');

gulp.task('protos', function () {
    gulp.src(path.from.protos.css)
        .pipe(gulp.dest(path.dest.protos_build.css))
  /*  gulp.src('./css/*.css')
        .pipe(gulp.dest('./src/css'))*/
});

gulp.task('protos-example', function () {
    gulp.src(path.from.protos.css)
        .pipe(gulp.dest(path.dest.protos_examples.css))
});

gulp.task('html', function () {
    gulp.src(path.from.src.html)
        .pipe(rigger())
        .pipe(gulp.dest(path.dest.src.html))
});

gulp.task('css', function () {
    gulp.src(path.from.src.css)
        .pipe(gulp.dest(path.dest.src.css))
});

gulp.task('img', function () {
    gulp.src(path.from.src.img)
        .pipe(gulp.dest(path.dest.src.img))
});

gulp.task('js', function () {
    gulp.src(path.from.src.js)
        .pipe(gulp.dest(path.dest.src.js))
});

gulp.task('html-example', function () {
    gulp.src(path.from.examples.html)
        .pipe(rigger())
        .pipe(gulp.dest(path.dest.examples.html))
});

gulp.task('css-example', function () {
    gulp.src(path.from.examples.css)
        .pipe(gulp.dest(path.dest.examples.css))
});

gulp.task('img-example', function () {
    gulp.src(path.from.examples.img)
        .pipe(gulp.dest(path.dest.examples.img))
});

gulp.task('js-example', function () {
    gulp.src(path.from.examples.js)
        .pipe(gulp.dest(path.from.examples.js))
});

gulp.task('watch', function() {
  watch('./css/*.css', function(event, cb) {
    gulp.start('protos');
  });
  watch('./css/*.css', function(event, cb) {
    gulp.start('protos-example');
  });
  watch('./src/**/*.html', function(event, cb) {
    gulp.start('html');
  });
  watch('./src/css/*.css', function(event, cb) {
    gulp.start('css');
  });
  watch('./src/img/*.*', function(event, cb) {
    gulp.start('img');
  });
  watch('./src/js/*.*', function(event, cb) {
    gulp.start('js');
  });
  watch('./examples/**/*.html', function(event, cb) {
    gulp.start('html-example');
  });
  watch('./examples/*.css', function(event, cb) {
    gulp.start('css-example');
  });
  watch('./examples/img/*.*', function(event, cb) {
    gulp.start('img-example');
  });
  watch('./examples/js/*.*', function(event, cb) {
    gulp.start('js-example');
  });
});

gulp.task('default', ['watch', 'protos', 'protos-example', 'html', 'css', 'js', 'img', 'html-example', 'css-example', 'img-example', 'js-example',]);
<commit_msg>remove old code<commit_after>"use strict";

var path = {
  from: {
    protos: {
      css: './css/*.css'
    },
    src: {
      html: './src/*.html',
      css: './src/css/*.css',
      img: './src/img/*.*',
      js: './src/js/*.*'
    },
    examples: {
      html: './examples/*.html',
      css: './examples/css/*.css',
      img: './examples/img/*.*',
      js: './npm /js/*.*'
    }
  },
  dest: {
    protos_build: {
      css: './src/css'
    },
    protos_examples: {
      css: './examples/css'
    },
    src: {
      html: './build/',
      css: './build/css',
      img: './build/img',
      js: './build/js'
    },
    examples: {
      html: './build-examples/',
      css: './build-examples/css',
      img: './build-examples/img',
      js:'./build-examples/js'
    },
  }
}

var gulp = require('gulp');
var rigger = require('gulp-rigger');
var watch = require('gulp-watch');

gulp.task('protos', function () {
    gulp.src(path.from.protos.css)
        .pipe(gulp.dest(path.dest.protos_build.css))
});

gulp.task('protos-example', function () {
    gulp.src(path.from.protos.css)
        .pipe(gulp.dest(path.dest.protos_examples.css))
});

gulp.task('html', function () {
    gulp.src(path.from.src.html)
        .pipe(rigger())
        .pipe(gulp.dest(path.dest.src.html))
});

gulp.task('css', function () {
    gulp.src(path.from.src.css)
        .pipe(gulp.dest(path.dest.src.css))
});

gulp.task('img', function () {
    gulp.src(path.from.src.img)
        .pipe(gulp.dest(path.dest.src.img))
});

gulp.task('js', function () {
    gulp.src(path.from.src.js)
        .pipe(gulp.dest(path.dest.src.js))
});

gulp.task('html-example', function () {
    gulp.src(path.from.examples.html)
        .pipe(rigger())
        .pipe(gulp.dest(path.dest.examples.html))
});

gulp.task('css-example', function () {
    gulp.src(path.from.examples.css)
        .pipe(gulp.dest(path.dest.examples.css))
});

gulp.task('img-example', function () {
    gulp.src(path.from.examples.img)
        .pipe(gulp.dest(path.dest.examples.img))
});

gulp.task('js-example', function () {
    gulp.src(path.from.examples.js)
        .pipe(gulp.dest(path.from.examples.js))
});

gulp.task('watch', function() {
  watch('./css/*.css', function(event, cb) {
    gulp.start('protos');
  });
  watch('./css/*.css', function(event, cb) {
    gulp.start('protos-example');
  });
  watch('./src/**/*.html', function(event, cb) {
    gulp.start('html');
  });
  watch('./src/css/*.css', function(event, cb) {
    gulp.start('css');
  });
  watch('./src/img/*.*', function(event, cb) {
    gulp.start('img');
  });
  watch('./src/js/*.*', function(event, cb) {
    gulp.start('js');
  });
  watch('./examples/**/*.html', function(event, cb) {
    gulp.start('html-example');
  });
  watch('./examples/*.css', function(event, cb) {
    gulp.start('css-example');
  });
  watch('./examples/img/*.*', function(event, cb) {
    gulp.start('img-example');
  });
  watch('./examples/js/*.*', function(event, cb) {
    gulp.start('js-example');
  });
});

gulp.task('default', ['watch', 'protos', 'protos-example', 'html', 'css', 'js', 'img', 'html-example', 'css-example', 'img-example', 'js-example',]);
<|endoftext|>


<commit_before>(function() {
  "use strict";

  var path = require("path");
  var gulp = require("gulp");
  var concat = require("gulp-concat");
  var jscs = require("gulp-jscs");
  var eslint = require("gulp-eslint");
  var connect = require("gulp-connect");
  var indent = require("gulp-indent");
  var trimlines = require("gulp-trimlines");
  var wrap = require("gulp-wrap");
  var karma = require("karma").server;

  var adapters = [
    "jquery",
    "prototype",
    "yui3"
  ];

  gulp.task("server", function() {
    connect.server({
      root: ["test/manual", "."],
      livereload: true
    });
  });

  gulp.task("build", function() {
    return gulp.src([
      "src/data.js",
      "src/mode.js",
      "src/utils.js",
      "src/support.js",
      "src/elements.js",
      "src/polyfill.js",
      "src/events.js",
      "src/main.js",
      "src/module.js"
    ])
    .pipe(indent({
      amount: 2
    }))
    .pipe(concat("placekeeper.js"))
    .pipe(wrap("(function(global) {\n  \"use strict\";\n\n  var placekeeper = {};\n\n<%= contents %>\n}(this));\n\n"))
    .pipe(trimlines({
      leading: false
    }))
    .pipe(gulp.dest("dist"));
  });

  function buildAdapter(adapter) {
    return gulp.src([
      "dist/placekeeper.js",
      "src/adapters/adapter." + adapter + ".js"
    ])
    .pipe(concat("placekeeper." + adapter + ".js"))
    .pipe(gulp.dest("dist"));
  }

  gulp.task("adapters", function() {
    return adapters.forEach(buildAdapter);
  });

  gulp.task("lint", function() {
    return gulp.src("src/*.js")
               .pipe(eslint({
                 useEslintrc: true
               }))
               .pipe(eslint.format())
               .pipe(eslint.failAfterError())
               .pipe(jscs());
  });

  gulp.task("default", ["lint"]);

  gulp.task("test", function(done) {
    karma.start({
      configFile: path.join(__dirname, "/config/karma.conf.js"),
      singleRun: true
    }, done);
  });

  gulp.task("tdd", function(done) {
    karma.start({
      configFile: path.join(__dirname, "/config/karma.conf.js"),
      singleRun: false,
      autoWatch: true
    }, done);
  });

}());
<commit_msg>Fix build task [ci skip]<commit_after>(function() {
  "use strict";

  var path = require("path");
  var gulp = require("gulp");
  var concat = require("gulp-concat");
  var jscs = require("gulp-jscs");
  var eslint = require("gulp-eslint");
  var connect = require("gulp-connect");
  var indent = require("gulp-indent");
  var trimlines = require("gulp-trimlines");
  var wrap = require("gulp-wrap");
  var karma = require("karma").server;

  var adapters = [
    "jquery",
    "prototype",
    "yui3"
  ];

  gulp.task("server", function() {
    connect.server({
      root: ["test/manual", "."],
      livereload: true
    });
  });

  gulp.task("source", function() {
    return gulp.src([
      "src/data.js",
      "src/mode.js",
      "src/utils.js",
      "src/support.js",
      "src/elements.js",
      "src/polyfill.js",
      "src/events.js",
      "src/main.js",
      "src/module.js"
    ])
    .pipe(indent({
      amount: 2
    }))
    .pipe(concat("placekeeper.js"))
    .pipe(wrap("(function(global) {\n  \"use strict\";\n\n  var placekeeper = {};\n\n<%= contents %>\n}(this));\n\n"))
    .pipe(trimlines({
      leading: false
    }))
    .pipe(gulp.dest("dist"));
  });

  function buildAdapter(adapter) {
    return gulp.src([
      "dist/placekeeper.js",
      "src/adapters/adapter." + adapter + ".js"
    ])
    .pipe(concat("placekeeper." + adapter + ".js"))
    .pipe(gulp.dest("dist"));
  }

  gulp.task("adapters", function() {
    return adapters.forEach(buildAdapter);
  });

  gulp.task("build", ["source", "adapters"]);

  gulp.task("lint", function() {
    return gulp.src("src/*.js")
               .pipe(eslint({
                 useEslintrc: true
               }))
               .pipe(eslint.format())
               .pipe(eslint.failAfterError())
               .pipe(jscs());
  });

  gulp.task("default", ["lint"]);

  gulp.task("test", function(done) {
    karma.start({
      configFile: path.join(__dirname, "/config/karma.conf.js"),
      singleRun: true
    }, done);
  });

  gulp.task("tdd", function(done) {
    karma.start({
      configFile: path.join(__dirname, "/config/karma.conf.js"),
      singleRun: false,
      autoWatch: true
    }, done);
  });

}());
<|endoftext|>


<commit_before>'use strict';

var gulp = require('gulp');
var chef = require('gulp-chef');

var browserSync = require('browser-sync');
var ghpages = require('gulp-gh-pages');

var ingredients = {
	src: 'src/',
	dest: 'dist/',
	clean: {},
	deploy: {
		src: {
			globs: '{{dest.path}}**/*',
			options: {
				join: ''
			}
		},
		config: {
			options: {
				remoteUrl: 'git@github.com:gulp-cookery/gulp-chef.git',
				branch: 'gh-pages'
			}
		},
		task: deploy
	},
	make: {
		script: {
			recipe: 'browserify',
			bundle: {
				entry: 'index.js',
				file: 'scripts.js',
				transform: ['stringify', 'browserify-shim'],
				uglify: true
			}
		},
		style: {
			src: 'styles.css',
			recipe: 'postcss',
			processors: {
				import: {},
				cssnext: {
					features: {
						autoprefixer: {
							browser: 'last 2 versions'
						}
					}
				},
				bem: {},
				lost: {},
				cssnano: {}
			}
		},
		markup: {
			src: 'index.html',
			recipe: 'copy'
		},
		assets: {
			src: {
				globs: [
					'favicon.ico',
					'opensearch.xml',
					'gulp-chef-white-text.svg'
				]
			},
			task: assets
		}
	},
	build: ['clean', 'make'],
	serve: ['build', watch],
	default: 'build'
};

var meals = chef(ingredients);

gulp.registry(meals);

function watch() {
	browserSync.init({
		server: this.config.dest.path
	});

	gulp.watch(this.config.src.globs[0] + '**/*', gulp.parallel(gulp.task('make'), browserSync.reload));
}

function deploy() {
	var config = this.config;

	return gulp.src(config.src.globs, config.src.options)
		.pipe(ghpages(config.options));
}

function assets() {
	var config = this.config;

	return gulp.src(config.src.globs, config.src.options)
		.pipe(gulp.dest(config.dest.path))
		.pipe(browserSync.stream());
}
<commit_msg>gulp: use conditional config<commit_after>'use strict';

var gulp = require('gulp');
var chef = require('gulp-chef');

var browserSync = require('browser-sync');
var ghpages = require('gulp-gh-pages');

var ingredients = {
	src: 'src/',
	dest: 'dist/',
	clean: {},
	deploy: {
		src: {
			globs: '{{dest.path}}**/*',
			options: {
				join: ''
			}
		},
		config: {
			options: {
				remoteUrl: 'git@github.com:gulp-cookery/gulp-chef.git',
				branch: 'gh-pages'
			}
		},
		task: deploy
	},
	make: {
		script: {
			recipe: 'browserify',
			bundle: {
				entry: 'index.js',
				file: 'scripts.js',
				transform: ['stringify', 'browserify-shim'],
				production: {
					uglify: true
				}
			}
		},
		style: {
			src: 'styles.css',
			recipe: 'postcss',
			processors: {
				import: {},
				cssnext: {
					features: {
						autoprefixer: {
							browser: 'last 2 versions'
						}
					}
				},
				bem: {},
				lost: {},
				production: {
					cssnano: {}
				}
			}
		},
		markup: {
			src: 'index.html',
			recipe: 'copy'
		},
		assets: {
			src: {
				globs: [
					'favicon.ico',
					'opensearch.xml',
					'gulp-chef-white-text.svg'
				]
			},
			task: assets
		}
	},
	build: ['clean', 'make'],
	serve: ['build', watch],
	default: 'build'
};

var meals = chef(ingredients);

gulp.registry(meals);

function watch() {
	browserSync.init({
		server: this.config.dest.path
	});

	gulp.watch(this.config.src.globs[0] + '**/*', gulp.parallel(gulp.task('make'), browserSync.reload));
}

function deploy() {
	var config = this.config;

	return gulp.src(config.src.globs, config.src.options)
		.pipe(ghpages(config.options));
}

function assets() {
	var config = this.config;

	return gulp.src(config.src.globs, config.src.options)
		.pipe(gulp.dest(config.dest.path))
		.pipe(browserSync.stream());
}
<|endoftext|>


<commit_before>'use strict';
var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
var coveralls = require('gulp-coveralls');

gulp.task('nsp', function (cb) {
  nsp('package.json', cb);
});

gulp.task('pre-test', function () {
  return gulp.src('lib\**\*.js')
    .pipe(istanbul({
      includeUntested: true
    }))
    .pipe(istanbul.hookRequire());
});

gulp.task('test', ['pre-test'], function (cb) {
  var mochaErr;

  gulp.src('test/**/*.js')
    .pipe(plumber())
    .pipe(mocha({reporter: 'spec'}))
    .on('error', function (err) {
      mochaErr = err;
    })
    .pipe(istanbul.writeReports())
    .on('end', function () {
      cb(mochaErr);
    });
});

gulp.task('coveralls', ['test'], function () {
  if (!process.env.CI) {
    return;
  }

  return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
    .pipe(coveralls());
});

gulp.task('prepublish', ['nsp']);
gulp.task('default', ['test', 'coveralls']);
<commit_msg>Skip coveralls<commit_after>'use strict';
var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
var coveralls = require('gulp-coveralls');

gulp.task('nsp', function(cb) {
	nsp('package.json', cb);
});

gulp.task('pre-test', function() {
	return gulp.src('lib\**\*.js')
		.pipe(istanbul({
			includeUntested: true
		}))
		.pipe(istanbul.hookRequire());
});

gulp.task('test', ['pre-test'], function(cb) {
	var mochaErr;

	gulp.src('test/**/*.js')
		.pipe(plumber())
		.pipe(mocha({
			reporter: 'spec'
		}))
		.on('error', function(err) {
			mochaErr = err;
		})
		.pipe(istanbul.writeReports({
			reporters: ['lcov']
		}))
		.on('end', function() {
			cb(mochaErr);
		});
});

gulp.task('coveralls', ['test'], function() {
	if (!process.env.CI) {
		return;
	}

	return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
		.pipe(coveralls()); // Crashes: 'error from lcovParse: ' 'Failed to parse string'
});

gulp.task('prepublish', ['nsp']);
gulp.task('default', ['test']); // + 'coveralls'
<|endoftext|>


<commit_before>var gulp = require('gulp');
var less = require('gulp-less');
var uglify = require('gulp-uglify');
var minify_css = require('gulp-minify-css');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
var jshint_stylish = require('jshint-stylish');
var bower = require('gulp-bower');
var browserify = require('gulp-browserify');
var ng_template_cache = require('gulp-angular-templatecache');
var nodemon = require('gulp-nodemon')

var paths = {
	css: './src/css/**/*',
	views_ng: './src/views_ng/**/*',
	scripts: ['./src/server/**/*', './src/client/**/*'],
	server_main: './src/server/server.js',
	client_main: './src/client/main.js',
};

gulp.task('bower', function() {
	bower();
	// .pipe(gulp.dest('build/bower'));
});

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

gulp.task('jshint', function() {
	gulp.src(paths.scripts)
		.pipe(jshint())
		.pipe(jshint.reporter(jshint_stylish))
		.pipe(jshint.reporter('fail'));
});

gulp.task('js', function() {
	// single entry point to browserify
	gulp.src(paths.client_main)
		.pipe(browserify({
			insertGlobals: true,
			debug: true
		}))
		.pipe(uglify())
		.pipe(rename('bundle.js'))
		.pipe(gulp.dest('build/js'));
});

gulp.task('ng', function() {
	gulp.src(paths.views_ng)
		.pipe(ng_template_cache())
		.pipe(uglify())
		.pipe(gulp.dest('build/js'));
});

gulp.task('install', [
	'bower',
	'css',
	'jshint',
	'js',
	'ng'
]);

// gulp.task('watch', function() {
// gulp.watch(paths.scripts, ['jshint', 'js']);
// gulp.watch(paths.css, ['css']);
// gulp.watch(paths.client_main, ['js']);
// gulp.watch(paths.views_ng, ['ng']);
// });

gulp.task('nodemon', function() {
	nodemon({
		script: paths.server_main,
		watch: 'src/',
		ext: 'js less css html json',
		ignore: ['.git'],
		verbose: true,
	}).on('change', 'install').on('restart', function() {
		console.log('~~~ restart server ~~~')
	})
});

gulp.task('start_dev', [
	'install',
	'nodemon'
]);

gulp.task('start_prod', function() {
	console.log('~~~ START PROD ~~~');
	require(paths.server_main);
});

if (process.env.DEV_MODE === 'dev') {
	gulp.task('start', ['start_dev']);
} else {
	gulp.task('start', ['start_prod']);
}

gulp.task('default', ['start']);
<commit_msg>gulp dependencies<commit_after>var gulp = require('gulp');
var less = require('gulp-less');
var uglify = require('gulp-uglify');
var minify_css = require('gulp-minify-css');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
var jshint_stylish = require('jshint-stylish');
var bower = require('gulp-bower');
var browserify = require('gulp-browserify');
var ng_template_cache = require('gulp-angular-templatecache');
var nodemon = require('gulp-nodemon')

var paths = {
	css: './src/css/**/*',
	views_ng: './src/views_ng/**/*',
	scripts: ['./src/server/**/*', './src/client/**/*'],
	server_main: './src/server/server.js',
	client_main: './src/client/main.js',
};

gulp.task('bower', function() {
	bower();
	// .pipe(gulp.dest('build/bower'));
});

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

gulp.task('jshint', function() {
	gulp.src(paths.scripts)
		.pipe(jshint())
		.pipe(jshint.reporter(jshint_stylish))
		.pipe(jshint.reporter('fail'));
});

gulp.task('js', ['bower', 'jshint'], function() {
	// single entry point to browserify
	gulp.src(paths.client_main)
		.pipe(browserify({
			insertGlobals: true,
			debug: true
		}))
		.pipe(uglify())
		.pipe(rename('bundle.js'))
		.pipe(gulp.dest('build/js'));
});

gulp.task('ng', function() {
	gulp.src(paths.views_ng)
		.pipe(ng_template_cache())
		.pipe(uglify())
		.pipe(gulp.dest('build/js'));
});

gulp.task('install', [
	'bower',
	'css',
	'jshint',
	'js',
	'ng'
]);

// gulp.task('watch', function() {
// gulp.watch(paths.scripts, ['jshint', 'js']);
// gulp.watch(paths.css, ['css']);
// gulp.watch(paths.client_main, ['js']);
// gulp.watch(paths.views_ng, ['ng']);
// });

gulp.task('nodemon', function() {
	nodemon({
		script: paths.server_main,
		watch: 'src/',
		ext: 'js less css html json',
		ignore: ['.git'],
		verbose: true,
	}).on('change', 'install').on('restart', function() {
		console.log('~~~ restart server ~~~')
	})
});

gulp.task('start_dev', [
	'install',
	'nodemon'
]);

gulp.task('start_prod', function() {
	console.log('~~~ START PROD ~~~');
	require(paths.server_main);
});

if (process.env.DEV_MODE === 'dev') {
	gulp.task('start', ['start_dev']);
} else {
	gulp.task('start', ['start_prod']);
}

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


<commit_before>'use strict';

var gulp = require('gulp');
var del = require('del');
var colors = require('colors');
var replace = require('gulp-replace');
var runSequence = require('run-sequence');
var fs = require('fs');
var zip = require('gulp-zip');
var rename = require('gulp-rename');
var babel = require("gulp-babel");
var merge = require('merge-stream');
var filter = require('gulp-filter');
var print = require('gulp-print');
var eslint = require('gulp-eslint');

var config = require('./config/gulp.config');
var envSettings = require('./config/settings');
var logMessagePrefix = "         + ";

console.log('[initiate]'.yellow + ' Creating artifacts for app name: ' + envSettings.appName.magenta);

function logMessage(action, context) {

   console.log(logMessagePrefix + action + context.magenta);
}

function getFilePathLogMessage(filepath) {

   return 'Writing  ' + filepath;
}

/* Clean existing build & package artifacts */
gulp.task('clean', function (cb) {

   del([config.paths.build, config.paths.temp, config.paths.package]).then(function (paths) {
      var pathsText = paths.length === 0 ? 'NONE' : paths.join(';\n                    ');
      logMessage('Deleted  ', pathsText);
      cb();
   });
});

/* Clean temporary build artifacts (from babel compile and test specs) */
gulp.task('clean-temp', function (cb) {

   del([config.paths.temp]).then(function (paths) {
      var pathsText = paths.join(';');
      logMessage('Deleted  ', pathsText);
      cb();
   });
});

/* Prepare build directory */
gulp.task('prepare-build', ['clean'], function (cb) {

   fs.mkdir(config.paths.build, function (err) {

      if (err) { throw err; }
      cb();
   });
});

/* Copy server scripts */
gulp.task('server-scripts', function() {

   gulp.src('./scripts/*.sh')
       .pipe(print(getFilePathLogMessage))
       .pipe(replace('%APPNAME%', envSettings.appName))
       .pipe(replace('%ENVIRONMENT%', envSettings.envName))
       .pipe(replace('%DEPLOY_USER%', envSettings.deployUser))
       .pipe(replace('%DEPLOY_HOST%', envSettings.deployHost))
       .pipe(replace('%DEPLOY_LOCATION%', envSettings.deployDirectory))
       .pipe(replace('%NODE_RUNTIME_ENV%', envSettings.nodeRuntimeVersion))
       .pipe(replace('%FRONT_WITH_NGINX%', envSettings.frontWithNginx))
       .pipe(gulp.dest(config.paths.build + '/scripts'));
});

/* Prepare Environment settings file */
gulp.task('environment-settings', function (cb) {

   // TODO: Could this be done with JsonFile instead ???

   var settingsContent = JSON.stringify(envSettings, null, '  ');
   var pathName = config.paths.build + '/settings.json';
   logMessage('Creating ', pathName);

   fs.writeFile(pathName, settingsContent, function (err) {

      if (err) { throw err; }
      cb();
   });
});

/* Prepare package.json for the server / runtime */
gulp.task('package-json', function (cb) {

    // TODO: Replace all this crap with jsonfile package !!!

   fs.readFile('./package.json', function (err, data) {

      if (err) { throw err; }

      var packageJson = JSON.parse(data);
      packageJson.name = envSettings.appName;
      packageJson.devDependencies = undefined;
      packageJson.scripts = undefined;
      packageJson.homepage = undefined;
      packageJson.bugs = undefined;
      packageJson.license = undefined;
      packageJson.author = undefined;
      packageJson.keywords = undefined;
      packageJson.repository = undefined;
      packageJson.description = undefined;

      var pathName = config.paths.build + '/package.json';
      logMessage('Creating ', pathName);

      fs.writeFile(pathName, JSON.stringify(packageJson, null, '  '), function (err) {

         if (err) { throw err; }
         cb();
      });
   });
});

/* Compile server-side app + specs */
gulp.task('compile-app', function () {

  return gulp.src(config.paths.app + '/**/*.js')
             .pipe(filter(['**/*.js', '!**/*Spec.js', '!**/specConstructs.js']))
             .pipe(babel())
             .pipe(gulp.dest(config.paths.temp + '/app'));
});

/* Copy app files and environmentalise the bootup module */
gulp.task('copy-app', ['compile-app'], function () {

   var startupDestFileName = envSettings.appName + '_' + envSettings.envName;
   var startupDestDir = config.paths.build + '/app/bin/';
   logMessage('Creating ', startupDestDir + startupDestFileName);

   var startupFileStream = gulp.src(config.paths.temp + '/app/bin/startup.js')
                               .pipe(rename(startupDestFileName))
                               .pipe(gulp.dest(startupDestDir));

   var appFilesStream = gulp.src(config.paths.temp + '/app/**/*.js')
                            .pipe(filter(['**/*.js', '!**/startup.js']))
                            .pipe(gulp.dest(config.paths.build + '/app'))
                            .pipe(print(getFilePathLogMessage));

   return merge(startupFileStream, appFilesStream);
});

/* Lint */
gulp.task('lint', function () {

   return gulp.src(config.paths.app + '/**/*.js')
              .pipe(eslint())
              .pipe(eslint.format())
              .pipe(eslint.failOnError());
});

/* Build entire solution */
gulp.task('build', function (cb) {

   runSequence('prepare-build',
               'lint',
               ['server-scripts', 'environment-settings', 'package-json', 'copy-app'],
               cb);
});

/* Package build artifacts */
gulp.task('package', function () {

   var packageFileName = envSettings.appName + '.package.' + envSettings.envName + '.zip';
   logMessage('Creating ', config.paths.package + '/' + packageFileName);

   return gulp.src(config.paths.build + '/**/*', { dot: true })
              .pipe(zip(packageFileName))
              .pipe(gulp.dest(config.paths.package));
});

/* Default gulp task */
gulp.task('default', function (cb) {

});<commit_msg>Excluded server install scripts for local builds<commit_after>'use strict';

var gulp = require('gulp');
var del = require('del');
var colors = require('colors');
var replace = require('gulp-replace');
var runSequence = require('run-sequence');
var fs = require('fs');
var zip = require('gulp-zip');
var rename = require('gulp-rename');
var babel = require("gulp-babel");
var merge = require('merge-stream');
var filter = require('gulp-filter');
var print = require('gulp-print');
var eslint = require('gulp-eslint');

var config = require('./config/gulp.config');
var envSettings = require('./config/settings');
var logMessagePrefix = "         + ";

console.log('[initiate]'.yellow + ' Creating artifacts for app name: ' + envSettings.appName.magenta);

function logMessage(action, context) {

   console.log(logMessagePrefix + action + context.magenta);
}

function getFilePathLogMessage(filepath) {

   return 'Writing  ' + filepath;
}

/* Clean existing build & package artifacts */
gulp.task('clean', function (cb) {

   del([config.paths.build, config.paths.temp, config.paths.package]).then(function (paths) {
      var pathsText = paths.length === 0 ? 'NONE' : paths.join(';\n                    ');
      logMessage('Deleted  ', pathsText);
      cb();
   });
});

/* Clean temporary build artifacts (from babel compile and test specs) */
gulp.task('clean-temp', function (cb) {

   del([config.paths.temp]).then(function (paths) {
      var pathsText = paths.join(';');
      logMessage('Deleted  ', pathsText);
      cb();
   });
});

/* Prepare build directory */
gulp.task('prepare-build', ['clean'], function (cb) {

   fs.mkdir(config.paths.build, function (err) {

      if (err) { throw err; }
      cb();
   });
});

/* Copy server scripts */
gulp.task('server-scripts', function() {

   if (envSettings.envName !== 'local') {

      gulp.src('./scripts/*.sh')
          .pipe(print(getFilePathLogMessage))
          .pipe(replace('%APPNAME%', envSettings.appName))
          .pipe(replace('%ENVIRONMENT%', envSettings.envName))
          .pipe(replace('%DEPLOY_USER%', envSettings.deployUser))
          .pipe(replace('%DEPLOY_HOST%', envSettings.deployHost))
          .pipe(replace('%DEPLOY_LOCATION%', envSettings.deployDirectory))
          .pipe(replace('%NODE_RUNTIME_ENV%', envSettings.nodeRuntimeVersion))
          .pipe(replace('%FRONT_WITH_NGINX%', envSettings.frontWithNginx))
          .pipe(gulp.dest(config.paths.build + '/scripts'));
   }
});

/* Prepare Environment settings file */
gulp.task('environment-settings', function (cb) {

   // TODO: Could this be done with JsonFile instead ???

   var settingsContent = JSON.stringify(envSettings, null, '  ');
   var pathName = config.paths.build + '/settings.json';
   logMessage('Creating ', pathName);

   fs.writeFile(pathName, settingsContent, function (err) {

      if (err) { throw err; }
      cb();
   });
});

/* Prepare package.json for the server / runtime */
gulp.task('package-json', function (cb) {

    // TODO: Replace all this crap with jsonfile package !!!

   fs.readFile('./package.json', function (err, data) {

      if (err) { throw err; }

      var packageJson = JSON.parse(data);
      packageJson.name = envSettings.appName;
      packageJson.devDependencies = undefined;
      packageJson.scripts = undefined;
      packageJson.homepage = undefined;
      packageJson.bugs = undefined;
      packageJson.license = undefined;
      packageJson.author = undefined;
      packageJson.keywords = undefined;
      packageJson.repository = undefined;
      packageJson.description = undefined;

      var pathName = config.paths.build + '/package.json';
      logMessage('Creating ', pathName);

      fs.writeFile(pathName, JSON.stringify(packageJson, null, '  '), function (err) {

         if (err) { throw err; }
         cb();
      });
   });
});

/* Compile server-side app + specs */
gulp.task('compile-app', function () {

  return gulp.src(config.paths.app + '/**/*.js')
             .pipe(filter(['**/*.js', '!**/*Spec.js', '!**/specConstructs.js']))
             .pipe(babel())
             .pipe(gulp.dest(config.paths.temp + '/app'));
});

/* Copy app files and environmentalise the bootup module */
gulp.task('copy-app', ['compile-app'], function () {

   var startupDestFileName = envSettings.appName + '_' + envSettings.envName;
   var startupDestDir = config.paths.build + '/app/bin/';
   logMessage('Creating ', startupDestDir + startupDestFileName);

   var startupFileStream = gulp.src(config.paths.temp + '/app/bin/startup.js')
                               .pipe(rename(startupDestFileName))
                               .pipe(gulp.dest(startupDestDir));

   var appFilesStream = gulp.src(config.paths.temp + '/app/**/*.js')
                            .pipe(filter(['**/*.js', '!**/startup.js']))
                            .pipe(gulp.dest(config.paths.build + '/app'))
                            .pipe(print(getFilePathLogMessage));

   return merge(startupFileStream, appFilesStream);
});

/* Lint */
gulp.task('lint', function () {

   return gulp.src(config.paths.app + '/**/*.js')
              .pipe(eslint())
              .pipe(eslint.format())
              .pipe(eslint.failOnError());
});

/* Build entire solution */
gulp.task('build', function (cb) {

   runSequence('prepare-build',
               'lint',
               ['server-scripts', 'environment-settings', 'package-json', 'copy-app'],
               cb);
});

/* Package build artifacts */
gulp.task('package', function () {

   var packageFileName = envSettings.appName + '.package.' + envSettings.envName + '.zip';
   logMessage('Creating ', config.paths.package + '/' + packageFileName);

   return gulp.src(config.paths.build + '/**/*', { dot: true })
              .pipe(zip(packageFileName))
              .pipe(gulp.dest(config.paths.package));
});

/* Default gulp task */
gulp.task('default', function (cb) {

});<|endoftext|>


<commit_before>"use strict"
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var watch = require('gulp-watch');
var watchify = require('watchify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gutil = require('gulp-util');
var sourcemaps = require('gulp-sourcemaps');
var assign = require('lodash.assign');

var handleError = function(task) {
  return function(err) {

    notify.onError({
      message: task + ' failed, check the logs..',
      sound: false
    })(err);

    gutil.log(gutil.colors.bgRed(task + ' error:'), gutil.colors.red(err));
  };
};

var customOpts = {
  entries: ['./client/app/main.js'],
  debug: true //creates readable 'source maps' of code
};
var opts = assign({}, watchify.args, customOpts);
var bundler = watchify(browserify(opts));
bundler.on('update', bundle); // on any dep update, runs the bundler
bundler.on('log', gutil.log); // output build logs to terminal

function bundle() {
  return bundler.bundle()
    // log errors if they happen
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source('bundle.js'))
    // optional, remove if you don't need to buffer file contents
    .pipe(buffer())
    // optional, remove if you dont want sourcemaps
    .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file
       // Add transformation tasks to the pipeline here.
    .pipe(sourcemaps.write('./')) // writes .map file
    .pipe(gulp.dest('./client'));
}
gulp.task('browserify', bundle);

/*
  JSHINT SECTION
  Not optional. You should always be validating your JavaScript
 */
gulp.task('lint', function() {
  return gulp.src(['./app.main.js'])
    .pipe(jshint())
    .pipe(jshint.reporter('jshint-stylish'))
    .on('error', function() { });
});

/*
  WATCH TASK SECTION
  Detects when you make a change to any JavaScript file, and/or
  SASS file and immediately runs the corresponding task.
 */
gulp.task('watch', function() {
  // Run the link task when any JavaScript file changes
  gulp.watch(['./app/main.js'], ['lint']);
  gutil.log(gutil.colors.bgGreen('Watching for changes...'));
});

// This task runs when you type `gulp` in the CLI
gulp.task('default', ['lint', 'watch'], bundle);

gulp.task('heroku:production', [
  'gulp',
  'gulp-jshint',
  'gulp-watch',
  'watchify',
  'browserify',
  'vinyl-source-stream',
  'vinyl-buffer',
  'gulp-util',
  'gulp-sourcemaps',
  'lodash.assign'
]);

<commit_msg>heroku try added bundle to heroku-production<commit_after>"use strict"
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var watch = require('gulp-watch');
var watchify = require('watchify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gutil = require('gulp-util');
var sourcemaps = require('gulp-sourcemaps');
var assign = require('lodash.assign');

var handleError = function(task) {
  return function(err) {

    notify.onError({
      message: task + ' failed, check the logs..',
      sound: false
    })(err);

    gutil.log(gutil.colors.bgRed(task + ' error:'), gutil.colors.red(err));
  };
};

var customOpts = {
  entries: ['./client/app/main.js'],
  debug: true //creates readable 'source maps' of code
};
var opts = assign({}, watchify.args, customOpts);
var bundler = watchify(browserify(opts));
bundler.on('update', bundle); // on any dep update, runs the bundler
bundler.on('log', gutil.log); // output build logs to terminal

function bundle() {
  return bundler.bundle()
    // log errors if they happen
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source('bundle.js'))
    // optional, remove if you don't need to buffer file contents
    .pipe(buffer())
    // optional, remove if you dont want sourcemaps
    .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file
       // Add transformation tasks to the pipeline here.
    .pipe(sourcemaps.write('./')) // writes .map file
    .pipe(gulp.dest('./client'));
}
gulp.task('browserify', bundle);

/*
  JSHINT SECTION
  Not optional. You should always be validating your JavaScript
 */
gulp.task('lint', function() {
  return gulp.src(['./app/main.js'])
    .pipe(jshint())
    .pipe(jshint.reporter('jshint-stylish'))
    .on('error', function() { });
});

/*
  WATCH TASK SECTION
  Detects when you make a change to any JavaScript file, and/or
  SASS file and immediately runs the corresponding task.
 */
gulp.task('watch', function() {
  // Run the link task when any JavaScript file changes
  gulp.watch(['./app/main.js'], ['lint']);
  gutil.log(gutil.colors.bgGreen('Watching for changes...'));
});

// This task runs when you type `gulp` in the CLI
gulp.task('default', ['lint', 'watch'], bundle);

gulp.task('heroku:production', [
  'gulp',
  'gulp-jshint',
  'gulp-watch',
  'watchify',
  'browserify',
  'vinyl-source-stream',
  'vinyl-buffer',
  'gulp-util',
  'gulp-sourcemaps',
  'lodash.assign'
], bundle);

<|endoftext|>


<commit_before>var gulp = require('gulp')
var yaml = require('gulp-yaml')
var jsonConcat = require('gulp-json-concat')
var merge = require('merge-stream')
var jeditor = require("gulp-json-editor")
var rename = require("gulp-rename")
var jsonFormat = require('gulp-json-format')
var tv4 = require('gulp-tv4')
var through = require('through2')
var packageData = require('./package.json')

gulp.task('default', function() {
    var controllerJson = gulp.src('./controller/*.yml')
        .pipe(yaml({ space: 0 }))
        .pipe(tv4('./schema/controller.schema.json'))
        .pipe(through.obj(function(file, enc, callback) {
            callback(null, file);
            if (!file.tv4.valid) {
                throw new Error(file.tv4.error + ' at ' + file.path);
            }
        }))
        .pipe(jsonConcat('Controllers.json', function(data) {
            return new Buffer(JSON.stringify(data))
        }))

    var platformJson = gulp.src('./platform/*.yml')
        .pipe(yaml({ space: 0 }))
        .pipe(tv4('./schema/platform.schema.json'))
        .pipe(through.obj(function(file, enc, callback) {
            callback(null, file);
            if (!file.tv4.valid) {
                throw new Error(file.tv4.error + ' at ' + file.path);
            }
        }))
        .pipe(jsonConcat('Platforms.json', function(data) {
            return new Buffer(JSON.stringify(data))
        }))

    merge(platformJson, controllerJson)
        .pipe(jsonConcat('stone.json', function(data) {
            return new Buffer(JSON.stringify(data))
        }))
        .pipe(jeditor({
            'version': packageData.version
        }))
        .pipe(gulp.dest('./dist'))
        .pipe(rename("stone.dist.json"))
        .pipe(jsonFormat(0))
        .pipe(gulp.dest('./dist'))

})

gulp.task('format-platform', function() {
    var platformSrc = gulp.src('./platform/*.yml')
        .pipe(yaml({ space: 2, safe: true }))
        .pipe(gulp.dest("./src/platform"))
})

gulp.task('format-controller', function() {
    var controllerSrc = gulp.src('./controller/*.yml')
        .pipe(yaml({ space: 2, safe: true }))
        .pipe(gulp.dest("./src/controller"))
})
<commit_msg>gulpfile: Validate with standard style.<commit_after>var gulp = require('gulp')
var yaml = require('gulp-yaml')
var jsonConcat = require('gulp-json-concat')
var merge = require('merge-stream')
var jeditor = require('gulp-json-editor')
var rename = require('gulp-rename')
var jsonFormat = require('gulp-json-format')
var tv4 = require('gulp-tv4')
var through = require('through2')
var packageData = require('./package.json')

gulp.task('default', function () {
  var controllerJson = gulp.src('./controller/*.yml')
    .pipe(yaml({ space: 0 }))
    .pipe(tv4('./schema/controller.schema.json'))
    .pipe(through.obj(function (file, enc, callback) {
      callback(null, file)
      if (!file.tv4.valid) {
        throw new Error(file.tv4.error + ' at ' + file.path)
      }
    }))
    .pipe(jsonConcat('Controllers.json', function (data) {
      return new Buffer(JSON.stringify(data))
    }))

  var platformJson = gulp.src('./platform/*.yml')
    .pipe(yaml({ space: 0 }))
    .pipe(tv4('./schema/platform.schema.json'))
    .pipe(through.obj(function (file, enc, callback) {
      callback(null, file)
      if (!file.tv4.valid) {
        throw new Error(file.tv4.error + ' at ' + file.path)
      }
    }))
    .pipe(jsonConcat('Platforms.json', function (data) {
      return new Buffer(JSON.stringify(data))
    }))

  merge(platformJson, controllerJson)
    .pipe(jsonConcat('stone.json', function (data) {
      return new Buffer(JSON.stringify(data))
    }))
    .pipe(jeditor({
      'version': packageData.version
    }))
    .pipe(gulp.dest('./dist'))
    .pipe(rename('stone.dist.json'))
    .pipe(jsonFormat(0))
    .pipe(gulp.dest('./dist'))
})

gulp.task('format-platform', function () {
  gulp.src('./platform/*.yml')
    .pipe(yaml({ space: 2, safe: true }))
    .pipe(gulp.dest('./src/platform'))
})

gulp.task('format-controller', function () {
  gulp.src('./controller/*.yml')
    .pipe(yaml({ space: 2, safe: true }))
    .pipe(gulp.dest('./src/controller'))
})
<|endoftext|>


<commit_before>'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var plugins = require('gulp-load-plugins')();

var paths = {
  all: {
    scripts: [
      'app/scripts/**/*.js',
      'lib/**/*.js',
      'gulpfile.js',
      'index.js'
    ]
  },
  app: {
    dir: 'app',
    glob: ['app/**/*', '!app/bower_components/**/*'],
    bower: {
      dir: 'app/bower_components'
    },
    html: 'app/index.html',
    scripts: {
      dir: 'app/scripts',
      entry: 'app/scripts/app.js'
    },
    styles: {
      dir: 'app/styles',
      entry: 'app/styles/app.scss'
    }
  },
  bower: {
    json: 'bower.json'
  },
  build: {
    dir: 'build',
    assets: {
      dir: 'build/assets'
    }
  },
  tmp: {
    dir: '.tmp',
    styles: {
      dir: '.tmp/styles',
      glob: './tmp/styles/**/*.css'
    }
  }
};

gulp.task('default', ['build']);

gulp.task('build', ['wiredep', 'html', 'jshint']);

gulp.task('html', ['styles'], function () {
  var searchPath = '{' + paths.tmp.dir + ',' + paths.app.dir + '}';

  return gulp.src(paths.app.html)
    .pipe(plugins.useref.assets({searchPath: searchPath})
      .on('error', gutil.log))
    .pipe(plugins.useref.restore())
    .pipe(plugins.if('*.js', plugins.ngmin()))
    .pipe(plugins.if('*.js', plugins.uglify({preserveComments: 'some'})))
    .pipe(plugins.if('*.css', plugins.csso()))
    .pipe(plugins.useref())
    .pipe(gulp.dest(paths.build.dir));
});

gulp.task('jshint', function () {
  return gulp.src(paths.all.scripts)
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('jshint-stylish'));
});

gulp.task('styles', function () {
  return gulp.src(paths.app.styles.entry)
    .pipe(plugins.sass({includePaths: [paths.app.bower.dir]}))
    .pipe(gulp.dest(paths.tmp.styles.dir));
});

gulp.task('wiredep', function () {
  var wiredep = require('wiredep').stream;

  gulp.src(paths.app.html)
    .pipe(wiredep())
    .pipe(gulp.dest(paths.app.dir));
});

gulp.task('watch', function () {
  var path = require('path');

  // Start and watch the Express server
  plugins.nodemon({
    script: 'index.js',
    ext: 'js',
    ignore: [
      paths.app.dir + '/'
    ]
  });

  // Start the LiveReload server
  plugins.livereload.listen();

  // Watch for changes
  gulp.watch(paths.app.glob, function (event) {
    // Build a path that is relative to the browser
    var relativePath = '/' + path.relative(__dirname, event.path);
    relativePath = relativePath.replace(paths.app.dir + '/', '');
    relativePath = relativePath.replace('.scss', '.css');
    plugins.livereload.changed(relativePath);
  });
  gulp.watch(paths.app.styles.glob, ['styles']);
  gulp.watch(paths.bower.json, ['wiredep']);
});
<commit_msg>Copy templates over to the build directory.<commit_after>'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var plugins = require('gulp-load-plugins')();

var paths = {
  all: {
    scripts: [
      'app/scripts/**/*.js',
      'lib/**/*.js',
      'gulpfile.js',
      'index.js'
    ]
  },
  app: {
    dir: 'app',
    glob: ['app/**/*', '!app/bower_components/**/*'],
    bower: {
      dir: 'app/bower_components'
    },
    html: 'app/index.html',
    scripts: {
      dir: 'app/scripts',
      entry: 'app/scripts/app.js'
    },
    styles: {
      dir: 'app/styles',
      entry: 'app/styles/app.scss'
    },
    templates: {
      glob: 'app/templates/**/*.html'
    }
  },
  bower: {
    json: 'bower.json'
  },
  build: {
    dir: 'build',
    assets: {
      dir: 'build/assets'
    }
  },
  tmp: {
    dir: '.tmp',
    styles: {
      dir: '.tmp/styles',
      glob: './tmp/styles/**/*.css'
    }
  }
};

gulp.task('default', ['build']);

gulp.task('build', ['wiredep', 'html', 'jshint'], function () {
  return gulp.src(paths.app.templates.glob, {base: paths.app.dir})
    .pipe(gulp.dest(paths.build.dir));
});

gulp.task('html', ['styles'], function () {
  var searchPath = '{' + paths.tmp.dir + ',' + paths.app.dir + '}';

  return gulp.src(paths.app.html)
    .pipe(plugins.useref.assets({searchPath: searchPath})
      .on('error', gutil.log))
    .pipe(plugins.useref.restore())
    .pipe(plugins.if('*.js', plugins.ngmin()))
    .pipe(plugins.if('*.js', plugins.uglify({preserveComments: 'some'})))
    .pipe(plugins.if('*.css', plugins.csso()))
    .pipe(plugins.useref())
    .pipe(gulp.dest(paths.build.dir));
});

gulp.task('jshint', function () {
  return gulp.src(paths.all.scripts)
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('jshint-stylish'));
});

gulp.task('styles', function () {
  return gulp.src(paths.app.styles.entry)
    .pipe(plugins.sass({includePaths: [paths.app.bower.dir]}))
    .pipe(gulp.dest(paths.tmp.styles.dir));
});

gulp.task('wiredep', function () {
  var wiredep = require('wiredep').stream;

  gulp.src(paths.app.html)
    .pipe(wiredep())
    .pipe(gulp.dest(paths.app.dir));
});

gulp.task('watch', function () {
  var path = require('path');

  // Start and watch the Express server
  plugins.nodemon({
    script: 'index.js',
    ext: 'js',
    ignore: [
      paths.app.dir + '/'
    ]
  });

  // Start the LiveReload server
  plugins.livereload.listen();

  // Watch for changes
  gulp.watch(paths.app.glob, function (event) {
    // Build a path that is relative to the browser
    var relativePath = '/' + path.relative(__dirname, event.path);
    relativePath = relativePath.replace(paths.app.dir + '/', '');
    relativePath = relativePath.replace('.scss', '.css');
    plugins.livereload.changed(relativePath);
  });
  gulp.watch(paths.app.styles.glob, ['styles']);
  gulp.watch(paths.bower.json, ['wiredep']);
});
<|endoftext|>


<commit_before>'use strict';

var gulp = require('gulp'),
    merge = require('merge-stream'),
    pf = require('./js/paramFiles'),
    sourcemaps = require('gulp-sourcemaps'),
    vulcanize = require('gulp-vulcanize'),
    // css
    csscomb = require('gulp-csscomb'),
    autoprefixer = require('autoprefixer-core'),
    csswring = require('csswring'),
    postcss = require('gulp-postcss'),
    // js
    sass = require('gulp-sass'),
    jshint = require('gulp-jshint'),
    jscs = require('gulp-jscs'),
    webpack = require('gulp-webpack'),
    // CONSTANTS
    SCSS_PATH = 'css',
    JS_PATH = 'js',
    COMPONENT_PATH = 'components',
    PUBLIC_CSS = 'public/css',
    PUBLIC_JS = 'public/js',
    JS_ENTRY_POINTS = [
      JS_PATH + '/main.js'
    ];

/**
 * Linting SCSS files
 * Possible send files to param -files=...
 */
gulp.task('csslint', function() {
  var files = pf.paramFiles(),
      stream,
      global,
      components;

  if (files) {
    stream = gulp.src(files)
      .pipe(csscomb(__dirname + '/.csscomb.json'))
      .pipe(gulp.dest('./'));

  } else {
    global = gulp.src(pf.scss(SCSS_PATH))
      .pipe(csscomb(__dirname + '/.csscomb.json'))
      .pipe(gulp.dest(SCSS_PATH));

    components = gulp.src(pf.scss(COMPONENT_PATH))
      .pipe(csscomb(__dirname + '/.csscomb.json'))
      .pipe(gulp.dest(COMPONENT_PATH));

    stream = merge(global, components);
  }

  return stream;
});

/**
 * Processing SCSS files
 */
gulp.task('css', ['csslint'], function() {
  var processors = [
    autoprefixer({
      browsers: ['last 1 version']
    }),
    csswring({
      removeAllComments: true
    })
  ];

  return gulp.src([pf.scss(SCSS_PATH)])
    .pipe(sourcemaps.init())
    .pipe(sass())
    .pipe(postcss(processors))
    .pipe(sourcemaps.write(PUBLIC_CSS + '/map'))
    .pipe(gulp.dest(PUBLIC_CSS));
});

/**
 * Linting JS files
 * Possible send files to param -files=...
 */
gulp.task('jslint', function() {
  var files = pf.paramFiles();

  if (!files) {
    files = [pf.js(JS_PATH), pf.js(COMPONENT_PATH)];
  }

  return gulp.src(files)
    .pipe(jshint.extract())
    .pipe(jshint())
    .pipe(jshint.reporter('default'))
    .pipe(jscs())
    .pipe(jshint.reporter('fail'));
});

/**
 *
 */
gulp.task('component', function() {
  return gulp.src('prototype/component.html')
    .pipe(vulcanize({
      dest: 'prototype/component',
      strip: true,
      inline: true
    }))
    .pipe(gulp.dest('prototype/component'));
});

/**
 * Processing JS files
 */
gulp.task('js', ['jslint'], function() {
  // return gulp.src(JS_ENTRY_POINTS)
  //   .pipe(webpack())
  //   .pipe(gulp.dest(PUBLIC_JS));
});

gulp.task('default', ['js', 'css']);
<commit_msg>clean gulpfile<commit_after>'use strict';

var gulp = require('gulp'),
    merge = require('merge-stream'),
    pf = require('./js/paramFiles'),
    sourcemaps = require('gulp-sourcemaps'),
    vulcanize = require('gulp-vulcanize'),
    // css
    csscomb = require('gulp-csscomb'),
    autoprefixer = require('autoprefixer-core'),
    csswring = require('csswring'),
    postcss = require('gulp-postcss'),
    // js
    sass = require('gulp-sass'),
    jshint = require('gulp-jshint'),
    jscs = require('gulp-jscs'),
    // CONSTANTS
    SCSS_PATH = 'css',
    JS_PATH = 'js',
    COMPONENT_PATH = 'components',
    PUBLIC_CSS = 'public/css';

/**
 * Linting SCSS files
 * Possible send files to param -files=...
 */
gulp.task('csslint', function() {
  var files = pf.paramFiles(),
      stream,
      global,
      components;

  if (files) {
    stream = gulp.src(files)
      .pipe(csscomb(__dirname + '/.csscomb.json'))
      .pipe(gulp.dest('./'));

  } else {
    global = gulp.src(pf.scss(SCSS_PATH))
      .pipe(csscomb(__dirname + '/.csscomb.json'))
      .pipe(gulp.dest(SCSS_PATH));

    components = gulp.src(pf.scss(COMPONENT_PATH))
      .pipe(csscomb(__dirname + '/.csscomb.json'))
      .pipe(gulp.dest(COMPONENT_PATH));

    stream = merge(global, components);
  }

  return stream;
});

/**
 * Processing SCSS files
 */
gulp.task('css', ['csslint'], function() {
  var processors = [
    autoprefixer({
      browsers: ['last 1 version']
    }),
    csswring({
      removeAllComments: true
    })
  ];

  return gulp.src([pf.scss(SCSS_PATH)])
    .pipe(sourcemaps.init())
    .pipe(sass())
    .pipe(postcss(processors))
    .pipe(sourcemaps.write(PUBLIC_CSS + '/map'))
    .pipe(gulp.dest(PUBLIC_CSS));
});

/**
 * Linting JS files
 * Possible send files to param -files=...
 */
gulp.task('jslint', function() {
  var files = pf.paramFiles();

  if (!files) {
    files = [pf.js(JS_PATH), pf.js(COMPONENT_PATH)];
  }

  return gulp.src(files)
    .pipe(jshint.extract())
    .pipe(jshint())
    .pipe(jshint.reporter('default'))
    .pipe(jscs())
    .pipe(jshint.reporter('fail'));
});

/**
 *
 */
gulp.task('component', function() {
  return gulp.src('prototype/component.html')
    .pipe(vulcanize({
      dest: 'prototype/component',
      strip: true,
      inline: true
    }))
    .pipe(gulp.dest('prototype/component'));
});

/**
 * Processing JS files
 */
gulp.task('js', ['jslint'], function() {
});

gulp.task('default', ['js', 'css']);
<|endoftext|>


<commit_before>const gulp = require('gulp');
const scgulp = require('showcar-gulp')(gulp);

// Don't put in separate task. Runs async on each gulp task
const pkg = require('showcar-gulp/package.json');
const updateNotifier = require('update-notifier');
updateNotifier({
    pkg,
    updateCheckInterval: 1 //check each time
}).notify({ defer: false, isGlobal: false });

gulp.task('js', ['eslint'], scgulp.js({
    entry: 'src/showcar-ui.js',
    out: 'dist/showcar-ui.js',
}));

gulp.task('icons', ['eslint'], scgulp.js({
    entry: 'src/js/showcar-icons.js',
    out: 'dist/showcar-icons.js',
}));

gulp.task('tracking', ['eslint'], scgulp.js({
    entry: 'src/js/showcar-tracking.js',
    out: 'dist/showcar-tracking.js',
}));

gulp.task('eslint', scgulp.eslint({
    files: 'src/**/*.js'
}));

gulp.task('stylelint', scgulp.stylelint({
    files: 'src/**/*.scss'
}));

gulp.task('scss', ['stylelint'], scgulp.scss({
    entry: 'src/showcar-ui.scss',
    out: 'dist/showcar-ui.css',
}));

gulp.task('clean', scgulp.clean({
    files: ['dist/**/*']
}));

gulp.task('serve', scgulp.serve({
    dir: 'dist'
}));

gulp.task('copy:fragments', () => {
    gulp.src('src/html/showcar-ui-fragment.html').pipe(gulp.dest('dist/'));
    gulp.src('src/html/showcar-ui-standalone-fragment.html').pipe(gulp.dest('dist/'));
    gulp.src('src/html/showcar-ui-toggled-fragment.html').pipe(gulp.dest('dist/'));
    gulp.src('src/html/optimizely-*.html').pipe(gulp.dest('dist/'));
});

const fs = require('fs');
const UglifyJS = require('uglify-js');
const readFile = filename => fs.readFileSync(filename, 'utf-8');
const readJsFile = filename => UglifyJS.minify(readFile(filename)).code;
const stringReplace = require('gulp-string-replace');
var replaceOptions = {
    logs: {
        enabled: false
    }
};
gulp.task('replace', function () {
    gulp.src(['src/html/index.html', 'src/html/index-standalone.html', 'docs/helpers/polyfills.js'])
        .pipe(stringReplace('@@POLYFILL_DOCUMENT_REGISTER_ELEMENT', readFile('node_modules/document-register-element/build/document-register-element.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_DOM4', readFile('node_modules/dom4/build/dom4.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_ARRAY', readJsFile('src/js/polyfills/array.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_STRING', readJsFile('src/js/polyfills/string.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_OBJECT', readJsFile('src/js/polyfills/object.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_PROMISE', readJsFile('node_modules/promiz/promiz.min.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_FETCH', readJsFile('node_modules/whatwg-fetch/fetch.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_ES6_COLLECTIONS', readJsFile('node_modules/es6-collections/es6-collections.js'), replaceOptions))
        .pipe(stringReplace('@@SCRIPT_ERROR_COLLECTOR', readJsFile('src/js/inline-js/js-error-collector.js'), replaceOptions))
        .pipe(stringReplace('@@SCRIPT_FONT_LOADER', readJsFile('src/js/inline-js/font-loader.js'), replaceOptions))
        .pipe(gulp.dest('dist/'));
});

gulp.task('set-dev', () => {
    scgulp.config.devmode = true;
});

gulp.task('docs:generate', () => {
    require('./docs/tasks/generateJson')();
    require('./docs/tasks/generateHtml')();
});

const serveDocs = require('./docs/tasks/docs');

gulp.task('docs:serve', () => {serveDocs(gulp);});
gulp.task('docs:edit', ['build'], () => {serveDocs(gulp);});
gulp.task('docs:watch', ['build'], () => {serveDocs(gulp);});

gulp.task('build', ['js', 'icons', 'tracking', 'scss', 'copy:fragments', 'replace']);
gulp.task('default', ['docs:watch']);

const testingParams = {
    files: ['.quixoteconf.js'],
    preprocessors: {
        '.quixoteconf.js': ['webpack', 'sourcemap']
    },
    proxies: {
        '/': 'http://localhost:3000/',
    }
};

gulp.task('test', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browsers: ['Firefox', 'Chrome', 'Safari']
    }))
);

gulp.task('test:fast', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browsers: ['Chrome']
    }))
);

gulp.task('test:bs', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browserStack: {
            build: new Date().toLocaleString('de-DE', {
                hour12: false,
                month: '2-digit',
                day: '2-digit',
                hour: '2-digit',
                minute: '2-digit'
            }),
            project: 'Showcar-ui',
        },
        browsers: ['bs_safari_mac', 'bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win', 'bs_iphone6s', 'bs_iphone7'],
    }))
);

gulp.task('test:travis', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browserStack: {
            project: 'Showcar-ui',
        },
        // browsers: ['bs_safari_mac', 'bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win', 'bs_iphone6s', 'bs_iphone7'],
        // temporary removed iphones
        // browsers: ['bs_safari_mac', 'bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win'],
        browsers: ['bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win'],  //temporary remove safari
        // browsers: ['bs_chrome_win'], //only test on chrome
    }))
);
<commit_msg>Removed `es6-collection` polyfill<commit_after>const gulp = require('gulp');
const scgulp = require('showcar-gulp')(gulp);

// Don't put in separate task. Runs async on each gulp task
const pkg = require('showcar-gulp/package.json');
const updateNotifier = require('update-notifier');
updateNotifier({
    pkg,
    updateCheckInterval: 1 //check each time
}).notify({ defer: false, isGlobal: false });

gulp.task('js', ['eslint'], scgulp.js({
    entry: 'src/showcar-ui.js',
    out: 'dist/showcar-ui.js',
}));

gulp.task('icons', ['eslint'], scgulp.js({
    entry: 'src/js/showcar-icons.js',
    out: 'dist/showcar-icons.js',
}));

gulp.task('tracking', ['eslint'], scgulp.js({
    entry: 'src/js/showcar-tracking.js',
    out: 'dist/showcar-tracking.js',
}));

gulp.task('eslint', scgulp.eslint({
    files: 'src/**/*.js'
}));

gulp.task('stylelint', scgulp.stylelint({
    files: 'src/**/*.scss'
}));

gulp.task('scss', ['stylelint'], scgulp.scss({
    entry: 'src/showcar-ui.scss',
    out: 'dist/showcar-ui.css',
}));

gulp.task('clean', scgulp.clean({
    files: ['dist/**/*']
}));

gulp.task('serve', scgulp.serve({
    dir: 'dist'
}));

gulp.task('copy:fragments', () => {
    gulp.src('src/html/showcar-ui-fragment.html').pipe(gulp.dest('dist/'));
    gulp.src('src/html/showcar-ui-standalone-fragment.html').pipe(gulp.dest('dist/'));
    gulp.src('src/html/showcar-ui-toggled-fragment.html').pipe(gulp.dest('dist/'));
    gulp.src('src/html/optimizely-*.html').pipe(gulp.dest('dist/'));
});

const fs = require('fs');
const UglifyJS = require('uglify-js');
const readFile = filename => fs.readFileSync(filename, 'utf-8');
const readJsFile = filename => UglifyJS.minify(readFile(filename)).code;
const stringReplace = require('gulp-string-replace');
var replaceOptions = {
    logs: {
        enabled: false
    }
};
gulp.task('replace', function () {
    gulp.src(['src/html/index.html', 'src/html/index-standalone.html', 'docs/helpers/polyfills.js'])
        .pipe(stringReplace('@@POLYFILL_DOCUMENT_REGISTER_ELEMENT', readFile('node_modules/document-register-element/build/document-register-element.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_DOM4', readFile('node_modules/dom4/build/dom4.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_ARRAY', readJsFile('src/js/polyfills/array.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_STRING', readJsFile('src/js/polyfills/string.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_OBJECT', readJsFile('src/js/polyfills/object.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_PROMISE', readJsFile('node_modules/promiz/promiz.min.js'), replaceOptions))
        .pipe(stringReplace('@@POLYFILL_FETCH', readJsFile('node_modules/whatwg-fetch/fetch.js'), replaceOptions))
        // .pipe(stringReplace('@@POLYFILL_ES6_COLLECTIONS', readJsFile('node_modules/es6-collections/es6-collections.js'), replaceOptions))
        .pipe(stringReplace('@@SCRIPT_ERROR_COLLECTOR', readJsFile('src/js/inline-js/js-error-collector.js'), replaceOptions))
        .pipe(stringReplace('@@SCRIPT_FONT_LOADER', readJsFile('src/js/inline-js/font-loader.js'), replaceOptions))
        .pipe(gulp.dest('dist/'));
});

gulp.task('set-dev', () => {
    scgulp.config.devmode = true;
});

gulp.task('docs:generate', () => {
    require('./docs/tasks/generateJson')();
    require('./docs/tasks/generateHtml')();
});

const serveDocs = require('./docs/tasks/docs');

gulp.task('docs:serve', () => {serveDocs(gulp);});
gulp.task('docs:edit', ['build'], () => {serveDocs(gulp);});
gulp.task('docs:watch', ['build'], () => {serveDocs(gulp);});

gulp.task('build', ['js', 'icons', 'tracking', 'scss', 'copy:fragments', 'replace']);
gulp.task('default', ['docs:watch']);

const testingParams = {
    files: ['.quixoteconf.js'],
    preprocessors: {
        '.quixoteconf.js': ['webpack', 'sourcemap']
    },
    proxies: {
        '/': 'http://localhost:3000/',
    }
};

gulp.task('test', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browsers: ['Firefox', 'Chrome', 'Safari']
    }))
);

gulp.task('test:fast', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browsers: ['Chrome']
    }))
);

gulp.task('test:bs', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browserStack: {
            build: new Date().toLocaleString('de-DE', {
                hour12: false,
                month: '2-digit',
                day: '2-digit',
                hour: '2-digit',
                minute: '2-digit'
            }),
            project: 'Showcar-ui',
        },
        browsers: ['bs_safari_mac', 'bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win', 'bs_iphone6s', 'bs_iphone7'],
    }))
);

gulp.task('test:travis', ['docs:serve'], scgulp.karma(
    Object.assign({}, testingParams, {
        browserStack: {
            project: 'Showcar-ui',
        },
        // browsers: ['bs_safari_mac', 'bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win', 'bs_iphone6s', 'bs_iphone7'],
        // temporary removed iphones
        // browsers: ['bs_safari_mac', 'bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win'],
        browsers: ['bs_chrome_win', 'bs_firefox_win', 'bs_edge_win', 'bs_ie11_win'],  //temporary remove safari
        // browsers: ['bs_chrome_win'], //only test on chrome
    }))
);
<|endoftext|>