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

Commit 3340268

Browse files
author
Roie Schwaber-Cohen
committed
Added grunt and nodemon
1 parent 69ccd09 commit 3340268

File tree

10 files changed

+152
-56
lines changed

10 files changed

+152
-56
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.DS_Store
2+
.nodemonignore
3+
.sass-cache/
24
node_modules/
35
public/lib
6+
public/css

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ See the [config](config/) folder and especially the [config.js](config/config.js
2323

2424
The quickest way to get started with MEAN is to clone the project and utilize it like this:
2525

26-
Install npm (server side) dependencies:
26+
Install dependencies:
2727

2828
$ npm install
2929

30-
Install bower (client side) dependencies:
30+
Start the server:
3131

32-
$ bower install
32+
$ grunt
3333

34-
Start the server:
34+
When not using grunt you can use:
3535

3636
$ node server
37-
38-
Then open a browser and go to:
37+
38+
Then open a browser and go to:
3939

4040
http://localhost:3000
4141

app/views/includes/foot.jade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ script(type='text/javascript', src='js/controllers/articles.js')
1717
script(type='text/javascript', src='js/controllers/index.js')
1818
script(type='text/javascript', src='js/controllers/header.js')
1919
script(type='text/javascript', src='js/init.js')
20+
21+
//livereload script rendered
22+
script(type='text/javascript', src='http://localhost:35729/livereload.js')

gruntfile.js

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
module.exports = function(grunt) {
2+
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
watch: {
7+
html: {
8+
files: ['public/views/**'],
9+
options: {
10+
livereload: true,
11+
},
12+
},
13+
js: {
14+
files: ['public/js/**'],
15+
options: {
16+
livereload: true,
17+
},
18+
19+
},
20+
css: {
21+
files: ['public/sass/**'],
22+
tasks: ['compass'],
23+
options: {
24+
livereload: true,
25+
},
26+
}
27+
},
28+
jshint: {
29+
all: ['gruntfile.js']
30+
},
31+
compass: { // Task
32+
dist: { // Target
33+
options: { // Target options
34+
sassDir: 'public/sass',
35+
cssDir: 'public/css',
36+
environment: 'production'
37+
}
38+
},
39+
dev: { // Another target
40+
options: {
41+
sassDir: 'public/sass',
42+
cssDir: 'public/css'
43+
}
44+
}
45+
},
46+
nodemon: {
47+
dev: {
48+
options: {
49+
file: 'server.js',
50+
args: [],
51+
ignoredFiles: ['README.md', 'node_modules/**', '.DS_Store'],
52+
watchedExtensions: ['js'],
53+
watchedFolders: ['app', 'config'],
54+
debug: true,
55+
delayTime: 1,
56+
env: {
57+
PORT: 3000
58+
},
59+
cwd: __dirname
60+
}
61+
},
62+
exec: {
63+
options: {
64+
exec: 'less'
65+
}
66+
}
67+
},
68+
concurrent: {
69+
target: {
70+
tasks: ['nodemon', 'watch'],
71+
options: {
72+
logConcurrentOutput: true
73+
}
74+
}
75+
}
76+
});
77+
78+
// Load NPM tasks
79+
grunt.loadNpmTasks('grunt-contrib-compass');
80+
grunt.loadNpmTasks('grunt-contrib-watch');
81+
grunt.loadNpmTasks('grunt-contrib-jshint');
82+
grunt.loadNpmTasks('grunt-nodemon');
83+
grunt.loadNpmTasks('grunt-concurrent');
84+
85+
// Default task(s).
86+
grunt.registerTask('default', ['jshint', 'compass', 'concurrent:target']);
87+
};

package.json

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
11
{
2-
"name": "mean"
3-
, "description": "Mongo"
4-
, "version": "1.0.0"
5-
, "private": false
6-
, "author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support)."
7-
, "engines": {
8-
"node": "0.10.x"
9-
, "npm": "1.2.x"
10-
}
11-
, "scripts": {
12-
"start": "NODE_ENV=development ./node_modules/.bin/nodemon server.js",
13-
"test": "NODE_ENV=test ./node_modules/.bin/mocha --reporter spec test/test-*.js"
14-
}
15-
, "dependencies": {
16-
"express": "latest"
17-
, "jade": "latest"
18-
, "mongoose": "latest"
19-
, "connect-mongo": "latest"
20-
, "connect-flash": "latest"
21-
, "passport": "latest"
22-
, "passport-local": "latest"
23-
, "passport-facebook": "latest"
24-
, "passport-twitter": "latest"
25-
, "passport-github": "latest"
26-
, "passport-google-oauth": "latest"
27-
, "underscore": "latest"
28-
, "async": "latest"
29-
, "view-helpers": "latest"
30-
, "forever": "latest"
31-
, "mean-logger": "latest"
32-
, "bower": "latest"
2+
"name": "mean",
3+
"description": "Mongo",
4+
"version": "1.0.0",
5+
"private": false,
6+
"author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support).",
7+
"engines": {
8+
"node": "0.10.x",
9+
"npm": "1.2.x"
10+
},
11+
"scripts": {
12+
"start": "NODE_ENV=development ./node_modules/.bin/nodemon server.js",
13+
"test": "NODE_ENV=test ./node_modules/.bin/mocha --reporter spec test/test-*.js",
14+
"postinstall": "./node_modules/bower/bin/bower install"
15+
},
16+
"dependencies": {
17+
"express": "latest",
18+
"jade": "latest",
19+
"mongoose": "latest",
20+
"connect-mongo": "latest",
21+
"connect-flash": "latest",
22+
"passport": "latest",
23+
"passport-local": "latest",
24+
"passport-facebook": "latest",
25+
"passport-twitter": "latest",
26+
"passport-github": "latest",
27+
"passport-google-oauth": "latest",
28+
"underscore": "latest",
29+
"async": "latest",
30+
"view-helpers": "latest",
31+
"mean-logger": "latest"
32+
},
33+
"devDependencies": {
34+
"supertest": "latest",
35+
"should": "latest",
36+
"mocha": "latest",
37+
"bower": "latest",
38+
"grunt": "~0.4.1",
39+
"grunt-contrib-compass": "~0.3.0",
40+
"grunt-contrib-watch": "~0.4.4",
41+
"grunt-contrib-jshint": "~0.6.0",
42+
"grunt-nodemon": "0.0.8",
43+
"grunt-concurrent": "~0.3.0"
3344
}
34-
, "devDependencies": {
35-
"supertest": "latest"
36-
, "should": "latest"
37-
, "mocha": "latest"
38-
, "nodemon": "latest"
39-
}
40-
}
45+
}

public/css/views/articles.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

public/css/views/index.css

Whitespace-only changes.
File renamed without changes.

public/sass/views/articles.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
h1 {
2+
text-align: center;
3+
}
4+
5+
ul.articles {
6+
li:not(:last-child) {
7+
border-bottom: 1px solid #ccc;
8+
}
9+
}

public/views/articles/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section data-ng-controller="ArticlesController" data-ng-init="find()">
2-
<ul class="unstyled">
2+
<ul class="articles unstyled">
33
<li data-ng-repeat="article in articles">
44
<span>{{article.created | date:'medium'}}</span> /
55
<span>{{article.user.name}}</span>

0 commit comments

Comments
 (0)