Skip to content

Commit

Permalink
update and correction
Browse files Browse the repository at this point in the history
  • Loading branch information
wallace souza committed Jun 10, 2016
1 parent ee54e7d commit b48436e
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 35 deletions.
127 changes: 102 additions & 25 deletions Gruntfile.js
@@ -1,4 +1,4 @@
// Generated on 2015-07-09 using generator-angular 0.11.1
// Generated on 2016-06-07 using generator-angular 0.15.1
'use strict';

// # Globbing
Expand All @@ -9,12 +9,16 @@

module.exports = function (grunt) {

// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);

// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);

// Automatically load required Grunt tasks
require('jit-grunt')(grunt, {
useminPrepare: 'grunt-usemin',
ngtemplates: 'grunt-angular-templates',
cdnify: 'grunt-google-cdn'
});

// Configurable paths for the application
var appConfig = {
app: require('./bower.json').appPath || 'app',
Expand All @@ -35,18 +39,18 @@ module.exports = function (grunt) {
},
js: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
tasks: ['newer:jshint:all'],
tasks: ['newer:jshint:all', 'newer:jscs:all'],
options: {
livereload: '<%= connect.options.livereload %>'
}
},
jsTest: {
files: ['test/spec/{,*/}*.js'],
tasks: ['newer:jshint:test', 'karma']
tasks: ['newer:jshint:test', 'newer:jscs:test', 'karma']
},
styles: {
files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['newer:copy:styles', 'autoprefixer']
compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'postcss:server']
},
gruntfile: {
files: ['Gruntfile.js']
Expand Down Expand Up @@ -114,7 +118,7 @@ module.exports = function (grunt) {
}
},

// Make sure code styles are up to par and there are no obvious mistakes
// Make sure there are no obvious mistakes
jshint: {
options: {
jshintrc: '.jshintrc',
Expand All @@ -134,6 +138,23 @@ module.exports = function (grunt) {
}
},

// Make sure code styles are up to par
jscs: {
options: {
config: '.jscsrc',
verbose: true
},
all: {
src: [
'Gruntfile.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
},
test: {
src: ['test/spec/{,*/}*.js']
}
},

// Empties folders to start fresh
clean: {
dist: {
Expand All @@ -150,13 +171,15 @@ module.exports = function (grunt) {
},

// Add vendor prefixed styles
autoprefixer: {
postcss: {
options: {
browsers: ['last 1 version']
processors: [
require('autoprefixer-core')({browsers: ['last 1 version']})
]
},
server: {
options: {
map: true,
map: true
},
files: [{
expand: true,
Expand Down Expand Up @@ -196,6 +219,39 @@ module.exports = function (grunt) {
}
}
}
},
sass: {
src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
ignorePath: /(\.\.\/){1,2}bower_components\//
}
},

// Compiles Sass to CSS and generates necessary files if requested
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
generatedImagesDir: '.tmp/images/generated',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: './bower_components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false,
assetCacheBuster: false,
raw: 'Sass::Script::Number.precision = 10\n'
},
dist: {
options: {
generatedImagesDir: '<%= yeoman.dist %>/images/generated'
}
},
server: {
options: {
sourcemap: true
}
}
},

Expand Down Expand Up @@ -234,12 +290,16 @@ module.exports = function (grunt) {
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
js: ['<%= yeoman.dist %>/scripts/{,*/}*.js'],
options: {
assetsDirs: [
'<%= yeoman.dist %>',
'<%= yeoman.dist %>/images',
'<%= yeoman.dist %>/styles'
]
],
patterns: {
js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']]
}
}
},

Expand Down Expand Up @@ -297,18 +357,30 @@ module.exports = function (grunt) {
collapseWhitespace: true,
conservativeCollapse: true,
collapseBooleanAttributes: true,
removeCommentsFromCDATA: true,
removeOptionalTags: true
removeCommentsFromCDATA: true
},
files: [{
expand: true,
cwd: '<%= yeoman.dist %>',
src: ['*.html', 'views/{,*/}*.html'],
src: ['*.html'],
dest: '<%= yeoman.dist %>'
}]
}
},

