From b400face73b1a7bdf6530607dcb79289a192d84b Mon Sep 17 00:00:00 2001 From: MangeshMp Date: Thu, 21 May 2015 22:58:10 -0700 Subject: [PATCH] Included all the changes. --- .gitignore | 1 + gruntfile.js | 448 +++++++++++++++++++++++++++------------------------ package.json | 192 +++++++++++----------- 3 files changed, 333 insertions(+), 308 deletions(-) diff --git a/.gitignore b/.gitignore index 90fc5a6fdf..2d79f14f72 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ public/dist/ .bower-*/ .idea/ uploads +coverage/ modules/users/client/img/profile/uploads diff --git a/gruntfile.js b/gruntfile.js index ea4eb0d88e..d02d990ca8 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -4,230 +4,252 @@ * Module dependencies. */ var _ = require('lodash'), - defaultAssets = require('./config/assets/default'), - testAssets = require('./config/assets/test'); + defaultAssets = require('./config/assets/default'), + testAssets = require('./config/assets/test'); module.exports = function (grunt) { - // Project Configuration - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - env: { - test: { - NODE_ENV: 'test' - }, - dev: { - NODE_ENV: 'development' - }, - prod: { - NODE_ENV: 'production' - } - }, - watch: { - serverViews: { - files: defaultAssets.server.views, - options: { - livereload: true - } - }, - serverJS: { - files: defaultAssets.server.allJS, - tasks: ['jshint'], - options: { - livereload: true - } - }, - clientViews: { - files: defaultAssets.client.views, - options: { - livereload: true - } - }, - clientJS: { - files: defaultAssets.client.js, - tasks: ['jshint'], - options: { - livereload: true - } - }, - clientCSS: { - files: defaultAssets.client.css, - tasks: ['csslint'], - options: { - livereload: true - } - }, - clientSCSS: { - files: defaultAssets.client.sass, - tasks: ['sass', 'csslint'], - options: { - livereload: true - } - }, - clientLESS: { - files: defaultAssets.client.less, - tasks: ['less', 'csslint'], - options: { - livereload: true - } - } - }, - nodemon: { - dev: { - script: 'server.js', - options: { - nodeArgs: ['--debug'], - ext: 'js,html', - watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config) - } - } - }, - concurrent: { - default: ['nodemon', 'watch'], - debug: ['nodemon', 'watch', 'node-inspector'], - options: { - logConcurrentOutput: true - } - }, - jshint: { - all: { - src: _.union(defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e), - options: { - jshintrc: true, - node: true, - mocha: true, - jasmine: true - } - } - }, - csslint: { - options: { - csslintrc: '.csslintrc' - }, - all: { - src: defaultAssets.client.css - } - }, - ngAnnotate: { - production: { - files: { - 'public/dist/application.js': defaultAssets.client.js - } - } - }, - uglify: { - production: { - options: { - mangle: false - }, - files: { - 'public/dist/application.min.js': 'public/dist/application.js' - } - } - }, - cssmin: { - combine: { - files: { - 'public/dist/application.min.css': defaultAssets.client.css - } - } - }, - sass: { - dist: { - files: [{ - expand: true, - src: defaultAssets.client.sass, - ext: '.css', - rename: function(base, src) { - return src.replace('/scss/', '/css/'); - } - }] - } - }, - less: { - dist: { - files: [{ - expand: true, - src: defaultAssets.client.less, - ext: '.css', - rename: function(base, src) { - return src.replace('/less/', '/css/'); - } - }] - } - }, - 'node-inspector': { - custom: { - options: { - 'web-port': 1337, - 'web-host': 'localhost', - 'debug-port': 5858, - 'save-live-edit': true, - 'no-preload': true, - 'stack-trace-limit': 50, - 'hidden': [] - } - } - }, - mochaTest: { - src: testAssets.tests.server, - options: { - reporter: 'spec' - } - }, - karma: { - unit: { - configFile: 'karma.conf.js' - } - }, - protractor: { - options: { - configFile: 'protractor.conf.js', - keepAlive: true, - noColor: false - }, - e2e: { - options: { - args: {} // Target-specific arguments - } - } - } - }); + // Project Configuration + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + env: { + test: { + NODE_ENV: 'test' + }, + dev: { + NODE_ENV: 'development' + }, + prod: { + NODE_ENV: 'production' + } + }, + watch: { + serverViews: { + files: defaultAssets.server.views, + options: { + livereload: true + } + }, + serverJS: { + files: defaultAssets.server.allJS, + tasks: ['jshint'], + options: { + livereload: true + } + }, + clientViews: { + files: defaultAssets.client.views, + options: { + livereload: true + } + }, + clientJS: { + files: defaultAssets.client.js, + tasks: ['jshint'], + options: { + livereload: true + } + }, + clientCSS: { + files: defaultAssets.client.css, + tasks: ['csslint'], + options: { + livereload: true + } + }, + clientSCSS: { + files: defaultAssets.client.sass, + tasks: ['sass', 'csslint'], + options: { + livereload: true + } + }, + clientLESS: { + files: defaultAssets.client.less, + tasks: ['less', 'csslint'], + options: { + livereload: true + } + } + }, + nodemon: { + dev: { + script: 'server.js', + options: { + nodeArgs: ['--debug'], + ext: 'js,html', + watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config) + } + } + }, + concurrent: { + default: ['nodemon', 'watch'], + debug: ['nodemon', 'watch', 'node-inspector'], + options: { + logConcurrentOutput: true + } + }, + jshint: { + all: { + src: _.union(defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e), + options: { + jshintrc: true, + node: true, + mocha: true, + jasmine: true + } + } + }, + csslint: { + options: { + csslintrc: '.csslintrc' + }, + all: { + src: defaultAssets.client.css + } + }, + ngAnnotate: { + production: { + files: { + 'public/dist/application.js': defaultAssets.client.js + } + } + }, + uglify: { + production: { + options: { + mangle: false + }, + files: { + 'public/dist/application.min.js': 'public/dist/application.js' + } + } + }, + cssmin: { + combine: { + files: { + 'public/dist/application.min.css': defaultAssets.client.css + } + } + }, + sass: { + dist: { + files: [{ + expand: true, + src: defaultAssets.client.sass, + ext: '.css', + rename: function (base, src) { + return src.replace('/scss/', '/css/'); + } + }] + } + }, + less: { + dist: { + files: [{ + expand: true, + src: defaultAssets.client.less, + ext: '.css', + rename: function (base, src) { + return src.replace('/less/', '/css/'); + } + }] + } + }, + 'node-inspector': { + custom: { + options: { + 'web-port': 1337, + 'web-host': 'localhost', + 'debug-port': 5858, + 'save-live-edit': true, + 'no-preload': true, + 'stack-trace-limit': 50, + 'hidden': [] + } + } + }, + mochaTest: { + src: testAssets.tests.server, + options: { + reporter: 'spec' + } + }, + mocha_istanbul: { + coverage: { + src: testAssets.tests.server, + options: { + mask: '*.tests.js', + require: 'server.js' + } + } + }, + istanbul_check_coverage: { + default: { + options: { + coverageFolder: 'coverage*', // will check both coverage folders and merge the coverage results + check: { + lines: 80, + statements: 80 + } + } + } + }, + karma: { + unit: { + configFile: 'karma.conf.js' + } + }, + protractor: { + options: { + configFile: 'protractor.conf.js', + keepAlive: true, + noColor: false + }, + e2e: { + options: { + args: {} // Target-specific arguments + } + } + } + }); - // Load NPM tasks - require('load-grunt-tasks')(grunt); + // Load NPM tasks + require('load-grunt-tasks')(grunt); - // Making grunt default to force in order not to break the project. - grunt.option('force', true); + // Making grunt default to force in order not to break the project. + grunt.option('force', true); - // Connect to the MongoDB instance and load the models - grunt.task.registerTask('mongoose', 'Task that connects to the MongoDB instance and loads the application models.', function() { - // Get the callback - var done = this.async(); + // Connect to the MongoDB instance and load the models + grunt.task.registerTask('mongoose', 'Task that connects to the MongoDB instance and loads the application models.', function () { + // Get the callback + var done = this.async(); - // Use mongoose configuration - var mongoose = require('./config/lib/mongoose.js'); + // Use mongoose configuration + var mongoose = require('./config/lib/mongoose.js'); - // Connect to database - mongoose.connect(function(db) { - done(); - }); - }); + // Connect to database + mongoose.connect(function (db) { + done(); + }); + }); - // Lint CSS and JavaScript files. - grunt.registerTask('lint', ['sass', 'less', 'jshint', 'csslint']); + // Lint CSS and JavaScript files. + grunt.registerTask('lint', ['sass', 'less', 'jshint', 'csslint']); - // Lint project files and minify them into two production files. - grunt.registerTask('build', ['env:dev', 'lint', 'ngAnnotate', 'uglify', 'cssmin']); + // Lint project files and minify them into two production files. + grunt.registerTask('build', ['env:dev', 'lint', 'ngAnnotate', 'uglify', 'cssmin']); - // Run the project tests - grunt.registerTask('test', ['env:test', 'mongoose', 'mochaTest', 'karma:unit']); + // Run the project tests + grunt.registerTask('test', ['test:server', 'test:client']); + grunt.registerTask('test:server', ['env:test', 'mongoose', 'mochaTest', 'mocha_istanbul', 'istanbul_check_coverage']); + grunt.registerTask('test:client', ['env:test', 'karma:unit']); - // Run the project in development mode - grunt.registerTask('default', ['env:dev', 'lint', 'concurrent:default']); + // Run the project in development mode + grunt.registerTask('default', ['env:dev', 'lint', 'concurrent:default']); - // Run the project in debug mode - grunt.registerTask('debug', ['env:dev', 'lint', 'concurrent:debug']); + // Run the project in debug mode + grunt.registerTask('debug', ['env:dev', 'lint', 'concurrent:debug']); - // Run the project in production mode - grunt.registerTask('prod', ['build', 'env:prod', 'concurrent:default']); + // Run the project in production mode + grunt.registerTask('prod', ['build', 'env:prod', 'concurrent:default']); }; diff --git a/package.json b/package.json index aabab5ab59..8044bb1a45 100644 --- a/package.json +++ b/package.json @@ -1,97 +1,99 @@ { - "name": "meanjs", - "description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.", - "version": "0.4.0", - "private": false, - "author": "https://github.com/meanjs/mean/graphs/contributors", - "repository": { - "type": "git", - "url": "https://github.com/meanjs/mean.git" - }, - "engines": { - "node": "0.10.x", - "npm": "1.4.x" - }, - "scripts": { - "start": "grunt", - "test": "grunt test", - "postinstall": "bower install --config.interactive=false" - }, - "dependencies": { - "express": "~4.12.3", - "express-session": "~1.10.4", - "serve-favicon": "~2.1.6", - "body-parser": "~1.12.2", - "cookie-parser": "~1.3.2", - "compression": "~1.4.3", - "method-override": "~2.3.0", - "morgan": "~1.5.2", - "multer": "0.1.6", - "connect-mongo": "~0.8.0", - "connect-flash": "~0.1.1", - "helmet": "~0.7.1", - "consolidate": "~0.11.0", - "swig": "~1.4.1", - "mongoose": "~3.8.8", - "passport": "~0.2.0", - "passport-local": "~1.0.0", - "passport-facebook": "~1.0.2", - "passport-twitter": "~1.0.2", - "passport-linkedin": "~0.1.3", - "passport-google-oauth": "~0.1.5", - "passport-github": "~0.1.5", - "acl": "~0.4.4", - "socket.io": "~1.1.0", - "lodash": "~2.4.1", - "forever": "~0.11.0", - "bower": "~1.3.8", - "grunt-cli": "~0.1.13", - "chalk": "~0.5.1", - "glob": "~5.0.0", - "async": "~0.9.0", - "nodemailer": "~1.3.0" - }, - "devDependencies": { - "supertest": "~0.14.0", - "should": "~4.1.0", - "grunt-env": "~0.4.1", - "grunt-node-inspector": "~0.1.3", - "grunt-contrib-watch": "~0.6.1", - "grunt-contrib-jshint": "~0.10.0", - "grunt-contrib-csslint": "^0.3.1", - "grunt-ng-annotate": "~0.4.0", - "grunt-contrib-uglify": "~0.6.0", - "grunt-contrib-cssmin": "~0.10.0", - "grunt-nodemon": "~0.3.0", - "grunt-concurrent": "~1.0.0", - "grunt-mocha-test": "~0.12.1", - "grunt-karma": "~0.9.0", - "grunt-protractor-runner": "1.1.4", - "grunt-contrib-sass": "~0.8.1", - "grunt-contrib-less": "~0.12.0", - "load-grunt-tasks": "~1.0.0", - "gulp": "~3.8.9", - "run-sequence": "~1.0.1", - "gulp-rename": "~1.2.0", - "gulp-concat": "~2.4.1", - "gulp-nodemon": "~1.0.4", - "gulp-livereload": "~2.1.1", - "gulp-jshint": "~1.8.6", - "gulp-csslint": "~0.1.5", - "gulp-ng-annotate": "~0.3.3", - "gulp-uglify": "~1.0.1", - "gulp-cssmin": "~0.1.6", - "gulp-mocha": "~1.1.1", - "gulp-karma": "~0.0.4", - "gulp-protractor": "~0.0.11", - "gulp-sass": "~1.3.3", - "gulp-less": "~1.3.6", - "gulp-load-plugins": "~0.7.0", - "karma": "~0.12.0", - "karma-jasmine": "~0.2.1", - "karma-coverage": "~0.2.0", - "karma-chrome-launcher": "~0.1.2", - "karma-firefox-launcher": "~0.1.3", - "karma-phantomjs-launcher": "~0.1.2" - } + "name": "meanjs", + "description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.", + "version": "0.4.0", + "private": false, + "author": "https://github.com/meanjs/mean/graphs/contributors", + "repository": { + "type": "git", + "url": "https://github.com/meanjs/mean.git" + }, + "engines": { + "node": "0.10.x", + "npm": "1.4.x" + }, + "scripts": { + "start": "grunt", + "test": "grunt test", + "postinstall": "bower install --config.interactive=false" + }, + "dependencies": { + "express": "~4.12.3", + "express-session": "~1.10.4", + "serve-favicon": "~2.1.6", + "body-parser": "~1.12.2", + "cookie-parser": "~1.3.2", + "compression": "~1.4.3", + "method-override": "~2.3.0", + "morgan": "~1.5.2", + "multer": "0.1.6", + "connect-mongo": "~0.8.0", + "connect-flash": "~0.1.1", + "helmet": "~0.7.1", + "consolidate": "~0.11.0", + "swig": "~1.4.1", + "mongoose": "~3.8.8", + "passport": "~0.2.0", + "passport-local": "~1.0.0", + "passport-facebook": "~1.0.2", + "passport-twitter": "~1.0.2", + "passport-linkedin": "~0.1.3", + "passport-google-oauth": "~0.1.5", + "passport-github": "~0.1.5", + "acl": "~0.4.4", + "socket.io": "~1.1.0", + "lodash": "~2.4.1", + "forever": "~0.11.0", + "bower": "~1.3.8", + "grunt-cli": "~0.1.13", + "chalk": "~0.5.1", + "glob": "~5.0.0", + "async": "~0.9.0", + "nodemailer": "~1.3.0" + }, + "devDependencies": { + "supertest": "~0.14.0", + "should": "~4.1.0", + "grunt-env": "~0.4.1", + "grunt-node-inspector": "~0.1.3", + "grunt-contrib-watch": "~0.6.1", + "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-csslint": "^0.3.1", + "grunt-ng-annotate": "~0.4.0", + "grunt-contrib-uglify": "~0.6.0", + "grunt-contrib-cssmin": "~0.10.0", + "grunt-nodemon": "~0.3.0", + "grunt-concurrent": "~1.0.0", + "grunt-mocha-test": "~0.12.1", + "grunt-karma": "~0.9.0", + "grunt-protractor-runner": "1.1.4", + "grunt-contrib-sass": "~0.8.1", + "grunt-contrib-less": "~0.12.0", + "load-grunt-tasks": "~1.0.0", + "gulp": "~3.8.9", + "run-sequence": "~1.0.1", + "gulp-rename": "~1.2.0", + "gulp-concat": "~2.4.1", + "gulp-nodemon": "~1.0.4", + "gulp-livereload": "~2.1.1", + "gulp-jshint": "~1.8.6", + "gulp-csslint": "~0.1.5", + "gulp-ng-annotate": "~0.3.3", + "gulp-uglify": "~1.0.1", + "gulp-cssmin": "~0.1.6", + "gulp-mocha": "~1.1.1", + "gulp-karma": "~0.0.4", + "gulp-protractor": "~0.0.11", + "gulp-sass": "~1.3.3", + "gulp-less": "~1.3.6", + "gulp-load-plugins": "~0.7.0", + "karma": "~0.12.0", + "karma-jasmine": "~0.2.1", + "karma-coverage": "~0.2.0", + "karma-chrome-launcher": "~0.1.2", + "karma-firefox-launcher": "~0.1.3", + "karma-phantomjs-launcher": "~0.1.2", + "grunt-mocha-istanbul": "^2.4.0", + "istanbul": "^0.3.14" + } }