From 7e9566d7be99f945d6ccdfa9f7828d1db8802174 Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Mon, 30 Jun 2014 17:18:28 +0200 Subject: tools --- .gitignore | 28 +++++++++++++++++++++++ Gruntfile.js | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 14 ++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 Gruntfile.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 485dee6..c30e479 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,29 @@ .idea +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git +node_modules + +# Users Environment Variables +.lock-wscript diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..8bab037 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,75 @@ +module.exports = function (grunt) { + 'use strict'; + // Project configuration + grunt.initConfig({ + // Metadata + pkg: grunt.file.readJSON('package.json'), + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + + ' Licensed <%= props.license %> */\n', + // Task configuration + concat: { + options: { + banner: '<%= banner %>', + stripBanners: true + }, + dist: { + src: ['<%= pkg.name %>.js'], + dest: 'dist/<%= pkg.name %>.js' + } + }, + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: '<%= concat.dist.dest %>', + dest: 'dist/<%= pkg.name %>.min.js' + } + }, + jshint: { + options: { + node: true, + curly: true, + eqeqeq: true, + immed: true, + latedef: true, + newcap: true, + noarg: true, + sub: true, + undef: true, + unused: true, + eqnull: true, + boss: true + }, + gruntfile: { + src: 'gruntfile.js' + }, + main: { + src: '<%= pkg.name %>.js' + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + main: { + files: '<%= jshint.main.src %>', + tasks: ['jshint:main'] + } + } + }); + + // These plugins provide necessary tasks + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // Default task + grunt.registerTask('default', ['jshint', 'concat', 'uglify']); +}; + diff --git a/package.json b/package.json new file mode 100644 index 0000000..0a9b3cd --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "lastcommit", + "version": "0.1.0", + "license": "MIT", + "author": "Victor Häggqvist (http://victorhaggqvits.com)", + "homepage": "https://github.com/victorhaggqvist/lastcommit", + "devDependencies": { + "grunt": "~0.4.2", + "grunt-contrib-watch": "~0.5.3", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-uglify": "~0.2.7", + "grunt-contrib-jshint": "~0.7.2" + } +} -- cgit v1.2.3