<commit_before>/*
 * @title Scripts
 * @description A task to concatenate and compress js files
 * @example (cli) gulp scripts
 */


/*********************************************************************************
 1. DEPENDENCIES
 *********************************************************************************/

import babel from 'gulp-babel';
import bowerFiles from 'main-bower-files';
import concat from 'gulp-concat';
import cache from 'gulp-cached';
import gulpif from 'gulp-if';
import merge from 'merge-stream';
import rev from 'gulp-rev';
import uglify from 'gulp-uglify';
import sourcemaps from 'gulp-sourcemaps';


/*********************************************************************************
 2. TASK
 *********************************************************************************/

export default () => {

  let libs = gulp
    .src(bowerFiles('**/*.js'))
    .pipe(plumber({errorHandler: sharedEvents.onError}))
    .pipe(gulpif(gulpboilerplate.uglify, uglify()))
    .pipe(gulpif(gulpboilerplate.concat, concat('libs.min.js')))
    .pipe(gulpif(gulpboilerplate.rev, rev()))
    .pipe(gulp.dest(`${ sharedPaths.outputDir }/js/bower`));

  let app = gulp
    .src(sharedPaths.concatSrc)
    .pipe(plumber({errorHandler: sharedEvents.onError}))
    .pipe(gulpif(gulpboilerplate.cache, cache('scripts')))
    .pipe(gulpif(gulpboilerplate.sourcemaps, sourcemaps.init()))
    .pipe(babel())
    .pipe(gulpif(gulpboilerplate.sourcemaps, sourcemaps.write()))
    .pipe(gulpif(gulpboilerplate.uglify, uglify()))
    .pipe(gulpif(gulpboilerplate.concat, concat('app.min.js')))
    .pipe(gulpif(gulpboilerplate.rev, rev()))
    .pipe(gulp.dest(`${ sharedPaths.outputDir }/js`));

  return merge(libs, app);

};

<commit_msg>chore(gulp): explicitly importing required modules<commit_after>/*
 * @title Scripts
 * @description A task to concatenate and compress js files
 * @example (cli) gulp scripts
 */


/*********************************************************************************
 1. DEPENDENCIES
 *********************************************************************************/

import sharedPaths  from '../shared/paths.js';
import sharedEvents from '../shared/events.js';
import gulp         from 'gulp';
import babel        from 'gulp-babel';
import cache        from 'gulp-cached';
import concat       from 'gulp-concat';
import gulpif       from 'gulp-if';
import plumber      from 'gulp-plumber';
import rev          from 'gulp-rev';
import sourcemaps   from 'gulp-sourcemaps';
import uglify       from 'gulp-uglify';
import bowerFiles   from 'main-bower-files';
import merge        from 'merge-stream';


/*********************************************************************************
 2. TASK
 *********************************************************************************/

export default () => {

    let libs = gulp
        .src(bowerFiles('**/*.js'))
        .pipe(plumber({errorHandler: sharedEvents.onError}))
        .pipe(gulpif(gulpboilerplate.uglify, uglify()))
        .pipe(gulpif(gulpboilerplate.concat, concat('libs.min.js')))
        .pipe(gulpif(gulpboilerplate.rev, rev()))
        .pipe(gulp.dest(`${ sharedPaths.outputDir }/js/bower`));

    let app = gulp
        .src(sharedPaths.concatSrc)
        .pipe(plumber({errorHandler: sharedEvents.onError}))
        .pipe(gulpif(gulpboilerplate.cache, cache('scripts')))
        .pipe(gulpif(gulpboilerplate.sourcemaps, sourcemaps.init()))
        .pipe(babel())
        .pipe(gulpif(gulpboilerplate.sourcemaps, sourcemaps.write()))
        .pipe(gulpif(gulpboilerplate.uglify, uglify()))
        .pipe(gulpif(gulpboilerplate.concat, concat('app.min.js')))
        .pipe(gulpif(gulpboilerplate.rev, rev()))
        .pipe(gulp.dest(`${ sharedPaths.outputDir }/js`));

    return merge(libs, app);

};


{'fraction_non_alphanumeric': 0.29884453781512604, 'fraction_numerical': 0.0010504201680672268, 'mean_word_length': 4.504335260115607, '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': '1192267', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1131, 'n_words': 216}