<commit_before>module.exports = (grunt) ->
  grunt.config.init(
    pkg: grunt.file.readJSON('package.json')

    clean:
      derived: ['javascripts', 'stylesheets', 'fonts', 'html']
      options:
        force: true

    ts:
      options:
        module: "commonjs"
        emitDecoratorMetadata: true
        sourceMap: true
        sourceRoot: 'src'
        removeComments: false
        verbose: true
      app:
        expand: true
        cwd: 'src/'
        src: ['**/*.ts']
        out: 'public/app.ts'
        # See the pug extDot comment.
        extDot: 'last'
      tslint:
        options:
          sourceMap: false
          sourceRoot: false
        src: ['tslint/src/rules/*.ts', 'node_modules/tslint/lib/tslint.d.ts']
        dest: 'tslint/dist/rules'

    tslint:
      files:
        src: ['src/**/*.ts']
    
    typings:
      install: {}

    coffee:
      default:
        expand: true
        ext: '.js'
        cwd: 'coffeescripts/'
        src: ['**/*.coffee']
        dest: 'javascripts'

    pug:
      options:
        pretty: true
      index:
        src: 'index.pug'
        dest: 'index.html'
      partials:
        expand: true
        cwd: 'src/'
        ext: '.html'
        src: ['*.pug', '*/**.pug', '!**include/*.pug']
        dest: 'html'

    markdown:
      default:
        expand: true
        ext: '.html'
        cwd: 'src/'
        src: ['**/*.md']
        dest: 'html'

    stylus:
      options:
        use: [
          require('autoprefixer-stylus')
          require('csso-stylus')
        ]
      default:
        src: ['stylus/app.styl']
        dest: 'stylesheets/app.css'

    copy:
      # The native applicaton JavaScript files.
      js:
        expand: true
        cwd: 'coffeescripts/'
        src: ['**/*.js']
        dest: 'javascripts/'

      # Note: this task is only used to copy CSS map files. The
      # CSS style files themselves are copied to the destination
      # in the concat:css task.
      #
      # This task is only used to copy the Bootstrap map file. 
      # Since the non-minimized Bootstrap module references the
      # CSS map, the map must be colocated with the stylesheets.
      cssmap:
        expand: true
        flatten: true
        cwd: 'node_modules/'
        src: ['bootstrap/dist/css/bootstrap.css.map']
        dest: 'stylesheets/'

      fonts:
        expand: true
        flatten: true
        cwd: 'node_modules/'
        # Note: Due to a grunt bug, the font-awesome example subdirectory,
        #   e.g. 4.0.4/index.html, can't be excluded
        #   (cf. https://github.com/gruntjs/grunt-contrib-copy/issues/13).
        src: ['bootstrap/dist/fonts/*', 'font-awesome/fonts/*']
        dest: 'fonts/'

    concat:
      css:
        src: [
          'node_modules/bootstrap/dist/css/bootstrap.css'
          'node_modules/font-awesome/css/font-awesome.css'
        ]
        dest: 'stylesheets/vendor.css'

    concurrent:
      options:
        logConcurrentOutput: true
      compile:
        tasks: ['typings', 'coffee', 'pug', 'markdown', 'stylus']

    cssmin:
      options:
        'nomunge': true
        'line-break': 80
      files:
        src: ['stylesheets/app.css']
        dest: 'stylesheets/app.min.css'

    browserSync:
      options:
        watchTask: true
        proxy: 'http:3000'
      bsFiles:
        src:
          'html/**'
    
    jspm:
      dist:
        files:
          "public/javascripts/app.js": "build/javascripts/app.js"

    karma:
      options:
        singleRun: not grunt.option('debug')
        browsers: [if grunt.option('debug') then 'Chrome' else 'PhantomJS']
        logLevel: [if grunt.option('debug') then 'DEBUG' else 'ERROR']
      unit:
        configFile: 'test/conf/karma-conf.coffee'

    exec:
      # This task is used in preference to grunt-selenium-standalone to<commit_msg>CoffeeScript transpilation renders grunt task obsolete.<commit_after>module.exports = (grunt) ->
  grunt.config.init(
    pkg: grunt.file.readJSON('package.json')

    clean:
      derived: ['public']
      options:
        force: true

    ts:
      options:
        module: "commonjs"
        emitDecoratorMetadata: true
        sourceMap: true
        sourceRoot: 'src'
        removeComments: false
        verbose: true
      app:
        expand: true
        cwd: 'src/'
        src: ['**/*.ts']
        out: 'public/app.ts'
      tslint:
        options:
          sourceMap: false
          sourceRoot: false
        src: ['tslint/src/rules/*.ts', 'node_modules/tslint/lib/tslint.d.ts']
        dest: 'tslint/dist/rules'

    tslint:
      files:
        src: ['src/**/*.ts']
    
    typings:
      install: {}

    pug:
      options:
        pretty: true
      index:
        src: 'index.pug'
        dest: 'index.html'
      partials:
        expand: true
        cwd: 'src/'
        ext: '.html'
        src: ['*.pug', '*/**.pug', '!**include/*.pug']
        dest: 'public/html'

    markdown:
      default:
        expand: true
        ext: '.html'
        cwd: 'src/'
        src: ['**/*.md']
        dest: 'public/html'

    stylus:
      options:
        use: [
          require('autoprefixer-stylus')
          require('csso-stylus')
        ]
      default:
        src: ['stylus/app.styl']
        dest: 'public/stylesheets/app.css'

    copy:
      static:
        expand: true
        cwd: 'static/'
        src: '**/*'
        dest: 'public/'

      # Note: this task is only used to copy CSS map files. The
      # CSS style files themselves are copied to the destination
      # in the concat:css task.
      #
      # This task is only used to copy the Bootstrap map file. 
      # Since the non-minimized Bootstrap module references the
      # CSS map, the map must be colocated with the stylesheets.
      cssmap:
        expand: true
        flatten: true
        cwd: 'node_modules/'
        src: ['bootstrap/dist/css/bootstrap.css.map']
        dest: 'public/stylesheets/'

      fonts:
        expand: true
        flatten: true
        cwd: 'node_modules/'
        # Note: Due to a grunt bug, the font-awesome example subdirectory,
        #   e.g. 4.0.4/index.html, can't be excluded
        #   (cf. https://github.com/gruntjs/grunt-contrib-copy/issues/13).
        src: ['bootstrap/dist/fonts/*', 'font-awesome/fonts/*']
        dest: 'public/fonts/'

    concat:
      css:
        src: [
          'node_modules/bootstrap/dist/css/bootstrap.css'
          'node_modules/font-awesome/css/font-awesome.css'
        ]
        dest: 'public/stylesheets/vendor.css'

    concurrent:
      options:
        logConcurrentOutput: true
      compile:
        tasks: ['typings', 'pug', 'markdown', 'stylus']

    cssmin:
      options:
        'nomunge': true
        'line-break': 80
      files:
        src: ['public/stylesheets/app.css']
        dest: 'public/stylesheets/app.min.css'

    browserSync:
      options:
        watchTask: true
        proxy: 'http:3000'
      bsFiles:
        src:
          'html/**'
    
    jspm:
      dist:
        files:
          "public/app.js": "build/app.js"

    karma:
      options:
        singleRun: not grunt.option('debug')
        browsers: [if grunt.option('debug') then 'Chrome' else 'PhantomJS']
        logLevel: [if grunt.option('debug') then 'DEBUG' else 'ERROR']
      unit:
        configFile: 'test/conf/karma-conf.coffee'

    exec:
      # This task is used in preference to grunt-selenium-standalone to
{'fraction_non_alphanumeric': 0.12902792696025778, 'fraction_numerical': 0.002953813104189044, 'mean_word_length': 1.6998912649510691, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '180630', 'n_tokens_mistral': 2447, 'n_tokens_neox': 2341, 'n_words': 575}