<commit_before>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),

		concat: {
			options: {
				separator: '\r\n\r\n'
			},
			dist: {
				src: [
                    'src/modules/soundmanager2.js',
                    'src/01-app.js',
                    'src/02-filter-humanTime.js',
                    'src/03-factory-angularPlayer.js',
                    'src/04-directive-soundManager.js',
                    'src/05-directive-musicPlayer.js',
                    'src/06-directive-playFromPlaylist.js',
                    'src/07-directive-removeFromPlaylist.js',
                    'src/08-directive-seekTrack.js',
                    'src/09-directive-playMusic.js',
                    'src/10-directive-pauseMusic.js',
                    'src/11-directive-stopMusic.js',
                    'src/12-directive-nextTrack.js',
                    'src/13-directive-prevTrack.js',
                    'src/14-directive-muteMusic.js',
                    'src/15-directive-repeatMusic.js',
                    'src/16-directive-musicVolume.js',
                    'src/17-directive-clearPlaylist.js',
                    'src/18-directive-playAll.js',
                    'src/19-directive-volumeBar.js',
                    'src/20-directive-playPauseToggle.js',
                ],
				dest: 'dist/angular-soundmanager2.js'
			}
		},

		uglify: {
			options: {
				banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
			},
			dist: {
				files: {
					'dist/angular-soundmanager2.min.js': ['dist/angular-soundmanager2.js']
				}
			}
		},

		jshint: {
			files: ['gruntfile.js', 'src/*.js', 'src/modules/*.js'],
			options: {
				globals: {
					jQuery: true,
					console: true,
					module: true
				}
			}
		},

		watch: {
			files: ['<%= jshint.files %>'],
			tasks: ['concat', 'uglify', 'jshint']
		}

	});

	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask('default', ['concat', 'uglify', 'jshint', 'watch']);
};<commit_msg>Makes space characters consistent to the rest of the project using 4 spaces instead of tab.<commit_after>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    concat: {
      options: {
        separator: '\r\n\r\n'
      },
      dist: {
        src: [
          'src/modules/soundmanager2.js',
          'src/01-app.js',
          'src/02-filter-humanTime.js',
          'src/03-factory-angularPlayer.js',
          'src/04-directive-soundManager.js',
          'src/05-directive-musicPlayer.js',
          'src/06-directive-playFromPlaylist.js',
          'src/07-directive-removeFromPlaylist.js',
          'src/08-directive-seekTrack.js',
          'src/09-directive-playMusic.js',
          'src/10-directive-pauseMusic.js',
          'src/11-directive-stopMusic.js',
          'src/12-directive-nextTrack.js',
          'src/13-directive-prevTrack.js',
          'src/14-directive-muteMusic.js',
          'src/15-directive-repeatMusic.js',
          'src/16-directive-musicVolume.js',
          'src/17-directive-clearPlaylist.js',
          'src/18-directive-playAll.js',
          'src/19-directive-volumeBar.js',
          'src/20-directive-playPauseToggle.js',
        ],
        dest: 'dist/angular-soundmanager2.js'
      }
    },

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
      },
      dist: {
        files: {
          'dist/angular-soundmanager2.min.js': ['dist/angular-soundmanager2.js']
        }
      }
    },

    jshint: {
      files: ['gruntfile.js', 'src/*.js', 'src/modules/*.js'],
      options: {
        globals: {
          jQuery: true,
          console: true,
          module: true
        }
      }
    },

    watch: {
      files: ['<%= jshint.files %>'],
      tasks: ['concat', 'uglify', 'jshint']
    }

  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('default', ['concat', 'uglify', 'jshint', 'watch']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = () => {
	const grunt = require('grunt');

	const pkg = grunt.file.readJSON('package.json');
	const version = pkg.version;

	grunt.initConfig({
		shell: {
			install: {
				options: {
					stdout: false,
					stderr: false,
					stdin: false,
				},
				command: 'npm install',
			},
			dist: {
				options: {
					stdout: true,
					stderr: true,
					stdin: false,
				},
				command: 'cd ./dist && npm install --production',
			},
		},

		concat: {
			options: {
				stripBanners: true,
			},
			dist: {
				src: [
					'src/client/js/modules/handlebars/Templates.js',
					'src/client/js/modules/Message.js',
					'src/client/js/modules/Interface.js',
					'src/client/js/modules/Sources.js',
					'src/client/js/modules/Incoming.js',
					'src/client/js/modules/Connections.js',
					'src/client/js/modules/Outgoing.js',
					'src/client/js/index.js',
				],
				dest: 'dist/src/client/built.js',
			},
			dependencies: {
				options: {
					banner: `/*! Maid-IRC - v${version} - ${grunt.template.today('yyyy-mm-dd')} */

'use strict';

`,
					stripBanners: true,
					process(src, filepath) {
						return `// Source: ${filepath}

${src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1')}`;
					},
				},
				src: [
					// Libraries
					'src/client/js/lib/Autolinker.min.js',
					'src/client/js/lib/handlebars.runtime.min.js',
					'src/client/js/lib/twemoji.min.js',
					'src/client/js/lib/uuid.js',
					// Compiled core code
					'src/client/app.js',
					// Precompiled templates
					'src/client/js/modules/handlebars/compiled.js',
				],
				dest: 'src/client/app.js',
			},
		},

		babel: {
			options: {
				comments: false,
			},
			development: {
				files: {
					'src/client/app.js': 'dist/src/client/built.js',
				},
			},
			dist: {
				files: {
					'dist/src/client/app.js': 'dist/src/client/built.js',
				},
			},
		},

		clean: {
			beforeDist: {
				src: ['dist/**/*'],
			},
			dist: {
				src: ['build', 'dist/src/client/built.js'],
			},
			afterDist: {
				src: ['dist/**/*', `!dist/maid-irc_v${version}.zip`],
			},
		},

		copy: {
			dist: {
				files: [
					{
						expand: true,
						src: [
							'src/client/**',
							'!src/client/js/**',
							'!src/client/css/**',
							'!src/client/less/**',
							'src/server/**',
							'screenshots/**',
						],
						dest: 'dist',
					},
					{
						src: ['src/index.js'],
						dest: 'dist/src/index.js',
					},
					{
						src: ['maid.js'],
						dest: 'dist/maid.js',
					},
					{
						src: ['config.yml'],
						dest: 'dist/config.yml',
					},
					{
						src: ['package.json'],
						dest: 'dist/package.json',
					},
					{
						src: ['README.md'],
						dest: 'dist/README.md',
					},
					{
						src: ['LICENSE'],
						dest: 'dist/LICENSE',
					},
				],
			},
			final: {
				files: [
					{
						src: ['src/client/app.js'],
						dest: 'dist/src/client/app.js',
					},
				],
			},
		},

		less: {
			development: {
				options: {
					paths: [],
				},
				files: {
					'src/client/css/client.css': 'src/client/less/client.less',
				},
			},
			dist: {
				options: {
					paths: [],
					plugins: [],
					compress: true,
					optimization: 0,
				},
				files: {
					'dist/src/client/css/client.css': 'src/client/less/client.less',
				},
			},
		},

		compress: {
			dist: {
				options: {
					archive: `dist/maid-irc_v${version}.zip`,
				},
				files: [
					{
						expand: true,
						cwd: './dist',
						src: ['**'],
					},
				],
			},
		},

		watch: {
			less: {
				files: ['src/client/less/*.less'],
				tasks: ['build:css'],
				options: {
					span: false,
				},
			},
			js: {
				files: [
					'src/client/js/**/*.js',
					'!src/client/js/modules/handlebars/compiled.js',
					'src/client/views/**/*.hbs',
				],
				tasks: ['handlebars:compile', 'build:js'],
				options: {
					span: false,
				},
			},
			handlebars: {
				files: ['src/client/views/**/*.hbs'],
				tasks: ['handlebars:compile'],
				options: {
					span: false,
				},
			},
		},

		handlebars: {
			options: {
				namespace: 'Maid.Templates',
				wrapped: true,
			},
			compile: {
				files: {
					'src/client/js/modules/handlebars/compiled.js': ['src/client/views/**/*.hbs'],
				},
			},
		},
	});

	// Load grunt contribution tasks
	grunt.loadNpmTasks('grunt-contrib-handlebars');
	grunt.loadNpmTasks('grunt-contrib-compress');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-less');

	// Load third-party tasks
	grunt.loadNpmTasks('grunt-shell');
	grunt.loadNpmTasks('grunt-babel');

	// Override default tasks or some magic
	grunt.registerTask('default', []);

	grunt.registerTask('install', function install() {
		grunt.log.writeln('Installing Dependencies');
		grunt.task.run(['shell:install']);
	});

	grunt.registerTask('build:js', function buildjs() {
		grunt.log.writeln(`Compiling Maid-IRC's client javascript`);
		grunt.task.run([
			'concat:dist',
			'babel:development',
			'handlebars:compile',
			'concat:dependencies',
			'clean:dist',
		]);
	});

	grunt.registerTask('build:less', function buildless() {
		grunt.log.writeln(`Compiling Maid-IRC's less files`);
		grunt.task.run([
			'less:development',
		]);
	});

	grunt.registerTask('build:handlebars', function buildhandlebars() {
		grunt.log.writeln(`Compiling Maid-IRC's handlebars files`);
		grunt.task.run([
			'handlebars:compile',
		]);
	});

	grunt.registerTask('build', function build() {
		grunt.log.writeln('Building Maid-IRC');
		grunt.task.run([
			'concat:dist',
			'babel:development',
			'handlebars:compile',
			'concat:dependencies',
			'clean:dist',
			'less:development',
		]);
	});

	grunt.registerTask('package', function packageTask() {
		grunt.log.writeln('Packaging Maid-IRC');
		grunt.task.run([
			'clean:beforeDist',
			'copy:dist',
			'concat:dist',
			'babel:dist',
			'handlebars:compile',
			'concat:dependencies',
			'copy:final',
			'less:dist',
			'clean:dist',
			'shell:dist',
			'compress:dist',
			'clean:afterDist',
		]);
	});
};
<commit_msg>Should fix the issue deploying in the last release<commit_after>'use strict';

module.exports = () => {
	const grunt = require('grunt');

	const pkg = grunt.file.readJSON('package.json');
	const version = pkg.version;

	grunt.initConfig({
		shell: {
			install: {
				options: {
					stdout: false,
					stderr: false,
					stdin: false,
				},
				command: 'npm install',
			},
			dist: {
				options: {
					stdout: true,
					stderr: true,
					stdin: false,
				},
				command: 'cd ./dist && npm install --production',
			},
		},

		concat: {
			options: {
				stripBanners: true,
			},
			dist: {
				src: [
					'src/client/js/modules/handlebars/Templates.js',
					'src/client/js/modules/Message.js',
					'src/client/js/modules/Interface.js',
					'src/client/js/modules/Sources.js',
					'src/client/js/modules/Incoming.js',
					'src/client/js/modules/Connections.js',
					'src/client/js/modules/Outgoing.js',
					'src/client/js/index.js',
				],
				dest: 'dist/src/client/built.js',
			},
			dependencies: {
				options: {
					banner: `/*! Maid-IRC - v${version} - ${grunt.template.today('yyyy-mm-dd')} */

'use strict';

`,
					stripBanners: true,
					process(src, filepath) {
						return `// Source: ${filepath}

${src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1')}`;
					},
				},
				src: [
					// Libraries
					'src/client/js/lib/Autolinker.min.js',
					'src/client/js/lib/handlebars.runtime.min.js',
					'src/client/js/lib/twemoji.min.js',
					'src/client/js/lib/uuid.js',
					// Compiled core code
					'src/client/app.js',
					// Precompiled templates
					'src/client/js/modules/handlebars/compiled.js',
				],
				dest: 'src/client/app.js',
			},
		},

		babel: {
			options: {
				comments: false,
			},
			development: {
				files: {
					'src/client/app.js': 'dist/src/client/built.js',
				},
			},
			dist: {
				files: {
					'dist/src/client/app.js': 'dist/src/client/built.js',
				},
			},
		},

		clean: {
			beforeDist: {
				src: ['dist/**/*'],
			},
			dist: {
				src: ['build', 'dist/src/client/built.js'],
			},
			afterDist: {
				src: ['dist/**/*', `!dist/maid-irc_v${version}_prebuilt.zip`],
			},
		},

		copy: {
			dist: {
				files: [
					{
						expand: true,
						src: [
							'src/client/**',
							'!src/client/js/**',
							'!src/client/css/**',
							'!src/client/less/**',
							'src/server/**',
							'screenshots/**',
						],
						dest: 'dist',
					},
					{
						src: ['src/index.js'],
						dest: 'dist/src/index.js',
					},
					{
						src: ['maid.js'],
						dest: 'dist/maid.js',
					},
					{
						src: ['config.yml'],
						dest: 'dist/config.yml',
					},
					{
						src: ['package.json'],
						dest: 'dist/package.json',
					},
					{
						src: ['README.md'],
						dest: 'dist/README.md',
					},
					{
						src: ['LICENSE'],
						dest: 'dist/LICENSE',
					},
				],
			},
			final: {
				files: [
					{
						src: ['src/client/app.js'],
						dest: 'dist/src/client/app.js',
					},
				],
			},
		},

		less: {
			development: {
				options: {
					paths: [],
				},
				files: {
					'src/client/css/client.css': 'src/client/less/client.less',
				},
			},
			dist: {
				options: {
					paths: [],
					plugins: [],
					compress: true,
					optimization: 0,
				},
				files: {
					'dist/src/client/css/client.css': 'src/client/less/client.less',
				},
			},
		},

		compress: {
			dist: {
				options: {
					archive: `dist/maid-irc_v${version}_prebuilt.zip`,
				},
				files: [
					{
						expand: true,
						cwd: './dist',
						src: ['**'],
					},
				],
			},
		},

		watch: {
			less: {
				files: ['src/client/less/*.less'],
				tasks: ['build:css'],
				options: {
					span: false,
				},
			},
			js: {
				files: [
					'src/client/js/**/*.js',
					'!src/client/js/modules/handlebars/compiled.js',
					'src/client/views/**/*.hbs',
				],
				tasks: ['handlebars:compile', 'build:js'],
				options: {
					span: false,
				},
			},
			handlebars: {
				files: ['src/client/views/**/*.hbs'],
				tasks: ['handlebars:compile'],
				options: {
					span: false,
				},
			},
		},

		handlebars: {
			options: {
				namespace: 'Maid.Templates',
				wrapped: true,
			},
			compile: {
				files: {
					'src/client/js/modules/handlebars/compiled.js': ['src/client/views/**/*.hbs'],
				},
			},
		},
	});

	// Load grunt contribution tasks
	grunt.loadNpmTasks('grunt-contrib-handlebars');
	grunt.loadNpmTasks('grunt-contrib-compress');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-less');

	// Load third-party tasks
	grunt.loadNpmTasks('grunt-shell');
	grunt.loadNpmTasks('grunt-babel');

	// Override default tasks or some magic
	grunt.registerTask('default', []);

	grunt.registerTask('install', function install() {
		grunt.log.writeln('Installing Dependencies');
		grunt.task.run(['shell:install']);
	});

	grunt.registerTask('build:js', function buildjs() {
		grunt.log.writeln(`Compiling Maid-IRC's client javascript`);
		grunt.task.run([
			'concat:dist',
			'babel:development',
			'handlebars:compile',
			'concat:dependencies',
			'clean:dist',
		]);
	});

	grunt.registerTask('build:less', function buildless() {
		grunt.log.writeln(`Compiling Maid-IRC's less files`);
		grunt.task.run([
			'less:development',
		]);
	});

	grunt.registerTask('build:handlebars', function buildhandlebars() {
		grunt.log.writeln(`Compiling Maid-IRC's handlebars files`);
		grunt.task.run([
			'handlebars:compile',
		]);
	});

	grunt.registerTask('build', function build() {
		grunt.log.writeln('Building Maid-IRC');
		grunt.task.run([
			'concat:dist',
			'babel:development',
			'handlebars:compile',
			'concat:dependencies',
			'clean:dist',
			'less:development',
		]);
	});

	grunt.registerTask('package', function packageTask() {
		grunt.log.writeln('Packaging Maid-IRC');
		grunt.task.run([
			'clean:beforeDist',
			'copy:dist',
			'concat:dist',
			'babel:dist',
			'handlebars:compile',
			'concat:dependencies',
			'copy:final',
			'less:dist',
			'clean:dist',
			'shell:dist',
			'compress:dist',
			'clean:afterDist',
		]);
	});
};
<|endoftext|>


<commit_before>require('es6-promise').polyfill();

module.exports = function(grunt) {

  var sauceLaunchers = require('./test/sauceLaunchers');

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      options: {
        jshintrc: true
      }
    },
    mochaTest: {
      test: {
        src: ['test/**/*.spec.js']
      }
    },
    browserify: {
      dist: {
        src: ['src/index.js'],
        dest: 'dist/<%= pkg.name %>.js',
        options: {
          browserifyOptions: {
            standalone: 'Reflux'
          }
        },
      }
    },
    uglify: {
      dist: {
        src: 'dist/reflux.js',
        dest: 'dist/reflux.min.js'
      }
    },
    watch: {
      files: ['<%= jshint.files %>'],
      tasks: ['build']
    },
    karma: {
      local: {
        configFile: 'karma.conf.js',
        options: {
            browsers: ['PhantomJS']
        }
      },
      sauce: {
        configFile: 'karma.conf.js',
        options: {
          reporters: ['saucelabs', 'dots'],
          sauceLabs: {
            "public": "public",
            testName: 'RefluxJS Karma Tests',
            recordVideo: false,
            recordScreenshot: false,
            startConnect: false,
            tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
            connectOptions: {
              port: 5757,
              logfile: "sauce_connect.log"
            }
          },
          customLaunchers: sauceLaunchers,
          browsers: Object.keys(sauceLaunchers),
          singleRun: true,
          captureTimeout: 0
        },
      }
    }
  });

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.registerTask('test', ['jshint', 'mochaTest', 'karma:local']);

  grunt.registerTask('travis', ['jshint', 'karma:sauce']);

  grunt.registerTask('build', ['test', 'browserify', 'uglify']);

  grunt.registerTask('default', ['watch']);

};
<commit_msg>Added sauce task to run from dev<commit_after>require('es6-promise').polyfill();

