<commit_before>appName = 'app'

scripts = [
	'scripts/vendor/angular.min.js'
	'scripts/vendor/angular-mocks.js'
	'scripts/vendor/angular-animate.min.js'
	'scripts/vendor/angular-route.min.js'
	'scripts/app.js'
	'**/*.js'
]

styles = [
	'styles/styles.css'
]

bowerDirectory = './bower_components/'
changelog = './CHANGELOG.md'
componentsDirectory = "#{bowerDirectory}flattened_components/"
distDirectory = './dist/'
devPort = 8181
devServer = "http://localhost:#{devPort}"
srcDirectory = './src/'
tempDirectory = './.temp/'

bower = require 'gulp-bower'
clean = require 'gulp-clean'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
connect = require 'gulp-connect'
conventionalChangelog = require 'conventional-changelog'
es = require 'event-stream'
flatten = require 'gulp-flatten'
fs = require 'fs'
gulp = require 'gulp'
gutil = require 'gulp-util'
jade = require 'gulp-jade'
less = require 'gulp-less'
markdown = require 'gulp-markdown'
ngClassify = require 'gulp-ng-classify'
path = require 'path'
pkg = require './package.json'
Q = require 'q'
template = require 'gulp-template'

gulp.task 'bower', ->
	bower()

gulp.task 'build', ['scripts', 'styles', 'views', 'spa']

gulp.task 'changelog', ->
	options =
		repository: pkg.repository.url
		version: pkg.version
		file: changelog
		log: gutil.log

	conventionalChangelog options, (err, log) ->
		fs.writeFile changelog, log

gulp.task 'clean', ['clean:working'], ->
	gulp
		.src bowerDirectory
		.pipe clean()

gulp.task 'clean:working', ->
	gulp
		.src [componentsDirectory, tempDirectory, distDirectory]
		.pipe clean()

gulp.task 'coffee', ['coffeelint', 'ngClassify'], ->
	options =
		sourceMap: true

	gulp
		.src '**/*.coffee', cwd: tempDirectory
		.pipe coffee options
		.pipe gulp.dest tempDirectory

gulp.task 'coffeelint', ->
	options =
		arrow_spacing:
			level: 'error'
		indentation:
			value: 1
		max_line_length:
			level: 'ignore'
		no_tabs:
			level: 'ignore'

	gulp
		.src ['**/*.coffee', '!scripts/app.coffee'], cwd: srcDirectory
		.pipe coffeelint options
		.pipe coffeelint.reporter()

gulp.task 'copy:dist', ['build'], ->
	gulp
		.src '**', cwd: tempDirectory
		.pipe gulp.dest distDirectory
		
gulp.task 'copy:temp', ['clean:working', 'flatten'], ->
	gulp
		.src ["#{srcDirectory}**", "#{componentsDirectory}**"]
		.pipe gulp.dest tempDirectory

# gulp.task 'default', ['copy:dist']

gulp.task 'flatten', ['flatten:fonts', 'flatten:scripts', 'flatten:styles']

gulp.task 'flatten:fonts', ['bower', 'clean:working'], ->
	gulp
		.src 'bootstrap/dist/fonts/**/*.{eot,svg,ttf,woff}', cwd: bowerDirectory
		.pipe flatten()
		.pipe gulp.dest "#{componentsDirectory}fonts/"

gulp.task 'flatten:scripts', ['bower', 'clean:working'], ->
	gulp
		.src [
			'angular/angular.min.js{,.map}'
			'angular-animate/angular-animate.min.js{,.map}'
			'angular-mocks/angular-mocks.js'
			'angular-route/angular-route.min.js{,.map}'
		], cwd: bowerDirectory
		.pipe flatten()
		.pipe gulp.dest "#{componentsDirectory}scripts/vendor/"

gulp.task 'flatten:styles', ['bower', 'clean:working'], ->
	gulp
		.src 'bootstrap/less/**/*.less', cwd: bowerDirectory
		.pipe flatten()
		.pipe gulp.dest "#{componentsDirectory}styles/"

gulp.task 'jade', ['copy:temp'], ->
	options =
		pretty: true

	gulp
		.src '**/*.jade', cwd: tempDirectory
		.pipe jade options
		.pipe gulp.dest tempDirectory

gulp.task 'less', ['copy:temp'], ->
	gulp
		.src 'styles/styles.less', cwd: tempDirectory
		.pipe less()
		.pipe gulp.dest 'styles/', cwd: tempDirectory

gulp.task 'markdown', ['copy:temp'], ->
	gulp
		.src '**/*.{md,markdown}', cwd: tempDirectory
		.pipe markdown()
		.pipe gulp.dest tempDirectory

gulp.task 'ngClassify', ['copy:temp'], ->
	options =
		appName: appName or 'app'
		data:
			environment: 'dev'

	gulp
		.src '**/*.coffee', cwd: tempDirectory
		.pipe ngClassify options
		.pipe gulp.dest tempDirectory

gulp.task 'scripts', ['coffee']

gulp.task 'spa', ['scripts', 'styles', 'views'], ->
	unixifyPath = (p) -><commit_msg>chore(build): add initial less sourceMap support<commit_after>appName = 'app'

scripts = [
	'scripts/vendor/angular.min.js'
	'scripts/vendor/angular-mocks.js'
	'scripts/vendor/angular-animate.min.js'
	'scripts/vendor/angular-route.min.js'
	'scripts/app.js'
	'**/*.js'
]

