<commit_before>gulp       = require 'gulp'
gutil      = require 'gulp-util'
coffee     = require 'gulp-coffee'
rename     = require 'gulp-rename'
buffer     = require 'gulp-buffer'
stream     = require 'gulp-stream'
stylus     = require 'gulp-stylus'
rimraf     = require 'gulp-rimraf'
concat     = require 'gulp-concat'
sourcemaps = require 'gulp-sourcemaps'
argv       = require('minimist') process.argv
browserify = require 'browserify'
coffeeify  = require 'coffeeify'
source     = require 'vinyl-source-stream'
nodemon    = require 'gulp-nodemon'
pistachio  = require 'gulp-kd-pistachio-compiler'
spritesmith= require 'gulp.spritesmith'
livereload = require 'gulp-livereload'
shell      = require 'gulp-shell'

STYLES_PATH = ['./app/styl/**/*.styl']
COFFEE_PATH = ['./app/coffee/**/*.coffee']
INDEX_PATH  = ['./app/index.html']
SERVER_FILE = './server/server.coffee'
SERVER_PATH = ['./server/**/*.coffee']
BUILD_PATH  = argv.outputDir ? './static/a/out'

log = (color, message) -> gutil.log gutil.colors[color] message

watchLogger = (color, watcher) ->
  server = livereload()
  watcher.on 'change', (event) ->
    log color, "file #{event.path} was #{event.type}"
    server?.changed event.path

gulpBrowserify = (options = {}) ->
  options.extensions or= ['.coffee']
  options.debug       ?= yes
  b = browserify options
  b.transform coffeeify
  b.bundle()

gulp.task 'serve', ['build'], -> server = nodemon script: SERVER_FILE

gulp.task 'watch-server', -> watchLogger 'cyan', gulp.watch SERVER_PATH, ['serve']

compileStyles = ->

  gulp.src STYLES_PATH
    .pipe stylus
      compress  : yes
      sourcemap : inline  : yes
    .pipe concat 'main.css'
    .pipe rename 'main.css'
    .pipe livereload()
    .pipe gulp.dest "#{BUILD_PATH}/css"


gulp.task 'styles-only', -> compileStyles()

gulp.task 'styles', ['sprites'], -> compileStyles()<commit_msg>Build: style sourcemaps commented out<commit_after>gulp       = require 'gulp'
gutil      = require 'gulp-util'
coffee     = require 'gulp-coffee'
rename     = require 'gulp-rename'
buffer     = require 'gulp-buffer'
stream     = require 'gulp-stream'
stylus     = require 'gulp-stylus'
rimraf     = require 'gulp-rimraf'
concat     = require 'gulp-concat'
sourcemaps = require 'gulp-sourcemaps'
argv       = require('minimist') process.argv
browserify = require 'browserify'
coffeeify  = require 'coffeeify'
source     = require 'vinyl-source-stream'
nodemon    = require 'gulp-nodemon'
pistachio  = require 'gulp-kd-pistachio-compiler'
spritesmith= require 'gulp.spritesmith'
livereload = require 'gulp-livereload'
shell      = require 'gulp-shell'

STYLES_PATH = ['./app/styl/**/*.styl']
COFFEE_PATH = ['./app/coffee/**/*.coffee']
INDEX_PATH  = ['./app/index.html']
SERVER_FILE = './server/server.coffee'
SERVER_PATH = ['./server/**/*.coffee']
BUILD_PATH  = argv.outputDir ? './static/a/out'

log = (color, message) -> gutil.log gutil.colors[color] message

watchLogger = (color, watcher) ->
  server = livereload()
  watcher.on 'change', (event) ->
    log color, "file #{event.path} was #{event.type}"
    server?.changed event.path

gulpBrowserify = (options = {}) ->
  options.extensions or= ['.coffee']
  options.debug       ?= yes
  b = browserify options
  b.transform coffeeify
  b.bundle()

gulp.task 'serve', ['build'], -> server = nodemon script: SERVER_FILE

gulp.task 'watch-server', -> watchLogger 'cyan', gulp.watch SERVER_PATH, ['serve']

compileStyles = ->

  gulp.src STYLES_PATH
    .pipe stylus
      compress  : yes
      # sourcemap : inline  : yes
    .pipe concat 'main.css'
    .pipe rename 'main.css'
    .pipe livereload()
    .pipe gulp.dest "#{BUILD_PATH}/css"


gulp.task 'styles-only', -> compileStyles()

gulp.task 'styles', ['sprites'], -> compileStyles()
{'fraction_non_alphanumeric': 0.154419595314164, 'fraction_numerical': 0.0, 'mean_word_length': 3.483293556085919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '219400', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1311, 'n_words': 297}