@domoinc/multiline-chart
Version:
MultiLineChart - Domo Widget
87 lines (81 loc) • 2.63 kB
JavaScript
var blue = '\x1B[0;36m';
var yellow = '\x1B[1;33m';
var noColor = '\x1B[0m';
var webpackConfig = require("./webpack.config.js");
module.exports = function(grunt) {
'use strict';
// Project configuration
grunt.initConfig({
// Metadata
bower: grunt.file.readJSON('bower.json'),
banner: '/*! <%= bower.name %> - v<%= bower.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> Domo */\n',
// Task configuration
jshint: {
dev: {
options: {
force: true,
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
src: ['*.js', '!Gruntfile.js']
},
dep: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
src: ['*.js', '!Gruntfile.js']
}
},
watch: {
all: {
files: ['*.js'],
tasks: ['jshint:dev', 'webpack'],
},
},
init: {
dist: {
title: "<%= bower.name %>"
}
},
release: {
options: {
file: 'bower.json', //default: package.json
additionalFiles: ['package.json'],
beforeRelease: ['build'],
npm: true, //default: true
npmtag: false, //default: no tag
tagName: 'v<%= version %>'
}
},
webpack: {
config: webpackConfig,
build: {}
}
});
// These plugins provide necessary tasks
require('load-grunt-tasks')(grunt);
//Run Server
grunt.registerTask('default', ['jshint:dev', 'webpack']);
grunt.registerTask('build', ['default']);
// Deploy to Github with tags
grunt.registerTask('push', function(release){
if (release) {
release = release.toLowerCase();
}
if (release === 'patch') {
grunt.task.run(['release:patch']);
} else if (release === 'minor') {
grunt.task.run(['release:minor']);
} else if (release === 'major') {
grunt.task.run(['release:major']);
} else {
console.log('Use one of the following commands to push');
console.log('grunt push:major');
console.log('grunt push:minor');
console.log('grunt push:patch');
}
})
};