<commit_before>var gulp        = require('gulp');
var imagemin    = require('gulp-imagemin');
var notify      = require('gulp-notify');
var cssimport   = require('gulp-cssimport');
var include     = require("gulp-include");
var shell       = require('gulp-shell');
var zip         = require('gulp-zip');
var open        = require('gulp-open');
var runSequence = require('run-sequence');
var del         = require('del');
var pkg         = require('./package.json')
var browserSync = require('browser-sync').create();
var fs          = require('fs');
var yaml        = require('js-yaml');
var argv        = require('yargs').argv;
var gulpif      = require('gulp-if');
var svgSprite   = require('gulp-svg-sprite');
var changed     = require('gulp-changed');
var cheerio     = require('gulp-cheerio');

/**
 *
 *  All paths used by tasks
 *
 */
var paths = {
  srcScss: 'src/stylesheets/**/*.*',
  srcJs: 'src/javascripts/**/*.*',
  srcIcons: 'src/icons/*.svg',
  tempIcons: 'src/icons/temp', // so we never overwrite original files
  srcIconsTemp: 'src/icons/temp/*.svg',
  srcAssets: [
    'src/assets/*.*',
    'src/templates/**/*.*',
    'src/snippets/*.*',
    'src/locales/*.*',
    'src/config/*.*',
    'src/layout/*.*'
  ],
  parentIncludeScss: [
    'src/stylesheets/[^_]*.*'
  ],
  parentIncludeJs: [
    'src/javascripts/[^_]*.*'
  ],
  images: 'src/images/*.{png,jpg,gif}',
  destAssets: 'dist/assets',
  destSnippets: 'dist/snippets',
  config: 'config.yml',
  watch: '.themekit',
  dist: 'dist/'
};

/**
 *   CONCAT CSS:
 *
 *   Concatenate css together into a single scss file for use in the theme
 */
gulp.task('concat-css', function () {
  gulp.src(paths.parentIncludeScss)
    .pipe(cssimport())
    .pipe(gulp.dest(paths.destAssets));
});

/**
 *   CONCAT JS:
 *
 *   Concatenate JS together into a single file for use in the theme
 */
gulp.task('concat-js', function () {
  gulp.src(paths.parentIncludeJs)
    .pipe(include())
      .on('error', console.log)
    .pipe(gulp.dest(paths.destAssets));
});

/**
 *  SVG CLASSES
 *
 *  Make sure all icons have class="icon"
 *  Files with `-full-color` in their name will also get
 *  class="icon--full-color" so CSS cannot override them
 */
gulp.task('icon-class', function (callback) {
  return gulp
    .src(paths.srcIcons)
      .pipe(changed(paths.tempIcons))
      .pipe(cheerio({
        run: function ($, file) {
          var $svg = $('svg');
          if (file.relative.indexOf('-full-color') >= 0){
            $svg.addClass('icon icon--full-color')
          }
          $svg.addClass('icon');
       }
   }))
   .pipe(gulp.dest(paths.tempIcons));
});

/**
 *  SVG SPRITES
 *
 *  Create an svg sprite from all svg icon files
 *  Runs after icon-class task
 */
gulp.task('svgicons', ['icon-class'], function() {
  gulp.src(paths.srcIconsTemp)
    .pipe(svgSprite({
      svg: {
        namespaceClassnames: false
      },
      mode: {
        symbol: {
          inline: true,
          sprite: 'icon-sprite.svg.liquid',
          dest: '.'
        }
      }
    }))
      .on('error', function(error){
        console.log('Error with svgicons task. Potentially trying to parse an empty file. Full error below.');
        console.log(error);
      })
    .pipe(gulp.dest(paths.destSnippets));
});

/**
 *   BUILD ASSETS:
 *
 *   Move all your templates, snippets, config, and assets into the dist folder
 */
gulp.task('build-assets', function () {
  return gulp.src(paths.srcAssets, {base: 'src/'})
    .pipe(changed(paths.dist))
    .pipe(gulp.dest(paths.dist));
});

/**
 *   CONFIG:
 *
 *
 */
gulp.task('config', function () {
  return gulp.src(paths.config)
    .pipe(gulp.dest(paths.dist));
});

/**
 *    IMAGEMIN
 *
 *    Minify Images
 */
gulp.task('imagemin', function () {
  gulp.src(paths.images)
    .pipe(imagemin({
        optimizationLevel: 3
    }))
    .pipe(gulp.dest(paths.destAssets))
});

/**
 *  BROWSERSYNC
 */
