<commit_before>var gulp = require( 'gulp' );
var concat = require( 'gulp-concat' );
var uglify = require( 'gulp-uglify' );
var insert = require( 'gulp-insert' );
var watch = require( 'gulp-watch' );

/* global require */
module.exports = function( grunt ) {

	grunt.registerTask( 'build', require( './build/task' ) );

	var sources = [
		'./build/ns.js',
		'./src/js/utils/utils.js',
		'./src/js/utils/EventEmitter.js',
		'./src/js/utils/DragListener.js',
		'./src/js/**'
	];

	var basicGulpStream = function( stream ) {
		return stream
			.pipe( concat( 'goldenlayout.js' ) )
			.pipe( insert.wrap( '(function($){', '})(window.$);' ) );
	};

	// Project configuration.
	grunt.initConfig( {
			pkg: grunt.file.readJSON( 'package.json' ),

			/***********************
			 * WATCH
			 ***********************/
			watch: {
				tasks: [ 'build' ],
				files: [ './src/**' ],
				options: { livereload: 5051 },
			},

			/***********************
			 * RELEASE
			 ***********************/
			release: {
				options: {
					additionalFiles: [ 'bower.json' ],
					beforeRelease: [ 'gulp:gl', 'gulp:glmin' ],
					tagName: 'v<%= version %>',
					github: {
						repo: 'deepstreamIO/golden-layout',
						accessTokenVar: 'GITHUB_ACCESS_TOKEN'
					}
				}
			},
			/***********************
			 * GULP
			 ***********************/
			gulp: {
				gl: {
					options: {
						tasks: basicGulpStream
					},
					src: sources,
					dest: 'dist/goldenlayout.js'
				},
				glmin: {
					options: {
						tasks: function( stream ) {
							return basicGulpStream( stream )
								.pipe( uglify() )
								.pipe( concat( 'goldenlayout.min.js' ) );
						}
					},
					src: sources,
					dest: 'dist/goldenlayout.min.js'
				}
			},

			/***********************
			 * KARMA
			 ***********************/
			karma: {
				unit: {
					configFile: 'karma.conf.js',
					background: true,
					singleRun: false
				}
				,
				travis: {
					configFile: 'karma.conf.js',
					singleRun: true,
					browsers: [ 'PhantomJS' ]
				}
			}
		}
	);

	// Load the plugin that provides the "uglify" task.
	grunt.loadNpmTasks( 'grunt-contrib-watch' );

	grunt.loadNpmTasks( 'grunt-release' );
	grunt.loadNpmTasks( 'grunt-karma' );
	grunt.loadNpmTasks( 'grunt-gulp' );

	// Default task(s).
	grunt.registerTask( 'default', [ 'watch' ] );

	// travis support
	grunt.registerTask( 'test', [ 'karma:travis' ] );
};<commit_msg>Ensure grunt watch build distribution and runs tests<commit_after>var gulp = require( 'gulp' );
var concat = require( 'gulp-concat' );
var uglify = require( 'gulp-uglify' );
var insert = require( 'gulp-insert' );
var watch = require( 'gulp-watch' );

/* global require */
module.exports = function( grunt ) {

	grunt.registerTask( 'build', require( './build/task' ) );

	var sources = [
		'./build/ns.js',
		'./src/js/utils/utils.js',
		'./src/js/utils/EventEmitter.js',
		'./src/js/utils/DragListener.js',
		'./src/js/**'
	];

	var basicGulpStream = function( stream ) {
		return stream
			.pipe( concat( 'goldenlayout.js' ) )
			.pipe( insert.wrap( '(function($){', '})(window.$);' ) );
	};

	// Project configuration.
	grunt.initConfig( {
			pkg: grunt.file.readJSON( 'package.json' ),

			/***********************
			 * WATCH
			 ***********************/
			watch: {
				tasks: [ 'dist', 'test' ],
				files: [ './src/**' ],
				options: { livereload: 5051 },
			},

			/***********************
			 * RELEASE
			 ***********************/
			release: {
				options: {
					additionalFiles: [ 'bower.json' ],
					beforeRelease: [ 'gulp:gl', 'gulp:glmin' ],
					tagName: 'v<%= version %>',
					github: {
						repo: 'deepstreamIO/golden-layout',
						accessTokenVar: 'GITHUB_ACCESS_TOKEN'
					}
				}
			},
			/***********************
			 * GULP
			 ***********************/
			gulp: {
				gl: {
					options: {
						tasks: basicGulpStream
					},
					src: sources,
					dest: 'dist/goldenlayout.js'
				},
				glmin: {
					options: {
						tasks: function( stream ) {
							return basicGulpStream( stream )
								.pipe( uglify() )
								.pipe( concat( 'goldenlayout.min.js' ) );
						}
					},
					src: sources,
					dest: 'dist/goldenlayout.min.js'
				}
			},

			/***********************
			 * KARMA
			 ***********************/
			karma: {
				unit: {
					configFile: 'karma.conf.js',
					background: true,
					singleRun: false
				}
				,
				travis: {
					configFile: 'karma.conf.js',
					singleRun: true,
					browsers: [ 'PhantomJS' ]
				}
			}
		}
	);

	// Load the plugin that provides the "uglify" task.
	grunt.loadNpmTasks( 'grunt-contrib-watch' );

	grunt.loadNpmTasks( 'grunt-release' );
	grunt.loadNpmTasks( 'grunt-karma' );
	grunt.loadNpmTasks( 'grunt-gulp' );

	// Default task(s).
	grunt.registerTask( 'default', [ 'watch' ] );

	// travis support
	grunt.registerTask( 'test', [ 'karma:travis' ] );

    // distribution support
	grunt.registerTask( 'dist', [ 'build', 'gulp' ] );
};
{'fraction_non_alphanumeric': 0.24171579589347428, 'fraction_numerical': 0.0016263468184590363, 'mean_word_length': 2.591240875912409, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '47294', 'n_tokens_mistral': 2230, 'n_tokens_neox': 1751, 'n_words': 312}