<commit_before>"use strict";

var gulp = require('gulp');
var taskGenerator = require('../taskGenerator');
var upath = require('upath');

module.exports = function(name, config, serverConfig) {
    if (config) {
        return taskGenerator(name, config.registerpackages, serverConfig, function(taskName, task) {
            gulp.task(taskName, function() {
                var pattern = task.pattern.map(function(name) {
                    return upath.join('node_modules', name);
                });
                var pkgHandlbarsDocs = config.handlebars.subtasks.find(function(task) {
                    if (task.name === 'docs-packages') {
                        return true;
                    }
                });
                var pkgExportHbsDocs = config.exporthbs.subtasks.find(function(task) {
                    if (task.name === 'packages') {
                        return true;
                    }
                });
                var pkgHandlbarsDocsSrc = [];
                if (pkgHandlbarsDocs) {
                    pkgHandlbarsDocsSrc = pkgHandlbarsDocs.files.src;
                }
                var pkgExportHbsDocsSrc = [];
                if (pkgExportHbsDocs) {
                    pkgExportHbsDocsSrc = pkgExportHbsDocs.files.src;
                }
                return gulp.src(pattern)
                    .on('data', function(file) {
                        if (process.env.npm_package_name !== upath.basename(file.path)) {
                            console.log('register package', upath.basename(file.path));
                            var path = upath.join('node_modules', upath.basename(file.path), '**/*.hbs');
                            config.handlebars.partials.files.src.push(path);
                            config.handlebars.layouts.files.src.push(path);
                            pkgHandlbarsDocsSrc.push(path);
                            pkgExportHbsDocsSrc.push(path);
                        }
                    });
            });
        });
    }
};
<commit_msg>log message when exporthbs config is missing<commit_after>"use strict";

var gulp = require('gulp');
var taskGenerator = require('../taskGenerator');
var upath = require('upath');
require('colors');

module.exports = function(name, config, serverConfig) {
    if (config) {
        return taskGenerator(name, config.registerpackages, serverConfig, function(taskName, task) {
            gulp.task(taskName, function() {
                var pattern = task.pattern.map(function(name) {
                    return upath.join('node_modules', name);
                });
                var pkgHandlbarsDocs = config.handlebars.subtasks.find(function(task) {
                    if (task.name === 'docs-packages') {
                        return true;
                    }
                });
                var pkgExportHbsDocs = null;
                if (config.exporthbs && config.exporthbs.subtasks) {
                    pkgExportHbsDocs = config.exporthbs.subtasks.find(function(task) {
                        if (task.name === 'packages') {
                            return true;
                        }
                    });
                } else {
                    console.log('register-packages missing exporthbs config!'.bold.red);
                }
                var pkgHandlbarsDocsSrc = [];
                if (pkgHandlbarsDocs) {
                    pkgHandlbarsDocsSrc = pkgHandlbarsDocs.files.src;
                }
                var pkgExportHbsDocsSrc = [];
                if (pkgExportHbsDocs) {
                    pkgExportHbsDocsSrc = pkgExportHbsDocs.files.src;
                }
                return gulp.src(pattern)
                    .on('data', function(file) {
                        if (process.env.npm_package_name !== upath.basename(file.path)) {
                            console.log('register package', upath.basename(file.path).green);
                            var path = upath.join('node_modules', upath.basename(file.path), '**/*.hbs');
                            config.handlebars.partials.files.src.push(path);
                            config.handlebars.layouts.files.src.push(path);
                            pkgHandlbarsDocsSrc.push(path);
                            pkgExportHbsDocsSrc.push(path);
                        }
                    });
            });
        });
    }
};

{'fraction_non_alphanumeric': 0.11078252957233849, 'fraction_numerical': 0.0, 'mean_word_length': 1.3413205537806177, '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': '5875515', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1111, 'n_words': 173}