<commit_before># gulp

theme_name = "../wordpress/wp-content/themes/THEME"

gulp       = require "gulp"
yargs      = require "yargs"
del        = require "del"
coffee     = require "gulp-coffee"
concat     = require "gulp-concat"
flatten    = require "gulp-flatten"
gulpif     = require "gulp-if"
less       = require "gulp-less"
order      = require "gulp-order"
plumber    = require "gulp-plumber"
sourcemaps = require "gulp-sourcemaps"
uglify     = require "gulp-uglify"
uglifycss  = require "gulp-uglifycss"
watch      = require "gulp-watch"

production = !!(yargs.argv.production)

paths =
  "build":  theme_name
  "fonts":  ["./assets/fonts/**/*"]
  "images": ["./assets/images/**/*"]
  "php": [
    "./functions/**/*.*"
    "./pages/**/*.php"
    "./partials/**/*.php"
  ]
  "js":
    "app":    "./assets/javascripts/coffee/index.coffee"
    "base":   "./assets/javascripts/js"
    "coffee": "./assets/javascripts/coffee/**/*.coffee"
  "css":
    "base": "./assets/stylesheets/css"
    "less": "./assets/stylesheets/less/**/*.less"


gulp.task "fonts", ->
  gulp.src paths.fonts
    .pipe gulp.dest("#{paths.build}/fonts/")

gulp.task "images", ->
  gulp.src paths.images
    .pipe gulp.dest("#{paths.build}/images/")

gulp.task "php", ->
  gulp.src paths.php
    .pipe gulp.dest(paths.build)

gulp.task "coffee", (cb) ->
  gulp.src paths.js.coffee
    .pipe coffee(bare: true)
    .pipe gulp.dest(paths.js.base)
  cb()

gulp.task "js", ->
  gulp.src require(paths.js.app)
    .pipe plumber()
    .pipe concat("index.js")
    .pipe gulpif(production, uglify())
    .pipe plumber.stop()
    .pipe gulp.dest(paths.build)

  gulp.src ["#{paths.js.base}/ie.js"]
    .pipe gulpif(production, uglify())
    .pipe gulp.dest(paths.build)

gulp.task "css", ->
  gulp.src ["./assets/stylesheets/less/index.less", "./assets/stylesheets/less/admin.less"]
    .pipe plumber()
    .pipe gulpif(!production, sourcemaps.init())
    .pipe less()
    .pipe gulpif(production, uglifycss())
    .pipe gulpif(!production, sourcemaps.write("./maps"))
    .pipe plumber.stop()
    .pipe gulp.dest(paths.build)

gulp.task "wordpress", ->
  gulp.src ["./style.css", "./screenshot.png"]
    .pipe gulp.dest(paths.build)

gulp.task "clean", (cb) ->
  del.sync(["#{paths.build}/images/**", "#{paths.build}/images", "#{paths.build}*"], { force: true})
  cb()

gulp.task "default", ->
  gulp.start "clean"
  gulp.start "fonts", "images", "php", "coffee", "js", "css", "wordpress"

gulp.task "watch", ->
  gulp.start "default"

  watch paths.fonts,     -> gulp.start ["fonts"]
  watch paths.images,    -> gulp.start ["images"]
  watch paths.php,       -> gulp.start ["php"]
  watch paths.js.app,    -> gulp.start ["coffee", "js"]
  watch paths.js.coffee, -> gulp.start ["coffee", "js"]
  watch paths.css.less,  -> gulp.start ["css"]<commit_msg>updating the gulpfile to compile the coffeescript & js together, no need to break up the function<commit_after># gulp

theme_name = "../wordpress/wp-content/themes/THEME"

gulp       = require "gulp"
yargs      = require "yargs"
del        = require "del"
coffee     = require "gulp-coffee"
concat     = require "gulp-concat"
flatten    = require "gulp-flatten"
gulpif     = require "gulp-if"
less       = require "gulp-less"
order      = require "gulp-order"
plumber    = require "gulp-plumber"
sourcemaps = require "gulp-sourcemaps"
uglify     = require "gulp-uglify"
uglifycss  = require "gulp-uglifycss"
watch      = require "gulp-watch"

production = !!(yargs.argv.production)

paths =
  "build":  theme_name
  "fonts":  ["./assets/fonts/**/*"]
  "images": ["./assets/images/**/*"]
  "php": [
    "./functions/**/*.*"
    "./pages/**/*.php"
    "./partials/**/*.php"
  ]
  "js":
    "app":    "./assets/javascripts/coffee/index.coffee"
    "base":   "./assets/javascripts/js"
    "coffee": "./assets/javascripts/coffee/**/*.coffee"
  "css":
    "base": "./assets/stylesheets/css"
    "less": "./assets/stylesheets/less/**/*.less"


gulp.task "fonts", ->
  gulp.src paths.fonts
    .pipe gulp.dest("#{paths.build}/fonts/")

gulp.task "images", ->
  gulp.src paths.images
    .pipe gulp.dest("#{paths.build}/images/")

gulp.task "php", ->
  gulp.src paths.php
    .pipe gulp.dest(paths.build)

gulp.task "js", (cb) ->
  gulp.src paths.js.coffee
    .pipe coffee(bare: true)
    .pipe gulp.dest(paths.js.base)

  gulp.src require(paths.js.app)
    .pipe plumber()
    .pipe concat("index.js")
    .pipe gulpif(production, uglify())
    .pipe plumber.stop()
    .pipe gulp.dest(paths.build)

  gulp.src ["#{paths.js.base}/ie.js"]
    .pipe gulpif(production, uglify())
    .pipe gulp.dest(paths.build)

gulp.task "css", ->
  gulp.src ["./assets/stylesheets/less/index.less", "./assets/stylesheets/less/admin.less"]
    .pipe plumber()
    .pipe gulpif(!production, sourcemaps.init())
    .pipe less()
    .pipe gulpif(production, uglifycss())
    .pipe gulpif(!production, sourcemaps.write("./maps"))
    .pipe plumber.stop()
    .pipe gulp.dest(paths.build)

gulp.task "wordpress", ->
  gulp.src ["./style.css", "./screenshot.png"]
    .pipe gulp.dest(paths.build)

gulp.task "clean", (cb) ->
  del.sync(["#{paths.build}/images/**", "#{paths.build}/images", "#{paths.build}*"], { force: true})
  cb()

gulp.task "default", ->
  gulp.start "clean"
  gulp.start "fonts", "images", "php", "js", "css", "wordpress"

gulp.task "watch", ->
  gulp.start "default"

  watch paths.fonts,     -> gulp.start ["fonts"]
  watch paths.images,    -> gulp.start ["images"]
  watch paths.php,       -> gulp.start ["php"]
  watch paths.js.app,    -> gulp.start ["js"]
  watch paths.js.coffee, -> gulp.start ["js"]
  watch paths.css.less,  -> gulp.start ["css"]
{'fraction_non_alphanumeric': 0.2028601694915254, 'fraction_numerical': 0.0, 'mean_word_length': 2.972650771388499, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 34, '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': '7270915', 'n_tokens_mistral': 2183, 'n_tokens_neox': 2134, 'n_words': 412}