module.exports = function (grunt)
{
    'use strict';

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-shell');
    grunt.loadNpmTasks('grunt-contrib-cssmin');

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

        watch: {
            sass: {
                files: ['src/style/*.scss', 'src/style/*/sass/**'],
                tasks: ['sass']
            },

			theme: {
				files: ['!src/style/*/sass/**', '!src/style/*/js/**', 'src/style/*/**'],
				tasks: ['copy:theme']
			},

            js: {
                files: 'src/style/*/js/**',
                tasks: ['jshint', 'uglify', 'copy:js']
            }
        },

        compass: {
            dev: {
                options: {
                    config: 'config.rb',
                    force: true
                }
            }
        },

        copy: {
			js: {
				files: [
					{expand: true, cwd: 'src/style/Textpattern/js/libs/', src: ['**'], dest: 'public/style/Textpattern/js/'}
				]
			},

			theme: {
				files: [
					{expand: true, cwd: 'src/style/Textpattern/', src: ['**', '!sass/**', '!js/**'], dest: 'public/style/Textpattern/'}
				]
			}
        },

        jshint: {
            files: ['Gruntfile.js', 'src/style/*/js/*.js'],
            options: {
                bitwise: true,
                camelcase: true,
                curly: true,
                eqeqeq: true,
                es3: true,
                forin: true,
                immed: true,
                indent: 4,
                latedef: true,
                noarg: true,
                noempty: true,
                nonew: true,
                quotmark: 'single',
                undef: true,
                unused: true,
                strict: true,
                trailing: true,
                browser: true,
                globals: {
                    jQuery: true,
                    Zepto: true,
                    define: true,
                    module: true,
                    require: true,
                    requirejs: true,
                    responsiveNav: true,
                    prettyPrint: true
                }
            }
        },

        cssmin: {
            main: {
                files: {
                    'public/style/Textpattern.css': ['tmp/style/Textpattern.css'],
                    'public/style/Textpattern/css/ie8.css': ['tmp/style/Textpattern/sass/ie8.css']
                }
            }
        },

        uglify: {
            dist: {
                options: {
                    mangle: false,
                    preserveComments: 'some'
                },

                files: [
                    {
                        'public/style/Textpattern/js/main.js': ['src/style/Textpattern/js/main.js']
                    }
                ]
            }
        },

        shell: {
            setup: {
                command: [
                    'php src/setup/setup.php'
                ].join('&&'),
                options: {
                    stdout: true
                }
            }
        }
    });

    grunt.registerTask('test', ['jshint']);
    grunt.registerTask('sass', ['compass', 'cssmin']);
    grunt.registerTask('default', ['watch']);
    grunt.registerTask('build', ['jshint', 'copy', 'sass', 'uglify']);
    grunt.registerTask('travis', ['jshint']);
    grunt.registerTask('setup', ['shell:setup']);
};

@@ -3023,24 +3023,25 @@
 js/main.js'%5D
+,
 %0A           
@@ -3041,32 +3041,385 @@
                 
+    'public/style/Textpattern/js/placeholder.js': %5B'bower_components/jquery-placeholder/jquery.placeholder.js'%5D,%0A                        'public/style/Textpattern/js/require.js': %5B'bower_components/requirejs/require.js'%5D,%0A                        'public/style/Textpattern/js/responsivenav.js': %5B'bower_components/responsive-nav/responsive-nav.js'%5D%0A%09%09%09%09%09
 %7D%0A              

Include Bower components in the build.