styles = [
	'styles/styles.css'
]

bowerDirectory = './bower_components/'
changelog = './CHANGELOG.md'
componentsDirectory = "#{bowerDirectory}flattened_components/"
distDirectory = './dist/'
devPort = 8181
devServer = "http://localhost:#{devPort}"
srcDirectory = './src/'
tempDirectory = './.temp/'

bower = require 'gulp-bower'
clean = require 'gulp-clean'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
connect = require 'gulp-connect'
conventionalChangelog = require 'conventional-changelog'
es = require 'event-stream'
flatten = require 'gulp-flatten'
fs = require 'fs'
gulp = require 'gulp'
gutil = require 'gulp-util'
jade = require 'gulp-jade'
less = require 'gulp-less'
markdown = require 'gulp-markdown'
ngClassify = require 'gulp-ng-classify'
path = require 'path'
pkg = require './package.json'
Q = require 'q'
template = require 'gulp-template'

gulp.task 'bower', ->
	bower()

gulp.task 'build', ['scripts', 'styles', 'views', 'spa']

gulp.task 'changelog', ->
	options =
		repository: pkg.repository.url
		version: pkg.version
		file: changelog
		log: gutil.log

	conventionalChangelog options, (err, log) ->
		fs.writeFile changelog, log

gulp.task 'clean', ['clean:working'], ->
	gulp
		.src bowerDirectory
		.pipe clean()

gulp.task 'clean:working', ->
	gulp
		.src [componentsDirectory, tempDirectory, distDirectory]
		.pipe clean()

gulp.task 'coffee', ['coffeelint', 'ngClassify'], ->
	options =
		sourceMap: true

	gulp
		.src '**/*.coffee', cwd: tempDirectory
		.pipe coffee options
		.pipe gulp.dest tempDirectory

gulp.task 'coffeelint', ->
	options =
		arrow_spacing:
			level: 'error'
		indentation:
			value: 1
		max_line_length:
			level: 'ignore'
		no_tabs:
			level: 'ignore'

	gulp
		.src ['**/*.coffee', '!scripts/app.coffee'], cwd: srcDirectory
		.pipe coffeelint options
		.pipe coffeelint.reporter()

gulp.task 'copy:dist', ['build'], ->
	gulp
		.src '**', cwd: tempDirectory
		.pipe gulp.dest distDirectory
		
gulp.task 'copy:temp', ['clean:working', 'flatten'], ->
	gulp
		.src ["#{srcDirectory}**", "#{componentsDirectory}**"]
		.pipe gulp.dest tempDirectory

# gulp.task 'default', ['copy:dist']

gulp.task 'flatten', ['flatten:fonts', 'flatten:scripts', 'flatten:styles']

gulp.task 'flatten:fonts', ['bower', 'clean:working'], ->
	gulp
		.src 'bootstrap/dist/fonts/**/*.{eot,svg,ttf,woff}', cwd: bowerDirectory
		.pipe flatten()
		.pipe gulp.dest "#{componentsDirectory}fonts/"

gulp.task 'flatten:scripts', ['bower', 'clean:working'], ->
	gulp
		.src [
			'angular/angular.min.js{,.map}'
			'angular-animate/angular-animate.min.js{,.map}'
			'angular-mocks/angular-mocks.js'
			'angular-route/angular-route.min.js{,.map}'
		], cwd: bowerDirectory
		.pipe flatten()
		.pipe gulp.dest "#{componentsDirectory}scripts/vendor/"

gulp.task 'flatten:styles', ['bower', 'clean:working'], ->
	gulp
		.src 'bootstrap/less/**/*.less', cwd: bowerDirectory
		.pipe flatten()
		.pipe gulp.dest "#{componentsDirectory}styles/"

gulp.task 'jade', ['copy:temp'], ->
	options =
		pretty: true

	gulp
		.src '**/*.jade', cwd: tempDirectory
		.pipe jade options
		.pipe gulp.dest tempDirectory

console.log path.resolve tempDirectory

gulp.task 'less', ['copy:temp'], ->
	options =
		sourceMap: true
		sourceMapBasepath: path.resolve path.join tempDirectory, 'styles'

	gulp
		.src 'styles/styles.less', cwd: tempDirectory
		.pipe less options
		.pipe gulp.dest 'styles/', cwd: tempDirectory

gulp.task 'markdown', ['copy:temp'], ->
	gulp
		.src '**/*.{md,markdown}', cwd: tempDirectory
		.pipe markdown()
		.pipe gulp.dest tempDirectory

gulp.task 'ngClassify', ['copy:temp'], ->
	options =
		appName: appName or 'app'
		data:
			environment: 'dev'

	gulp
		.src '**/*.coffee', cwd: tempDirectory
		.pipe ngClassify options
		.pipe gulp.dest tempDirectory

gulp.task 'scripts', ['coffee']

gulp.task 'spa', ['scripts', 'styles', 'views'], ->
	unixifyPath = (p) ->
{'fraction_non_alphanumeric': 0.17634119516069902, 'fraction_numerical': 0.0012220457045093486, 'mean_word_length': 4.23943661971831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, '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': '3166956', 'n_tokens_mistral': 3213, 'n_tokens_neox': 3011, 'n_words': 663}