<commit_before>/*
 * grunt-modulize
 * https://github.com/ericmann/grunt-modulize
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function( grunt ) {

	// Please see the Grunt documentation for more information regarding task
	// creation: http://gruntjs.com/creating-tasks

	grunt.registerMultiTask( 'modulize', 'Browserify and Factor-Bundle plugin for Grunt.', function() {
		var done = this.async();

		var path = require( 'path' ),
			fs = require( 'fs.extra' ),
			browserify = require( 'browserify' ),
			factor = require( 'factor-bundle' );

		var entries = [],
			output = [],
			outputPath = this.data.output;

		this.data.modules.forEach( function( file ) {
			grunt.log.writeln( 'Adding `' + file + '` to bundle ...' );
			entries.push( file );

			var filename = path.basename( file );
			output.push( path.join( outputPath, filename ) );
		} );

		// Make sure output directories exist
		fs.mkdirRecursiveSync( this.data.output );
		fs.mkdirRecursiveSync( path.dirname( this.data.bundle ) );

		var bundle = browserify( {
			entries: entries
		} );

		// Group common dependencies
		// -o outputs the entry files without the common dependencies
		bundle.plugin( 'factor-bundle', {
			o: output
		} );

		// Create Write Stream
		var dest = fs.createWriteStream( this.data.bundle );<commit_msg>Clean up module structure<commit_after>/*
 * grunt-modulize
 * https://github.com/ericmann/grunt-modulize
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

/**
 * Module Dependencies
 */
var path = require( 'path' ),
	fs = require( 'fs.extra' ),
	browserify = require( 'browserify' ),
	factor = require( 'factor-bundle' );

/**
 * Export the module.
 * 
 * @param grunt
 */
module.exports = function( grunt ) {

	// Please see the Grunt documentation for more information regarding task
	// creation: http://gruntjs.com/creating-tasks

	grunt.registerMultiTask( 'modulize', 'Browserify and Factor-Bundle plugin for Grunt.', function() {
		var done = this.async();

		/**
		 * Local variables
		 */
		var entries = [],
			output = [],
			outputPath = this.data.output;

		// Set up the inputs and outputs for our bundle files.
		this.data.modules.forEach( function( file ) {
			grunt.log.writeln( 'Adding `' + file + '` to bundle ...' );
			entries.push( file );

			var filename = path.basename( file );
			output.push( path.join( outputPath, filename ) );
		} );

		// Make sure output directories exist
		fs.mkdirRecursiveSync( this.data.output );
		fs.mkdirRecursiveSync( path.dirname( this.data.bundle ) );

		// Build our bundle
		var bundle = browserify( {
			entries: entries
		} );

		// Group common dependencies
		// -o outputs the entry files without the common dependencies
		bundle.plugin( 'factor-bundle', {
			o: output
		} );

		// Create Write Stream
		var dest = fs.createWriteStream( this.data.bundle );
{'fraction_non_alphanumeric': 0.14070523793221498, 'fraction_numerical': 0.0027387880862718246, 'mean_word_length': 3.1862464183381087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3695748', 'n_tokens_mistral': 1012, 'n_tokens_neox': 893, 'n_words': 255}