<commit_before>const config = require("./config/config");
const configDocs = require("./config/config-docs");
const configStyle = require("./config/config-style");

const gulp = require("gulp");
const connect = require("gulp-connect");
const babelify = require("babelify");
const browserify = require("browserify");
const uglify = require("gulp-uglify");
const streamify = require("gulp-streamify");
const sass = require("gulp-sass");
const postcss = require("gulp-postcss");
const sourcemaps = require("gulp-sourcemaps");
const autoprefixer = require("autoprefixer");
const rename = require("gulp-rename");
const concat = require("gulp-concat");
const source = require("vinyl-source-stream");
const uglifySaveLicense = require("uglify-save-license");

const path = require("path");
const rimraf = require("rimraf");
const exec = require("child_process").exec;

const buildFolder = config.targetDir;
const docsFolder = configDocs.sourceDir;
const styleFolder = configStyle.sourceFolder;
const scriptFolder = "script";
const libFolder = "lib";

const vendorJs = [
    path.resolve(__dirname, "node_modules", "barba.js", "dist", "barba.js"),
    path.resolve(__dirname, "node_modules", "lunr", "lunr.js")
];

const swaggerUi = [
    path.resolve(__dirname, "node_modules", "swagger-ui-dist", "swagger-ui-bundle.js"),
    path.resolve(__dirname, "node_modules", "swagger-ui-docs-preset", "dist", "swagger-ui-docs-preset.js"),
    path.resolve(__dirname, "node_modules", "swagger-ui-docs-preset", "dist", "swagger-ui-docs-preset.css")
];

function swallowError(error) {
    console.error(error.toString());
    this.emit("end");
}

gulp.task("docs", (cb) => {
    exec("npm run build:docs", function(err, stdout, stderr) {
        console.error(stderr);
        cb(err);
    });
});

gulp.task("docs:dev", (cb) => {
    exec("npm run build:docs:dev", function(err, stdout, stderr) {
        console.error(stderr);
        cb(err);
    });
});

gulp.task("docs:watch", () => {
    gulp.watch(
        [`${ docsFolder }/*.*`, `${ docsFolder }/**/*.*`],
        ["docs:dev", "connect:reload:docs"]
    ).on("error", swallowError);
});

gulp.task("sass", () => {
    return gulp.src(path.join(__dirname, configStyle.sourceFolder, configStyle.sourceFile))
        .pipe(rename(configStyle.targetFile))<commit_msg>fix(swaggerui): fix importing of swagger ui layout"<commit_after>const config = require("./config/config");
const configDocs = require("./config/config-docs");
const configStyle = require("./config/config-style");

const gulp = require("gulp");
const connect = require("gulp-connect");
const babelify = require("babelify");
const browserify = require("browserify");
const uglify = require("gulp-uglify");
const streamify = require("gulp-streamify");
const sass = require("gulp-sass");
const postcss = require("gulp-postcss");
const sourcemaps = require("gulp-sourcemaps");
const autoprefixer = require("autoprefixer");
const rename = require("gulp-rename");
const concat = require("gulp-concat");
const source = require("vinyl-source-stream");
const uglifySaveLicense = require("uglify-save-license");

const path = require("path");
const rimraf = require("rimraf");
const exec = require("child_process").exec;

const buildFolder = config.targetDir;
const docsFolder = configDocs.sourceDir;
const styleFolder = configStyle.sourceFolder;
const scriptFolder = "script";
const libFolder = "lib";

const vendorJs = [
    path.resolve(__dirname, "node_modules", "barba.js", "dist", "barba.js"),
    path.resolve(__dirname, "node_modules", "lunr", "lunr.js")
];

const swaggerUi = [
    path.resolve(__dirname, "node_modules", "swagger-ui-dist", "swagger-ui-bundle.js"),
    path.resolve(__dirname, "node_modules", "@telenorfrontend", "swagger-ui-docs-preset", "dist", "swagger-ui-docs-preset.js"),
    path.resolve(__dirname, "node_modules", "@telenorfrontend", "swagger-ui-docs-preset", "dist", "swagger-ui-docs-preset.css")
];

function swallowError(error) {
    console.error(error.toString());
    this.emit("end");
}

gulp.task("docs", (cb) => {
    exec("npm run build:docs", function(err, stdout, stderr) {
        console.error(stderr);
        cb(err);
    });
});

gulp.task("docs:dev", (cb) => {
    exec("npm run build:docs:dev", function(err, stdout, stderr) {
        console.error(stderr);
        cb(err);
    });
});

gulp.task("docs:watch", () => {
    gulp.watch(
        [`${ docsFolder }/*.*`, `${ docsFolder }/**/*.*`],
        ["docs:dev", "connect:reload:docs"]
    ).on("error", swallowError);
});

gulp.task("sass", () => {
    return gulp.src(path.join(__dirname, configStyle.sourceFolder, configStyle.sourceFile))
        .pipe(rename(configStyle.targetFile))
{'fraction_non_alphanumeric': 0.18864703371745625, 'fraction_numerical': 0.0, 'mean_word_length': 4.9254108723135275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7074635', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1533, 'n_words': 287}