Permalink
Browse files

Convert to grunt 0.4 and updated tasks.

  • Loading branch information...
1 parent d7f4d5f commit 8cc2b76509a32c5250416386ab39671ed6dc9784 @dmethvin dmethvin committed Dec 26, 2012
Showing with 174 additions and 167 deletions.
  1. +12 −14 .jshintrc
  2. +89 −0 Gruntfile.js
  3. +0 −84 grunt.js
  4. +10 −2 package.json
  5. +27 −29 src/.jshintrc
  6. +1 −1 src/attributes.js
  7. +1 −1 src/core.js
  8. +5 −5 src/event.js
  9. +29 −31 test/.jshintrc
View
@@ -1,16 +1,14 @@
{
- "options": {
- "curly": true,
- "eqeqeq": true,
- "eqnull": true,
- "expr": true,
- "latedef": true,
- "noarg": true,
- "node": true,
- "quotmark": "double",
- "smarttabs": true,
- "trailing": true,
- "undef": true,
- "unused": true
- }
+ "curly": true,
+ "eqeqeq": true,
+ "eqnull": true,
+ "expr": true,
+ "latedef": true,
+ "noarg": true,
+ "node": true,
+ "quotmark": "double",
+ "smarttabs": true,
+ "trailing": true,
+ "undef": true,
+ "unused": true
}
View
@@ -0,0 +1,89 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ "use strict";
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON("package.json"),
+ files: [
+ "src/intro.js",
+ "src/migrate.js",
+ "src/attributes.js",
+ "src/core.js",
+ "src/data.js",
+ "src/manipulation.js",
+ "src/event.js",
+ "src/outro.js"
+ ],
+ banners: {
+ tiny: "/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.homepage %> */"
+ },
+ concat: {
+ options: {
+ banner: "/*!\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
+ "<%= grunt.template.today('yyyy-mm-dd') %>\n" +
+ " * <%= pkg.homepage %>\n" +
+ " * Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
+ " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %>\n */\n"
+ },
+ dist: {
+ src: "<%= files %>",
+ dest: "dist/<%= pkg.name %>.js"
+ }
+ },
+ qunit: {
+ files: [ "test/**/*.html" ]
+ },
+ jshint: {
+ dist: {
+ src: [ "dist/jquery-migrate.js" ],
+ options: {
+ jshintrc: "src/.jshintrc"
+ }
+ },
+ tests: {
+ src: [ "test/**/*.js" ],
+ options: {
+ jshintrc: "test/.jshintrc"
+ }
+ },
+ grunt: {
+ src: [ "Gruntfile.js" ],
+ options: {
+ jshintrc: ".jshintrc"
+ }
+ }
+ },
+ uglify: {
+ all: {
+ files: {
+ "dist/jquery-migrate.min.js": [ "dist/jquery-migrate.js" ]
+ }
+ },
+ options: {
+ banner: "/*! jQuery v<%= pkg.version %> jquery.com | jquery.org/license */",
+ sourceMap: "dist/jquery-migrate.min.map",
+ beautify: {
+ ascii_only: true
+ },
+ defines: {
+ JQMIGRATE_WARN: [ "name", 0 ]
+ }
+ }
+
+ }
+ });
+
+ // Load grunt tasks from NPM packages
+ grunt.loadNpmTasks("grunt-git-authors");
+ grunt.loadNpmTasks("grunt-contrib-concat");
+ grunt.loadNpmTasks("grunt-contrib-watch");
+ grunt.loadNpmTasks("grunt-contrib-jshint");
+ grunt.loadNpmTasks("grunt-contrib-uglify");
+ grunt.loadNpmTasks("grunt-contrib-qunit");
+
+ // Default task.
+ grunt.registerTask( "default", [ "concat", "uglify", "jshint", "qunit" ] );
+
+};
View
@@ -1,84 +0,0 @@
-/*global module:false*/
-module.exports = function(grunt) {
- "use strict";
-
- function readOptionalJSON( filepath ) {
- var data = {};
- try {
- data = grunt.file.readJSON( filepath );
- grunt.verbose.write( "Reading " + filepath + "..." ).ok();
- } catch(e) {}
- return data;
- }
-
- // Project configuration.
- grunt.initConfig({
- pkg: "<json:package.json>",
- files: [
- "src/intro.js",
- "src/migrate.js",
- "src/attributes.js",
- "src/core.js",
- "src/data.js",
- "src/manipulation.js",
- "src/event.js",
- "src/outro.js"
- ],
- banners: {
- full: "/*!\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
- "<%= grunt.template.today('yyyy-mm-dd') %>\n" +
- " * <%= pkg.homepage %>\n" +
- " * Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
- " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %>\n */",
- tiny: "/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.homepage %> */"
- },
- concat: {
- dist: {
- src: [ "<banner:banners.full>", "<config:files>" ],
- dest: "dist/<%= pkg.name %>.js"
- }
- },
- min: {
- dist: {
- src: [ "<banner:banners.tiny>", "<config:files>" ],
- dest: "dist/<%= pkg.name %>.min.js"
- }
- },
- qunit: {
- files: [ "test/**/*.html" ]
- },
- lint: {
- dist: "dist/<% pkg.name %>.js",
- grunt: "grunt.js",
- tests: "test/**/*.js"
- },
- watch: {
- files: "<config:lint.files>",
- tasks: "concat min lint"
- },
- jshint: (function() {
- function jshintrc( path ) {
- return readOptionalJSON( (path || "") + ".jshintrc" ) || {};
- }
- return {
- grunt: jshintrc(),
- dist: jshintrc("src/"),
- tests: jshintrc("test/")
- };
- }()),
- uglify: {
- codegen: {
- ascii_only: true
- },
- mangle: {
- defines: {
- JQMIGRATE_WARN: [ "name", 0 ]
- }
- }
- }
- });
-
- // Default task.
- grunt.registerTask( "default", "concat min lint qunit" );
-
-};
View
@@ -21,11 +21,19 @@
"url": "https://github.com/jquery/jquery-migrate/blob/master/LICENSE-MIT"
}
],
+ "scripts": {
+ "test" : "./node_modules/.bin/grunt"
+ },
"dependencies": {
- "jquery": "~1.7.2"
+ "jquery": ">=1.6.4"
},
"devDependencies": {
- "grunt": "~0.3.17"
+ "grunt-git-authors": "~1.1.0",
+ "grunt-contrib-watch": "~0.1.0",
+ "grunt-contrib-jshint": "~0.1.0",
+ "grunt-contrib-uglify": "~0.1.0",
+ "grunt-contrib-qunit": "~0.1.0",
+ "grunt": "~0.4.0"
},
"keywords": []
}
View
@@ -1,31 +1,29 @@
{
- "options": {
- "browser": true,
- "curly": true,
- "eqnull": true,
- "evil": true,
- "expr": true,
- "maxerr": 100,
- "newcap": false,
- "quotmark": "double",
- "strict": true,
- "sub": true,
- "trailing": true,
- "undef": true,
- "unused": true,
- "wsh": true
- },
- "globals": {
- "define": true,
- "DOMParser": true,
- "__dirname": true,
- "jQuery": true,
- "global": true,
- "module": true,
- "exports": true,
- "require": true,
- "file": true,
- "log": true,
- "console": true
- }
+ "browser": true,
+ "curly": true,
+ "eqnull": true,
+ "evil": true,
+ "expr": true,
+ "maxerr": 100,
+ "newcap": false,
+ "quotmark": "double",
+ "strict": true,
+ "sub": true,
+ "trailing": true,
+ "undef": true,
+ "unused": true,
+ "wsh": true,
+ "globals": {
+ "define": true,
+ "DOMParser": true,
+ "__dirname": true,
+ "jQuery": true,
+ "global": true,
+ "module": true,
+ "exports": true,
+ "require": true,
+ "file": true,
+ "log": true,
+ "console": true
+ }
}
View
@@ -41,7 +41,7 @@ jQuery.attrHooks.value = {
elem.value :
null;
},
- set: function( elem, value, name ) {
+ set: function( elem, value ) {
var nodeName = ( elem.nodeName || "" ).toLowerCase();
if ( nodeName === "button" ) {
return valueAttrSet.apply( this, arguments );
View
@@ -3,7 +3,7 @@ var matched, browser,
oldAccess = jQuery.access,
oldInit = jQuery.fn.init,
// Note this does NOT include the # XSS fix from 1.7!
- rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
+ rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
// $(html) "looks like html" rule change
jQuery.fn.init = function( selector, context, rootjQuery ) {
View
@@ -33,7 +33,7 @@ jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
};
-jQuery.fn.error = function( data, fn ) {
+jQuery.fn.error = function() {
var args = Array.prototype.slice.call( arguments, 0);
migrateWarn("jQuery.fn.error() is deprecated");
args.splice( 0, 0, "error" );
@@ -106,24 +106,24 @@ jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
jQuery.each( ajaxEvents.split("|"),
function( _, name ) {
jQuery.event.special[ name ] = {
- setup: function( data ) {
+ setup: function() {
var elem = this;
// The document needs no shimming; must be !== for oldIE
if ( elem !== document ) {
- jQuery.event.add( document, name + "." + jQuery.guid, function( event ) {
+ jQuery.event.add( document, name + "." + jQuery.guid, function() {
jQuery.event.trigger( name, null, elem, true );
});
jQuery._data( this, name, jQuery.guid++ );
}
return false;
},
- teardown: function( data, handleObj ) {
+ teardown: function() {
if ( this !== document ) {
jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
}
return false;
}
- }
+ };
}
);
Oops, something went wrong.

0 comments on commit 8cc2b76

Please sign in to comment.