gulp.task('browser-sync', function (options) {<commit_msg>Added return to other tasks<commit_after>var gulp        = require('gulp');
var imagemin    = require('gulp-imagemin');
var notify      = require('gulp-notify');
var cssimport   = require('gulp-cssimport');
var include     = require("gulp-include");
var shell       = require('gulp-shell');
var zip         = require('gulp-zip');
var open        = require('gulp-open');
var runSequence = require('run-sequence');
var del         = require('del');
var pkg         = require('./package.json')
var browserSync = require('browser-sync').create();
var fs          = require('fs');
var yaml        = require('js-yaml');
var argv        = require('yargs').argv;
var gulpif      = require('gulp-if');
var svgSprite   = require('gulp-svg-sprite');
var changed     = require('gulp-changed');
var cheerio     = require('gulp-cheerio');

/**
 *
 *  All paths used by tasks
 *
 */
var paths = {
  srcScss: 'src/stylesheets/**/*.*',
  srcJs: 'src/javascripts/**/*.*',
  srcIcons: 'src/icons/*.svg',
  tempIcons: 'src/icons/temp', // so we never overwrite original files
  srcIconsTemp: 'src/icons/temp/*.svg',
  srcAssets: [
    'src/assets/*.*',
    'src/templates/**/*.*',
    'src/snippets/*.*',
    'src/locales/*.*',
    'src/config/*.*',
    'src/layout/*.*'
  ],
  parentIncludeScss: [
    'src/stylesheets/[^_]*.*'
  ],
  parentIncludeJs: [
    'src/javascripts/[^_]*.*'
  ],
  images: 'src/images/*.{png,jpg,gif}',
  destAssets: 'dist/assets',
  destSnippets: 'dist/snippets',
  config: 'config.yml',
  watch: '.themekit',
  dist: 'dist/'
};

/**
 *   CONCAT CSS:
 *
 *   Concatenate css together into a single scss file for use in the theme
 */
gulp.task('concat-css', function () {
  return gulp.src(paths.parentIncludeScss)
    .pipe(cssimport())
    .pipe(gulp.dest(paths.destAssets));
});

/**
 *   CONCAT JS:
 *
 *   Concatenate JS together into a single file for use in the theme
 */
gulp.task('concat-js', function () {
  return gulp.src(paths.parentIncludeJs)
    .pipe(include())
      .on('error', console.log)
    .pipe(gulp.dest(paths.destAssets));
});

/**
 *  SVG CLASSES
 *
 *  Make sure all icons have class="icon"
 *  Files with `-full-color` in their name will also get
 *  class="icon--full-color" so CSS cannot override them
 */
gulp.task('icon-class', function (callback) {
  return gulp.src(paths.srcIcons)
    .pipe(changed(paths.tempIcons))
    .pipe(cheerio({
      run: function ($, file) {
        var $svg = $('svg');
        if (file.relative.indexOf('-full-color') >= 0){
          $svg.addClass('icon icon--full-color')
        }
        $svg.addClass('icon');
     }
   }))
   .pipe(gulp.dest(paths.tempIcons));
});

/**
 *  SVG SPRITES
 *
 *  Create an svg sprite from all svg icon files
 *  Runs after icon-class task
 */
gulp.task('svgicons', ['icon-class'], function() {
  return gulp.src(paths.srcIconsTemp)
    .pipe(svgSprite({
      svg: {
        namespaceClassnames: false
      },
      mode: {
        symbol: {
          inline: true,
          sprite: 'icon-sprite.svg.liquid',
          dest: '.'
        }
      }
    }))
      .on('error', function(error){
        console.log('Error with svgicons task. Potentially trying to parse an empty file. Full error below.');
        console.log(error);
      })
    .pipe(gulp.dest(paths.destSnippets));
});

/**
 *   BUILD ASSETS:
 *
 *   Move all your templates, snippets, config, and assets into the dist folder
 */
gulp.task('build-assets', function () {
  return gulp.src(paths.srcAssets, {base: 'src/'})
    .pipe(changed(paths.dist))
    .pipe(gulp.dest(paths.dist));
});

/**
 *   CONFIG:
 *
 *
 */
gulp.task('config', function () {
  return gulp.src(paths.config)
    .pipe(gulp.dest(paths.dist));
});

/**
 *    IMAGEMIN
 *
 *    Minify Images
 */
gulp.task('imagemin', function () {
  return gulp.src(paths.images)
    .pipe(imagemin({
        optimizationLevel: 3
    }))
    .pipe(gulp.dest(paths.destAssets))
});

/**
 *  BROWSERSYNC
 */
gulp.task('browser-sync', function (options) {
{'fraction_non_alphanumeric': 0.1840814786872878, 'fraction_numerical': 0.0005029548598013328, 'mean_word_length': 2.716822429906542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4504567', 'n_tokens_mistral': 2803, 'n_tokens_neox': 2736, 'n_words': 565}