<commit_before>/*!
 * gulp
 * Dependencies
 * - You need node installed if you don't already have it - https://nodejs.org/en/
 * - Open Terminal
 * - Run command 'npm install --global gulp'
 *
 * Project usage
 * - Navigate to the root of your project in terminal with 'cd <path to your project>'
 * - Run the command 'npm install' which installs all of the gulp plugins to the project
 * - Run the command 'gulp' if you want to manually clean up and compile all CSS, JS, and images
 * - Run the command 'gulp watch'
 */

var

    // Dependencies
    browserSync = require('browser-sync'),
    gulp = require('gulp'),
    del = require('del'),
    plugins = require("gulp-load-plugins")(),

    // Paths
    base = {
        src: 'src',
        public: 'public'
    },
    assets = base.public + '/assets'
    paths = {
        styles: {
            src:  base.src + '/scss/**/*.scss',
            dest: assets + '/css'
        },
        scripts: {
            src: base.src + '/js',
            dest: assets + '/js',
            destFiles: assets + '/js/**/*',
            precompiled: {
                root: assets + '/js/precompiled',
                files: assets + '/js/precompiled/**'
            }
        },
        images: {
            src:  base.src + '/img/**/*',
            dest: assets + '/img'
        }
    };


// Clean

gulp.task('clean', function(cb) {
    return del([
        paths.styles.dest,
        paths.scripts.destFiles,
        '!' + paths.scripts.precompiled.root,
        '!' + paths.scripts.precompiled.files,
        paths.images.dest
    ], cb);
});


// SCSS

gulp.task('styles', function() {

    return gulp.src(paths.styles.src)
        .pipe(plugins.sass({ errLogToConsole: true, outputStyle: 'expanded' }))
        .pipe(plugins.autoprefixer({ browsers: ['last 2 versions', 'IE 9'], cascade: false }))
        .pipe(plugins.sourcemaps.init())
        .pipe(plugins.cleanCss({ restructuring: false }))
        .pipe(plugins.sourcemaps.write('.'))
        .pipe(gulp.dest(paths.styles.dest))
        .pipe(browserSync.stream());

});


// Images

gulp.task('images', function() {

    var optimised = plugins.filter('**/*.{jpg,png}', { restore: true });

    return gulp.src(paths.images.src)
        .pipe(plugins.changed(paths.images.dest))
        .pipe(optimised)
        .pipe(plugins.tinypng('5_gZs_VCSFhHU28xGAVSm8o_JbT0Gpum'))
        .pipe(optimised.restore)
        .pipe(gulp.dest(paths.images.dest))
        .pipe(browserSync.stream());

});


// JS

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

gulp.task('scripts', function() {

    return gulp.src([
            paths.scripts.src + '/libs.js',
            paths.scripts.src + '/plugins.js',
            paths.scripts.src + '/utils.js',
            paths.scripts.src + '/site.js'
        ])
        .pipe(plugins.imports())
        .pipe(plugins.uglify())
        .on('error', onError)
        .pipe(gulp.dest(paths.scripts.dest))
        .pipe(browserSync.stream());

});

function onError(err) {
    plugins.notify.onError({
        message: 'Error: <%= err %>'
    });
    console.log(err);
}

// Watch
gulp.task('watch', function() {

    browserSync.init({
        ghostMode: { scroll: false },
        notify: false,
        open: false,
        proxy: 'front-end-baseplate.dev.com'
    });

    gulp.watch(paths.styles.src, ['styles']);

    gulp.watch(paths.images.src, ['images']);

    gulp.watch(paths.scripts.src + '/**/*.js', ['plugins.jshint']);

    gulp.watch(paths.scripts.src, ['scripts']);

    gulp.watch(['public/**/*.html', 'public/**/*.php']) .on('change', browserSync.reload);

});

