<commit_before>var gulp = require('gulp');
var ts = require('gulp-typescript');
var uglify = require('gulp-uglify');
var webpack = require('webpack-stream');
var del = require('del');
var rename = require("gulp-rename");
var gutil = require('gulp-util');

var tsProject = ts.createProject('tsconfig.json');
///////////////////////////////////////////////////////
// CLEAN                                             //
///////////////////////////////////////////////////////
gulp.task('clean:all', function () {
    return del([
      'dist/**/*',
      'lib/**/*',
    ]);
  });

///////////////////////////////////////////////////////
// PATCH                                             //
///////////////////////////////////////////////////////

gulp.task('patch', ['clean:all'], function () {
    let projectAction = function(project) {
            project.version = process.env.version || project.version
            return project;
        };

    patchProject(projectAction)
        .pipe(gulp.dest('./'));
});

gulp.task('compile', ['patch', 'clean:all'], function () {

    let tsResult = tsProject.src()
                            .pipe(tsProject());
    
    return tsResult.js.pipe(gulp.dest('lib'));
});

gulp.task('copy', ['compile', 'webpack'], function() {
    gulp.src('./types/loxium.d.ts')
        .pipe(gulp.dest('./lib/'))
})

gulp.task('webpack', ['compile'], function () {

      let project = require('./package.json');
    
        return gulp.src('./lib/loxium.js')
            .pipe(webpack(require('./webpack.config.js')))
            .pipe(uglify())
            .pipe(rename(`loxium-${project.version}.min.js`))
            .pipe(gulp.dest(`dist/`));
    });

gulp.task('default', [ 'clean:all', 'patch', 'compile', 'webpack', 'copy' ]);

function patchProject(action) {
    let package = require('./package.json');

    package = action(package);<commit_msg>changes gulp file not to include version in compiled script<commit_after>var gulp = require('gulp');
var ts = require('gulp-typescript');
var uglify = require('gulp-uglify');
var webpack = require('webpack-stream');
var del = require('del');
var rename = require("gulp-rename");
var gutil = require('gulp-util');

var tsProject = ts.createProject('tsconfig.json');
///////////////////////////////////////////////////////
// CLEAN                                             //
///////////////////////////////////////////////////////
gulp.task('clean:all', function () {
    return del([
      'dist/**/*',
      'lib/**/*',
    ]);
  });

///////////////////////////////////////////////////////
// PATCH                                             //
///////////////////////////////////////////////////////

gulp.task('patch', ['clean:all'], function () {
    let projectAction = function(project) {
            project.version = process.env.version || project.version
            return project;
        };

    patchProject(projectAction)
        .pipe(gulp.dest('./'));
});

gulp.task('compile', ['patch', 'clean:all'], function () {

    let tsResult = tsProject.src()
                            .pipe(tsProject());
    
    return tsResult.js.pipe(gulp.dest('lib'));
});

gulp.task('copy', ['compile', 'webpack'], function() {
    gulp.src('./types/loxium.d.ts')
        .pipe(gulp.dest('./lib/'))
})

gulp.task('webpack', ['compile'], function () {

        return gulp.src('./lib/loxium.js')
            .pipe(webpack(require('./webpack.config.js')))
            .pipe(uglify())
            .pipe(rename(`loxium.min.js`))
            .pipe(gulp.dest(`dist/`));
    });

gulp.task('default', [ 'clean:all', 'patch', 'compile', 'webpack', 'copy' ]);

function patchProject(action) {
    let package = require('./package.json');

    package = action(package);
{'fraction_non_alphanumeric': 0.2934753661784288, 'fraction_numerical': 0.0, 'mean_word_length': 1.611961057023644, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2517171', 'n_tokens_mistral': 1015, 'n_tokens_neox': 1008, 'n_words': 177}