module.exports = function(grunt) {

  var sauceLaunchers = require('./test/sauceLaunchers');

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      options: {
        jshintrc: true
      }
    },
    mochaTest: {
      test: {
        src: ['test/**/*.spec.js']
      }
    },
    browserify: {
      dist: {
        src: ['src/index.js'],
        dest: 'dist/<%= pkg.name %>.js',
        options: {
          browserifyOptions: {
            standalone: 'Reflux'
          }
        },
      }
    },
    uglify: {
      dist: {
        src: 'dist/reflux.js',
        dest: 'dist/reflux.min.js'
      }
    },
    watch: {
      files: ['<%= jshint.files %>'],
      tasks: ['build']
    },
    karma: {
      local: {
        configFile: 'karma.conf.js',
        options: {
            browsers: ['PhantomJS']
        }
      },
      devsauce: {
        configFile: 'karma.conf.js',
        options: {
          reporters: ['saucelabs', 'dots'],
          sauceLabs: {
            "public": "team",
            testName: 'RefluxJS Karma Tests (Dev)',
            recordVideo: false,
            recordScreenshot: false,
            tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
          },
          customLaunchers: sauceLaunchers,
          browsers: Object.keys(sauceLaunchers),
          captureTimeout: 0
        },
      },
      sauce: {
        configFile: 'karma.conf.js',
        options: {
          reporters: ['saucelabs', 'dots'],
          sauceLabs: {
            "public": "public",
            testName: 'RefluxJS Karma Tests (Travis)',
            recordVideo: false,
            recordScreenshot: false,
            startConnect: false,
            tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
            connectOptions: {
              port: 5757,
              logfile: "sauce_connect.log"
            }
          },
          customLaunchers: sauceLaunchers,
          browsers: Object.keys(sauceLaunchers),
          singleRun: true,
          captureTimeout: 0
        },
      }
    }
  });

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.registerTask('test', ['jshint', 'mochaTest', 'karma:local']);

  grunt.registerTask('travis', ['jshint', 'karma:sauce']);

  grunt.registerTask('build', ['test', 'browserify', 'uglify']);

  grunt.registerTask('default', ['watch']);

};
<|endoftext|>


