<commit_before>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            build: {
                src: [
                    'bower_components/medium-editor/dist/js/medium-editor.js',
                    'bower_components/MediumButton/src/MediumButton.js',
                    'bower_components/mousetrap-js/mousetrap.js',
                    'bower_components/mousetrap-js/plugins/global-bind/mousetrap-global-bind.js',
                    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js',
                    'bower_components/jszip/dist/jszip.js',
                    'src/js/jQuery/**/*.js',
                    'src/js/vendor.js',
                    'src/js/lib/**/*.js',
                    'src/js/Application/Application.js',
                    'src/js/Application/**/*.js',
                    'src/js/app.js'
                ],
                dest: 'build/js/MagazineTool.js'
            },
        },
        browserify: {
            vendor: {
                src: [],
                dest: 'src/js/vendor.js',
                options: {
                    require: ['html-minifier', 'relateurl', 'uglify-js', 'clean-css']
                }
            }
        },
        jshint: {
            files: ['Gruntfile.js', 'src/**/*.js', '!src/js/vendor.js'],
            options: {
                '-W008': true,
                '-W107': true,
                globals: {
                    jQuery: true
                }
            }
        },
        jscs: {
            files: ['Gruntfile.js', 'src/**/*.js', '!src/js/vendor.js'],
            options: {
                config: 'jscs.json',
                fix: true
            }
        },
        uglify: {
            build: {
                options: {
                    compress: {
                        negate_iife: false
                    }
                },
                files: {
                    'build/js/bookmark.min.js': ['src/js/bookmark.js']
                }
            },
            dist: {
                options: {
                    sourceMap: true
                },
                files: {
                    'dist/js/MagazineTool.min.js': '<%= concat.build.src %>'
                }
            },
            bookmark: {
                options: {
                    compress: {
                        negate_iife: false
                    }
                },
                files: {
                    'dist/js/bookmark.min.js': ['src/js/bookmark.js']
                }
            }
        },
        sass: {
            build: {
                options: {
                    sourceMap: true,
                    outputStyle: 'expanded'
                },
                files: {
                    'build/css/app.css': 'src/scss/app.scss'
                }
            },
            dist: {
                options: {
                    sourceMap: true,
                    outputStyle: 'compressed'
                },
                files: {
                    'dist/css/app.min.css': 'src/scss/app.scss'
                }
            }
        },
        htmlmin: {
            options: {
                collapseWhitespace: true,
                collapseBooleanAttributes: true,
                removeRedundantAttributes: true,
                removeEmptyAttributes: true,
                quoteCharacter: '"'
            },
            build: {
                files: [
                    {
                        expand: true,
                        cwd: 'src',
                        src: ['tpl/**.html'],
                        dest: 'build/',
                    }
                ]
            },
            dist: {
                options: {
                    removeComments: true
                },
                files: [
                    {
                        expand: true,
                        cwd: 'src',
                        src: ['tpl/**.html'],
                        dest: 'dist/',
                    }
                ]
            }
        },
        copy: {
            dist: {
                files: {
                    'dist/js/MagazineTool.js': ['<%= concat.build.dest %>'],
                    'dist/css/app.css': 'build/css/app.css'
                }
            }
        },
        'string-replace': {
            options: {
                replacements: [
                    {
                        pattern: '{{ APP_ENV }}',
                        replacement: function() {
                            return grunt.option('env') || 'dist';
                        }
                    },
                    {
                        pattern: '{{ PORT }}',
                        replacement: function() {
                            return grunt.option('port');
                        }
                    },
                    {
                        pattern: /^/,
                        replacement: 'javascript:'
                    }
                ]
            },
            build: {
                files: {
                    'build/js/bookmark.min.js': 'build/js/bookmark.min.js'
                }
            },
            dist: {
                files: {
                    'dist/js/bookmark.min.js': 'dist/js/bookmark.min.js'
                }
            }
        },
        exec: {
            bower_update: {
                cmd: 'bower update'
            },
            npm_update: {
                cmd: 'npm update'
            }
        },
        watch: {
            atBegin: {
                files: [],
                tasks: ['option-defaults', 'connect:watch']
            },
            bower: {
                files: ['bower.json'],
                tasks: ['exec:bower_update']
            },
            npm: {
                files: ['package.json'],
                tasks: ['exec:npm_update']
            },
            js: {
                files: ['Gruntfile.js', 'jscs.json', 'src/**/*.js', '!src/js/vendor.js'],
                tasks: ['jshint', 'jscs', 'browserify', 'concat:build', 'uglify:build', 'string-replace:build', 'notify:concat']
            },
            tpl: {
                files: ['src/tpl/**'],
                tasks: ['htmlmin:build', 'notify:htmlmin']
            },
            sass: {
                files: ['src/scss/**/*.scss'],
                tasks: ['sass:build', 'notify:sass']
            },
            options: {
                atBegin: true,
                spawn: false
            },
        },
        notify: {
            concat: {
                options: {
                    title: 'Concat Complete',
                    message: 'JS files concatenated'
                }
            },
            uglify: {
                options: {
                    title: 'Uglify Complete',
                    message: 'JS files uglified'
                }
            },
            sass: {
                options: {<commit_msg>Some improvements to watch task<commit_after>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            build: {
                src: [
                    'bower_components/medium-editor/dist/js/medium-editor.js',
                    'bower_components/MediumButton/src/MediumButton.js',
                    'bower_components/mousetrap-js/mousetrap.js',
                    'bower_components/mousetrap-js/plugins/global-bind/mousetrap-global-bind.js',
                    'bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js',
                    'bower_components/jszip/dist/jszip.js',
                    'src/js/jQuery/**/*.js',
                    'src/js/vendor.js',
                    'src/js/lib/**/*.js',
                    'src/js/Application/Application.js',
                    'src/js/Application/**/*.js',
                    'src/js/app.js'
                ],
                dest: 'build/js/MagazineTool.js'
            },
        },
        browserify: {
            vendor: {
                src: [],
                dest: 'src/js/vendor.js',
                options: {
                    require: ['html-minifier', 'relateurl', 'uglify-js', 'clean-css']
                }
            }
        },
        jshint: {
            files: ['Gruntfile.js', 'src/**/*.js', '!src/js/vendor.js'],
            options: {
                '-W008': true,
                '-W107': true,
                globals: {
                    jQuery: true
                }
            }
        },
        jscs: {
            files: ['Gruntfile.js', 'src/**/*.js', '!src/js/vendor.js'],
            options: {
                config: 'jscs.json',
                fix: true
            }
        },
        uglify: {
            build: {
                options: {
                    compress: {
                        negate_iife: false
                    }
                },
                files: {
                    'build/js/bookmark.min.js': ['src/js/bookmark.js']
                }
            },
            dist: {
                options: {
                    sourceMap: true
                },
                files: {
                    'dist/js/MagazineTool.min.js': '<%= concat.build.src %>'
                }
            },
            bookmark: {
                options: {
                    compress: {
                        negate_iife: false
                    }
                },
                files: {
                    'dist/js/bookmark.min.js': ['src/js/bookmark.js']
                }
            }
        },
        sass: {
            build: {
                options: {
                    sourceMap: true,
                    outputStyle: 'expanded'
                },
                files: {
                    'build/css/app.css': 'src/scss/app.scss'
                }
            },
            dist: {
                options: {
                    sourceMap: true,
                    outputStyle: 'compressed'
                },
                files: {
                    'dist/css/app.min.css': 'src/scss/app.scss'
                }
            }
        },
        htmlmin: {
            options: {
                collapseWhitespace: true,
                collapseBooleanAttributes: true,
                removeRedundantAttributes: true,
                removeEmptyAttributes: true,
                quoteCharacter: '"'
            },
            build: {
                files: [
                    {
                        expand: true,
                        cwd: 'src',
                        src: ['tpl/**.html'],
                        dest: 'build/',
                    }
                ]
            },
            dist: {
                options: {
                    removeComments: true
                },
                files: [
                    {
                        expand: true,
                        cwd: 'src',
                        src: ['tpl/**.html'],
                        dest: 'dist/',
                    }
                ]
            }
        },
        copy: {
            dist: {
                files: {
                    'dist/js/MagazineTool.js': ['<%= concat.build.dest %>'],
                    'dist/css/app.css': 'build/css/app.css'
                }
            }
        },
        'string-replace': {
            options: {
                replacements: [
                    {
                        pattern: '{{ APP_ENV }}',
                        replacement: function() {
                            return grunt.option('env') || 'dist';
                        }
                    },
                    {
                        pattern: '{{ PORT }}',
                        replacement: function() {
                            return grunt.option('port');
                        }
                    },
                    {
                        pattern: /^/,
                        replacement: 'javascript:'
                    }
                ]
            },
            build: {
                files: {
                    'build/js/bookmark.min.js': 'build/js/bookmark.min.js'
                }
            },
            dist: {
                files: {
                    'dist/js/bookmark.min.js': 'dist/js/bookmark.min.js'
                }
            }
        },
        exec: {
            bower_update: {
                cmd: 'bower update'
            },
            npm_update: {
                cmd: 'npm update'
            }
        },
        watch: {
            atBegin: {
                files: [],
                tasks: ['option-defaults', 'connect:watch']
            },
            js: {
                files: ['Gruntfile.js', 'jscs.json', 'src/**/*.js'],
                tasks: ['jshint', 'jscs', 'concat:build', 'uglify:build', 'string-replace:build', 'notify:concat']
            },
            tpl: {
                files: ['src/tpl/**'],
                tasks: ['htmlmin:build', 'notify:htmlmin']
            },
            sass: {
                files: ['src/scss/**/*.scss'],
                tasks: ['sass:build', 'notify:sass']
            },
            options: {
                atBegin: true,
                spawn: false
            },
        },
        notify: {
            concat: {
                options: {
                    title: 'Concat Complete',
                    message: 'JS files concatenated'
                }
            },
            uglify: {
                options: {
                    title: 'Uglify Complete',
                    message: 'JS files uglified'
                }
            },
            sass: {
                options: {
{'fraction_non_alphanumeric': 0.12264767855845382, 'fraction_numerical': 0.000871902928140667, 'mean_word_length': 0.7243798546730142, 'pattern_counts': {'":': 0, '<': 7, '<?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': '560315', 'n_tokens_mistral': 3642, 'n_tokens_neox': 3349, 'n_words': 480}