<commit_before>var gulp	 		= require('gulp'),
		webpack		= require('webpack-stream'),
		path		= require('path'),
		sync		= require('run-sequence'),
		browserSync		= require('browser-sync'),
		rename		= require('gulp-rename'),
		template	= require('gulp-template'),
		fs			= require('fs'),
		yargs		= require('yargs').argv,
		lodash 		= require('lodash'),
		nodemon = require('gulp-nodemon'),
		del = require('del'),
		reload		= function () { return browserSync.reload() };

// helper method to resolveToApp paths
var resolveToApp = function(glob){
	glob = glob || '';
	return path.join(frontendRoot, 'app', glob); // app/{glob}
};

var resolveToComponents = function(glob){
	glob = glob || '';
	return path.join(frontendRoot, 'app/components', glob); // app/components/{glob}
};

var frontendRoot = 'frontend';
var serverRoot = 'server';

// map of all our paths
var paths = {
	js: resolveToComponents('**/*!(.spec.js).js'), // don't include spec files
	css: resolveToApp('**/*.css'), // css files
	images: resolveToApp('images/**/*.*'), // image files
	html: [
		resolveToApp('**/*.html'),
		path.join(frontendRoot, 'index.html')
	],

	entry: path.join(frontendRoot, 'app/main.js'),
	output: path.join(frontendRoot, '../public/dist'),
	blankTemplates: path.join(__dirname, 'generator', 'component/**/*.**')
};

// use our webpack.config.js to
// build our modules
var webbackConfig = require('./webpack.config');

gulp.task('webpack', function(){
	return gulp.src(paths.entry)
		.pipe(webpack(webbackConfig))
		.pipe(gulp.dest(paths.output));
});

gulp.task('browser-sync', ['nodemon-debug'], function() {
	browserSync.init({
		proxy: 'localhost:5000',
		open: false,
		port: 3003
	});
});

gulp.task('watch:frontend', function(){
	console.log('paths.images: ', paths.images);
	var allPaths = [].concat(
		[paths.js],
		paths.html,
		[paths.css],
		[paths.images]
	);

	gulp.watch(allPaths, ['webpack', reload]);
});

gulp.task('watch:server', function(){
	console.log('watching:server', path.join(__dirname, 'server/src/**/*.js'));
	gulp.watch(['./server/src/**/*.js', './server/views/**/*.html', './server/src/**/*.json'], [reload]);
});

gulp.task('component', function(){
	var cap = function(val){
		return val.charAt(0).toUpperCase() + val.slice(1);
	};

	var name = yargs.name;
	var parentPath = yargs.parent || '';
	var destPath = path.join(resolveToComponents(), parentPath, name);

	return gulp.src(paths.blankTemplates)
		.pipe(template({
			name: name,
			upCaseName: cap(name)
		}))
		.pipe(rename(function(path){
			path.basename = path.basename.replace('temp', name);
		}))
		.pipe(gulp.dest(destPath));
});

gulp.task('nodemon', function(cb) {
	var called = false;
	nodemon({
		script: './server/src/index.js',
		watch: ['server/src']
	})
	.on('start', function() {
		// ensure start only got called once
	 if (!called) { cb(); }
	 called = true;
	})
	.on('restart', reload);
});

gulp.task('nodemon-debug', function(cb) {
	var called = false;
	nodemon({
		execMap: {
			js: 'node --debug'
		},
		ext: 'js',
		ignore: ['.idea/*', 'node_modules/*'],
		script: './server/src/index.js',
		verbose: true,
		watch: ['server/src']
	})
	.on('start', function() {
		// ensure start only got called once
	 if (!called) { cb(); }
	 called = true;
	})
	.on('restart', reload);
});

gulp.task('clean', function(){
  return del([
    'pubic/dist/**/*'
	]);
});