<commit_before>// Generated on 2016-04-29 using generator-angular 0.12.1
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Automatically load required Grunt tasks
  require('jit-grunt')(grunt, {
    useminPrepare: 'grunt-usemin',
    ngtemplates: 'grunt-angular-templates',
    cdnify: 'grunt-google-cdn'
  });

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git{,*/}*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      server: {
        options: {
          map: true,
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath:  /\.\.\//
      },
      test: {
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      js: ['<%= yeoman.dist %>/scripts/{,*/}*.js'],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>',
          '<%= yeoman.dist %>/images',
          '<%= yeoman.dist %>/styles'
        ],
        patterns: {
          js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']]
        }
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    ngtemplates: {
      dist: {
        options: {
          module: 'ubirchAdminCrudApp',
          htmlmin: '<%= htmlmin.dist.options %>',
          usemin: 'scripts/scripts.js'
        },
        cwd: '<%= yeoman.app %>',
        src: 'views/{,*/}*.html',
        dest: '.tmp/templateCache.js'
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'images/{,*/}*.{webp}',
            'styles/fonts/{,*/}*.*',
            'i18n/{,*/}*.json'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: 'bower_components/bootstrap/dist',
          src: 'fonts/*',
          dest: '<%= yeoman.dist %>'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'wiredep',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'ngtemplates',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
//    'test',
    'build'
  ]);
};
<commit_msg>BUG fixed: didn't copy html files from view-dir<commit_after>// Generated on 2016-04-29 using generator-angular 0.12.1
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Automatically load required Grunt tasks
  require('jit-grunt')(grunt, {
    useminPrepare: 'grunt-usemin',
    ngtemplates: 'grunt-angular-templates',
    cdnify: 'grunt-google-cdn'
  });

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        //livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git{,*/}*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      server: {
        options: {
          map: true,
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath:  /\.\.\//
      },
      test: {
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      js: ['<%= yeoman.dist %>/scripts/{,*/}*.js'],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>',
          '<%= yeoman.dist %>/images',
          '<%= yeoman.dist %>/styles'
        ],
        patterns: {
          js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']]
        }
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html','views/{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    ngtemplates: {
      dist: {
        options: {
          module: 'ubirchAdminCrudApp',
          htmlmin: '<%= htmlmin.dist.options %>',
          usemin: 'scripts/scripts.js'
        },
        cwd: '<%= yeoman.app %>',
        src: 'views/{,*/}*.html',
        dest: '.tmp/templateCache.js'
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'styles/fonts/{,*/}*.*',
            'i18n/{,*/}*.json'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: 'bower_components/bootstrap/dist',
          src: 'fonts/*',
          dest: '<%= yeoman.dist %>'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'wiredep',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'ngtemplates',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
//    'test',
    'build'
  ]);
};
<|endoftext|>


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

    grunt.initConfig({

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

        watch: {
            options: {
                livereload: {
                    port: 35729,
                }
            },
            ember_templates: {
                files: ['*.hbs', 'partials/*.hbs'],
            },
            js: {
                files: ['assets/js/*'],
                tasks: ['uglify', 'concat']
            },
            sass: {
                files: ['assets/scss/*'],
                tasks: ['compass', 'cssmin']
            }
        },

        compass: {
            dist: {
                options: {
                    sassDir: 'assets/scss/',
                    specify: 'assets/scss/main.scss',
                    cssDir: 'assets/scss/build/',
                    environment: 'production' //changeme
                }
            }
        },

        cssmin: {
            combine: {
                files: {
                    'assets/css/theme.min.css': ['assets/scss/build/*.css']
                }
            }
        },

        copy: {
            main: {
                files: [
                    {expand: true, flatten: true, src: ['bower_components/components-font-awesome/fonts/*'], dest: './assets/fonts'}
                ]
            }
        },
        uglify: {
            js: {
                files: {
                    'assets/js/theme.min.js': ['bower_components/jquery/dist/jquery.js', 'assets/js/lib/*.js', 'assets/js/plugins/*.js', 'assets/js/helpers/*.js', 'assets/js/base.js']
                }
            }
        },

        concat: {
            options: {
                separator: ';',
            },
            dist: {
                src: ['assets/js/config.js', 'assets/js/theme.min.js'],
                dest: 'assets/js/theme.min.js',
            },
        },

        connect: {
            server: {
                options: {
                    hostname: '127.0.0.1',
                    port: 8080,
                    base: '',
                    livereload: true
                }
            }
        }

    });

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

    grunt.registerTask('default', ['compass', 'cssmin', 'uglify', 'concat', 'watch']);
    grunt.registerTask('dev', ['compass', 'cssmin', 'uglify', 'concat', 'connect', 'copy', 'watch']);
    grunt.registerTask('build', ['compass', 'cssmin', 'uglify', 'concat']);

};
<commit_msg>updating gruntfile<commit_after>module.exports = function (grunt) {

    grunt.initConfig({

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

        watch: {
            options: {
                livereload: {
                    port: 35729,
                }
            },
            ember_templates: {
                files: ['*.hbs', 'partials/*.hbs'],
            },
            js: {
                files: ['assets/js/*'],
                tasks: ['uglify', 'concat']
            },
            sass: {
                files: ['assets/scss/*'],
                tasks: ['compass', 'cssmin']
            }
        },

        compass: {
            dist: {
                options: {
                    sassDir: 'assets/scss/',
                    specify: 'assets/scss/main.scss',
                    cssDir: 'assets/scss/build/',
                    environment: 'production' //changeme
                }
            }
        },

        cssmin: {
            combine: {
                files: {
                    'assets/css/theme.min.css': ['assets/scss/build/*.css']
                }
            }
        },

        copy: {
            main: {
                files: [
                    {expand: true, flatten: true, src: ['bower_components/components-font-awesome/fonts/*'], dest: './assets/fonts'}
                ]
            }
        },
        uglify: {
            js: {
                files: {
                    'assets/js/theme.min.js': ['bower_components/jquery/dist/jquery.js', 'assets/js/lib/*.js', 'assets/js/plugins/*.js', 'assets/js/helpers/*.js', 'assets/js/base.js']
                }
            }
        },

        concat: {
            options: {
                separator: ';',
            },
            dist: {
                src: ['assets/js/config.js', 'assets/js/theme.min.js'],
                dest: 'assets/js/theme.min.js',
            },
        },

        connect: {
            server: {
                options: {
                    hostname: '127.0.0.1',
                    port: 8080,
                    base: '',
                    livereload: true
                }
            }
        }

    });

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

    grunt.registerTask('default', ['compass', 'cssmin', 'uglify', 'concat', 'watch']);
    grunt.registerTask('dev', ['compass', 'cssmin', 'uglify', 'concat', 'connect', 'copy', 'watch']);
    grunt.registerTask('build', ['compass', 'cssmin', 'copy', 'uglify', 'concat']);

};
<|endoftext|>


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

  'use strict';

  grunt.initConfig({

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('package.json'),

    /**
     * Here's a banner with some template variables.
     * We'll be inserting it at the top of minified assets.
     */
    banner:
      '/*\n' +
      ' *            /|\n' +
      ' *           / |  |\\\n' +
      ' *          /  |  | \\\n' +
      ' *         /   |   \\ \\\n' +
      ' *        / /| |    \\ \\\n' +
      ' *       / / | |     \\ \\\n' +
      ' *      / /   \\ \\     \\ \\\n' +
      ' *     / /     \\/      \\ \\\n' +
      ' *    /_/   /\\    ______\\ \\\n' +
      ' * ________/ /   / ________\\\n' +
      ' * \\  ______/   / /    __\n' +
      ' *  \\ \\         \\/    / /\n' +
      ' *   \\ \\      /\\     / /\n' +
      ' *    \\ \\     \\ \\   / /\n' +
      ' *     \\ \\     | | / /\n' +
      ' *      \\ \\    | |/ /\n' +
      ' *       \\ \\   |   /\n' +
      ' *        \\ |  |  /\n' +
      ' *         \\|  | /\n' +
      ' *             |/\n' +
      ' *\n' +
      ' * <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      ' * <%= pkg.description %>\n' +
      ' * <%= pkg.homepage ? pkg.homepage + "\\n" : "" %>\n' +
      ' * License: Public Domain\n' +
      ' */\n\n',

    /**
     * Less: https://github.com/gruntjs/grunt-contrib-less
     *
     * Compile, concat and compress Less files.
     * Make sure to add any other CSS libraries/files you'll be using.
     * We are excluding minified files with the final ! pattern.
     */
    less: {
      dist: {
        src: ['<%= banner %>', 'static/css/main.less', '!static/css/*.min.css'],
        dest: 'static/css/main.min.css',
        options: {
          compile: true,
          compress: true
        }
      }
    },

    /**
     * Uglify: https://github.com/gruntjs/grunt-contrib-uglify
     *
     * Minify JS files.
     * Make sure to add any other JS libraries/files you'll be using.
     * We are excluding minified files with the final ! pattern.
     */
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: ['static/js/vendor/jquery-1.9.1.js', 'static/js/vendor/holder.js', 'static/js/*.js', '!static/js/*.min.js'],
        dest: 'static/js/main.min.js'
      }
    },

    /**
     * JSHint: https://github.com/gruntjs/grunt-contrib-jshint
     *
     * Validate files with JSHint.
     * Below are options that conform to idiomatic.js standards.
     * Feel free to add/remove your favorites: http://www.jshint.com/docs/#options
     */
    jshint: {
      options: {
        camelcase: true,
        curly: true,
        eqeqeq: true,
        forin: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        browser: true,
        globals: {
          jQuery: true,
          $: true,
          Backbone: true,
          _: true,
          module: true,
          Highcharts: true
        }
      },
      all: ['static/js/<%= pkg.name %>.js']
    },

    /**
     * Watch: https://github.com/gruntjs/grunt-contrib-watch
     *
     * Run predefined tasks whenever watched file patterns are added, changed or deleted.
     * Add files to monitor below.
     */
    watch: {
      gruntfile: {
        files: ['Gruntfile.js', '<%= less.dist.src %>', '<%= uglify.dist.src %>'],
        tasks: ['default']
      }
    }
  });

  /**
   * Loading tasks
   */
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');

  /**
   * Task aliases
   */
  grunt.registerTask('default', ['less', 'jshint', 'uglify']);

};
<commit_msg>Improve Grunt watch configuration<commit_after>module.exports = function(grunt) {

  'use strict';

  grunt.initConfig({

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('package.json'),

    /**
     * Here's a banner with some template variables.
     * We'll be inserting it at the top of minified assets.
     */
    banner:
      '/*\n' +
      ' *            /|\n' +
      ' *           / |  |\\\n' +
      ' *          /  |  | \\\n' +
      ' *         /   |   \\ \\\n' +
      ' *        / /| |    \\ \\\n' +
      ' *       / / | |     \\ \\\n' +
      ' *      / /   \\ \\     \\ \\\n' +
      ' *     / /     \\/      \\ \\\n' +
      ' *    /_/   /\\    ______\\ \\\n' +
      ' * ________/ /   / ________\\\n' +
      ' * \\  ______/   / /    __\n' +
      ' *  \\ \\         \\/    / /\n' +
      ' *   \\ \\      /\\     / /\n' +
      ' *    \\ \\     \\ \\   / /\n' +
      ' *     \\ \\     | | / /\n' +
      ' *      \\ \\    | |/ /\n' +
      ' *       \\ \\   |   /\n' +
      ' *        \\ |  |  /\n' +
      ' *         \\|  | /\n' +
      ' *             |/\n' +
      ' *\n' +
      ' * <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      ' * <%= pkg.description %>\n' +
      ' * <%= pkg.homepage ? pkg.homepage + "\\n" : "" %>\n' +
      ' * License: Public Domain\n' +
      ' */\n\n',

    /**
     * Less: https://github.com/gruntjs/grunt-contrib-less
     *
     * Compile, concat and compress Less files.
     * Make sure to add any other CSS libraries/files you'll be using.
     * We are excluding minified files with the final ! pattern.
     */
    less: {
      dist: {
        src: ['<%= banner %>', 'static/css/main.less', '!static/css/*.min.css'],
        dest: 'static/css/main.min.css',
        options: {
          compile: true,
          compress: true
        }
      }
    },

    /**
     * Uglify: https://github.com/gruntjs/grunt-contrib-uglify
     *
     * Minify JS files.
     * Make sure to add any other JS libraries/files you'll be using.
     * We are excluding minified files with the final ! pattern.
     */
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: ['static/js/vendor/jquery-1.9.1.js', 'static/js/vendor/holder.js', 'static/js/*.js', '!static/js/*.min.js'],
        dest: 'static/js/main.min.js'
      }
    },

    /**
     * JSHint: https://github.com/gruntjs/grunt-contrib-jshint
     *
     * Validate files with JSHint.
     * Below are options that conform to idiomatic.js standards.
     * Feel free to add/remove your favorites: http://www.jshint.com/docs/#options
     */
    jshint: {
      options: {
        camelcase: true,
        curly: true,
        eqeqeq: true,
        forin: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        browser: true,
        globals: {
          jQuery: true,
          $: true,
          Backbone: true,
          _: true,
          module: true,
          Highcharts: true
        }
      },
      all: ['static/js/<%= pkg.name %>.js']
    },

    /**
     * Watch: https://github.com/gruntjs/grunt-contrib-watch
     *
     * Run predefined tasks whenever watched file patterns are added, changed or deleted.
     * Add files to monitor below.
     */
    watch: {
      options: {
        livereload: true
      },
      gruntfile: {
        files: ['Gruntfile.js'],
        tasks: ['default']
      },
      less: {
        files: ['**/*.html', 'static/css/*.less'],
        tasks: ['less']
      },
      js: {
        files: ['static/js/*.js', '!static/js/*.min.js'],
        tasks: ['jshint', 'uglify']
      }
    }
  });

  /**
   * Loading tasks
   */
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');

  /**
   * Task aliases
   */
  grunt.registerTask('default', ['less', 'jshint', 'uglify']);

};
<|endoftext|>


