Skip to content

Rewrite the build process in Grunt 0.4.5, use jQuery & QUnit from npm #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/**
node_modules/**
5 changes: 5 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ".jshintrc-common",

"node": true
}
12 changes: 12 additions & 0 deletions .jshintrc-common
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"quotmark": "double",
"undef": true,
"unused": true
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
70 changes: 70 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"use strict";

module.exports = function( grunt ) {

// Project configuration.
grunt.initConfig( {
pkg: grunt.file.readJSON( "package.json" ),
replace: {
all: {
src: [ "src/<%= pkg.name %>.js" ],
dest: "dist/",
replacements: [
{
from: "@VERSION",
to: "<%= pkg.version %>"
},
{
from: "@YEAR",
to: "<%= grunt.template.today('yyyy') %>"
}
]
},
},
qunit: {
all: [ "test/**/*.html" ]
},
jshint: {
all: {
src: [ "Gruntfile.js", "src/**/*.js", "test/**/*.js" ]
},
options: {
jshintrc: true
}
},
watch: {
files: [ "<%= jshint.all.src %>" ],
tasks: [ "lint", "qunit" ]
},
uglify: {
all: {
files: {
"dist/<%= pkg.name %>.min.js": "dist/<%= pkg.name %>.js"
}
},
options: {
preserveComments: false,
sourceMap: true,
ASCIIOnly: true,
sourceMapName:
"dist/<%= pkg.name %>.min.map",
report: "min",
beautify: {
"ascii_only": true
},
banner: "/*! jQuery requestAnimationFrame - <%= pkg.version %> - " +
"<%= grunt.template.today('yyyy-mm-dd') %>\n" +
"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
" * Copyright (c) <%= grunt.template.today('yyyy') %> " +
"<%= pkg.author.name %>; Licensed <%= pkg.license %> */"
}
}
} );

// Load grunt tasks from NPM packages
require( "load-grunt-tasks" )( grunt );

// Default task.
grunt.registerTask( "default", [ "jshint", "qunit", "replace", "uglify" ] );

};
38 changes: 23 additions & 15 deletions dist/jquery.requestAnimationFrame.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
/*! jQuery requestAnimationFrame - v0.1.3pre - 2016-02-03
* https://github.com/gnarf37/jquery-requestAnimationFrame
* Copyright (c) 2016 Corey Frang; Licensed MIT */
/*!
* jquery.requestAnimationFrame - 0.1.3-pre
* https://github.com/gnarf37/jquery-requestAnimationFrame
* Requires jQuery 1.8+
*
* Copyright (c) 2016 Corey Frang
* Licensed under the MIT license.
*/
// UMD factory https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
( function ( factory ) {
if ( typeof define === "function" && define.amd ) {

// UMD factory https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
define( [ "jquery" ], factory );
} else {

// Browser globals
factory(jQuery);
factory( jQuery );
}
}(function (jQuery) {

// requestAnimationFrame polyfill adapted from Erik Möller
// fixes from Paul Irish and Tino Zijdel
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
}( function ( jQuery ) {

if ( Number( jQuery.fn.jquery.split( "." )[ 0 ] ) >= 3 ) {
if ( window.console && window.console.warn ) {
window.console.warn( "The jquery.requestAnimationFrame plugin is not needed " +
"in jQuery 3.0 or newer as they handle it natively." );
}
return;
}

var animating;

Expand All @@ -41,4 +49,4 @@ if ( window.requestAnimationFrame ) {
};
}

}));
} ) );
7 changes: 4 additions & 3 deletions dist/jquery.requestAnimationFrame.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/jquery.requestAnimationFrame.min.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 0 additions & 84 deletions grunt.js

This file was deleted.

Loading