<commit_before>"use strict";
var fs = require("fs");
var path = require("path");
var gulp = require("gulp"),
  runSequence = require("run-sequence"),
  del = require("del"),
  jasmine = require("gulp-jasmine"),
  tslint = require("gulp-tslint"),
  tsc = require("gulp-typescript"),
  sourcemaps = require("gulp-sourcemaps");

gulp.task("lint", function () {
  return gulp.src([
    "src/**/**.ts",
    "spec/**.ts",
    "typings/**.d.ts",
    "!lib/**",
    "!maps/**"
  ])
    .pipe(tslint({}))
    .pipe(tslint.report("verbose"));
});

var tsProjectForJs = tsc.createProject("tsconfig.json");
var tsProjectForDts = tsc.createProject("tsconfig.json");
gulp.task("build-js", function () {
  return gulp.src([
    "./**/**.ts",
    "!./lib/**",
    "!./node_modules/**"
  ])
    .pipe(sourcemaps.init())
    .pipe(tsc(tsProjectForJs))
    .js
    .pipe(sourcemaps.write("../maps", {
      includeContent: false,
      sourceRoot: function (file) {
        // needed to fix relative path in sourceMaps
        var path = "../".repeat((file.relative.match(/\//g) || []).length + 1);
        return path;
      }
    }))
    .pipe(gulp.dest("lib"));
})
gulp.task("build-dts", function () {
  return gulp.src([
    "./**/**.ts",
    "!./lib/**",
    "!./node_modules/**"
  ])
    .pipe(tsc(tsProjectForDts))
    .dts
    .pipe(gulp.dest("lib"));
})
gulp.task("build-package.json", function () {
  var appPackageJson = JSON.parse(fs.readFileSync(__dirname + "/package.json", "utf8"));
  var npmPackageJson = {
    "name": appPackageJson.name,
    "description": appPackageJson.description,
    "version": appPackageJson.version,
    "author": appPackageJson.author,
    "repository": appPackageJson.repository,
    "main": "system/index.js",      // TODO: generate this from app package.json
    "typings": "system/index.d.ts", // TODO: generate this from app package.json
    "dependencies": appPackageJson.dependencies,
    "keywords": appPackageJson.keywords,
    "license": appPackageJson.license,
    "bugs": appPackageJson.bugs
  }
  fs.mkdirSync(path.join(__dirname, "lib"));
  fs.mkdirSync(path.join(__dirname, "lib", "src"));
  fs.writeFileSync(path.join(__dirname, "lib", "src", "package.json"), JSON.stringify(npmPackageJson, null, 2));
});

gulp.task("copy", function () {
  return gulp.src([
    "./**/**settings.json",
    "README.md",
    "LICENSE"
  ])
    .pipe(gulp.dest("lib/src"));
});
gulp.task("build", function (cb) {
  return runSequence(
    "clean-all",
    ["build-js", "build-dts", "copy", "build-package.json"],
    cb
  );
});

gulp.task("tests", ["build-spec"], function () {
  return gulp.src("./")
    .pipe(jasmine({ config: require("./spec/support/jasmine.json"), includeStackTrace: true, verbose: true }));
});

gulp.task("clean-all", function () {
  return del(["./maps", "./lib"]);
});

//alternative name for the "tests" task
gulp.task("specs", ["tests"]);

gulp.task("server", function () {
  require("./lib/src/server");
});<commit_msg>build-spec<commit_after>"use strict";
var fs = require("fs");
var path = require("path");
var gulp = require("gulp"),
  runSequence = require("run-sequence"),
  del = require("del"),
  jasmine = require("gulp-jasmine"),
  tslint = require("gulp-tslint"),
  tsc = require("gulp-typescript"),
  sourcemaps = require("gulp-sourcemaps");

gulp.task("lint", function () {
  return gulp.src([
    "src/**/**.ts",
    "spec/**.ts",
    "typings/**.d.ts",
    "!lib/**",
    "!maps/**"
  ])
    .pipe(tslint({}))
    .pipe(tslint.report("verbose"));
});

var tsProjectForJs = tsc.createProject("tsconfig.json");
var tsProjectForDts = tsc.createProject("tsconfig.json");
gulp.task("build-js", function () {
  return gulp.src([
    "./**/**.ts",
    "!./spec/**",
    "!./lib/**",
    "!./node_modules/**"
  ])
    .pipe(sourcemaps.init())
    .pipe(tsc(tsProjectForJs))
    .js
    .pipe(sourcemaps.write("../maps", {
      includeContent: false,
      sourceRoot: function (file) {
        // needed to fix relative path in sourceMaps
        var path = "../".repeat((file.relative.match(/\//g) || []).length + 1);
        return path;
      }
    }))
    .pipe(gulp.dest("lib"));
})
gulp.task("build-dts", function () {
  return gulp.src([
    "./**/**.ts",
    "!./spec/**",
    "!./lib/**",
    "!./node_modules/**"
  ])
    .pipe(tsc(tsProjectForDts))
    .dts
    .pipe(gulp.dest("lib"));
})
gulp.task("build-package.json", function () {
  var appPackageJson = JSON.parse(fs.readFileSync(__dirname + "/package.json", "utf8"));
  var npmPackageJson = {
    "name": appPackageJson.name,
    "description": appPackageJson.description,
    "version": appPackageJson.version,
    "author": appPackageJson.author,
    "repository": appPackageJson.repository,
    "main": "system/index.js",      // TODO: generate this from app package.json
    "typings": "system/index.d.ts", // TODO: generate this from app package.json
    "dependencies": appPackageJson.dependencies,
    "keywords": appPackageJson.keywords,
    "license": appPackageJson.license,
    "bugs": appPackageJson.bugs
  }
  fs.mkdirSync(path.join(__dirname, "lib"));
  fs.mkdirSync(path.join(__dirname, "lib", "src"));
  fs.writeFileSync(path.join(__dirname, "lib", "src", "package.json"), JSON.stringify(npmPackageJson, null, 2));
});

gulp.task("copy", function () {
  return gulp.src([
    "./**/**settings.json",
    "README.md",
    "LICENSE"
  ])
    .pipe(gulp.dest("lib/src"));
});

gulp.task("build", function (cb) {
  return runSequence(
    "clean-all",
    ["build-js", "build-dts", "copy", "build-package.json"],
    cb
  );
});

gulp.task("build-spec", function (cb) {
  return gulp.src([
    "./**/**.ts",
    "!./src/**",
    "!./lib/**",
    "!./node_modules/**"
  ])
    .pipe(sourcemaps.init())
    .pipe(tsc(tsProjectForJs))
    .js
    .pipe(sourcemaps.write("../maps", {
      includeContent: false,
      sourceRoot: function (file) {
        // needed to fix relative path in sourceMaps
        var path = "../".repeat((file.relative.match(/\//g) || []).length + 1);
        return path;
      }
    }))
    .pipe(gulp.dest("lib"));
});

gulp.task("tests", ["build-spec"], function () {
  return gulp.src("./")
    .pipe(jasmine({ config: require("./spec/support/jasmine.json"), includeStackTrace: true, verbose: true }));
});

gulp.task("clean-all", function () {
  return del(["./maps", "./lib"]);
});

//alternative name for the "tests" task
gulp.task("specs", ["tests"]);

gulp.task("server", function () {
  require("./lib/src/server");
});
{'fraction_non_alphanumeric': 0.22478829869130101, 'fraction_numerical': 0.001077752117013087, 'mean_word_length': 3.2906208718626155, 'pattern_counts': {'":': 22, '<': 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': '7002543', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2243, 'n_words': 401}