<commit_before>module.exports = function (grunt)
{
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-conventional-changelog');
	grunt.loadNpmTasks('grunt-bumpup');
	grunt.loadNpmTasks('grunt-contrib-qunit');

	grunt.initConfig({
		pkg : grunt.file.readJSON('package.json'),
		uglify :
		{
			options :
			{
				banner : '/*! <%= pkg.name %> | Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.homepage %> | Released under the MIT License */\n',
				report : "gzip"
			},
			dist :
			{
				files :
				{
					'dist/jquery.thar.min.js': ['jquery.thar.js']
				}
			}
		},

		copy :
		{
			main :
			{
				files :
				[
					{
						src  : ['dist/jquery.thar.min.js'],
						dest : 'dist/jquery.thar.v<%= pkg.version %>.min.js'
					}
				]
			}
		},

		jshint :
		{
			files : ['Gruntfile.js', 'jquery.thar.js'],
			options :
			{
				globals :
				{
					jQuery : true
				}
			}
		},

		changelog :
		{
			options :
			{
				dest : 'CHANGELOG.md'
			}
		},

		bumpup :
		{
			files : ['package.json']
		},

		qunit :
		{
			all : ['test/*.html']
		}
	});

	grunt.registerTask('default', ['jshint', 'uglify', 'copy']);
	grunt.registerTask('changelog', ['changelog']);
	grunt.registerTask('debug', ['jshint', 'qunit']);

	grunt.registerTask('release', function (type)
	{
		type = type ? type : 'patch';
		grunt.task.run('default');
		grunt.task.run('bumpup:' + type);
	});
};<commit_msg>Renamed debug task to test.<commit_after>module.exports = function (grunt)
{
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-conventional-changelog');
	grunt.loadNpmTasks('grunt-bumpup');
	grunt.loadNpmTasks('grunt-contrib-qunit');

	grunt.initConfig({
		pkg : grunt.file.readJSON('package.json'),
		uglify :
		{
			options :
			{
				banner : '/*! <%= pkg.name %> | Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.homepage %> | Released under the MIT License */\n',
				report : "gzip"
			},
			dist :
			{
				files :
				{
					'dist/jquery.thar.min.js': ['jquery.thar.js']
				}
			}
		},

		copy :
		{
			main :
			{
				files :
				[
					{
						src  : ['dist/jquery.thar.min.js'],
						dest : 'dist/jquery.thar.v<%= pkg.version %>.min.js'
					}
				]
			}
		},

		jshint :
		{
			files : ['Gruntfile.js', 'jquery.thar.js'],
			options :
			{
				globals :
				{
					jQuery : true
				}
			}
		},

		changelog :
		{
			options :
			{
				dest : 'CHANGELOG.md'
			}
		},

		bumpup :
		{
			files : ['package.json']
		},

		qunit :
		{
			all : ['test/*.html']
		}
	});

	grunt.registerTask('default', ['jshint', 'uglify', 'copy']);
	grunt.registerTask('changelog', ['changelog']);
	grunt.registerTask('test', ['jshint', 'qunit']);

	grunt.registerTask('release', function (type)
	{
		type = type ? type : 'patch';
		grunt.task.run('default');
		grunt.task.run('bumpup:' + type);
	});
};<|endoftext|>


