Permalink
Browse files

Tweaks, updates and fixes

  • Loading branch information...
stefangabos committed Jun 4, 2017
1 parent f469e65 commit b4b136bbdd7cb34c5452e2eafe1aaa31f2cfc51f
Showing with 109 additions and 35 deletions.
  1. +91 −18 Gruntfile.js
  2. +18 −17 package.json
View
@@ -1,46 +1,119 @@
'use strict';
module.exports = function(grunt) {
var source_files = ['public/javascript/zebra_cookie.src.js'];
// show time spent on each task
require('time-grunt')(grunt);
grunt.initConfig({
// load packages.json
pkg: grunt.file.readJSON('package.json'),
// configure plugins
/***************************************************************************************************************
* NOTIFY
* https://github.com/dylang/grunt-notify
**************************************************************************************************************/
'notify': {
done: {
options: {
title: 'Grunt ',
message: 'All tasks were successfully completed!'
}
}
},
/***************************************************************************************************************
* ESLINT
* http://eslint.org/docs/rules/
**************************************************************************************************************/
'eslint' : {
options: {
configFile: 'eslint.json'
},
src: ['src/zebra_cookie.src.js']
},
/***************************************************************************************************************
* JSHINT
* https://npmjs.org/package/grunt-contrib-jshint
**************************************************************************************************************/
'jshint': {
options: {
strict: false, // requires all functions to run in ECMAScript 5's strict mode
asi: true, // suppresses warnings about missing semicolons
globals: { // white list of global variables that are not formally defined in the source code
'$': true,
'alert': true,
'console': true,
'jQuery': true
},
browser: true, // defines globals exposed by modern browsers (like `document` and `navigator`)
bitwise: true, // prohibits the use of bitwise operators such as ^ (XOR), | (OR) and others
curly: false, // whether to always put curly braces around blocks in loops and conditionals
eqeqeq: true, // this options prohibits the use of == and != in favor of === and !==
freeze: true, // this options prohibits overwriting prototypes of native objects such as Array, Date and so on
scripturl: true, // allow use of scripts
nonew: true, // this option prohibits the use of constructor functions without assigning them to a variable
loopfunc: true, // allow functions to be defined inside loops
undef: true // this option prohibits the use of explicitly undeclared variables
},
src: ['src/zebra_cookie.src.js']
},
/***************************************************************************************************************
* UGLIFY
* https://npmjs.org/package/grunt-contrib-uglify
**************************************************************************************************************/
'uglify': {
options: {
compress: true,
mangle: true,
beautify: false
},
build: {
src: source_files,
dest: 'public/javascript/zebra_cookie.js'
src: 'src/zebra_cookie.src.js',
dest: 'dist/zebra_cookie.min.js'
}
},
'jshint': {
files: source_files,
options: {
quotmark: 'single',
boss: true,
strict: true
/***************************************************************************************************************
* COPY
* https://github.com/gruntjs/grunt-contrib-copy
**************************************************************************************************************/
'copy': {
all: {
files: [
{ src: 'src/zebra_cookie.src.js', dest: 'dist/zebra_cookie.src.js' }
]
}
},
/***************************************************************************************************************
* WATCH
* https://npmjs.org/package/grunt-contrib-watch
**************************************************************************************************************/
'watch': {
files: source_files,
tasks: ['jshint', 'uglify']
js: {
files: ['src/zebra_cookie.src.js'],
tasks: ['newer:eslint', 'newer:jshint', 'newer:uglify', 'copy', 'notify:done'],
options: {
livereload: true
}
}
}
});
// register plugins
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-notify');
// register tasks
grunt.registerTask('default', ['jshint', 'uglify', 'watch']);
grunt.registerTask('default', ['eslint', 'jshint', 'uglify', 'copy', 'watch']);
};
View
@@ -1,40 +1,41 @@
{
"name": "zebra_cookie",
"version": "1.0.7",
"main": "public/javascript/zebra_cookie.js",
"homepage": "https://github.com/stefangabos/Zebra_Cookie",
"description": "An extremely small (~500 bytes minified) jQuery plugin for writing, reading and deleting cookies",
"author": {
"name": "Stefan Gabos",
"email": "contact@stefangabos.ro"
},
"description": "An extremely small (~500 bytes minified) jQuery plugin for writing, reading and deleting cookies",
"homepage": "https://github.com/stefangabos/Zebra_Cookie",
"main": "dist/zebra_cookie.min.js",
"repository": {
"type": "git",
"url": "https://github.com/stefangabos/Zebra_Cookie.git"
},
"bugs": {
"url": "http://github.com/stefangabos/Zebra_Cookie/issues",
"email": "contact@stefangabos.ro"
},
"license": "LGPL-3.0",
"version": "1.0.7",
"keywords": [
"jquery-plugin",
"ecosystem:jquery",
"cookie",
"cookies",
"client",
"browser"
],
"licenses": [
{
"type": "LGPL",
"url": "https://www.gnu.org/licenses/lgpl-3.0.txt"
}
"browser",
"jquery"
],
"bugs": {
"url": "https://github.com/stefangabos/Zebra_cookie/issues",
"email": "contact@stefangabos.ro"
},
"devDependencies": {
"grunt": "*",
"grunt-cli": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-uglify": "*",
"grunt-cli": "*",
"grunt-contrib-watch": "*"
"grunt-contrib-watch": "*",
"grunt-eslint": "*",
"grunt-newer": "*",
"grunt-notify": "*",
"time-grunt": "*"
}
}

0 comments on commit b4b136b

Please sign in to comment.