'use strict';

var timeGrunt = require('time-grunt'),
    loadTasks = require('load-grunt-tasks');

var jspaths = {
  server: ['app.js', 'globals.js', 'test/**/*.js', 'lib/**/*.js', '!node_modules/**/*.js', '!build/**/*.js', '!dist/**/*.js'],
  support: ['Gruntfile.js']
};

module.exports = function (grunt) {

  // time grunt
  timeGrunt(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    clean: {
      build: ['build']
    },
    jshint: {
      options: {
        jshintrc: true
      },
      server: jspaths.server,
      support: jspaths.support
    },
    watch: {
      server: {
        files: jspaths.server,
        tasks: ['server:debug']
      },
      support: {
        files: jspaths.support,
        tasks: ['support:debug']
      }
    },
    mochaTest: {
      options: {
        reporter: 'spec'
      },
      debug: {
        src: ['test/specs/**/*.js']
      },
      release: {
        src: ['test/integration/*.js']
      }
    },
    bump: {
      options: {
        updateConfigs: ['pkg'],
        commitFiles: ['package.json', 'CHANGELOG.md'],
        pushTo: 'origin'
      }
    },
    changelog: {
      options: {
        repository: '<%= pkg.repository.url %>'
      }
    }
  });

  // load tasks
  loadTasks(grunt);

  grunt.registerTask('support:debug', ['jshint:support']);
  grunt.registerTask('server:debug', ['jshint:server', 'mochaTest:debug']);
  grunt.registerTask('server:release', ['mochaTest:release']);

  grunt.registerTask('notes', ['bump-only', 'changelog', 'bump-commit']);

  grunt.registerTask('debug', ['support:debug', 'server:debug']);
  grunt.registerTask('release', ['debug', 'server:release']);

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

@@ -1466,32 +1466,206 @@
 est:release'%5D);%0A
+  %0A  grunt.registerTask('notes:minor', %5B'bump-only:minor', 'changelog', 'bump-commit'%5D);%0A  grunt.registerTask('notes:major', %5B'bump-only:major', 'changelog', 'bump-commit'%5D);
 %0A  grunt.registe
@@ -1719,24 +1719,26 @@
 -commit'%5D);%0A
+  
 %0A  grunt.reg

support for minor/major version bump