<commit_before>module.exports = (grunt) ->
  require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks)

  # Extract browsers list from the command line
  # For example `grunt test --browsers=Chrome,Firefox`
  # Currently available browsers:
  # - Chrome
  # - ChromeCanary
  # - Firefox
  # - Opera
  # - Safari (only Mac)
  # - PhantomJS
  # - IE (only Windows)
  parseBrowsers = (opts = {}) ->
    opts.defaultBrowser or= "PhantomJS"

    browsers = grunt.option("browsers") || opts.defaultBrowser
    browsers = browsers.replace(/[\s\[\]]/, "")
    browsers.split(",")

  grunt.initConfig
    watch:
      options:
        livereload: true

      html:
        files: ["./app/**/*.html"]
        tasks: ["copy:dist"]

      css:
        files: ["./app/styles/**/*.css"]
        tasks: ["copy:dist"]

      coffee:
        files: ["./app/scripts/**/*.coffee"]
        tasks: ["coffee:dist"]

      coffeeTest:
        files: ["test/**/*.coffee"]
        tasks: ["coffee:test"]

    coffee:
      dist:
        files: [
          expand: true
          cwd: "./app/scripts"
          src: "**/*.coffee"
          dest: "./dist/scripts"
          ext: ".js"
        ]

      test:
        files: [
          expand: true
          cwd: "./test"
          src: "**/*.coffee"
          dest: "./dist/test"
          ext: ".js"
        ]

    copy:
      dist:
        files: [
          expand: true
          dot: true
          cwd: "./app"
          dest: "./dist"
          src: [
            "components/**/*"
            "**/*.html"
            "styles/**/*.css"
          ]
        ]

    browserify2:
      dev:
        entry: "./dist/scripts/app.js"
        compile: "./dist/scripts/bundle.js"
        debug: true

      compile:
        entry: "./dist/scripts/app.js"
        compile: "./dist/scripts/bundle.js"

    karma:
      options:
        configFile: "./test/karma.conf.js"
        browsers: parseBrowsers(defaultBrowser: "PhantomJS")

      unit:
        singleRun: true

      e2e:
        configFile: "./test/karma-e2e.conf.js"
        singleRun: true

      watch:
        singleRun: false
        autoWatch: true

    clean:
      dist: ["./dist"]

    connect:
      server:
        options:
          hostname: "localhost"
          port: 9000
          base: "./dist"

  grunt.registerTask "build", [
    "clean:dist"
    "copy:dist"
    "coffee:dist"
    "browserify2:dev"<commit_msg>Remove source map for browserify.<commit_after>module.exports = (grunt) ->
  require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks)

  # Extract browsers list from the command line
  # For example `grunt test --browsers=Chrome,Firefox`
  # Currently available browsers:
  # - Chrome
  # - ChromeCanary
  # - Firefox
  # - Opera
  # - Safari (only Mac)
  # - PhantomJS
  # - IE (only Windows)
  parseBrowsers = (opts = {}) ->
    opts.defaultBrowser or= "PhantomJS"

    browsers = grunt.option("browsers") || opts.defaultBrowser
    browsers = browsers.replace(/[\s\[\]]/, "")
    browsers.split(",")

  grunt.initConfig
    watch:
      options:
        livereload: true

      html:
        files: ["./app/**/*.html"]
        tasks: ["copy:dist"]

      css:
        files: ["./app/styles/**/*.css"]
        tasks: ["copy:dist"]

      coffee:
        files: ["./app/scripts/**/*.coffee"]
        tasks: ["coffee:dist"]

      coffeeTest:
        files: ["test/**/*.coffee"]
        tasks: ["coffee:test"]

    coffee:
      dist:
        files: [
          expand: true
          cwd: "./app/scripts"
          src: "**/*.coffee"
          dest: "./dist/scripts"
          ext: ".js"
        ]

      test:
        files: [
          expand: true
          cwd: "./test"
          src: "**/*.coffee"
          dest: "./dist/test"
          ext: ".js"
        ]

    copy:
      dist:
        files: [
          expand: true
          dot: true
          cwd: "./app"
          dest: "./dist"
          src: [
            "components/**/*"
            "**/*.html"
            "styles/**/*.css"
          ]
        ]

    browserify2:
      compile:
        entry: "./dist/scripts/app.js"
        compile: "./dist/scripts/bundle.js"

    karma:
      options:
        configFile: "./test/karma.conf.js"
        browsers: parseBrowsers(defaultBrowser: "PhantomJS")

      unit:
        singleRun: true

      e2e:
        configFile: "./test/karma-e2e.conf.js"
        singleRun: true

      watch:
        singleRun: false
        autoWatch: true

    clean:
      dist: ["./dist"]

    connect:
      server:
        options:
          hostname: "localhost"
          port: 9000
          base: "./dist"

  grunt.registerTask "build", [
    "clean:dist"
    "copy:dist"
    "coffee:dist"
    "browserify2:compile"
{'fraction_non_alphanumeric': 0.15813855548536535, 'fraction_numerical': 0.0033691303432301536, 'mean_word_length': 1.5428265524625269, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '605528', 'n_tokens_mistral': 1582, 'n_tokens_neox': 1520, 'n_words': 308}