<commit_before>'use strict';

var gulp      = require('gulp');
var uglify    = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var concat    = require('gulp-concat');
var path      = require('path');

var pkg = require('./package.json');

var buildPath = path.join('../../build', pkg.version);

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('default', ['readme', 'root', 'backend', 'frontend']);

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('root', function() {
    return gulp.src([
            'package.json',
            'qforms.js',
            'server.js',
            'www.js'])
        .pipe(gulp.dest(buildPath));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('readme', function() {
    return gulp.src('../../README.md').pipe(gulp.dest(path.join(buildPath)));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('backend', function() {
    return gulp.src('backend/**/*').pipe(gulp.dest(path.join(buildPath, 'backend')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend', ['frontend_common', 'frontend_editor', 'frontend_home', 'frontend_viewer'], function() {
    return gulp.src('frontend/*.*').pipe(gulp.dest(path.join(buildPath, 'frontend')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_common', ['frontend_common_class', 'frontend_common_img', 'frontend_common_lib']);
gulp.task('frontend_common_class', ['frontend_common_class_js', 'frontend_common_class_css']);
gulp.task('frontend_common_class_js', function() {
    return gulp.src('frontend/common/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/common/class')));
});
gulp.task('frontend_common_class_css', function() {
    return gulp.src('frontend/common/class/**/*.css')
        .pipe(concat('bundle.css'))
        .pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/common/class')));
});
gulp.task('frontend_common_img', function() {
    return gulp.src('frontend/common/img/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/common/img')));
});
gulp.task('frontend_common_lib', function() {
    return gulp.src('frontend/common/lib/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/common/lib')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_editor', ['frontend_editor_class', 'frontend_editor_lib']);
gulp.task('frontend_editor_class', ['frontend_editor_class_js', 'frontend_editor_class_css', 'frontend_editor_class_ejs', 'frontend_editor_class_html']);
gulp.task('frontend_editor_class_js', function() {
    return gulp.src('frontend/editor/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_class_css', function() {
    return gulp.src('frontend/editor/class/**/*.css')
        .pipe(concat('bundle.css'))
        .pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_class_ejs', function() {
    return gulp.src('frontend/editor/class/**/*.ejs').pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_class_html', function() {
    return gulp.src('frontend/editor/class/**/*.html').pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_lib', function() {
    return gulp.src('frontend/editor/lib/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/editor/lib')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_home', ['frontend_home_class', 'frontend_home_html']);
gulp.task('frontend_home_class', ['frontend_home_class_js', 'frontend_home_class_css']);
gulp.task('frontend_home_class_js', function() {
    return gulp.src('frontend/home/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/home/class')));
});
gulp.task('frontend_home_class_css', function() {
    return gulp.src('frontend/home/class/**/*.css')
        .pipe(concat('bundle.css'))
        .pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/home/class')));
});
gulp.task('frontend_home_html', function() {
    return gulp.src('frontend/home/html/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/home/html')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_viewer', ['frontend_viewer_class']);

gulp.task('frontend_viewer_class', ['frontend_viewer_class_js', 'frontend_viewer_class_css', 'frontend_viewer_class_ejs']);

gulp.task('frontend_viewer_class_js', function() {
    return gulp.src('frontend/viewer/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/viewer/class')));
});
gulp.task('frontend_viewer_class_css', function() {
    return gulp.src('frontend/viewer/class/**/*.css')
        //.pipe(concat('bundle.css'))
        //.pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/viewer/class')));
});
gulp.task('frontend_viewer_class_ejs', function() {
    return gulp.src('frontend/viewer/class/**/*.ejs').pipe(gulp.dest(path.join(buildPath, 'frontend/viewer/class')));
});<commit_msg>license file<commit_after>'use strict';

var gulp      = require('gulp');
var uglify    = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var concat    = require('gulp-concat');
var path      = require('path');

var pkg = require('./package.json');

var buildPath = path.join('../../build', pkg.version);

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('default', ['readme', 'root', 'backend', 'frontend']);

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('root', function() {
    return gulp.src([
            'package.json',
            'qforms.js',
            'server.js',
            'www.js'])
        .pipe(gulp.dest(buildPath));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('readme', function() {
    return gulp.src(['../../README.md', '../../LICENSE']).pipe(gulp.dest(path.join(buildPath)));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('backend', function() {
    return gulp.src('backend/**/*').pipe(gulp.dest(path.join(buildPath, 'backend')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend', ['frontend_common', 'frontend_editor', 'frontend_home', 'frontend_viewer'], function() {
    return gulp.src('frontend/*.*').pipe(gulp.dest(path.join(buildPath, 'frontend')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_common', ['frontend_common_class', 'frontend_common_img', 'frontend_common_lib']);
gulp.task('frontend_common_class', ['frontend_common_class_js', 'frontend_common_class_css']);
gulp.task('frontend_common_class_js', function() {
    return gulp.src('frontend/common/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/common/class')));
});
gulp.task('frontend_common_class_css', function() {
    return gulp.src('frontend/common/class/**/*.css')
        .pipe(concat('bundle.css'))
        .pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/common/class')));
});
gulp.task('frontend_common_img', function() {
    return gulp.src('frontend/common/img/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/common/img')));
});
gulp.task('frontend_common_lib', function() {
    return gulp.src('frontend/common/lib/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/common/lib')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_editor', ['frontend_editor_class', 'frontend_editor_lib']);
gulp.task('frontend_editor_class', ['frontend_editor_class_js', 'frontend_editor_class_css', 'frontend_editor_class_ejs', 'frontend_editor_class_html']);
gulp.task('frontend_editor_class_js', function() {
    return gulp.src('frontend/editor/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_class_css', function() {
    return gulp.src('frontend/editor/class/**/*.css')
        .pipe(concat('bundle.css'))
        .pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_class_ejs', function() {
    return gulp.src('frontend/editor/class/**/*.ejs').pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_class_html', function() {
    return gulp.src('frontend/editor/class/**/*.html').pipe(gulp.dest(path.join(buildPath, 'frontend/editor/class')));
});
gulp.task('frontend_editor_lib', function() {
    return gulp.src('frontend/editor/lib/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/editor/lib')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_home', ['frontend_home_class', 'frontend_home_html']);
gulp.task('frontend_home_class', ['frontend_home_class_js', 'frontend_home_class_css']);
gulp.task('frontend_home_class_js', function() {
    return gulp.src('frontend/home/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/home/class')));
});
gulp.task('frontend_home_class_css', function() {
    return gulp.src('frontend/home/class/**/*.css')
        .pipe(concat('bundle.css'))
        .pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/home/class')));
});
gulp.task('frontend_home_html', function() {
    return gulp.src('frontend/home/html/**/*').pipe(gulp.dest(path.join(buildPath, 'frontend/home/html')));
});

////////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('frontend_viewer', ['frontend_viewer_class']);

gulp.task('frontend_viewer_class', ['frontend_viewer_class_js', 'frontend_viewer_class_css', 'frontend_viewer_class_ejs']);

gulp.task('frontend_viewer_class_js', function() {
    return gulp.src('frontend/viewer/class/**/*.js')
        .pipe(concat('bundle.js'))
        .pipe(uglify())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/viewer/class')));
});
gulp.task('frontend_viewer_class_css', function() {
    return gulp.src('frontend/viewer/class/**/*.css')
        //.pipe(concat('bundle.css'))
        //.pipe(minifyCss())
        .pipe(gulp.dest(path.join(buildPath, 'frontend/viewer/class')));
});
gulp.task('frontend_viewer_class_ejs', function() {
    return gulp.src('frontend/viewer/class/**/*.ejs').pipe(gulp.dest(path.join(buildPath, 'frontend/viewer/class')));
});
{'fraction_non_alphanumeric': 0.3277628485052066, 'fraction_numerical': 0.0, 'mean_word_length': 2.16644509438979, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7556934', 'n_tokens_mistral': 3654, 'n_tokens_neox': 3646, 'n_words': 366}