Skip to content

Commit

Permalink
Update version to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
barisaydinoglu committed Mar 21, 2014
1 parent 8686f00 commit d18dd61
Show file tree
Hide file tree
Showing 27 changed files with 7,079 additions and 4,191 deletions.
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Tabs in JS unless otherwise specified
[**.js]
indent_style = tab

[Makefile]
indent_style = tab


[test/**.xml]
indent_style = tab

[test/**.html]
indent_style = tab

[test/**.css]
indent_style = space
indent_size = 8
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* eol=lf
*.jar binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
.DS_Store
.bower.json
.sizecache.json

/bower_components
/node_modules
21 changes: 21 additions & 0 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"requireCurlyBraces": [ "if", "else", "for", "while", "do" ],
"requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return" ],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireMultipleVarDecl": true,
"requireSpacesInsideObjectBrackets": "all",
"requireSpacesInsideArrayBrackets": "all",
"disallowLeftStickedOperators": [ "?", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ],
"disallowRightStickedOperators": [ "?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ],
"requireRightStickedOperators": [ "!" ],
"requireLeftStickedOperators": [ "," ],
"disallowKeywords": [ "with" ],
"disallowMultipleLineBreaks": true,
"disallowKeywordsOnNewLine": [ "else" ],
"requireLineFeedAtFileEnd": true
}
28 changes: 14 additions & 14 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "double",
"smarttabs": true,
"trailing": true,
"undef": true,
"unused": true,
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "double",
"smarttabs": true,
"trailing": true,
"undef": true,
"unused": true,

"node": true
"node": true
}
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.jshintignore
.jshintrc

/.editorconfig
/.gitattributes
/.jscs.json
/.travis.yml

/build
/test
/Gruntfile.js
218 changes: 112 additions & 106 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,113 +1,119 @@
module.exports = function (grunt) {
"use strict";
module.exports = function(grunt) {
"use strict";

function readOptionalJSON(filepath) {
var data = {};
try {
data = grunt.file.readJSON(filepath);
} catch (e) {}
return data;
}
var gzip = require("gzip-js");

var gzip = require( "gzip-js" ),
srcHintOptions = readOptionalJSON("src/.jshintrc");
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
bowercopy: {
options: {
clean: true
},
tests: {
files: {
"test/libs/qunit.js": "qunit/qunit/qunit.js",
"test/libs/qunit.css": "qunit/qunit/qunit.css",
"test/libs/require.js": "requirejs/require.js",
"test/libs/modernizr.js": "modernizr/modernizr.js"
}
}
},
compare_size: {
files: [ "dist/<%= pkg.name %>.js", "dist/<%= pkg.name %>.min.js" ],
options: {
compress: {
gz: function(contents) {
return gzip.zip(contents, {}).length;
}
},
cache: "dist/.sizecache.json"
}
},
compile: {
all: {
dest: "dist/<%= pkg.name %>.js",
src: "src/<%= pkg.name %>.js"
}
},
coveralls: {
options: {
force: true
},
all: {
// LCOV coverage file relevant to every target
src: "_tests/reports/lcov/lcov.info"
}
},
jscs: {
src: "src/**/*.js",
gruntfile: "Gruntfile.js",
tasks: "build/tasks/*.js",
options: {
config: ".jscs.json"
}
},
jshint: {
source: {
src: "src/<%= pkg.name %>.js",
options: {
jshintrc: "src/.jshintrc"
}
},
grunt: {
src: [ "Gruntfile.js", "tasks/*" ],
options: {
jshintrc: ".jshintrc"
}
}
},
jsonlint: {
pkg: {
src: [ "package.json" ]
},
jscs: {
src: [ ".jscs.json" ]
},
bower: {
src: [ "bower.json" ]
}
},
qunit: {
files: [ "test/index.html" ]
},
uglify: {
all: {
files: {
"dist/<%= pkg.name %>.min.js": [ "dist/<%= pkg.name %>.js" ]
},
options: {
banner: "/*! <%= pkg.title %> v<%= pkg.version %> | (c) 2012 <%= pkg.author.name %> | Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */",
beautify: {
ascii_only: true
},
compress: {
hoist_funs: false,
loops: false
},
sourceMap: "dist/<%= pkg.name %>.min.map"
}
}
},
version: {
files: [ "package.json", "bower.json" ]
}
});