gulp.task('watch', function(done){
	sync('watch:frontend', 'watch:server', done);
});<commit_msg>commented out server watch, I don't think it's necessary<commit_after>var gulp	 		= require('gulp'),
		webpack		= require('webpack-stream'),
		path		= require('path'),
		sync		= require('run-sequence'),
		browserSync		= require('browser-sync'),
		rename		= require('gulp-rename'),
		template	= require('gulp-template'),
		fs			= require('fs'),
		yargs		= require('yargs').argv,
		lodash 		= require('lodash'),
		nodemon = require('gulp-nodemon'),
		del = require('del'),
		reload		= function () { return browserSync.reload() };

// helper method to resolveToApp paths
var resolveToApp = function(glob){
	glob = glob || '';
	return path.join(frontendRoot, 'app', glob); // app/{glob}
};

var resolveToComponents = function(glob){
	glob = glob || '';
	return path.join(frontendRoot, 'app/components', glob); // app/components/{glob}
};

var frontendRoot = 'frontend';
var serverRoot = 'server';

// map of all our paths
var paths = {
	js: resolveToComponents('**/*!(.spec.js).js'), // don't include spec files
	css: resolveToApp('**/*.css'), // css files
	images: resolveToApp('images/**/*.*'), // image files
	html: [
		resolveToApp('**/*.html'),
		path.join(frontendRoot, 'index.html')
	],

	entry: path.join(frontendRoot, 'app/main.js'),
	output: path.join(frontendRoot, '../public/dist'),
	blankTemplates: path.join(__dirname, 'generator', 'component/**/*.**')
};

// use our webpack.config.js to
// build our modules
var webbackConfig = require('./webpack.config');

gulp.task('webpack', function(){
	return gulp.src(paths.entry)
		.pipe(webpack(webbackConfig))
		.pipe(gulp.dest(paths.output));
});

gulp.task('browser-sync', ['nodemon-debug'], function() {
	browserSync.init({
		proxy: 'localhost:5000',
		open: false,
		port: 3003
	});
});

gulp.task('watch:frontend', function(){
	console.log('paths.images: ', paths.images);
	var allPaths = [].concat(
		[paths.js],
		paths.html,
		[paths.css],
		[paths.images]
	);

	gulp.watch(allPaths, ['webpack', reload]);
});

gulp.task('watch:server', function(){
	console.log('watching:server', path.join(__dirname, 'server/src/**/*.js'));
	gulp.watch(['./server/src/**/*.js', './server/views/**/*.html', './server/src/**/*.json'], [reload]);
});

gulp.task('component', function(){
	var cap = function(val){
		return val.charAt(0).toUpperCase() + val.slice(1);
	};

	var name = yargs.name;
	var parentPath = yargs.parent || '';
	var destPath = path.join(resolveToComponents(), parentPath, name);

	return gulp.src(paths.blankTemplates)
		.pipe(template({
			name: name,
			upCaseName: cap(name)
		}))
		.pipe(rename(function(path){
			path.basename = path.basename.replace('temp', name);
		}))
		.pipe(gulp.dest(destPath));
});

gulp.task('nodemon', function(cb) {
	var called = false;
	nodemon({
		script: './server/src/index.js',
		watch: ['server/src']
	})
	.on('start', function() {
		// ensure start only got called once
	 if (!called) { cb(); }
	 called = true;
	})
	.on('restart', reload);
});

gulp.task('nodemon-debug', function(cb) {
	var called = false;
	nodemon({
		execMap: {
			js: 'node --debug'
		},
		ext: 'js',
		ignore: ['.idea/*', 'node_modules/*'],
		script: './server/src/index.js',
		verbose: true,
		watch: ['server/src']
	})
	.on('start', function() {
		// ensure start only got called once
	 if (!called) { cb(); }
	 called = true;
	})
	.on('restart', reload);
});

gulp.task('clean', function(){
  return del([
    'pubic/dist/**/*'
	]);
});

gulp.task('watch', function(done){
	sync('watch:frontend'
	// , 'watch:server'
	, done);
});
{'fraction_non_alphanumeric': 0.21809578434184113, 'fraction_numerical': 0.0028677946659019216, 'mean_word_length': 4.136229749631812, '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': '7002056', 'n_tokens_mistral': 2602, 'n_tokens_neox': 2461, 'n_words': 500}