<commit_before>var browsersync = require("browser-sync");
var argv = require("yargs").argv;
var gulp = require("gulp");
var nodemon = require("gulp-nodemon");
var karma = require("karma");

var gft = require("gulp-frontend-tasks")(gulp);

process.env.NODE_ENV = process.env.NODE_ENV || "development";

var bsApp = browsersync.create();
var bsTest = browsersync.create();

var distPath = "server/public";
var testPath = ".tmp/test/";

var karmaPort = 3001;
var bsAppPort = 3002;
var bsTestPort = 3004;

var libs = [
  "underscore",
  "es5-shim/es5-shim",
  "es5-shim/es5-sham",
];

var testLibs = [
  "chai",
];

gft.generateTask("js", {
  taskName: "lib",
  entries: [
    "client/js/libs/entry.js",
  ],
  includes: [
    "client/js/libs",
  ],
  dest: distPath + "/js/",
  destFileName: "lib.js",
  browserify: {
    requires: libs,
  },
  watch: [
    "client/js/libs/entry.js",
  ],
  browsersync: bsApp,
});

gft.generateTask("js", {
  taskName: "app",
  entries: [
    "client/js/src/*.js",
  ],
  dest: distPath + "/js/",
  includes: [
    "client/js/src",
  ],
  browserify: {
    externals: libs,
  },
  watch: [
    "client/js/src/*.js",
  ],
  browsersync: bsApp,
});

gft.generateTask("js", {
  taskName: "testLib",
  entries: [
    "client/js/test/libs/entry.js",
  ],
  includes: [
    "client/js/test/libs",
  ],
  dest: testPath + "/js/",
  destFileName: "testLib.js",
  browserify: {
    requires: testLibs,
  },
  watch: [
    "client/js/test/libs/entry.js",
  ],
  browsersync: bsTest,
});

gft.generateTask("js", {
  taskName: "test",
  entries: [
    "client/js/test/src/**/*.js",
  ],
  dest: testPath + "/js/",
  includes: [
    "client/js/test/src",
    "client/js/src",
  ],
  browserify: {
    externals: libs.concat(testLibs),
  },
  watch: [
    "client/js/test/src/**/*.js",
  ],
  browsersync: bsTest,
});

gulp.task("build:js", [
  "build:js:lib",
  "build:js:app",
  "build:js:test",
]);

gulp.task("watch:js", [
  "watch:js:lib",
  "watch:js:app",
  "watch:js:test",
]);

gft.generateTask("css:scss", {
  taskName: "app",
  entries: [
    "client/css/src/*.scss",
  ],
  includes: [
    "client/css/src/",
    "node_modules/",
  ],
  dest: distPath + "/css/",
  watch: [
    "client/css/src/**/*.scss",
  ],
  browsersync: bsApp,
});

gulp.task("build:css", [
  "build:css:scss:app",
]);

gulp.task("watch:css", [
  "watch:css:scss:app",
]);

gulp.task("build", [
  "build:js",
  "build:css",
]);

gulp.task("serve", [], function () {
  nodemon({
    watch: [
      "server",
    ],
    ignore: [
      "server/public/js/*.js*",
      "server/public/css/*.css*",
    ],
    script: "server/index.js",
    ext: "js html",
  });
});

gulp.task("test:karma", [
  "build:js:testLib",
  "build:js:test",
], function (done) {
  new karma.Server({
    configFile: __dirname + "/karma.conf.js",
    singleRun: true
  }, done).start();
});

gulp.task("watch:test:karma", [<commit_msg>Don't reload server when changing html<commit_after>var browsersync = require("browser-sync");
var argv = require("yargs").argv;
var gulp = require("gulp");
var nodemon = require("gulp-nodemon");
var karma = require("karma");

var gft = require("gulp-frontend-tasks")(gulp);

process.env.NODE_ENV = process.env.NODE_ENV || "development";

var bsApp = browsersync.create();
var bsTest = browsersync.create();

var distPath = "server/public";
var testPath = ".tmp/test/";

var karmaPort = 3001;
var bsAppPort = 3002;
var bsTestPort = 3004;

var libs = [
  "underscore",
  "es5-shim/es5-shim",
  "es5-shim/es5-sham",
];

var testLibs = [
  "chai",
];

gft.generateTask("js", {
  taskName: "lib",
  entries: [
    "client/js/libs/entry.js",
  ],
  includes: [
    "client/js/libs",
  ],
  dest: distPath + "/js/",
  destFileName: "lib.js",
  browserify: {
    requires: libs,
  },
  watch: [
    "client/js/libs/entry.js",
  ],
  browsersync: bsApp,
});

gft.generateTask("js", {
  taskName: "app",
  entries: [
    "client/js/src/*.js",
  ],
  dest: distPath + "/js/",
  includes: [
    "client/js/src",
  ],
  browserify: {
    externals: libs,
  },
  watch: [
    "client/js/src/*.js",
  ],
  browsersync: bsApp,
});

gft.generateTask("js", {
  taskName: "testLib",
  entries: [
    "client/js/test/libs/entry.js",
  ],
  includes: [
    "client/js/test/libs",
  ],
  dest: testPath + "/js/",
  destFileName: "testLib.js",
  browserify: {
    requires: testLibs,
  },
  watch: [
    "client/js/test/libs/entry.js",
  ],
  browsersync: bsTest,
});

gft.generateTask("js", {
  taskName: "test",
  entries: [
    "client/js/test/src/**/*.js",
  ],
  dest: testPath + "/js/",
  includes: [
    "client/js/test/src",
    "client/js/src",
  ],
  browserify: {
    externals: libs.concat(testLibs),
  },
  watch: [
    "client/js/test/src/**/*.js",
  ],
  browsersync: bsTest,
});

gulp.task("build:js", [
  "build:js:lib",
  "build:js:app",
  "build:js:test",
]);

gulp.task("watch:js", [
  "watch:js:lib",
  "watch:js:app",
  "watch:js:test",
]);

gft.generateTask("css:scss", {
  taskName: "app",
  entries: [
    "client/css/src/*.scss",
  ],
  includes: [
    "client/css/src/",
    "node_modules/",
  ],
  dest: distPath + "/css/",
  watch: [
    "client/css/src/**/*.scss",
  ],
  browsersync: bsApp,
});

gulp.task("build:css", [
  "build:css:scss:app",
]);

gulp.task("watch:css", [
  "watch:css:scss:app",
]);

gulp.task("build", [
  "build:js",
  "build:css",
]);

gulp.task("serve", [], function () {
  nodemon({
    watch: [
      "server",
    ],
    ignore: [
      "server/public/js/*.js*",
      "server/public/css/*.css*",
    ],
    script: "server/index.js",
    ext: "js",
  });
});

gulp.task("test:karma", [
  "build:js:testLib",
  "build:js:test",
], function (done) {
  new karma.Server({
    configFile: __dirname + "/karma.conf.js",
    singleRun: true
  }, done).start();
});

gulp.task("watch:test:karma", [
{'fraction_non_alphanumeric': 0.22395476353666896, 'fraction_numerical': 0.0054832076764907475, 'mean_word_length': 3.107670654468684, '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': '285272', 'n_tokens_mistral': 2474, 'n_tokens_neox': 2422, 'n_words': 364}