<commit_before>gulp = require 'gulp'
open = require 'open'
connect = require 'gulp-connect'
source = require('vinyl-source-stream')
watchify = require('watchify')

# Load plugins
$ = require('gulp-load-plugins')()

# React code
gulp.task('scripts', ->
    return gulp.src('client.coffee', read: false)
        .pipe($.browserify({
            insertGlobals: true
            extensions: '.cjsx'
            transform: ['coffee-reactify', 'envify']
            debug: true
        }))
        .pipe($.rename('bundle.js'))
        .pipe(gulp.dest('public/'))
        .pipe($.size())
        .pipe($.connect.reload())
)

# CSS
gulp.task('css', ->
  gulp.src(['styles/*.sass', 'styles/*.scss'])
    .pipe($.compass({
      css: 'public/'
      sass: 'styles'
      image: 'styles/images'
      style: 'nested'
      comments: false
      bundle_exec: true
      time: true
      require: ['susy', 'modular-scale', 'normalize-scss', 'sass-css-importer', 'breakpoint']
    }))
    .on('error', (err) ->
      console.log err
    )
    .pipe($.size())
    .pipe(connect.reload())
)

# Connect
gulp.task 'connect', -> connect.server({
  root: ['public']
  port: 9000,
  livereload: true
})

gulp.task 'default', ->
  gulp.start 'build'

gulp.task 'build', ['scripts', 'css']

gulp.task 'watch', ['css', 'connect'], ->
  gulp.watch(['styles/*'], ['css'])

  # https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md
  bundler = watchify('./client.coffee', {
    extensions: ['.coffee', '.cjsx']
  })
  bundler.transform('coffee-reactify')
  rebundle = ->
    return bundler.bundle({debug: true})
      .pipe(source('bundle.js'))
      .pipe(gulp.dest('./public'))
      .pipe($.connect.reload())

  bundler.on('update', rebundle)
  rebundle()<commit_msg>Watch files within sub-folders of styles/<commit_after>gulp = require 'gulp'
open = require 'open'
connect = require 'gulp-connect'
source = require('vinyl-source-stream')
watchify = require('watchify')

# Load plugins
$ = require('gulp-load-plugins')()

# React code
gulp.task('scripts', ->
    return gulp.src('client.coffee', read: false)
        .pipe($.browserify({
            insertGlobals: true
            extensions: '.cjsx'
            transform: ['coffee-reactify', 'envify']
            debug: true
        }))
        .pipe($.rename('bundle.js'))
        .pipe(gulp.dest('public/'))
        .pipe($.size())
        .pipe($.connect.reload())
)

# CSS
gulp.task('css', ->
  gulp.src(['styles/*.sass', 'styles/*.scss'])
    .pipe($.compass({
      css: 'public/'
      sass: 'styles'
      image: 'styles/images'
      style: 'nested'
      comments: false
      bundle_exec: true
      time: true
      require: ['susy', 'modular-scale', 'normalize-scss', 'sass-css-importer', 'breakpoint']
    }))
    .on('error', (err) ->
      console.log err
    )
    .pipe($.size())
    .pipe(connect.reload())
)

# Connect
gulp.task 'connect', -> connect.server({
  root: ['public']
  port: 9000,
  livereload: true
})

gulp.task 'default', ->
  gulp.start 'build'

gulp.task 'build', ['scripts', 'css']

gulp.task 'watch', ['css', 'connect'], ->
  gulp.watch(['styles/*', 'styles/**/*'], ['css'])

  # https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md
  bundler = watchify('./client.coffee', {
    extensions: ['.coffee', '.cjsx']
  })
  bundler.transform('coffee-reactify')
  rebundle = ->
    return bundler.bundle({debug: true})
      .pipe(source('bundle.js'))
      .pipe(gulp.dest('./public'))
      .pipe($.connect.reload())

  bundler.on('update', rebundle)
  rebundle()
{'fraction_non_alphanumeric': 0.20315527262662608, 'fraction_numerical': 0.0022142264046498754, 'mean_word_length': 2.8243386243386244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4462647', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1244, 'n_words': 223}