<commit_before>gulp        = require 'gulp'
browserify  = require 'browserify'
concat      = require 'gulp-concat'
uglify      = require 'gulp-uglify'
rename      = require 'gulp-rename'
coffee      = require 'gulp-coffee'
util        = require 'gulp-util'
replace     = require 'gulp-replace'
source      = require 'vinyl-source-stream'
coffeeify   = require 'coffeeify'
http        = require 'http'
ecstatic    = require 'ecstatic'

coffee4Node = -> (coffee bare: yes, sourceMap: yes).on 'error', util.log

# Build for node

gulp.task 'build commons', ->
  gulp.src 'src/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib'

gulp.task 'build logging', ->
  gulp.src 'src/logging/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/logging'

gulp.task 'build kite', ->
  gulp.src 'src/kite/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite'

gulp.task 'build kite as promised', ->
  gulp.src 'src/kite-as-promised/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-as-promised'

gulp.task 'build kontrol', ->
  gulp.src 'src/kontrol/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kontrol'

gulp.task 'build kontrol as promised', ->
  gulp.src 'src/kontrol-as-promised/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kontrol-as-promised'

gulp.task 'build kite server', ['build websocket server adapter'], ->
  gulp.src 'src/kite-server/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-server'

gulp.task 'build websocket server adapter', ->
  gulp.src 'src/kite-server/websocket/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-server/websocket'

gulp.task 'build auth', ->
  gulp.src 'src/auth/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/auth'

# Build for the browser
gulp.task 'browserify kite', ->
  browserify
    entries     : ['./src/kite/kite.coffee']
    debug       : no
  .require 'events'
  .require './src/kite/kite.coffee', expose: 'kite'
  .transform coffeeify
  .bundle()
  .pipe source 'kite.coffee'
  .pipe rename 'kite-bundle.js'
  .pipe gulp.dest 'static/browser'

gulp.task 'polyfill kite', ['browserify kite'], ->
  gulp.src ['./vendor/sockjs-0.3.4.min.nojson.js', './browser/kite-bundle.js']
    .pipe concat 'kite-sock-bundle.js'
    .pipe gulp.dest 'static/browser'

gulp.task 'browserify kite as promised', ->
  browserify
    entries     : ['./src/kite-as-promised/kite.coffee']
    debug       : no
  .require 'events'<commit_msg>need to build the sockjs server adapter<commit_after>gulp        = require 'gulp'
browserify  = require 'browserify'
concat      = require 'gulp-concat'
uglify      = require 'gulp-uglify'
rename      = require 'gulp-rename'
coffee      = require 'gulp-coffee'
util        = require 'gulp-util'
replace     = require 'gulp-replace'
source      = require 'vinyl-source-stream'
coffeeify   = require 'coffeeify'
http        = require 'http'
ecstatic    = require 'ecstatic'

coffee4Node = -> (coffee bare: yes, sourceMap: yes).on 'error', util.log

# Build for node

gulp.task 'build commons', ->
  gulp.src 'src/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib'

gulp.task 'build logging', ->
  gulp.src 'src/logging/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/logging'

gulp.task 'build kite', ->
  gulp.src 'src/kite/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite'

gulp.task 'build kite as promised', ->
  gulp.src 'src/kite-as-promised/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-as-promised'

gulp.task 'build kontrol', ->
  gulp.src 'src/kontrol/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kontrol'

gulp.task 'build kontrol as promised', ->
  gulp.src 'src/kontrol-as-promised/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kontrol-as-promised'

gulp.task 'build kite server', [
  'build websocket server adapter'
  'build sockjs server adapter'
], ->
  gulp.src 'src/kite-server/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-server'

gulp.task 'build websocket server adapter', ->
  gulp.src 'src/kite-server/websocket/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-server/websocket'

gulp.task 'build sockjs server adapter', ->
  gulp.src 'src/kite-server/sockjs/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/kite-server/sockjs'

gulp.task 'build auth', ->
  gulp.src 'src/auth/*.coffee'
    .pipe coffee4Node()
    .pipe replace '.coffee', '.js'
    .pipe gulp.dest 'lib/auth'

# Build for the browser
gulp.task 'browserify kite', ->
  browserify
    entries     : ['./src/kite/kite.coffee']
    debug       : no
  .require 'events'
  .require './src/kite/kite.coffee', expose: 'kite'
  .transform coffeeify
  .bundle()
  .pipe source 'kite.coffee'
  .pipe rename 'kite-bundle.js'
  .pipe gulp.dest 'static/browser'

gulp.task 'polyfill kite', ['browserify kite'], ->
  gulp.src ['./vendor/sockjs-0.3.4.min.nojson.js', './browser/kite-bundle.js']
    .pipe concat 'kite-sock-bundle.js'
    .pipe gulp.dest 'static/browser'

gulp.task 'browserify kite as promised', ->
  browserify
    entries     : ['./src/kite-as-promised/kite.coffee']
    debug       : no
  .require 'events'
{'fraction_non_alphanumeric': 0.16265888010992785, 'fraction_numerical': 0.0046375815870834764, 'mean_word_length': 2.8108638743455496, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 30, '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': '1303277', 'n_tokens_mistral': 2234, 'n_tokens_neox': 2169, 'n_words': 505}