diff --git a/.gitignore b/.gitignore index f95117913f..226f983c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .DS_Store +.nodemonignore +.sass-cache/ node_modules/ public/lib +public/css \ No newline at end of file diff --git a/README.md b/README.md index 376aa18020..2c7e657e0d 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,19 @@ See the [config](config/) folder and especially the [config.js](config/config.js The quickest way to get started with MEAN is to clone the project and utilize it like this: - Install npm (server side) dependencies: + Install dependencies: $ npm install - Install bower (client side) dependencies: + Start the server: - $ bower install + $ grunt - Start the server: + When not using grunt you can use: $ node server - - Then open a browser and go to: + + Then open a browser and go to: http://localhost:3000 diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index f26e33f216..f63a42b865 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -17,3 +17,6 @@ script(type='text/javascript', src='js/controllers/articles.js') script(type='text/javascript', src='js/controllers/index.js') script(type='text/javascript', src='js/controllers/header.js') script(type='text/javascript', src='js/init.js') + +//livereload script rendered +script(type='text/javascript', src='http://localhost:35729/livereload.js') diff --git a/gruntfile.js b/gruntfile.js new file mode 100644 index 0000000000..54bea2b314 --- /dev/null +++ b/gruntfile.js @@ -0,0 +1,87 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + watch: { + html: { + files: ['public/views/**'], + options: { + livereload: true, + }, + }, + js: { + files: ['public/js/**'], + options: { + livereload: true, + }, + + }, + css: { + files: ['public/sass/**'], + tasks: ['compass'], + options: { + livereload: true, + }, + } + }, + jshint: { + all: ['gruntfile.js'] + }, + compass: { // Task + dist: { // Target + options: { // Target options + sassDir: 'public/sass', + cssDir: 'public/css', + environment: 'production' + } + }, + dev: { // Another target + options: { + sassDir: 'public/sass', + cssDir: 'public/css' + } + } + }, + nodemon: { + dev: { + options: { + file: 'server.js', + args: [], + ignoredFiles: ['README.md', 'node_modules/**', '.DS_Store'], + watchedExtensions: ['js'], + watchedFolders: ['app', 'config'], + debug: true, + delayTime: 1, + env: { + PORT: 3000 + }, + cwd: __dirname + } + }, + exec: { + options: { + exec: 'less' + } + } + }, + concurrent: { + target: { + tasks: ['nodemon', 'watch'], + options: { + logConcurrentOutput: true + } + } + } + }); + + // Load NPM tasks + grunt.loadNpmTasks('grunt-contrib-compass'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-nodemon'); + grunt.loadNpmTasks('grunt-concurrent'); + + // Default task(s). + grunt.registerTask('default', ['jshint', 'compass', 'concurrent:target']); +}; \ No newline at end of file diff --git a/package.json b/package.json index d79a21d0c4..001a2f6a9f 100755 --- a/package.json +++ b/package.json @@ -1,40 +1,45 @@ { - "name": "mean" - , "description": "Mongo" - , "version": "1.0.0" - , "private": false - , "author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support)." - , "engines": { - "node": "0.10.x" - , "npm": "1.2.x" - } - , "scripts": { - "start": "NODE_ENV=development ./node_modules/.bin/nodemon server.js", - "test": "NODE_ENV=test ./node_modules/.bin/mocha --reporter spec test/test-*.js" - } - , "dependencies": { - "express": "latest" - , "jade": "latest" - , "mongoose": "latest" - , "connect-mongo": "latest" - , "connect-flash": "latest" - , "passport": "latest" - , "passport-local": "latest" - , "passport-facebook": "latest" - , "passport-twitter": "latest" - , "passport-github": "latest" - , "passport-google-oauth": "latest" - , "underscore": "latest" - , "async": "latest" - , "view-helpers": "latest" - , "forever": "latest" - , "mean-logger": "latest" - , "bower": "latest" + "name": "mean", + "description": "Mongo", + "version": "1.0.0", + "private": false, + "author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support).", + "engines": { + "node": "0.10.x", + "npm": "1.2.x" + }, + "scripts": { + "start": "NODE_ENV=development ./node_modules/.bin/nodemon server.js", + "test": "NODE_ENV=test ./node_modules/.bin/mocha --reporter spec test/test-*.js", + "postinstall": "./node_modules/bower/bin/bower install" + }, + "dependencies": { + "express": "latest", + "jade": "latest", + "mongoose": "latest", + "connect-mongo": "latest", + "connect-flash": "latest", + "passport": "latest", + "passport-local": "latest", + "passport-facebook": "latest", + "passport-twitter": "latest", + "passport-github": "latest", + "passport-google-oauth": "latest", + "underscore": "latest", + "async": "latest", + "view-helpers": "latest", + "mean-logger": "latest" + }, + "devDependencies": { + "supertest": "latest", + "should": "latest", + "mocha": "latest", + "bower": "latest", + "grunt": "~0.4.1", + "grunt-contrib-compass": "~0.3.0", + "grunt-contrib-watch": "~0.4.4", + "grunt-contrib-jshint": "~0.6.0", + "grunt-nodemon": "0.0.8", + "grunt-concurrent": "~0.3.0" } - , "devDependencies": { - "supertest": "latest" - , "should": "latest" - , "mocha": "latest" - , "nodemon": "latest" - } -} +} \ No newline at end of file diff --git a/public/css/views/articles.css b/public/css/views/articles.css deleted file mode 100644 index 247bfc26ba..0000000000 --- a/public/css/views/articles.css +++ /dev/null @@ -1,11 +0,0 @@ -h1 { - text-align: center; -} - -ul { - list-style: none; -} - -li:not(:last-child) { - border-bottom: 1px solid #ccc; -} \ No newline at end of file diff --git a/public/css/views/index.css b/public/css/views/index.css deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/public/css/common.css b/public/sass/common.scss old mode 100755 new mode 100644 similarity index 100% rename from public/css/common.css rename to public/sass/common.scss diff --git a/public/sass/views/articles.scss b/public/sass/views/articles.scss new file mode 100644 index 0000000000..0e417dfe6d --- /dev/null +++ b/public/sass/views/articles.scss @@ -0,0 +1,9 @@ +h1 { + text-align: center; +} + +ul.articles { + li:not(:last-child) { + border-bottom: 1px solid #ccc; + } +} \ No newline at end of file diff --git a/public/views/articles/list.html b/public/views/articles/list.html index 5fbfb0f9ce..40b4fba8f1 100644 --- a/public/views/articles/list.html +++ b/public/views/articles/list.html @@ -1,5 +1,5 @@
-