<commit_before>
'use strict';

module.exports = function (grunt) {
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    var _ = require('underscore')._;

    var reloadPort = 35729, files;

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        browserify: {
            options: {
                debug: true,
                extensions: ['.jsx'],
                transform: ['reactify']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
                options: {
                    debug: false
                },
                src: '<%= browserify.devApp.src %>',
                dest: '<%= browserify.devApp.dest %>'
            }
        },

        build: {
            app: {
                options: {
                    developTasks: ['browserify:devApp', 'stylus:devApp', 'copy:app'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app']
                }
            }
        },

        copy: {
            app: {
                files: [
                    { expand: true, cwd: './public', src: 'index.html', dest: './dist/app' },
                    { expand: true, cwd: './public', src: 'img/**/*.*', dest: './dist/app' }]
            }
        },

        express: {
            options: {
                script: 'app.js'
            },

            devApp: {
                node_env: 'develop'
            },

            prodApp: {
                node_env: 'production'
            }
        },

        run: {
            app: {
                options: {
                    developTasks: ['watchify:devApp', 'stylus:devApp', 'copy:app', 'express:devApp', 'watch'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app', 'express:prodApp', 'keepalive']
                }
            }
        },

        stylus: {
            devApp: {
                files: {
                    './dist/app/css/style.css': ['./public/css/**/*.styl'],
                }
            },

            prodApp: {
                options: {
                    compress: true
                },

                files: '<%= stylus.devApp.files %>'
            }
        },

        watch: {
            options: {
                nospawn: true,
                livereload: reloadPort
            },
            server: {
                files: [
                    'app.js',
                    'model/*.js',
                    'routes/*.js'
                ],
                tasks: ['express:devApp', 'delayed-livereload']
            },
            js: {
                files: ['public/js/*.js', 'dist/js/*.js'],
                options: {
                  livereload: reloadPort
                }
            },
            css: {
                files: ['public/css/*.css'],
                options: {
                  livereload: reloadPort
                }
            },
            jade: {
                files: ['views/*.jade'],
                options: {
                  livereload: reloadPort
                }
            }
        },

        watchify: {
            options: {
                debug: true,
                transform: ['reactify'],
                extensions: ['.jsx']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {<commit_msg>Enables reprocessing of styl resources in watchify<commit_after>
'use strict';

module.exports = function (grunt) {
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    var _ = require('underscore')._;

    var reloadPort = 35729, files;

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        browserify: {
            options: {
                debug: true,
                extensions: ['.jsx'],
                transform: ['reactify']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
                options: {
                    debug: false
                },
                src: '<%= browserify.devApp.src %>',
                dest: '<%= browserify.devApp.dest %>'
            }
        },

        build: {
            app: {
                options: {
                    developTasks: ['browserify:devApp', 'stylus:devApp', 'copy:app'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app']
                }
            }
        },

        copy: {
            app: {
                files: [
                    { expand: true, cwd: './public', src: 'index.html', dest: './dist/app' },
                    { expand: true, cwd: './public', src: 'img/**/*.*', dest: './dist/app' }]
            }
        },

        express: {
            options: {
                script: 'app.js'
            },

            devApp: {
                node_env: 'develop'
            },

            prodApp: {
                node_env: 'production'
            }
        },

        run: {
            app: {
                options: {
                    developTasks: ['watchify:devApp', 'stylus:devApp', 'copy:app', 'express:devApp', 'watch'],
                    productionTasks: ['browserify:prodApp', 'stylus:prodApp', 'copy:app', 'express:prodApp', 'keepalive']
                }
            }
        },

        stylus: {
            devApp: {
                files: {
                    './dist/app/css/style.css': ['./public/css/**/*.styl'],
                }
            },

            prodApp: {
                options: {
                    compress: true
                },

                files: '<%= stylus.devApp.files %>'
            }
        },

        watch: {
            options: {
                nospawn: true,
                livereload: reloadPort
            },
            server: {
                files: [
                    'app.js',
                    'model/*.js',
                    'routes/*.js'
                ],
                tasks: ['express:devApp', 'delayed-livereload']
            },
            js: {
                files: ['public/js/*.js', 'dist/js/*.js'],
                options: {
                  livereload: reloadPort
                }
            },
            css: {
                files: ['public/css/*.css'],
                options: {
                  livereload: reloadPort
                }
            },
            styl: {
                files: ['public/css/*.styl'],
                tasks: ['stylus:devApp'],
                options: {
                  livereload: reloadPort
                }
            },
            jade: {
                files: ['views/*.jade'],
                options: {
                  livereload: reloadPort
                }
            }
        },

        watchify: {
            options: {
                debug: true,
                transform: ['reactify'],
                extensions: ['.jsx']
            },

            devApp: {
                options: {
                    alias: ['react:']  // Make React available externally for dev tools
                },
                src: ['./public/js/app.js'],
                dest: './dist/app/bundle.js'
            },

            prodApp: {
{'fraction_non_alphanumeric': 0.13519367991845055, 'fraction_numerical': 0.0012742099898063201, 'mean_word_length': 0.8831573896353166, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5341574', 'n_tokens_mistral': 2167, 'n_tokens_neox': 1962, 'n_words': 362}