<commit_before>'use strict';

const gulp = require('gulp');
const include = require('gulp-include');
const rollup = require('gulp-rollup');
const jetpack = require('fs-jetpack');
const path = require('path');

const nodeBuiltInModules = ['assert', 'buffer', 'child_process', 'cluster',
    'console', 'constants', 'crypto', 'dgram', 'dns', 'domain', 'events',
    'fs', 'http', 'https', 'module', 'net', 'os', 'path', 'process', 'punycode',
    'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'timers',
    'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];

const electronBuiltInModules = ['electron'];

const customExternalModules = ['angular', 'angular-ui-router', 'ui-router-extras', 'angular-spinner', 'angular-color-picker', 'angular-elastic-input', 'angular-marked', 'angular-vs-repeat'];

const rollupPlugins = [];

let generateExternalModulesList = function() {
    let appManifest = jetpack.read('./package.json', 'json');
    return [].concat(
        nodeBuiltInModules,
        electronBuiltInModules,
		customExternalModules,
        Object.keys(appManifest.dependencies),
        Object.keys(appManifest.devDependencies)
    );
};

let cached = {};

module.exports = function(src, dest) {
    return gulp.src('./src/javascripts/**/*.js')
        .pipe(include())
        .pipe(rollup({
            input: src,
            external: generateExternalModulesList(),
            cache: cached[src],
            plugins: rollupPlugins,
            format: 'cjs'
        }))
        .on('bundle', function(bundle) {
            cached[src] = bundle;

            let jsFile = path.basename(dest);
            return bundle.generate({
                format: 'cjs',
                sourcemap: true,
                sourcemapFile: jsFile
            }).then(function(result) {<commit_msg>Removed the explicit declaration of externs; they're unnecessary now<commit_after>'use strict';

const gulp = require('gulp');
const include = require('gulp-include');
const rollup = require('gulp-rollup');
const jetpack = require('fs-jetpack');
const path = require('path');

const nodeBuiltInModules = ['assert', 'buffer', 'child_process', 'cluster',
    'console', 'constants', 'crypto', 'dgram', 'dns', 'domain', 'events',
    'fs', 'http', 'https', 'module', 'net', 'os', 'path', 'process', 'punycode',
    'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'timers',
    'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];

const electronBuiltInModules = ['electron'];

const customExternalModules = ['angular', 'angular-ui-router', 'ui-router-extras', 'angular-spinner', 'angular-color-picker', 'angular-elastic-input', 'angular-marked', 'angular-vs-repeat', 'xelib'];

const rollupPlugins = [];

let generateExternalModulesList = function() {
    let appManifest = jetpack.read('./package.json', 'json');
    return [].concat(
        nodeBuiltInModules,
        electronBuiltInModules,
        Object.keys(appManifest.dependencies),
        Object.keys(appManifest.devDependencies)
    );
};

let cached = {};

module.exports = function(src, dest) {
    return gulp.src('./src/javascripts/**/*.js')
        .pipe(include())
        .pipe(rollup({
            input: src,
            external: generateExternalModulesList(),
            cache: cached[src],
            plugins: rollupPlugins,
            format: 'cjs'
        }))
        .on('bundle', function(bundle) {
            cached[src] = bundle;

            let jsFile = path.basename(dest);
            return bundle.generate({
                format: 'cjs',
                sourcemap: true,
                sourcemapFile: jsFile
            }).then(function(result) {
{'fraction_non_alphanumeric': 0.17172545802570413, 'fraction_numerical': 0.0005468963631391851, 'mean_word_length': 3.124013528748591, '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': '6838216', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1082, 'n_words': 240}