Add grunt to jquery.uls
This library is supposed to be hosted outside WMF gerrit. So adding a build, test system. * Add js lint and css lint * minifier for css and js * css lint does not pass now. Change-Id: Iaadfad786f5de4b2ab95e24d3ea4f1d21952af75
This commit is contained in:
committed by
Amir E. Aharoni
parent
62a8d4f8fd
commit
8134f523dc
1
lib/jquery.uls/.gitignore
vendored
Normal file
1
lib/jquery.uls/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/node_modules
|
||||||
85
lib/jquery.uls/grunt.js
Normal file
85
lib/jquery.uls/grunt.js
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*global module:false*/
|
||||||
|
module.exports = function(grunt) {
|
||||||
|
grunt.loadNpmTasks('grunt-css');
|
||||||
|
// Project configuration.
|
||||||
|
grunt
|
||||||
|
.initConfig({
|
||||||
|
pkg : '<json:package.json>',
|
||||||
|
meta : {
|
||||||
|
banner : '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - '
|
||||||
|
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n'
|
||||||
|
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>'
|
||||||
|
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;'
|
||||||
|
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
|
||||||
|
},
|
||||||
|
concat : {
|
||||||
|
js : {
|
||||||
|
src: [ '<banner:meta.banner>','src/jquery.uls.data.js',
|
||||||
|
'src/jquery.uls.data.utils.js', 'src/jquery.uls.lcd.js',
|
||||||
|
'src/jquery.uls.languagefilter.js', 'src/jquery.uls.regionfilter.js',
|
||||||
|
'src/jquery.uls.core.js'],
|
||||||
|
dest : 'dist/<%= pkg.name %>.js'
|
||||||
|
},
|
||||||
|
css: {
|
||||||
|
src: [ 'css/jquery.uls.css', 'css/jquery.uls.grid.css',
|
||||||
|
'css/jquery.uls.lcd.css' ],
|
||||||
|
dest : 'dist/<%= pkg.name %>.css'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
min : {
|
||||||
|
dist : {
|
||||||
|
src : [ '<banner:meta.banner>',
|
||||||
|
'<config:concat.js.dest>' ],
|
||||||
|
dest : 'dist/<%= pkg.name %>.min.js'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cssmin : {
|
||||||
|
dist: {
|
||||||
|
src : '<config:concat.css.dest>',
|
||||||
|
dest : 'dist/<%= pkg.name %>.min.css'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lint : {
|
||||||
|
files : [ 'src/**/*.js', 'test/**/*.js' ]
|
||||||
|
},
|
||||||
|
csslint : {
|
||||||
|
file: [ 'css/**/*.css' ]
|
||||||
|
},
|
||||||
|
watch : {
|
||||||
|
files : '<config:lint.files>',
|
||||||
|
tasks : 'lint'
|
||||||
|
},
|
||||||
|
jshint : {
|
||||||
|
options : {
|
||||||
|
curly : true,
|
||||||
|
eqeqeq : true,
|
||||||
|
immed : true,
|
||||||
|
latedef : true,
|
||||||
|
newcap : true,
|
||||||
|
noarg : true,
|
||||||
|
sub : true,
|
||||||
|
undef : true,
|
||||||
|
boss : true,
|
||||||
|
eqnull : true,
|
||||||
|
browser : true,
|
||||||
|
smarttabs : true,
|
||||||
|
laxbreak : true,
|
||||||
|
multistr: true
|
||||||
|
},
|
||||||
|
globals : {
|
||||||
|
jQuery : true,
|
||||||
|
QUnit : true,
|
||||||
|
pluralRuleParser : true,
|
||||||
|
_ : true,
|
||||||
|
module : true,
|
||||||
|
test : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uglify : {
|
||||||
|
src : [ '<banner:meta.banner>', '<config:concat.dist.js>' ],
|
||||||
|
dest : 'dist/<%= pkg.name %>.min.js'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Default task.
|
||||||
|
grunt.registerTask('default', 'lint cssmin concat min csslint');
|
||||||
|
};
|
||||||
53
lib/jquery.uls/package.json
Normal file
53
lib/jquery.uls/package.json
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"name": "jquery.uls",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Universal Language Selector",
|
||||||
|
"homepage": "https://github.com/wikimedia/jquery.uls",
|
||||||
|
"keywords": [
|
||||||
|
"internationalization",
|
||||||
|
"localization",
|
||||||
|
"uls",
|
||||||
|
"jquery",
|
||||||
|
"l10n"
|
||||||
|
],
|
||||||
|
"author": {
|
||||||
|
"name": "Santhosh Thottingal",
|
||||||
|
"email": "santhosh.thottingal@gmail.com"
|
||||||
|
},
|
||||||
|
"contributors": [
|
||||||
|
"Alolita Sharma",
|
||||||
|
"Amir Aharoni",
|
||||||
|
"Arun Ganesh",
|
||||||
|
"Brandon Harris",
|
||||||
|
"Niklas Laxström",
|
||||||
|
"Pau Giner",
|
||||||
|
"Santhosh Thottingal",
|
||||||
|
"Siebrand Mazeland"
|
||||||
|
],
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"grunt": "~0.3.9",
|
||||||
|
"grunt-compare-size": ">=0.1.4",
|
||||||
|
"grunt-css": ">0.0.0"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/wikimedia/jquery.uls.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url" : "http://github.com/wikimedia/jquery.uls/issues"
|
||||||
|
},
|
||||||
|
"engine": {
|
||||||
|
"node": ">=0.6.x"
|
||||||
|
},
|
||||||
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "GPL",
|
||||||
|
"url": "https://github.com/wikimedia/jquery.uls/blob/master/GPL-LICENSE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "https://github.com/wikimedia/jquery.uls/blob/master/MIT-LICENSE"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user