<commit_before>var path = require('path');

var Builder = require('mip-builder');
var reporter = require('./build-reporter');

var amdProcessor = require('mip-processor-amd');
var AMDCompiler = amdProcessor.Compiler;
var AMDPacker = amdProcessor.Packer;
var LessProcessor = require('mip-processor-less');
var JSCompressor = require('mip-processor-jscompress');

var requireConfig = {
    baseUrl: path.resolve(__dirname, '..', 'src'),
    paths: {
        'zepto' : '../deps/zepto',
        'naboo' : '../deps/naboo',
        'spark' : '../deps/spark',
        'fetch-jsonp' : '../deps/fetch-jsonp'
    }
    // ,
    // packages: [
    //     {
    //         name: 'mip',
    //         main: 'mip',
    //         location: '../src'
    //     }
    // ]
};

// init processors
var amdCompiler = new AMDCompiler({
    config: requireConfig,
    files: [
        '**/*.js',
        '!deps/**/*'
    ]
});

var amdPacker = new AMDPacker({
    config: requireConfig,
    modules: ['mip']
});

var lessProcessor = new LessProcessor({
    files: ['src/less/mip.less']
});

var jsCompressor = new JSCompressor();

var requireConfigAdder = {
    process: function (builder) {
        var file = builder.getFile('src/mip.js');
        var configFileContent = require('fs').readFileSync(
            path.resolve(__dirname, 'require-config.js'), 'UTF-8'
        );

        file.setData(configFileContent + '\n' + file.getData());
        return Promise.resolve();
    }
};

var Combiner = require('./file-combiner');
var mainCombiner = new Combiner({
    sep: '\n\n',
    files: {
        'src/mip.js': [
            'deps/promise.js',
            'deps/fetch.js',
            'deps/document-register-element.max.js',
            'deps/esl.js',
            'src/mip.js'
        ]
    }
});


var builder = new Builder({
    dir: path.resolve(__dirname, '..'),
    processors: [
        amdCompiler,
        amdPacker,
        lessProcessor,
        requireConfigAdder,
        mainCombiner,
        jsCompressor,
        {
            name: 'OutputFilter',
            processFile: function (file) {
                if (file.outputPath !== 'src/mip.js'
                    && file.outputPath !== 'deps/jquery.js'
                    && file.outputPath !== 'src/less/mip.css'
                ) {
                    file.outputPath = null;
                }
            }
        },
        {
            name: 'PathMapper',
            processFile: function (file) {
                if (file.outputPath) {
                    file.outputPath = file.outputPath.slice(file.outputPath.lastIndexOf('/') + 1);
                }
            }
        }
    ],

    files: [
        '!**/.*',
        '!package.json',
        '!node_modules/**/*',
        '!.git/**/*',
        '!Makefile',
        '!karma.conf.js',
        '!.editorconfig',
        '!.gitignore',
        '!README.md',
        '!dist/**/*',
        '!examples/**/*',
        '!test/**/*',
        '!extensions/**/*',
        '!tools/**/*'
    ],

    outputDir: path.resolve(__dirname, '..', 'dist'),
});

builder.setReporter(reporter);

// do build
builder.build()
    .catch(function (e) {
        console.log(e);
    });
<commit_msg>modify some file selector<commit_after>var path = require('path');

var Builder = require('mip-builder');
var reporter = require('./build-reporter');

var amdProcessor = require('mip-processor-amd');
var AMDCompiler = amdProcessor.Compiler;
var AMDPacker = amdProcessor.Packer;
var LessProcessor = require('mip-processor-less');
var JSCompressor = require('mip-processor-jscompress');

var requireConfig = {
    baseUrl: path.resolve(__dirname, '..', 'src'),
    paths: {
        'zepto' : '../deps/zepto',
        'naboo' : '../deps/naboo',
        'spark' : '../deps/spark',
        'fetch-jsonp' : '../deps/fetch-jsonp'
    }
    // ,
    // packages: [
    //     {
    //         name: 'mip',
    //         main: 'mip',
    //         location: '../src'
    //     }
    // ]
};

// init processors
var amdCompiler = new AMDCompiler({
    config: requireConfig,
    files: [
        'src/**/*.js',
        'deps/naboo.js',
        'deps/zepto.js',
        'deps/spark.js',
        'deps/fetch-jsonp.js'
    ]
});

var amdPacker = new AMDPacker({
    config: requireConfig,
    modules: ['mip']
});

var lessProcessor = new LessProcessor({
    files: ['src/less/mip.less']
});

var jsCompressor = new JSCompressor();


var Combiner = require('./file-combiner');
var mainCombiner = new Combiner({
    sep: '\n\n',
    files: {
        'src/mip.js': [
            'deps/promise.js',
            'deps/fetch.js',
            'deps/document-register-element.max.js',
            'deps/esl.js',
            'src/mip.js'
        ]
    }
});


var builder = new Builder({
    dir: path.resolve(__dirname, '..'),
    processors: [
        amdCompiler,
        amdPacker,
        lessProcessor,
        {
            name: 'AddRequireConfigToMip',
            process: function (builder) {
                var file = builder.getFile('src/mip.js');
                var configFileContent = require('fs').readFileSync(
                    path.resolve(__dirname, 'require-config.js'), 'UTF-8'
                );

                file.setData(configFileContent + '\n' + file.getData());
                return Promise.resolve();
            }
        },
        mainCombiner,
        jsCompressor,
        {
            name: 'OutputFilter',
            files: ['**/*'],
            processFile: function (file) {
                if (file.outputPath !== 'src/mip.js'
                    && file.outputPath !== 'deps/jquery.js'
                    && file.outputPath !== 'src/less/mip.css'
                ) {
                    file.outputPath = null;
                }
            }
        },
        {
            name: 'PathMapper',
            files: ['**/*'],
            processFile: function (file) {
                if (file.outputPath) {
                    file.outputPath = file.outputPath.slice(file.outputPath.lastIndexOf('/') + 1);
                }
            }
        }
    ],

    files: [
        '!**/.*',
        '!package.json',
        '!node_modules/**/*',
        '!.git/**/*',
        '!Makefile',
        '!karma.conf.js',
        '!.editorconfig',
        '!.gitignore',
        '!README.md',
        '!dist/**/*',
        '!examples/**/*',
        '!test/**/*',
        '!extensions/**/*',
        '!tools/**/*'
    ],

    outputDir: path.resolve(__dirname, '..', 'dist'),
});

builder.setReporter(reporter);

// do build
builder.build()
    .catch(function (e) {
        console.log(e);
    });

{'fraction_non_alphanumeric': 0.17765346235258542, 'fraction_numerical': 0.0006047777441790142, 'mean_word_length': 1.628128724672229, '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': '3985665', 'n_tokens_mistral': 2116, 'n_tokens_neox': 2058, 'n_words': 347}