<commit_before>path   = require "path"

renameCoffe2js = (dest, matchedSrcPath, opts) ->
  path.join dest, path.basename(matchedSrcPath,'.coffee') + '.js'

renameJs2min = (dest, matchedSrcPath, opts) ->
  path.join dest, path.basename(matchedSrcPath,'.js') + '.min.js'

banner =
  """
  /*!
  <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\"yyyy-mm-dd\") %>
  This program is distributed under the terms of the <%= pkg.licenses[0].type %> license.
  Copyright (c) 2011-<%= grunt.template.today(\"yyyy\") %> <%= pkg.author %>
  */\n
  """

module.exports = (grunt) ->
  grunt.initConfig

    pkg: grunt.file.readJSON "package.json"

    concat:
      options:
        banner: banner
      core:
        files:
          "dist/scaleApp.js": ["dist/scaleApp.js"]
      full:
        files:
          "dist/scaleApp.full.js": ["dist/scaleApp.full.js"]

    coffee:
      core:
        options:
          join: true
        files:
          "dist/scaleApp.js": [
            "src/Util.coffee"
            "src/Mediator.coffee"
            "src/Sandbox.coffee"
            "src/Core.coffee"
            "src/scaleApp.coffee" ]
      full:
        options:
          join: true
        files:
          "dist/scaleApp.full.js": [
            "src/Util.coffee",
            "src/Mediator.coffee"
            "src/Sandbox.coffee"
            "src/scaleApp.coffee"
            "plugins/src/*.coffee" ]
      plugins:
        expand: true
        flatten: true
        cwd: 'plugins/src'
        src: ['*.coffee']
        dest: 'dist/plugins/'
        rename: renameCoffe2js
      modules:
        expand: true
        flatten: true
        cwd: 'modules/'
        src: ['*.coffee']
        dest: 'dist/modules/'
        rename: renameCoffe2js

    copy:
      modules:
        expand: true
        cwd: 'modules/'
        src: ['*.html']
        dest: 'dist/modules'

    uglify:
      options:
        banner: banner
        mangle:
          toplevel: false

        squeeze:
          dead_code: true

        codegen:
          quote_keys: false
      core:
        files:
          'dist/scaleApp.min.js': ["dist/scaleApp.js"]
      full:
        files:
          'dist/scaleApp.full.min.js': ["dist/scaleApp.full.js"]
      plugins:
        expand: true
        flatten: true
        cwd: 'dist/plugins/'
        src: ["*.js"]
        dest: 'dist/plugins/'
        rename: renameJs2min
      modules:
        expand: true
        flatten: true
        cwd: 'dist/modules/'
        src: ["*.js"]
        dest: 'dist/modules/'
        rename: renameJs2min

    watch:
      src:
        files: ["src/*.coffee", "src/**/*.coffee"]
        tasks: ["coffee"]
      styles:
        files: ["modules/*.styl"]
        tasks: ["stylus"]
<commit_msg>don't minify minified files<commit_after>path   = require "path"

renameCoffe2js = (dest, matchedSrcPath, opts) ->
  path.join dest, path.basename(matchedSrcPath,'.coffee') + '.js'

renameJs2min = (dest, matchedSrcPath, opts) ->
  path.join dest, path.basename(matchedSrcPath,'.js') + '.min.js'

banner =
  """
  /*!
  <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\"yyyy-mm-dd\") %>
  This program is distributed under the terms of the <%= pkg.licenses[0].type %> license.
  Copyright (c) 2011-<%= grunt.template.today(\"yyyy\") %> <%= pkg.author %>
  */\n
  """

module.exports = (grunt) ->
  grunt.initConfig

    pkg: grunt.file.readJSON "package.json"

    concat:
      options:
        banner: banner
      core:
        files:
          "dist/scaleApp.js": ["dist/scaleApp.js"]
      full:
        files:
          "dist/scaleApp.full.js": ["dist/scaleApp.full.js"]

    coffee:
      core:
        options:
          join: true
        files:
          "dist/scaleApp.js": [
            "src/Util.coffee"
            "src/Mediator.coffee"
            "src/Sandbox.coffee"
            "src/Core.coffee"
            "src/scaleApp.coffee" ]
      full:
        options:
          join: true
        files:
          "dist/scaleApp.full.js": [
            "src/Util.coffee",
            "src/Mediator.coffee"
            "src/Sandbox.coffee"
            "src/scaleApp.coffee"
            "plugins/src/*.coffee" ]
      plugins:
        expand: true
        flatten: true
        cwd: 'plugins/src'
        src: ['*.coffee']
        dest: 'dist/plugins/'
        rename: renameCoffe2js
      modules:
        expand: true
        flatten: true
        cwd: 'modules/'
        src: ['*.coffee']
        dest: 'dist/modules/'
        rename: renameCoffe2js

    copy:
      modules:
        expand: true
        cwd: 'modules/'
        src: ['*.html']
        dest: 'dist/modules'

    uglify:
      options:
        banner: banner
        mangle:
          toplevel: false

        squeeze:
          dead_code: true

        codegen:
          quote_keys: false
      core:
        files:
          'dist/scaleApp.min.js': ["dist/scaleApp.js"]
      full:
        files:
          'dist/scaleApp.full.min.js': ["dist/scaleApp.full.js"]
      plugins:
        expand: true
        flatten: true
        cwd: 'dist/plugins/'
        src: ["*.js","!*.min.js"]
        dest: 'dist/plugins/'
        rename: renameJs2min
      modules:
        expand: true
        flatten: true
        cwd: 'dist/modules/'
        src: ["*.js","!*.min.js"]
        dest: 'dist/modules/'
        rename: renameJs2min

    watch:
      src:
        files: ["src/*.coffee", "src/**/*.coffee"]
        tasks: ["coffee"]
      styles:
        files: ["modules/*.styl"]
        tasks: ["stylus"]

{'fraction_non_alphanumeric': 0.15014419610670512, 'fraction_numerical': 0.003965392934390771, 'mean_word_length': 1.610065851364064, 'pattern_counts': {'":': 8, '<': 15, '<?xml version=': 0, '>': 21, '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': '1252928', 'n_tokens_mistral': 1936, 'n_tokens_neox': 1810, 'n_words': 357}