Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added grunt support.

  • Loading branch information...
commit 15bc5bc50706fe58772e3a1dd6b3d510f1cee3bb 1 parent c15d2e9
@scottgonzalez scottgonzalez authored
View
1  .gitignore
@@ -1,3 +1,4 @@
build/.sizecache.json
dist/
.DS_Store
+node_modules
View
15 .jshintrc
@@ -0,0 +1,15 @@
+{
+ "boss": true,
+ "browser": true,
+ "curly": true,
+ "eqnull": true,
+ "eqeqeq": true,
+ "expr": true,
+ "jquery": true,
+ "latedef": true,
+ "noarg": true,
+ "onevar": true,
+ "smarttabs": true,
+ "trailing": true,
+ "undef": true
+}
View
97 grunt.js
@@ -0,0 +1,97 @@
+/*jshint node: true */
+module.exports = function( grunt ) {
+
+var max = "dist/jquery.color.js",
+ min = "dist/jquery.color.min.js",
+ minify = {};
+
+minify[ min ] = [ "<banner>", max ];
+
+grunt.loadNpmTasks( "grunt-compare-size" );
+
+grunt.initConfig({
+ pkg: "<json:package.json>",
+
+ meta: {
+ banner: "/*! jQuery Color v@<%= pkg.version %> http://github.com/jquery/jquery-color | jquery.org/license */"
+ },
+
+ lint: {
+ src: "jquery.color.js",
+ test: "test/unit/**"
+ },
+
+ jshint: (function() {
+ function parserc( path ) {
+ var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ),
+ settings = {
+ options: rc,
+ globals: {}
+ };
+
+ (rc.predef || []).forEach(function( prop ) {
+ settings.globals[ prop ] = true;
+ });
+ delete rc.predef;
+
+ return settings;
+ }
+
+ return {
+ src: parserc(),
+ test: parserc( "test/unit/" )
+ };
+ })(),
+
+ qunit: {
+ files: "test/index.html"
+ },
+
+ min: minify,
+
+ compare_size: {
+ files: [ max, min ]
+ }
+});
+
+grunt.registerHelper( "git-date", function( fn ) {
+ grunt.utils.spawn({
+ cmd: "git",
+ args: [ "log", "-1", "--pretty=format:%ad" ]
+ }, function( error, result ) {
+ if ( error ) {
+ grunt.log.error( error );
+ return fn( error );
+ }
+
+ fn( null, result );
+ });
+});
+
+grunt.registerTask( "clean", function() {
+ require( "rimraf" ).sync( "dist" );
+});
+
+grunt.registerTask( "max", function() {
+ var done = this.async();
+ grunt.helper( "git-date", function( error, date ) {
+ if ( error ) {
+ return done( false );
+ }
+
+ grunt.file.copy( "jquery.color.js", max, {
+ process: function( source ) {
+ return source
+ .replace( /@VERSION/g, grunt.config( "pkg.version" ) )
+ .replace( /@DATE/g, date );
+ }
+ });
+
+ done();
+ });
+});
+
+grunt.registerTask( "default", "lint qunit" );
+grunt.registerTask( "build", "clean max min" );
+
+};
View
2  jquery.color.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery Color Animations v@VERSION
* http://jquery.org/
*
View
34 package.json
@@ -0,0 +1,34 @@
+{
+ "name": "jquery-color",
+ "title": "jQuery Color",
+ "description": "A jQuery plugin that adds color animation support.",
+ "version": "2.0.0pre",
+ "homepage": "https://github.com/jquery/jquery-color",
+ "author": {
+ "name": "jQuery Team"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jquery/jquery-color.git"
+ },
+ "bugs": {
+ "url": "https://github.com/jquery/jquery-color/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://www.opensource.org/licenses/MIT"
+ },
+ {
+ "type": "GPL",
+ "url": "http://www.opensource.org/licenses/GPL-2.0"
+ }
+ ],
+ "dependencies": {},
+ "devDependencies": {
+ "grunt": "0.3.9",
+ "grunt-compare-size": "0.1.7",
+ "rimraf": "2.0.2"
+ },
+ "keywords": [ "color", "animation" ]
+}
View
28 test/unit/.jshintrc
@@ -0,0 +1,28 @@
+{
+ "boss": true,
+ "browser": true,
+ "curly": true,
+ "eqnull": true,
+ "eqeqeq": true,
+ "expr": true,
+ "jquery": true,
+ "latedef": true,
+ "noarg": true,
+ "onevar": true,
+ "smarttabs": true,
+ "trailing": true,
+ "undef": true,
+ "predef": [
+ "asyncTest",
+ "deepEqual",
+ "equal",
+ "expect",
+ "module",
+ "notEqual",
+ "ok",
+ "start",
+ "stop",
+ "strictEqual",
+ "test"
+ ]
+}
Please sign in to comment.
Something went wrong with that request. Please try again.