ngtemplates: {
dist: {
options: {
module: 'latestApp',
htmlmin: '<%= htmlmin.dist.options %>',
usemin: 'scripts/scripts.js'
},
cwd: '<%= yeoman.app %>',
src: 'views/{,*/}*.html',
dest: '.tmp/templateCache.js'
}
},

// ng-annotate tries to make the code safe for minification automatically
// by using the Angular long form for dependency injection.
ngAnnotate: {
Expand Down Expand Up @@ -339,9 +411,7 @@ module.exports = function (grunt) {
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'views/{,*/}*.html',
'images/{,*/}*.{webp}',
'styles/fonts/{,*/}*.*'
]
Expand All @@ -350,6 +420,11 @@ module.exports = function (grunt) {
cwd: '.tmp/images',
dest: '<%= yeoman.dist %>/images',
src: ['generated/*']
}, {
expand: true,
cwd: '.',
src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
dest: '<%= yeoman.dist %>'
}]
},
styles: {
Expand All @@ -363,13 +438,13 @@ module.exports = function (grunt) {
// Run some tasks in parallel to speed up the build process
concurrent: {
server: [
'copy:styles'
'compass:server'
],
test: [
'copy:styles'
'compass'
],
dist: [
'copy:styles',
'compass:dist',
'imagemin',
'svgmin'
]
Expand All @@ -394,7 +469,7 @@ module.exports = function (grunt) {
'clean:server',
'wiredep',
'concurrent:server',
'autoprefixer:server',
'postcss:server',
'connect:livereload',
'watch'
]);
Expand All @@ -409,7 +484,7 @@ module.exports = function (grunt) {
'clean:server',
'wiredep',
'concurrent:test',
'autoprefixer',
'postcss',
'connect:test',
'karma'
]);
Expand All @@ -419,7 +494,8 @@ module.exports = function (grunt) {
'wiredep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'postcss',
'ngtemplates',
'concat',
'ngAnnotate',
'copy:dist',
Expand All @@ -433,6 +509,7 @@ module.exports = function (grunt) {

grunt.registerTask('default', [
'newer:jshint',
'newer:jscs',
'test',
'build'
]);
Expand Down
30 changes: 20 additions & 10 deletions package.json
@@ -1,37 +1,47 @@
{
"name": "dashboardmdl",
"version": "0.0.0",
"dependencies": {},
"dependencies": {
"mkdirp": "^0.5.1",
"throttleit": "^1.0.0",
"yauzl": "^2.4.3"
},
"repository": {},
"devDependencies": {
"autoprefixer-core": "^5.2.1",
"coffee-script": "^1.10.0",
"exception": "^1.0.9",
"graceful-fs": "^4.1.4",
"grunt": "^0.4.5",
"grunt-autoprefixer": "^2.0.0",
"grunt-angular-templates": "^0.5.7",
"grunt-concurrent": "^1.0.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-compass": "^1.0.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-cssmin": "^0.12.0",
"grunt-contrib-htmlmin": "^0.4.0",
"grunt-contrib-imagemin": "^0.9.2",
"grunt-contrib-imagemin": "^1.0.0",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-filerev": "^2.1.2",
"grunt-google-cdn": "^0.4.3",
"grunt-karma": "^0.11.2",
"grunt-jscs": "^1.8.0",
"grunt-legacy-log-utils": "^1.0.0",
"grunt-newer": "^1.1.0",
"grunt-ng-annotate": "^0.9.2",
"grunt-postcss": "^0.5.5",
"grunt-svgmin": "^2.0.0",
"grunt-usemin": "^3.0.0",
"grunt-wiredep": "^2.0.0",
"jasmine-core": "^2.3.4",
"inherits": "^2.0.1",
"jit-grunt": "^0.9.1",
"jshint-stylish": "^1.0.0",
"karma": "^0.12.37",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.0",
"load-grunt-tasks": "^3.1.0",
"phantomjs": "^1.9.17",
"lru-cache": "^4.0.1",
"readable-stream": "^2.1.4",
"sigmund": "^1.0.1",
"time-grunt": "^1.0.0"
},
"engines": {
Expand Down

0 comments on commit b48436e

Please sign in to comment.