<commit_before>var gulp = require('gulp');

gulp.task('default', function() {
  console.log('Hello Gulp!');
});

var tslint = require('gulp-tslint');
gulp.task('lint', function() {
  return gulp.src([
   './source/ts/**/**.ts', './test/**/**.test.ts'
 ]).pipe(tslint.report({
      formatter: 'verbose'
    }))
    .pipe(tslint.report());
});

var ts = require('gulp-typescript');
var tsProject = ts.createProject({
    removeComments : true,
    noImplicitAny : true,
    target : 'ES3',
    module : 'commonjs',
    declarationFiles : false
});

gulp.task('tsc', function() {
return gulp.src('./source/ts/**/**.ts')
           .pipe(tsProject())
           .js.pipe(gulp.dest('./temp/source/js'));
});

var tsTestProject = ts.createProject({
    removeComments : true,
    noImplicitAny : true,
    target : 'ES3',
    module : 'commonjs',
    declarationFiles : false
});

gulp.task('tsc-tests', function() {
  return gulp.src('./test/**/**.test.ts')
             .pipe(tsTestProject())
             .js.pipe(gulp.dest('./temp/test/'));
});

var browserify  = require('browserify'),
    transform   = require('vinyl-transform'),
    uglify      = require('gulp-uglify'),
    sourcemaps  = require('gulp-sourcemaps');

var browserified = transform(function(filename) {
  var b = browserify({ entries: filename, debug: true });
  return b.bundle();
});

gulp.task('bundle-js', function () {
  return gulp.src('./temp/source/js/main.js')
             .pipe(browserified)
             .pipe(sourcemaps.init({ loadMaps: true }))
             .pipe(uglify())
             .pipe(sourcemaps.write('./'))
             .pipe(gulp.dest('./dist/source/js/'));
});

gulp.task('bundle-test', function () {
  return gulp.src('./temp/test/**/**.test.js')
             .pipe(browserified)
             .pipe(gulp.dest('./dist/test/'));
});

var Server = require('karma').Server;

gulp.task('karma', function (done) {
  new Server({
    configFile: './karma.conf.js',
    singleRun: true
  }, done).start();
});

gulp.task('bundle', function(cb) {
  runSequence('build', [
    'bundle-js', 'bundle-test'
  ], cb);
});

var browserSync = require('browser-sync');
gulp.task('browser-sync', ['test'], function() {
  browserSync({
    server: {
      baseDir: "./dist"
    }});
  });

  var runSequence = require('run-sequence');
  gulp.task('default', function(cb) {
    runSequence(
      'lint',                      // lint
      ['tsc', 'tsc-tests'],        // compile
      ['bundle-js','bundle-test'], // optimize
      'karma',                      // test
      'browser-sync',              // serve<commit_msg>Fix for path resolution issue on windows<commit_after>var gulp = require('gulp');

gulp.task('default', function() {
  console.log('Hello Gulp!');
});

var tslint = require('gulp-tslint');
gulp.task('lint', function() {
  return gulp.src([
   './source/ts/**/**.ts', './test/**/**.test.ts'
 ]).pipe(tslint.report({
      formatter: 'verbose'
    }))
    .pipe(tslint.report());
});

var ts = require('gulp-typescript');
var tsProject = ts.createProject({
    removeComments : true,
    noImplicitAny : true,
    target : 'ES3',
    module : 'commonjs',
    declarationFiles : false
});

gulp.task('tsc', function() {
return gulp.src('./source/ts/**/**.ts')
           .pipe(tsProject())
           .js.pipe(gulp.dest('./temp/source/js'));
});

var tsTestProject = ts.createProject({
    removeComments : true,
    noImplicitAny : true,
    target : 'ES3',
    module : 'commonjs',
    declarationFiles : false
});

gulp.task('tsc-tests', function() {
  return gulp.src('./test/**/**.test.ts')
             .pipe(tsTestProject())
             .js.pipe(gulp.dest('./temp/test/'));
});

var browserify  = require('browserify'),
    transform   = require('vinyl-transform'),
    uglify      = require('gulp-uglify'),
    sourcemaps  = require('gulp-sourcemaps');

var browserified = transform(function(filename) {
  var b = browserify({ entries: filename, debug: true });
  return b.bundle();
});

gulp.task('bundle-js', function () {
  return gulp.src('./temp/source/js/main.js')
             .pipe(browserified)
             .pipe(sourcemaps.init({ loadMaps: true }))
             .pipe(uglify())
             .pipe(sourcemaps.write('./'))
             .pipe(gulp.dest('./dist/source/js/'));
});

gulp.task('bundle-test', function () {
  return gulp.src('./temp/test/**/**.test.js')
             .pipe(browserified)
             .pipe(gulp.dest('./dist/test/'));
});

var Server = require('karma').Server;

gulp.task('karma', function (done) {
  new Server({
    configFile: require('path').resolve('karma.conf.js'),
    singleRun: true
  }, done).start();
});

gulp.task('bundle', function(cb) {
  runSequence('build', [
    'bundle-js', 'bundle-test'
  ], cb);
});

var browserSync = require('browser-sync');
gulp.task('browser-sync', ['test'], function() {
  browserSync({
    server: {
      baseDir: "./dist"
    }});
  });

  var runSequence = require('run-sequence');
  gulp.task('default', function(cb) {
    runSequence(
      'lint',                      // lint
      ['tsc', 'tsc-tests'],        // compile
      ['bundle-js','bundle-test'], // optimize
      'karma',                      // test
      'browser-sync',              // serve
{'fraction_non_alphanumeric': 0.20734958111195734, 'fraction_numerical': 0.0007616146230007616, 'mean_word_length': 2.6127922971114166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3565695', 'n_tokens_mistral': 1716, 'n_tokens_neox': 1703, 'n_words': 295}