Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Added grunt and nodemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Roie Schwaber-Cohen committed Aug 6, 2013
1 parent 69ccd09 commit 3340268
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
.nodemonignore
.sass-cache/
node_modules/
public/lib
public/css
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions app/views/includes/foot.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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')
87 changes: 87 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -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']);
};
81 changes: 43 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
11 changes: 0 additions & 11 deletions public/css/views/articles.css

This file was deleted.

Empty file removed public/css/views/index.css
Empty file.
File renamed without changes.
9 changes: 9 additions & 0 deletions public/sass/views/articles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
h1 {
text-align: center;
}

ul.articles {
li:not(:last-child) {
border-bottom: 1px solid #ccc;
}
}
2 changes: 1 addition & 1 deletion public/views/articles/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section data-ng-controller="ArticlesController" data-ng-init="find()">
<ul class="unstyled">
<ul class="articles unstyled">
<li data-ng-repeat="article in articles">
<span>{{article.created | date:'medium'}}</span> /
<span>{{article.user.name}}</span>
Expand Down

0 comments on commit 3340268

Please sign in to comment.