diff --git a/src/.jshintrc b/src/.jshintrc new file mode 100644 index 0000000..d06d75a --- /dev/null +++ b/src/.jshintrc @@ -0,0 +1,14 @@ +{ + "browser": true, + "white": false, + "smarttabs": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "undef": true, + "jquery": true, + "globals": { + "Modernizr": true + } +} \ No newline at end of file diff --git a/src/Gruntfile.js b/src/Gruntfile.js new file mode 100644 index 0000000..947b700 --- /dev/null +++ b/src/Gruntfile.js @@ -0,0 +1,58 @@ +// gruntjs.com + +/*jshint node:true*/ +module.exports = function(grunt) { + 'use strict'; + + require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); + + grunt.initConfig({ + cmpnt: grunt.file.readJSON('../component.json'), + banner: '/*! Social Likes v<%= cmpnt.version %> by Artem Sapegin - ' + + 'http://sapegin.github.com/social-likes - Licensed MIT */', + jshint: { + options: { + jshintrc: '.jshintrc' + }, + files: [ + 'grunt.js', + 'social-likes.js' + ] + }, + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: 'social-likes.js', + dest: '../social-likes.min.js' + } + }, + stylus: { + compile: { + files: { + '../social-likes.css': 'styles/index.styl' + }, + options: { + 'include css': true, + 'urlfunc': 'embedurl' + } + } + }, + watch: { + stylus: { + files: 'styles/**', + tasks: 'stylus' + } + }, + imgo: { + imgo: { + src: 'icons/*.png', + skip: require('os').platform() === 'win32' + } + } + }); + + grunt.registerTask('default', ['jshint', 'uglify', 'imgo', 'stylus']); + +}; \ No newline at end of file diff --git a/src/grunt.js b/src/grunt.js deleted file mode 100644 index 4268e6d..0000000 --- a/src/grunt.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -How to build this project? - -1. Install Grunt: - npm install grunt -g - mkdir node_modules - npm install grunt-stylus grunt-imgo - -2. Build: - grunt -*/ - -/*global module:false*/ -/*jshint node:true*/ -module.exports = function(grunt) { - 'use strict'; - - // Project configuration - grunt.initConfig({ - cmpnt: '', - meta: { - banner: "/*! Social Likes v<%= cmpnt.version %> by Artem Sapegin - " + - "http://sapegin.github.com/social-likes - " + - "Licensed MIT */" - }, - lint: { - files: [ - 'grunt.js', - 'social-likes.js' - ] - }, - min: { - dist: { - src: ['', 'social-likes.js'], - dest: '../social-likes.min.js' - } - }, - stylus: { - compile: { - files: { - '../social-likes.css': 'styles/index.styl' - }, - options: { - 'compress': true, - 'include css': true, - 'urlfunc': 'embedurl' - } - } - }, - watch: { - stylus: { - files: 'styles/**', - tasks: 'stylus' - } - }, - jshint: { - options: { - browser: true, - white: false, - smarttabs: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - undef: true - }, - globals: { - jQuery: true} - }, - imgo: { - imgo: { - files: 'icons/*.png', - skip: require('os').platform() === 'win32' - } - }, - uglify: {} - }); - - grunt.loadNpmTasks('grunt-stylus'); - grunt.loadNpmTasks('grunt-imgo'); - - // Default task - grunt.registerTask('default', 'lint min imgo stylus'); - -}; \ No newline at end of file diff --git a/src/package.json b/src/package.json new file mode 100644 index 0000000..65ed531 --- /dev/null +++ b/src/package.json @@ -0,0 +1,13 @@ +{ + "name": "social-likes", + "version": "0.0.0", + "devDependencies": { + "grunt": "~0.4.0", + "grunt-contrib-jshint": "~0.1.1", + "grunt-contrib-uglify": "~0.1.1", + "grunt-contrib-watch": "~0.2.0", + "grunt-contrib-stylus": "~0.4.0", + "grunt-imgo": "~0.1.0", + "matchdep": "~0.1.1" + } +}