<commit_before>/*
 * grunt-phantomcss
 * https://github.com/chrisgladd/grunt-phantomcss
 *
 * Copyright (c) 2013 Chris Gladd
 * Licensed under the MIT license.
 */

'use strict';
module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({
        jshint: {
            all: [
                'Gruntfile.js',
                'tasks/phantomcss.js',
                'config/testsuite.js',
                '<%= nodeunit.tests %>',
            ],
            options: {
                jshintrc: '.jshintrc',
            },
        },

        // Before generating any new files, remove any
        // previously-created files.
        clean: {
            tests: ['tmp'],
            screenshots: ['screenshots'],
        },

        // Configuration to be run (and then tested).
        phantomcss: {
            default_options: {
                options: {
                    configFile: "config/testsuite.js",
                    screenshots: "screenshots",
                    failures: "failures",
                    index: "test/coffeemachine.html"
                },
                //src: ['config/testsuite.js'],
            },
        },

        // Unit tests.
        nodeunit: {
            tests: ['test/*_test.js'],
        },
    });

    // Actually load this plugin's task(s).
    grunt.loadTasks('tasks');

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');

    // Whenever the "test" task is run, first clean the "tmp" dir,
    // then run this plugin's task(s), then test the result.
    grunt.registerTask('test', ['clean', 'phantomcss', 'nodeunit']);

    // By default, lint and run all tests.
    grunt.registerTask('default', ['jshint', 'test']);
};
<commit_msg>Added failures directory to clean task<commit_after>/*
 * grunt-phantomcss
 * https://github.com/chrisgladd/grunt-phantomcss
 *
 * Copyright (c) 2013 Chris Gladd
 * Licensed under the MIT license.
 */

