{"size": 2568, "ext": "js", "max_stars_repo_path": "Gruntfile.js", "max_stars_repo_name": "xueye/canal.js", "max_stars_repo_stars_event_min_datetime": "2015-01-07T18:36:42.000Z", "max_stars_repo_stars_event_max_datetime": "2015-10-07T20:53:05.000Z", "max_issues_repo_path": "Gruntfile.js", "max_issues_repo_name": "philbarresi/canal.js", "max_issues_repo_issues_event_min_datetime": "2015-03-23T18:13:39.000Z", "max_issues_repo_issues_event_max_datetime": "2015-03-23T18:58:00.000Z", "max_forks_repo_path": "Gruntfile.js", "max_forks_repo_name": "philbarresi/canal.js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 32.9230769231, "max_line_length": 152, "alphanum_fraction": 0.3757788162}
module.exports = function (grunt) {
    var pkg = grunt.file.readJSON('package.json');

    // Project configuration.
    grunt.initConfig({
        pkg: pkg,
        clean: ["build"],
        typescript: {
            base: {
                src: ['src/<%= pkg.name %>.ts'],
                dest: 'build/<%= pkg.name %>.js',
                options: {
                    target: 'es5',
                    sourceMap: true,
                    declaration: true
                }
            },
            tests: {
                src: ['src/<%= pkg.name %>.tests.ts'],
                dest: 'build/<%= pkg.name %>.tests.js'
            }
        },
        uglify: {
            options: {
                banner: '/*!<%= pkg.name %> v<%= pkg.version %><%= grunt.template.today("yyyy-mm-dd") %> */\n'
            },
            build: {
                src: 'build/<%= pkg.name %>.js',
                dest: 'build/<%= pkg.name %>.min.js'
            }
        },
        copy: {
            dev: {
                files: [
                    {
                        expand: true,
                        src: ['build/<%= pkg.name %>.js', 'build/<%= pkg.name %>.js.map', 'build/<%= pkg.name %>.d.ts', 'build/<%= pkg.name %>.min.js'],
                        dest: 'dev/',
                        filter: 'isFile',
                        flatten: true
                    }
                ]
            },
            dist: {
                files: [
                    {
                        expand: true,
                        src: ['build/<%= pkg.name %>.js', 'build/<%= pkg.name %>.js.map', 'build/<%= pkg.name %>.d.ts', 'build/<%= pkg.name %>.min.js'],
                        dest: 'dist/',
                        filter: 'isFile',
                        flatten: true
                    }
                ]
            }
        },
        watch: {
            src: {
                files: ['src/*.ts'],
                tasks: ['default']
            }
        },
        karma: {
            unit: {
                configFile: 'karma.conf.js'
            }
        }
    });

    grunt.loadNpmTasks('grunt-typescript');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-karma');

    grunt.registerTask('default', ['clean', 'typescript', 'uglify', 'copy:dev', 'karma']);
    grunt.registerTask('dist', ['clean', 'typescript', 'uglify', 'copy:dev', 'karma', 'copy:dist']);
};