<commit_before>
// require dependencies
const gulp       = require ('gulp');
const glob       = require ('glob-all');
const buffer     = require ('vinyl-buffer');
const source     = require ('vinyl-source-stream');
const uglify     = require ('gulp-uglify');
const babelify   = require ('babelify');
const sourcemaps = require ('gulp-sourcemaps');
const browserify = require ('browserify');

/**
 * build serviceworker task class
 *
 * @task serviceworker
 */
class serviceworkerTask {
  /**
   * construct serviceworker task class
   *
   * @param {edenGulp} runner
   */
  constructor (runner) {
    // set private variables
    this._runner = runner;

    // bind methods
    this.run   = this.run.bind (this);
    this.watch = this.watch.bind (this);
  }

  /**
   * run assets task
   *
   * @return {Promise}
   */
  run (files) {
    // create javascript array
    let entries = glob.sync (files);

    // browserfiy javascript
    return browserify ({
      entries : entries,
      paths   : [
        './',
        './app/bundles',
        './lib/bundles',
        './node_modules'
      ]
    })
      .transform (babelify)
      .bundle ()
      .pipe (source ('sw.min.js'))
      .pipe (buffer ())
      .pipe (sourcemaps.init ({
        'loadMaps' : true
      }))
      .pipe (uglify ({
        'compress' : true
      }))
      .pipe (sourcemaps.write ('./www/public/js'))
      .pipe (gulp.dest ('./www/public/js'));
  }

  /**
   * watch task
   *
   * @return {Array}
   */
  watch () {
    // return files
    return [
      'serviceworker/**/*.js'
    ];
  }
}

/**
 * export serviceworker task
 *
 * @type {serviceworkerTask}
 */
exports = module.exports = serviceworkerTask;<commit_msg>amend serviceworker task to use public/js<commit_after>
// require dependencies
const gulp       = require ('gulp');
const glob       = require ('glob-all');
const buffer     = require ('vinyl-buffer');
const source     = require ('vinyl-source-stream');
const uglify     = require ('gulp-uglify');
const babelify   = require ('babelify');
const sourcemaps = require ('gulp-sourcemaps');
const browserify = require ('browserify');

/**
 * build serviceworker task class
 *
 * @task serviceworker
 */
class serviceworkerTask {
  /**
   * construct serviceworker task class
   *
   * @param {edenGulp} runner
   */
  constructor (runner) {
    // set private variables
    this._runner = runner;

    // bind methods
    this.run   = this.run.bind (this);
    this.watch = this.watch.bind (this);
  }

  /**
   * run assets task
   *
   * @return {Promise}
   */
  run (files) {
    // create javascript array
    let entries = glob.sync (files);

    // browserfiy javascript
    return browserify ({
      entries : entries,
      paths   : [
        './',
        './app/bundles',
        './lib/bundles',
        './node_modules'
      ]
    })
      .transform (babelify)
      .bundle ()
      .pipe (source ('sw.min.js'))
      .pipe (buffer ())
      .pipe (sourcemaps.init ({
        'loadMaps' : true
      }))
      .pipe (uglify ({
        'compress' : true
      }))
      .pipe (sourcemaps.write ('./www/public/js'))
      .pipe (gulp.dest ('./www/public/js'));
  }

  /**
   * watch task
   *
   * @return {Array}
   */
  watch () {
    // return files
    return [
      'public/js/serviceworker.js'
    ];
  }
}

/**
 * export serviceworker task
 *
 * @type {serviceworkerTask}
 */
exports = module.exports = serviceworkerTask;
{'fraction_non_alphanumeric': 0.1553172993335265, 'fraction_numerical': 0.0, 'mean_word_length': 2.1127141568981065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1078405', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1074, 'n_words': 260}