-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSS is now done via SASS/Grunt - added all required resources for thi…
…s update
- Loading branch information
1 parent
5c235da
commit 5e31125
Showing
40 changed files
with
5,371 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,226 @@ | ||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
|
||
// show time spent on each task | ||
require('time-grunt')(grunt); | ||
|
||
// required for sass | ||
const sass = require('node-sass'); | ||
|
||
grunt.initConfig({ | ||
|
||
// load packages.json | ||
pkg: grunt.file.readJSON('package.json'), | ||
|
||
/*************************************************************************************************************** | ||
* NOTIFY | ||
* https://github.com/dylang/grunt-notify | ||
**************************************************************************************************************/ | ||
'notify': { | ||
done: { | ||
options: { | ||
title: 'Grunt ', | ||
message: 'All tasks were successfully completed!' | ||
} | ||
} | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* SASS | ||
* https://www.npmjs.org/package/grunt-sass | ||
**************************************************************************************************************/ | ||
'sass': { | ||
expanded: { | ||
options: { | ||
implementation: sass, | ||
outputStyle: 'expanded', | ||
indentWidth: 4 | ||
}, | ||
files: { | ||
'public/css/default/zebra_database.css': 'src/css/default/zebra_database.scss', | ||
} | ||
}, | ||
minified: { | ||
options: { | ||
implementation: sass, | ||
outputStyle: 'compressed' | ||
}, | ||
files: { | ||
'public/css/default/zebra_database.min.css': 'src/css/default/zebra_database.scss', | ||
} | ||
} | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* CSSMIN | ||
* https://github.com/gruntjs/grunt-contrib-cssmin | ||
**************************************************************************************************************/ | ||
'cssmin': { | ||
beutify: { | ||
options: { | ||
compatibility: { | ||
properties: { | ||
ieBangHack: true, | ||
ieFilters: true, | ||
iePrefixHack: true, | ||
ieSuffixHack: true | ||
}, | ||
selectors: { | ||
ie7Hack: true | ||
} | ||
}, | ||
format: { | ||
breaks: { | ||
afterAtRule: true, | ||
afterBlockBegins: true, | ||
afterBlockEnds: true, | ||
afterComment: true, | ||
afterProperty: true, | ||
afterRuleBegins: true, | ||
afterRuleEnds: true, | ||
beforeBlockEnds: true, | ||
betweenSelectors: true | ||
}, | ||
indentBy: 4, | ||
indentWith: 'space', | ||
spaces: { | ||
aroundSelectorRelation: true, | ||
beforeBlockBegins: true, | ||
beforeValue: true | ||
} | ||
}, | ||
level: 2 | ||
}, | ||
files: { | ||
'public/css/default/zebra_database.css': 'public/css/default/zebra_database.css', | ||
} | ||
}, | ||
minify: { | ||
options: { | ||
compatibility: { | ||
properties: { | ||
ieBangHack: true, | ||
ieFilters: true, | ||
iePrefixHack: true, | ||
ieSuffixHack: true | ||
}, | ||
selectors: { | ||
ie7Hack: true | ||
} | ||
}, | ||
level: 2 | ||
}, | ||
files: { | ||
'public/css/default/zebra_database.min.css': 'public/css/default/zebra_database.min.css', | ||
} | ||
} | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* ESLINT | ||
* http://eslint.org/docs/rules/ | ||
**************************************************************************************************************/ | ||
'eslint' : { | ||
options: { | ||
overrideConfigFile: 'eslint.json' | ||
}, | ||
src: ['src/zebra_database.src.js'] | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* JSHINT | ||
* https://npmjs.org/package/grunt-contrib-jshint | ||
**************************************************************************************************************/ | ||
'jshint': { | ||
options: { | ||
strict: true, // requires all functions to run in ECMAScript 5's strict mode | ||
asi: false, // suppresses warnings about missing semicolons | ||
globals: { // white list of global variables that are not formally defined in the source code | ||
'$': 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_database.src.js'] | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* UGLIFY | ||
* https://npmjs.org/package/grunt-contrib-uglify | ||
**************************************************************************************************************/ | ||
'uglify': { | ||
options: { | ||
compress: true, | ||
mangle: true, | ||
beautify: false | ||
}, | ||
build: { | ||
src: 'src/zebra_database.src.js', | ||
dest: 'public/javascript/zebra_database.min.js' | ||
} | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* COPY | ||
* https://github.com/gruntjs/grunt-contrib-copy | ||
**************************************************************************************************************/ | ||
'copy': { | ||
js: { | ||
files: [ | ||
{ src: 'src/zebra_database.src.js', dest: 'public/javascript/zebra_database.src.js' } | ||
] | ||
}, | ||
css: { | ||
files: [ | ||
{ expand: true, cwd: 'src/css/default/', src: ['*.png', '*.scss', '*.txt'], dest: 'public/css/default/' } | ||
] | ||
} | ||
}, | ||
|
||
/*************************************************************************************************************** | ||
* WATCH | ||
* https://npmjs.org/package/grunt-contrib-watch | ||
**************************************************************************************************************/ | ||
'watch': { | ||
js: { | ||
files: ['src/zebra_database.src.js'], | ||
tasks: ['newer:eslint', 'newer:jshint', 'newer:uglify', 'copy:js', 'notify:done'], | ||
options: { | ||
livereload: true | ||
} | ||
}, | ||
css: { | ||
files: ['src/css/**/*.scss'], | ||
tasks: ['sass', 'cssmin', 'copy:css', 'notify:done'], | ||
options: { | ||
livereload: true | ||
} | ||
} | ||
} | ||
|
||
}); | ||
|
||
// register plugins | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-cssmin'); | ||
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'); | ||
grunt.loadNpmTasks('grunt-sass'); | ||
|
||
grunt.registerTask('default', ['sass', 'cssmin', 'eslint', 'jshint', 'uglify', 'copy', 'watch']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"env": { | ||
"browser": true | ||
}, | ||
"globals": { | ||
"$": true | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": ["warn", "never"], | ||
"block-scoped-var": 1, | ||
"block-spacing": ["warn", "always"], | ||
"brace-style": ["warn", "1tbs", { "allowSingleLine": true }], | ||
"comma-dangle": 1, | ||
"comma-spacing": ["warn", { | ||
"before": false, | ||
"after": true | ||
}], | ||
"comma-style": ["warn", "last"], | ||
"computed-property-spacing": ["warn", "never"], | ||
"curly": ["warn", "multi"], | ||
"dot-location": ["warn", "property"], | ||
"eol-last": ["warn", "always"], | ||
"indent": ["warn", 4, { | ||
"SwitchCase": 1, | ||
"ignoreComments": true | ||
}], | ||
"keyword-spacing": ["warn", { | ||
"before": true, | ||
"after": true | ||
}], | ||
"func-call-spacing": ["warn", "never"], | ||
"key-spacing": ["warn", { | ||
"beforeColon": false, | ||
"mode": "minimum" | ||
}], | ||
"lines-around-comment": ["warn", { | ||
"beforeBlockComment": true, | ||
"afterBlockComment": false | ||
}], | ||
"quotes": ["warn", "single"], | ||
"newline-after-var": ["warn", "always"], | ||
"newline-before-return": 1, | ||
"no-console": 1, | ||
"no-dupe-args": 1, | ||
"no-dupe-keys": 1, | ||
"no-duplicate-case": 1, | ||
"no-else-return": 1, | ||
"no-empty": 1, | ||
"no-extra-semi": 1, | ||
"no-fallthrough": 1, | ||
"no-func-assign": 1, | ||
"no-inner-declarations": ["warn", "functions"], | ||
"no-irregular-whitespace": ["warn", { | ||
"skipStrings": false, | ||
"skipComments": false, | ||
"skipRegExps": false, | ||
"skipTemplates": false | ||
}], | ||
"no-lonely-if": 1, | ||
"no-mixed-spaces-and-tabs": 1, | ||
"no-multi-spaces": ["warn", { | ||
"ignoreEOLComments": true | ||
}], | ||
"no-multiple-empty-lines": ["warn", { | ||
"max": 1, | ||
"maxEOF": 1, | ||
"maxBOF": 0 | ||
}], | ||
"no-redeclare": 1, | ||
"no-tabs": 1, | ||
"no-trailing-spaces": ["warn", { | ||
"skipBlankLines": false | ||
}], | ||
"no-unexpected-multiline": 1, | ||
"no-unneeded-ternary": ["warn", { | ||
"defaultAssignment": false | ||
}], | ||
"no-unused-vars": [1, { | ||
"vars": "all", | ||
"args": "after-used", | ||
"varsIgnorePattern": "[$]this" | ||
}], | ||
"no-useless-concat": 1, | ||
"no-whitespace-before-property": 1, | ||
"object-curly-spacing": ["warn", "never"], | ||
"object-property-newline": ["warn", { | ||
"allowMultiplePropertiesPerLine": false | ||
}], | ||
"one-var": ["warn", "always"], | ||
"radix": ["warn", "always"], | ||
"semi-spacing": ["warn", { | ||
"before": false, | ||
"after": true | ||
}], | ||
"space-before-blocks": ["warn", "always"], | ||
"space-before-function-paren": ["warn", "never"], | ||
"space-in-parens": ["warn", "never"], | ||
"space-infix-ops": 1, | ||
"space-unary-ops": ["warn", { | ||
"words": true, | ||
"nonwords": false | ||
}], | ||
"spaced-comment": ["warn", "always", { | ||
"exceptions": ["-", "+", "*", "=", "_"] | ||
}], | ||
"use-isnan": 1, | ||
"valid-typeof": 1, | ||
"wrap-iife": ["warn", "inside"] | ||
} | ||
} |
Oops, something went wrong.