gulp.task('default', ['clean'], function() {
    gulp.start('styles', 'scripts', 'images');
});<commit_msg>Added extra js path for simplicity.<commit_after>/*!
 * gulp
 * Dependencies
 * - You need node installed if you don't already have it - https://nodejs.org/en/
 * - Open Terminal
 * - Run command 'npm install --global gulp'
 *
 * Project usage
 * - Navigate to the root of your project in terminal with 'cd <path to your project>'
 * - Run the command 'npm install' which installs all of the gulp plugins to the project
 * - Run the command 'gulp' if you want to manually clean up and compile all CSS, JS, and images
 * - Run the command 'gulp watch'
 */

var

    // Dependencies
    browserSync = require('browser-sync'),
    gulp = require('gulp'),
    del = require('del'),
    plugins = require("gulp-load-plugins")(),

    // Paths
    base = {
        src: 'src',
        public: 'public'
    },
    assets = base.public + '/assets'
    paths = {
        styles: {
            src:  base.src + '/scss/**/*.scss',
            dest: assets + '/css'
        },
        scripts: {
            dir: base.src + '/js',
            src: base.src + '/js/**/*.js',
            dest: assets + '/js',
            destFiles: assets + '/js/**/*',
            precompiled: {
                root: assets + '/js/precompiled',
                files: assets + '/js/precompiled/**'
            }
        },
        images: {
            src:  base.src + '/img/**/*',
            dest: assets + '/img'
        }
    };


// Clean

gulp.task('clean', function(cb) {
    return del([
        paths.styles.dest,
        paths.scripts.destFiles,
        '!' + paths.scripts.precompiled.root,
        '!' + paths.scripts.precompiled.files,
        paths.images.dest
    ], cb);
});


// SCSS

gulp.task('styles', function() {

    return gulp.src(paths.styles.src)
        .pipe(plugins.sass({ errLogToConsole: true, outputStyle: 'expanded' }))
        .pipe(plugins.autoprefixer({ browsers: ['last 2 versions', 'IE 9'], cascade: false }))
        .pipe(plugins.sourcemaps.init())
        .pipe(plugins.cleanCss({ restructuring: false }))
        .pipe(plugins.sourcemaps.write('.'))
        .pipe(gulp.dest(paths.styles.dest))
        .pipe(browserSync.stream());

});


// Images

gulp.task('images', function() {

    var optimised = plugins.filter('**/*.{jpg,png}', { restore: true });

    return gulp.src(paths.images.src)
        .pipe(plugins.changed(paths.images.dest))
        .pipe(optimised)
        .pipe(plugins.tinypng('5_gZs_VCSFhHU28xGAVSm8o_JbT0Gpum'))
        .pipe(optimised.restore)
        .pipe(gulp.dest(paths.images.dest))
        .pipe(browserSync.stream());

});


// JS

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

gulp.task('scripts', function() {

    return gulp.src([
            paths.scripts.dir + '/libs.js',
            paths.scripts.dir + '/plugins.js',
            paths.scripts.dir + '/utils.js',
            paths.scripts.dir + '/site.js'
        ])
        .pipe(plugins.imports())
        .pipe(plugins.uglify())
        .on('error', onError)
        .pipe(gulp.dest(paths.scripts.dest))
        .pipe(browserSync.stream());

});

function onError(err) {
    plugins.notify.onError({
        message: 'Error: <%= err %>'
    });
    console.log(err);
}

// Watch
gulp.task('watch', function() {

    browserSync.init({
        ghostMode: { scroll: false },
        notify: false,
        open: false,
        proxy: 'front-end-baseplate.dev.com'
    });

    gulp.watch(paths.styles.src, ['styles']);

    gulp.watch(paths.images.src, ['images']);

    gulp.watch(paths.scripts.src, ['plugins.jshint']);

    gulp.watch(paths.scripts.src, ['scripts']);

    gulp.watch(['public/**/*.html', 'public/**/*.php']) .on('change', browserSync.reload);

});

gulp.task('default', ['clean'], function() {
    gulp.start('styles', 'scripts', 'images');
});
{'fraction_non_alphanumeric': 0.17951698308149297, 'fraction_numerical': 0.0018080847216841018, 'mean_word_length': 2.2320534223706177, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4384974', 'n_tokens_mistral': 2553, 'n_tokens_neox': 2474, 'n_words': 498}