<commit_before>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concurrent: {
        dev: {
            tasks: ['watch', 'connect:server:keepalive'],
            options: {
                logConcurrentOutput: true
            }
        }
    },
    watch: {},
    mocha: {
        options: {
            log: true,
            reporter: 'Nyan'
        },
        all: ['tests/test.html']
    },
    connect: {
        server: {
            options: {
                port: 8000,
                base: '.',
                hostname: '*'
            }
        }
    },
    requirejs: {
        release: {
            options: {
                baseUrl: './',
                optimize: "none",
                paths: {
                    "fossil": "src",
                    "jquery": "components/jquery/jquery",
                    "underscore": "components/underscore/underscore",
                    "backbone": "components/backbone/backbone"
                },
                shim: {
                    'underscore': {exports: '_'},
                    'backbone': { deps: ['underscore', 'jquery'], exports: 'Backbone'}
                },
                name: "fossil/fossil",
                exclude: ["jquery", "underscore", "backbone"],
                out: "<%= pkg.name %>.js"
            }
        }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.min.js'
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-concurrent');
  grunt.loadNpmTasks('grunt-mocha');

  // Default task(s).
  grunt.registerTask('test', ['mocha']);
  grunt.registerTask('dev', ['concurrent:dev']);
  grunt.registerTask('release', ['test', 'requirejs', 'uglify']);
  grunt.registerTask('default', ['release']);

};<commit_msg>Add build and watcher for library and tests.<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    // list of files to be processed
    // for compilation.
    buildsrc: [
            'src/core.js',
            'src/deferred.js',
            'src/mixins/*.js',
            'src/service.js',
            'src/application.js',
            'src/module.js',
            'src/fragment.js',
            'src/services/*.js'
        ],
    concurrent: {
        dev: {
            tasks: ['watch', 'connect:server:keepalive'],
            options: {
                logConcurrentOutput: true
            }
        }
    },
    watch: {
        src: {
            files: 'src/**/*.js',
            tasks: ['concat:library', 'contact:amd']
        },
        tests: {
            files: 'tests/specs/**/*.js',
            tasks: ['concat:tests']
        }
    },
    mocha: {
        options: {
            log: true,
            reporter: 'Nyan'
        },
        all: ['tests/test.html']
    },
    connect: {
        server: {
            options: {
                port: 8000,
                base: '.',
                hostname: '*'
            }
        }
    },
    concat: {
        tests: {
            options: {
                banner: [
                    "mocha.setup('bdd')",
                    "mocha.checkLeaks();",
                    // ensure application selector is an external element
                    "Fossil.Application.prototype.selector = $('<div>');"
                ].join("\n"),
                footer: [
                    "mocha.run();"
                ].join("\n")
            },
            src: 'tests/specs/**/*.js',
            dest: 'tests/specs.js'
        },
        library:{
            options: {
                banner: "var Fossil = (function (_, Backbone, jQuery) {\n",
                footer: [
                    "return Fossil;",
                    "})(_, Backbone, jQuery);"
                ].join("\n")
            },
            src: '<%= buildsrc %>',
            dest: '<%= pkg.name %>.js'
        },
        amd:{
            options: {
                banner: "define('fossil', ['underscore', 'backbone', 'jquery']function (_, Backbone, jQuery) {\n",
                footer: [
                    "return Fossil;",
                    "});"
                ].join("\n")
            },
            src: '<%= buildsrc %>',
            dest: '<%= pkg.name %>-amd.js'
        }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      library: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.min.js'
      },
      amd: {
        src: '<%= pkg.name %>-amd.js',
        dest: '<%= pkg.name %>-amd.min.js'
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-concurrent');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-mocha');

  // Default task(s).
  grunt.registerTask('test', ['contact:tests', 'mocha']);
  grunt.registerTask('dev', ['concurrent:dev']);
  grunt.registerTask('release', ['test', 'concat:library', 'concat:amd', 'uglify:library', 'uglify:amd']);
  grunt.registerTask('default', ['release']);

};
{'fraction_non_alphanumeric': 0.17398202009518773, 'fraction_numerical': 0.0014101886127269522, 'mean_word_length': 1.4425312096427034, 'pattern_counts': {'":': 4, '<': 19, '<?xml version=': 0, '>': 19, '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': '6107326', 'n_tokens_mistral': 1802, 'n_tokens_neox': 1682, 'n_words': 280}