Permalink
Browse files

Clean up Grunt tasks and add bower integration.

In order to move to a more ordered project structure, I'm merging
the qTip2/bower and qTip2/qTip2 repos into one, with the dist/
folder being included in both bower and npm. This will allow both
Bower and NPM to share the same project structure, and should
make maintenance much easier for new releases.

Added preversion, version and postverion NPM tasks for easier
versioning, and add generate-bower script for generating the
bower.json file dynamically from the package.json file.

Some Grunt tasks are now renamed or gone, and several NPM
package scripts have been added for easier development and
building of the files via Grunt etc.
  • Loading branch information...
1 parent e4d59b0 commit 70fda076de6d8d9e79540c1804b6f3616586bbe3 @Craga89 Craga89 committed Dec 8, 2015
View
@@ -4,13 +4,4 @@
.DS_Store
/npm-debug.log
node_modules/
-bower/
-converter/
-bin/
-bower/
-converter/
-grunt/
-libs/
-qtest/
-tests/
-wiki/
+**/*.nfs*
View
@@ -1,12 +1 @@
-bower
-converter
-bin
-bower
-converter
-grunt
-libs
-qtest
-tests
-wiki
-
-
+node_modules
View
@@ -0,0 +1,35 @@
+{
+ "name": "qtip2",
+ "description": "Introducing... qTip2. The second generation of the advanced qTip plugin for the ever popular jQuery framework.",
+ "version": "2.1.1",
+ "homepage": "http://qtip2.com",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/qTip2/qTip2.git"
+ },
+ "author": "Craig Michael Thompson <craig@craigsworks.com> (http://craigsworks.com/)",
+ "license": [
+ "MIT"
+ ],
+ "keywords": [
+ "tooltip",
+ "tooltips",
+ "jquery",
+ "jquery-plugin",
+ "qtip",
+ "qtip2",
+ "simpletip",
+ "craig thompson",
+ "craig michael thompson",
+ "craigsworks",
+ "craga89"
+ ],
+ "main": [
+ "./dist/jquery.qtip.js",
+ "./dist/jquery.qtip.css"
+ ],
+ "dependencies": {
+ "jquery": ">=1.6.0",
+ "imagesloaded": ">=3.0.0"
+ }
+}
@@ -1,12 +1,12 @@
/*
- * qTip2 - Pretty powerful tooltips - v2.2.1-33-
+ * qTip2 - Pretty powerful tooltips - v2.1.1
* http://qtip2.com
*
* Copyright (c) 2015
* Released under the MIT licenses
* http://jquery.org/license
*
- * Date: Tue Dec 8 2015 06:01 GMT+0000
+ * Date: Tue Dec 8 2015 06:07 GMT+0000
* Plugins: None
* Styles: core
*/
@@ -1,12 +1,12 @@
/*
- * qTip2 - Pretty powerful tooltips - v2.2.1-33-
+ * qTip2 - Pretty powerful tooltips - v2.1.1
* http://qtip2.com
*
* Copyright (c) 2015
* Released under the MIT licenses
* http://jquery.org/license
*
- * Date: Tue Dec 8 2015 06:01 GMT+0000
+ * Date: Tue Dec 8 2015 06:07 GMT+0000
* Plugins: None
* Styles: core
*/
@@ -1928,7 +1928,7 @@ if(!$.ui) {
};
}
;// qTip version
-QTIP.version = '2.2.1-33-';
+QTIP.version = '2.1.1';
// Base ID for all qTips
QTIP.nextid = 0;
Oops, something went wrong.
@@ -1,12 +1,12 @@
/*
- * qTip2 - Pretty powerful tooltips - v2.2.1-33-
+ * qTip2 - Pretty powerful tooltips - v2.1.1
* http://qtip2.com
*
* Copyright (c) 2015
* Released under the MIT licenses
* http://jquery.org/license
*
- * Date: Tue Dec 8 2015 06:01 GMT+0000
+ * Date: Tue Dec 8 2015 06:07 GMT+0000
* Plugins: tips modal viewport svg imagemap ie6
* Styles: core basic css3
*/
View
@@ -1,12 +1,12 @@
/*
- * qTip2 - Pretty powerful tooltips - v2.2.1-33-
+ * qTip2 - Pretty powerful tooltips - v2.1.1
* http://qtip2.com
*
* Copyright (c) 2015
* Released under the MIT licenses
* http://jquery.org/license
*
- * Date: Tue Dec 8 2015 06:01 GMT+0000
+ * Date: Tue Dec 8 2015 06:07 GMT+0000
* Plugins: tips modal viewport svg imagemap ie6
* Styles: core basic css3
*/
@@ -1928,7 +1928,7 @@ if(!$.ui) {
};
}
;// qTip version
-QTIP.version = '2.2.1-33-';
+QTIP.version = '2.1.1';
// Base ID for all qTips
QTIP.nextid = 0;
Oops, something went wrong.
@@ -0,0 +1,23 @@
+var fs = require('fs');
+var pkg = require('./package.json');
+
+var bower = {
+ name: pkg.name,
+ description: pkg.description,
+ version: pkg.version,
+ homepage: pkg.homepage,
+ repository: pkg.repository,
+ author: pkg.author,
+ license: pkg.licenses.map(function (license) {
+ return license.type;
+ }),
+ keywords: pkg.keywords,
+ main: [
+ './dist/jquery.qtip.js',
+ './dist/jquery.qtip.css'
+ ],
+ dependencies: pkg.dependencies
+};
+
+fs.writeFile('bower.json', JSON.stringify(bower, null, '\t'));
+
View
@@ -1,10 +1,13 @@
-'use strict';
+var BASIC = 'BASIC';
-var defaultTasks = ['concat', 'uglify', 'cssmin', 'replace'];
-function alias(basic) {
- var start = (basic = basic === true) ? 1 : 0;
-
- return [basic ? 'init:basic' : 'init'].concat(
+var defaultTasks = [
+ 'concat', 'uglify', 'cssmin', 'replace'
+];
+
+function alias(type) {
+ var start = type === BASIC ? 1 : 0;
+
+ return [type === BASIC ? 'init:basic' : 'init'].concat(
Array.prototype.slice.call(arguments, start)
).concat(
defaultTasks
@@ -14,11 +17,11 @@ function alias(basic) {
// Task aliases
module.exports = {
default: alias('clean'),
- basic: alias(true, 'clean'),
- dev: alias('clean', 'eslint', 'csslint'),
- all: alias('clean').concat( alias(true) ),
- css: alias('clean', 'csslint', 'concat:css', 'cssmin', 'replace'),
+ basic: alias(BASIC, 'clean'),
+ css: alias('clean', 'concat:css', 'cssmin', 'replace'),
+ all: alias('clean').concat( alias(BASIC) ),
+ lint: [ 'eslint', 'csslint' ],
- watch_js: [ 'init', 'concat', 'uglify', 'replace' ],
- watch_css: [ 'init', 'concat', 'cssmin', 'replace' ]
-};
+ 'watch_js': [ 'eslint', 'init', 'concat', 'uglify', 'replace' ],
+ 'watch_css': [ 'csslint', 'init', 'concat', 'cssmin', 'replace' ]
+};
View
@@ -1,3 +1 @@
-'use strict';
-
module.exports = ['<%=dirs.dist%>/**/*.*'];
View
@@ -1,12 +1,10 @@
-'use strict';
-
module.exports = {
options: {
stripBanners: true,
separator: ';',
banner: '<%=meta.banners.full%>'
},
- dist: {
+ js: {
// See "init" task for src
dest: '<%=dirs.dist%>/jquery.qtip.js'
},
View
@@ -1,12 +1,10 @@
-'use strict';
-
module.exports = {
options: {
'empty-rules': false,
important: false,
ids: false
},
- strict: {
+ css: {
src: ['<%=dirs.src%>/**/*.css']
}
-};
+};
View
@@ -1,12 +1,10 @@
-'use strict';
-
module.exports = {
options: {
keepSpecialComments: 0,
banner: '<%=meta.banners.minified%>',
report: 'min'
},
- dist: {
+ js: {
files: {
'<%=dirs.dist%>/jquery.qtip.min.css': '<%=dirs.dist%>/jquery.qtip.css'
}
View
@@ -1,8 +1,12 @@
-'use strict';
-
module.exports = {
- beforeconcat: [
- 'grunt.js', '<%=dirs.src%>/*/*.js',
- '!<%=dirs.src%>/*/intro.js', '!<%=dirs.src%>/*/outro.js' // Ignore intro/outro files
- ]
-};
+ js: {
+ src: [
+ 'Gruntfile.js',
+ '<%=dirs.src%>/*/*.js',
+
+ // Ignore intro/outro files
+ '!<%=dirs.src%>/core/intro.js',
+ '!<%=dirs.src%>/core/outro.js'
+ ]
+ }
+};
View
@@ -1,15 +1,12 @@
-'use strict';
-
-// Replacement variables are set up in `init` task
-module.exports = function(grunt) {
- return {
- dist: {
- options: {
- patterns: []
- },
- files: [
- { expand: true, flatten: true, src: ['<%=dirs.dist%>/**/*'], dest: '<%=dirs.dist%>/' }
- ]
- }
+module.exports = {
+ js: {
+ options: {
+ patterns: [] // Replacements are set up in `init` task
+ },
+ files: [{
+ expand: true,
+ flatten: true,
+ src: ['<%=dirs.dist%>/**/*'], dest: '<%=dirs.dist%>/'
+ }]
}
-};
+};
View
@@ -46,7 +46,7 @@ module.exports = function(grunt) {
js.push('<%=dirs.src%>/core/outro.js');
// Update concatenation config
- grunt.config('concat.dist.src', js);
+ grunt.config('concat.js.src', js);
grunt.config('concat.css.src', css);
// Setup in-file text replacements (version, date etc)
@@ -81,7 +81,7 @@ module.exports = function(grunt) {
: '';
// Set replacement variables
- grunt.config('replace.dist.options.patterns', [{
+ grunt.config('replace.js.options.patterns', [{
json: {
'BUILDPROPS': buildprops,
'MINBUILDPROPS': minbuildprops,
View
@@ -1,20 +1,16 @@
-'use strict';
-
-module.exports = function(grunt) {
- return {
- options: {
- preserveComments: 'some',
- report: 'min',
- banner: '<%=meta.banners.minified%>',
- sourceMap: true,
- sourceMapName: function(name) {
- return name.replace('.js', '.map');
- }
- },
- dist: {
- files: {
- '<%=dirs.dist%>/jquery.qtip.min.js': ['<%=dirs.dist%>/jquery.qtip.js']
- }
+module.exports = {
+ options: {
+ preserveComments: false,
+ report: 'min',
+ banner: '<%=meta.banners.minified%>',
+ sourceMap: true,
+ sourceMapName: function(name) {
+ return name.replace('.js', '.map');
+ }
+ },
+ js: {
+ files: {
+ '<%=dirs.dist%>/jquery.qtip.min.js': ['<%=dirs.dist%>/jquery.qtip.js']
}
}
-};
+};
View
@@ -1,5 +1,3 @@
-'use strict';
-
module.exports = {
options: {
livereload: true
Oops, something went wrong.

0 comments on commit 70fda07

Please sign in to comment.