'use strict';
module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({
        jshint: {
            all: [
                'Gruntfile.js',
                'tasks/phantomcss.js',
                'config/testsuite.js',
                '<%= nodeunit.tests %>',
            ],
            options: {
                jshintrc: '.jshintrc',
            },
        },

        // Before generating any new files, remove any
        // previously-created files.
        clean: {
            tests: ['tmp'],
            screenshots: ['screenshots','failures'],
        },

        // Configuration to be run (and then tested).
        phantomcss: {
            default_options: {
                options: {
                    configFile: "config/testsuite.js",
                    screenshots: "screenshots",
                    failures: "failures",
                    index: "test/coffeemachine.html"
                },
                //src: ['config/testsuite.js'],
            },
        },

        // Unit tests.
        nodeunit: {
            tests: ['test/*_test.js'],
        },
    });

    // Actually load this plugin's task(s).
    grunt.loadTasks('tasks');

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');

    // Whenever the "test" task is run, first clean the "tmp" dir,
    // then run this plugin's task(s), then test the result.
    grunt.registerTask('test', ['clean', 'phantomcss', 'nodeunit']);

    // By default, lint and run all tests.
    grunt.registerTask('default', ['jshint', 'test']);
};
<|endoftext|>


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

    "use strict";

    var fs = require('fs'), pkginfo = grunt.file.readJSON("package.json");

    grunt.initConfig({

        pkg: pkginfo,

        meta: {
          banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.homepage %> | (c) 2014 YOOtheme | MIT License */"
        },

        jshint: {
            src: {
                options: {
                    jshintrc: "src/.jshintrc"
                },
                src: ["src/js/*.js"]
            }
        },

        less: (function(){

            var lessconf = {
                "docsmin": {
                    options: { paths: ["docs/less"], cleancss: true },
                    files: { "docs/css/uikit.docs.min.css": ["docs/less/uikit.less"] }
                }
            },

            themes = [];

            //themes

            ["default", "custom"].forEach(function(f){

                if(grunt.option('quick') && f=="custom") return;

                if(fs.existsSync('themes/'+f)) {

                    fs.readdirSync('themes/'+f).forEach(function(t){

                        var themepath = 'themes/'+f+'/'+t,
                            distpath  = f=="default" ? "dist/css" : themepath+"/dist";

                        // Is it a directory?
                        if (fs.lstatSync(themepath).isDirectory() && t!=="blank" && t!=='.git') {

                            var files = {};

                            if(t=="default") {
                                files[distpath+"/uikit.css"] = [themepath+"/uikit.less"];
                            } else {
                                files[distpath+"/uikit."+t+".css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t] = {
                                "options": { paths: [themepath] },
                                "files": files
                            };

                            var filesmin = {};

                            if(t=="default") {
                                filesmin[distpath+"/uikit.min.css"] = [themepath+"/uikit.less"];
                            } else {
                                filesmin[distpath+"/uikit."+t+".min.css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t+"min"] = {
                                "options": { paths: [themepath], cleancss: true},
                                "files": filesmin
                            };

                            themes.push({ "path":themepath, "name":t, "dir":f });
                        }
                    });
                }
            });

            //addons

            themes.forEach(function(theme){
                if(fs.existsSync(theme.path+'/uikit-addons.less')) {

                  lessconf["addons-"+theme.name] = {options: { paths: ['src/less/addons'] }, files: {} };
                  lessconf["addons-"+theme.name].files["dist/css/addons/uikit."+theme.name+".addons.css"] = [theme.path+'/uikit-addons.less'];

                  lessconf["addons-min-"+theme.name] = {options: { paths: ['src/less/addons'], cleancss: true }, files: {} };
                  lessconf["addons-min-"+theme.name].files["dist/css/addons/uikit."+theme.name+".addons.min.css"] = [theme.path+'/uikit-addons.less'];
                }
            });

            return lessconf;
        })(),

        copy: {
            fonts: {
                files: [{ expand: true, cwd: "src/fonts", src: ["*"], dest: "dist/fonts/" }]
            }
        },

        concat: {
            dist: {
                options: {
                    separator: "\n\n"
                },
                src: ["src/js/core.js",
                      "src/js/utility.js",
                      "src/js/touch.js",
                      "src/js/alert.js",
                      "src/js/button.js",
                      "src/js/dropdown.js",
                      "src/js/grid.js",
                      "src/js/modal.js",
                      "src/js/offcanvas.js",
                      "src/js/nav.js",
                      "src/js/tooltip.js",
                      "src/js/switcher.js",
                      "src/js/tab.js",
                      "src/js/scrollspy.js",
                      "src/js/smooth-scroll.js",
                      "src/js/toggle.js",
                      ],
                dest: "dist/js/uikit.js"
            }
        },

        usebanner: {
            dist: {
              options: {
                position: 'top',
                banner: "<%= meta.banner %>\n"
              },
              files: {
                src: [ 'dist/css/*.css', 'dist/js/*.js', 'dist/addons/**/*.css', 'dist/addons/**/*.js' ]
              }
            }
        },

        uglify: {
            distmin: {
                options: {
                    //banner: "<%= meta.banner %>\n"
                },
                files: {
                    "dist/js/uikit.min.js": ["dist/js/uikit.js"]
                }
            },
            addonsmin: {
              files: (function(){

                  var files = {};

                  fs.readdirSync('src/js/addons').forEach(function(f){

                      if(f.match(/\.js/)) {

                        var addon = f.replace(".js", "");

                        grunt.file.copy('src/js/addons/'+f, 'dist/js/addons/'+addon+'.js');

                        files['dist/js/addons/'+addon+'.min.js'] = ['src/js/addons/'+f];

                      }
                  });

                  return files;
              })()
            }
        },

        compress: {
            dist: {
                options: {
                    archive: ("dist/uikit-"+pkginfo.version+".zip")
                },
                files: [
                    { expand: true, cwd: "dist/", src: ["css/*", "js/*", "fonts/*", "addons/**/*"], dest: "" }
                ]
            }
        },

        watch: {
            src: {
                files: ["src/**/*.less", "themes/**/*.less","src/js/*.js"],
                tasks: ["build"]
            }
        }

    });

    grunt.registerTask('indexthemes', 'Rebuilding theme index.', function() {

       var themes = [];

       ["default", "custom"].forEach(function(f){

           if(fs.existsSync('themes/'+f)) {

               fs.readdirSync('themes/'+f).forEach(function(t){

                   var themepath = 'themes/'+f+'/'+t;

                   // Is it a directory?
                   if (fs.lstatSync(themepath).isDirectory() && t!=="blank" && t!=='.git') {

                       var theme = {
                           "name"  : t.split("-").join(" ").replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g, function ($1) { return $1.toUpperCase(); }),
                           "url"   : "../"+themepath+"/uikit.less",
                           "config": (fs.existsSync(themepath+"/customizer.json") ? "../"+themepath+"/customizer.json" : "../themes/default/uikit/customizer.json"),
                           "styles": {}
                       };

                       if(fs.existsSync(themepath+'/styles')) {

                          var styles = {};

                          fs.readdirSync(themepath+'/styles').forEach(function(sf){

                              var stylepath = [themepath, 'styles', sf, 'style.less'].join('/');

                              if(fs.existsSync(stylepath)) {
                                styles[sf] = "../"+themepath+"/styles/"+sf+"/style.less";
                              }
                          });

                          theme.styles = styles;
                       }

                       themes.push(theme);
                   }
               });
           }
       });

       grunt.log.writeln(themes.length+' themes found: ' + themes.map(function(theme){ return theme.name;}).join(", "));

       fs.writeFileSync("themes/themes.json", JSON.stringify(themes, " ", 4));
    });

    grunt.registerTask('sublime', 'Building Sublime Text Package', function() {
      // css core
      var filepath = 'dist/css/uikit.css';
      var cssFiles = [filepath];
      if (!fs.existsSync(filepath)) {
        grunt.log.error("Not found: " + filepath);
        return;
      }
      // css addons
      fs.readdirSync('dist/addons').forEach(function(f){
        var addon_css_file = 'dist/addons/'+f+'/'+f+'.css';
        if (fs.existsSync(addon_css_file)) {
          cssFiles.push(addon_css_file);
        }
      });
      var cssContent = "";
      for (var i in cssFiles) {
        cssContent += grunt.file.read(cssFiles[i])+' ';
      }
      var classesList = cssContent.match(/\.(uk-[a-z\d\-]+)/g),
          classesSet  = {},
          pystring    = '# copy & paste into sublime plugin code:\n';

      // use object as set (no duplicates)
      classesList.forEach(function(c) {
        c = c.substr(1); // remove leading dot
        classesSet[c] = true;
      });

      // convert set back to list
      classesList = Object.keys(classesSet);

      pystring += 'uikit_classes = ["' + classesList.join('", "') + '"]\n';

      // JS core
      filepath = 'dist/js/uikit.js';
      if (!fs.existsSync(filepath)) {
        grunt.log.error("Not found: " + filepath);
        return;
      }
      var jsFiles = [filepath];

      // JS addons
      fs.readdirSync('dist/addons').forEach(function(f){
        var addon_js_file = 'dist/addons/'+f+'/'+f+'.js';
        if (fs.existsSync(addon_js_file)) {
          jsFiles.push(addon_js_file);
        }
      });
      var jsContent = "";
      for (var i in jsFiles) {
        jsContent += grunt.file.read(jsFiles[i]) + ' ';
      }

      var dataList    = jsContent.match(/data-uk-[a-z\d\-]+/g),
        dataSet     = {};

      dataList.forEach(function(s) { dataSet[s] = true; });
      dataList = Object.keys(dataSet);
      pystring += 'uikit_data = ["' + dataList.join('", "') + '"]\n';

      grunt.file.write('dist/uikit_completions.py', pystring);
      grunt.log.writeln('Written: dist/uikit_completions.py');
    });

    // Load grunt tasks from NPM packages
    grunt.loadNpmTasks("grunt-contrib-less");
    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks("grunt-contrib-concat");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks("grunt-contrib-compress");
    grunt.loadNpmTasks("grunt-contrib-watch");
    grunt.loadNpmTasks("grunt-banner");

    // Register grunt tasks
    grunt.registerTask("build", ["jshint", "indexthemes", "less", "concat", "copy", "uglify", "usebanner"]);
    grunt.registerTask("default", ["build", "compress"]);

};
<commit_msg>grunt cleanup<commit_after>module.exports = function(grunt) {

    "use strict";

    var fs = require('fs'), pkginfo = grunt.file.readJSON("package.json");

    grunt.initConfig({

        pkg: pkginfo,

        meta: {
            banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.homepage %> | (c) 2014 YOOtheme | MIT License */"
        },

        jshint: {
            src: {
                options: {
                    jshintrc: "src/.jshintrc"
                },
                src: ["src/js/*.js"]
            }
        },

        less: (function(){

            var lessconf = {
                "docsmin": {
                    options: { paths: ["docs/less"], cleancss: true },
                    files: { "docs/css/uikit.docs.min.css": ["docs/less/uikit.less"] }
                }
            },

            themes = [];

            //themes

            ["default", "custom"].forEach(function(f){

                if(grunt.option('quick') && f=="custom") return;

                if(fs.existsSync('themes/'+f)) {

                    fs.readdirSync('themes/'+f).forEach(function(t){

                        var themepath = 'themes/'+f+'/'+t,
                            distpath  = f=="default" ? "dist/css" : themepath+"/dist";

                        // Is it a directory?
                        if (fs.lstatSync(themepath).isDirectory() && t!=="blank" && t!=='.git') {

                            var files = {};

                            if(t=="default") {
                                files[distpath+"/uikit.css"] = [themepath+"/uikit.less"];
                            } else {
                                files[distpath+"/uikit."+t+".css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t] = {
                                "options": { paths: [themepath] },
                                "files": files
                            };

                            var filesmin = {};

                            if(t=="default") {
                                filesmin[distpath+"/uikit.min.css"] = [themepath+"/uikit.less"];
                            } else {
                                filesmin[distpath+"/uikit."+t+".min.css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t+"min"] = {
                                "options": { paths: [themepath], cleancss: true},
                                "files": filesmin
                            };

                            themes.push({ "path":themepath, "name":t, "dir":f });
                        }
                    });
                }
            });

            //addons

            themes.forEach(function(theme){

                if(fs.existsSync(theme.path+'/uikit-addons.less')) {

                    lessconf["addons-"+theme.name] = {options: { paths: ['src/less/addons'] }, files: {} };
                    lessconf["addons-"+theme.name].files["dist/css/addons/uikit."+theme.name+".addons.css"] = [theme.path+'/uikit-addons.less'];

                    lessconf["addons-min-"+theme.name] = {options: { paths: ['src/less/addons'], cleancss: true }, files: {} };
                    lessconf["addons-min-"+theme.name].files["dist/css/addons/uikit."+theme.name+".addons.min.css"] = [theme.path+'/uikit-addons.less'];
                }
            });

            return lessconf;
        })(),

        copy: {
            fonts: {
                files: [{ expand: true, cwd: "src/fonts", src: ["*"], dest: "dist/fonts/" }]
            }
        },

        concat: {
            dist: {
                options: {
                    separator: "\n\n"
                },
                src: [
                    "src/js/core.js",
                    "src/js/utility.js",
                    "src/js/touch.js",
                    "src/js/alert.js",
                    "src/js/button.js",
                    "src/js/dropdown.js",
                    "src/js/grid.js",
                    "src/js/modal.js",
                    "src/js/offcanvas.js",
                    "src/js/nav.js",
                    "src/js/tooltip.js",
                    "src/js/switcher.js",
                    "src/js/tab.js",
                    "src/js/scrollspy.js",
                    "src/js/smooth-scroll.js",
                    "src/js/toggle.js",
                ],
                dest: "dist/js/uikit.js"
            }
        },

        usebanner: {
            dist: {
                options: {
                    position: 'top',
                    banner: "<%= meta.banner %>\n"
                },
                files: {
                    src: [ 'dist/css/*.css', 'dist/js/*.js', 'dist/addons/**/*.css', 'dist/addons/**/*.js' ]
                }
            }
        },

        uglify: {
            distmin: {
                options: {
                    //banner: "<%= meta.banner %>\n"
                },
                files: {
                    "dist/js/uikit.min.js": ["dist/js/uikit.js"]
                }
            },
            addonsmin: {
                files: (function(){

                    var files = {};

                    fs.readdirSync('src/js/addons').forEach(function(f){

                        if(f.match(/\.js/)) {

                            var addon = f.replace(".js", "");

                            grunt.file.copy('src/js/addons/'+f, 'dist/js/addons/'+addon+'.js');

                            files['dist/js/addons/'+addon+'.min.js'] = ['src/js/addons/'+f];

                        }
                    });

                    return files;
                })()
            }
        },

        compress: {
            dist: {
                options: {
                    archive: ("dist/uikit-"+pkginfo.version+".zip")
                },
                files: [
                    { expand: true, cwd: "dist/", src: ["css/*", "js/*", "fonts/*", "addons/**/*"], dest: "" }
                ]
            }
        },

        watch: {
            src: {
                files: ["src/**/*.less", "themes/**/*.less","src/js/*.js"],
                tasks: ["build"]
            }
        }

    });

    grunt.registerTask('indexthemes', 'Rebuilding theme index.', function() {

        var themes = [];

        ["default", "custom"].forEach(function(f){

           if(fs.existsSync('themes/'+f)) {

               fs.readdirSync('themes/'+f).forEach(function(t){

                   var themepath = 'themes/'+f+'/'+t;

                   // Is it a directory?
                   if (fs.lstatSync(themepath).isDirectory() && t!=="blank" && t!=='.git') {

                        var theme = {
                            "name"  : t.split("-").join(" ").replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g, function ($1) { return $1.toUpperCase(); }),
                            "url"   : "../"+themepath+"/uikit.less",
                            "config": (fs.existsSync(themepath+"/customizer.json") ? "../"+themepath+"/customizer.json" : "../themes/default/uikit/customizer.json"),
                            "styles": {}
                        };

                        if(fs.existsSync(themepath+'/styles')) {

                            var styles = {};

                            fs.readdirSync(themepath+'/styles').forEach(function(sf){

                                var stylepath = [themepath, 'styles', sf, 'style.less'].join('/');

                                if(fs.existsSync(stylepath)) {
                                    styles[sf] = "../"+themepath+"/styles/"+sf+"/style.less";
                                }
                            });

                            theme.styles = styles;
                        }

                        themes.push(theme);
                   }
               });
           }
       });

       grunt.log.writeln(themes.length+' themes found: ' + themes.map(function(theme){ return theme.name;}).join(", "));

       fs.writeFileSync("themes/themes.json", JSON.stringify(themes, " ", 4));
    });

    grunt.registerTask('sublime', 'Building Sublime Text Package', function() {
        // css core
        var filepath = 'dist/css/uikit.css', cssFiles = [filepath];

        if (!fs.existsSync(filepath)) {
            grunt.log.error("Not found: " + filepath);
            return;
        }

        // css addons
        fs.readdirSync('dist/css/addons').forEach(function(f){

            if (f.match(/\.css$/)) {
                cssFiles.push('dist/css/addons/'+f);
            }
        });

        var cssContent = "";

        for (var i in cssFiles) {
            cssContent += grunt.file.read(cssFiles[i])+' ';
        }

        var classesList = cssContent.match(/\.(uk-[a-z\d\-]+)/g),
            classesSet  = {},
            pystring    = '# copy & paste into sublime plugin code:\n';

        // use object as set (no duplicates)
        classesList.forEach(function(c) {
            c = c.substr(1); // remove leading dot
            classesSet[c] = true;
        });

        // convert set back to list
        classesList = Object.keys(classesSet);

        pystring += 'uikit_classes = ["' + classesList.join('", "') + '"]\n';

        // JS core
        filepath = 'dist/js/uikit.js';

        if (!fs.existsSync(filepath)) {
            grunt.log.error("Not found: " + filepath);
            return;
        }

        var jsFiles = [filepath];

        // JS addons
        fs.readdirSync('dist/js/addons').forEach(function(f){

            if (f.match(/\.js$/)) {
                jsFiles.push('dist/js/addons/'+f);
            }
        });

        var jsContent = "";

        for (var i in jsFiles) {
            jsContent += grunt.file.read(jsFiles[i]) + ' ';
        }

        var dataList = jsContent.match(/data-uk-[a-z\d\-]+/g),
            dataSet  = {};

        dataList.forEach(function(s) { dataSet[s] = true; });
        dataList  = Object.keys(dataSet);
        pystring += 'uikit_data = ["' + dataList.join('", "') + '"]\n';

        grunt.file.write('dist/uikit_completions.py', pystring);
        grunt.log.writeln('Written: dist/uikit_completions.py');
    });

    // Load grunt tasks from NPM packages
    grunt.loadNpmTasks("grunt-contrib-less");
    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks("grunt-contrib-concat");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks("grunt-contrib-compress");
    grunt.loadNpmTasks("grunt-contrib-watch");
    grunt.loadNpmTasks("grunt-banner");

    // Register grunt tasks
    grunt.registerTask("build", ["jshint", "indexthemes", "less", "concat", "copy", "uglify", "usebanner"]);
    grunt.registerTask("default", ["build", "compress"]);
};
<|endoftext|>