// The concatenated file won"t pass onevar
// But our modules can
delete srcHintOptions.onevar;
// Load grunt tasks from NPM packages
require("load-grunt-tasks")(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
dst: readOptionalJSON("dist/.destination.json"),
compare_size: {
files: [ "dist/<%= pkg.name %>.js", "dist/<%= pkg.name %>.min.js" ],
options: {
compress: {
gz: function( contents ) {
return gzip.zip( contents, {} ).length;
}
},
cache: "build/.sizecache.json"
}
},
jsonlint: {
pkg: {
src: [ "package.json" ]
},
bower: {
src: [ "bower.json" ]
}
},
jshint: {
all: {
src: [
"src/**/*.js", "Gruntfile.js"
],
options: {
jshintrc: true
}
},
dist: {
src: "dist/<%= pkg.name %>.js",
options: srcHintOptions
}
},
concat: {
options: {
separator: ";"
},
dist: {
src: ["src/**/*.js"],
dest: "dist/<%= pkg.name %>.js"
}
},
watch: {
files: [ "<%= jshint.all.src %>" ],
tasks: "dev"
},
uglify: {
all: {
files: {
"dist/<%= pkg.name %>.min.js": ["dist/<%= pkg.name %>.js"]
},
options: {
preserveComments: false,
sourceMap: "dist/<%= pkg.name %>.min.map",
sourceMappingURL: "<%= pkg.name %>.min.map",
report: "min",
beautify: {
ascii_only: true
},
banner: "/*! <%= pkg.title %> - v<%= pkg.version %> - " +
"<%= grunt.template.today('isoDate') %>\n" +
"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
"* Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>" +
" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n",
compress: {
hoist_funs: false,
loops: false,
unused: false
}
}
}
},
qunit: {
files: ["test/**/*.html"]
}
});
// Integrate Detectizr specific tasks
grunt.loadTasks("tasks");

// Load grunt tasks from NPM packages
require("load-grunt-tasks")(grunt);
grunt.registerTask("lint", [ "jsonlint", "jshint", "jscs" ]);
grunt.registerTask("build", [ "lint", "compile", "uglify", "dist", "compare_size" ]);
grunt.registerTask("test", [ "lint", "qunit" ]);
grunt.registerTask("default", [ "test", "compare_size" ]);

// Integrate jQuery specific tasks
grunt.loadTasks("build/tasks");

// Short list as a high frequency watch task
grunt.registerTask("dev", ["jshint"]);

// this would be run by typing "grunt test" on the command line
grunt.registerTask("test", ["jshint", "qunit"]);

// Default grunt
grunt.registerTask("default", [ "jshint", "jsonlint", "concat", "uglify", "compare_size"]);
// Task aliases
grunt.registerTask("bower", "bowercopy");
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Using it is a simple matter, illustrated in the following excerpt:
</head>
<body>
<script>
Modernizr.Detectizr.detect({detectScreen:false});
Detectizr.detect({detectScreen:false});
</script>
</body>
</html>
Expand Down
13 changes: 7 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"name": "detectizr",
"version": "1.5.0",
"version": "2.0.0",
"main": "dist/detectizr.js",
"license": "MIT",
"ignore": [
"**/.*",
"test",
"*.md",
"Gruntfile.js",
"package.json",
"bower.json"
"package.json"
],
"dependencies": {
"modernizr": "2.6.2"
"modernizr": "2.7.1"
},
"devDependencies": {
"requirejs": "~2.1.8",
"qunit": "~1.12.0"
"requirejs": "2.1.11",
"qunit": "1.14.0"
},
"keywords": [
"detect",
Expand Down
Loading

0 comments on commit d18dd61

Please sign in to comment.