Skip to content

Commit 17e88dc

Browse files
committed
Merge branch 'master' into pr/342
2 parents 8dc2f1e + 909af64 commit 17e88dc

File tree

18 files changed

+202
-52
lines changed

18 files changed

+202
-52
lines changed

Diff for: app/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
7979
name: "stylesheet",
8080
default: 1,
8181
message: "What would you like to write stylesheets with?",
82-
choices: [ "CSS", "Sass", "Less"],
82+
choices: [ "CSS", "Sass", "Stylus", "Less"],
8383
filter: function( val ) { return val.toLowerCase(); }
8484
}, {
8585
type: "list",
@@ -202,6 +202,7 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
202202
if(this.filters['html']) extensions.push('html');
203203
if(this.filters['jade']) extensions.push('jade');
204204
if(this.filters['css']) extensions.push('css');
205+
if(this.filters['stylus']) extensions.push('styl');
205206
if(this.filters['sass']) extensions.push('scss');
206207
if(this.filters['less']) extensions.push('less');
207208

Diff for: app/templates/Gruntfile.js

+54-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,17 @@ module.exports = function (grunt) {
7070
'<%%= yeoman.client %>/{app,components}/**/*.mock.js'
7171
],
7272
tasks: ['newer:jshint:all', 'karma']
73-
},<% if(filters.sass) { %>
73+
},<% if(filters.stylus) { %>
74+
injectStylus: {
75+
files: [
76+
'<%%= yeoman.client %>/{app,components}/**/*.styl'],
77+
tasks: ['injector:stylus']
78+
},
79+
stylus: {
80+
files: [
81+
'<%%= yeoman.client %>/{app,components}/**/*.styl'],
82+
tasks: ['stylus', 'autoprefixer']
83+
},<% } %><% if(filters.sass) { %>
7484
injectSass: {
7585
files: [
7686
'<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
@@ -394,13 +404,15 @@ module.exports = function (grunt) {
394404
concurrent: {
395405
server: [<% if(filters.coffee) { %>
396406
'coffee',<% } %><% if(filters.jade) { %>
397-
'jade',<% } %><% if(filters.sass) { %>
407+
'jade',<% } %><% if(filters.stylus) { %>
408+
'stylus',<% } %><% if(filters.sass) { %>
398409
'sass',<% } %><% if(filters.less) { %>
399410
'less',<% } %>
400411
],
401412
test: [<% if(filters.coffee) { %>
402413
'coffee',<% } %><% if(filters.jade) { %>
403-
'jade',<% } %><% if(filters.sass) { %>
414+
'jade',<% } %><% if(filters.stylus) { %>
415+
'stylus',<% } %><% if(filters.sass) { %>
404416
'sass',<% } %><% if(filters.less) { %>
405417
'less',<% } %>
406418
],
@@ -415,7 +427,8 @@ module.exports = function (grunt) {
415427
},
416428
dist: [<% if(filters.coffee) { %>
417429
'coffee',<% } %><% if(filters.jade) { %>
418-
'jade',<% } %><% if(filters.sass) { %>
430+
'jade',<% } %><% if(filters.stylus) { %>
431+
'stylus',<% } %><% if(filters.sass) { %>
419432
'sass',<% } %><% if(filters.less) { %>
420433
'less',<% } %>
421434
'imagemin',
@@ -499,6 +512,23 @@ module.exports = function (grunt) {
499512
ext: '.js'
500513
}]
501514
}
515+
},<% } %><% if(filters.stylus) { %>
516+
517+
// Compiles Stylus to CSS
518+
stylus: {
519+
server: {
520+
options: {
521+
paths: [
522+
'<%%= yeoman.client %>/bower_components',
523+
'<%%= yeoman.client %>/app',
524+
'<%%= yeoman.client %>/components'
525+
],
526+
"include css": true
527+
},
528+
files: {
529+
'.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.styl'
530+
}
531+
}
502532
},<% } %><% if(filters.sass) { %>
503533

504534
// Compiles Sass to CSS
@@ -557,7 +587,26 @@ module.exports = function (grunt) {
557587
'!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js']
558588
]
559589
}
560-
},<% if(filters.sass) { %>
590+
},<% if(filters.stylus) { %>
591+
592+
// Inject component styl into app.styl
593+
stylus: {
594+
options: {
595+
transform: function(filePath) {
596+
filePath = filePath.replace('/client/app/', '');
597+
filePath = filePath.replace('/client/components/', '');
598+
return '@import \'' + filePath + '\';';
599+
},
600+
starttag: '// injector',
601+
endtag: '// endinjector'
602+
},
603+
files: {
604+
'<%%= yeoman.client %>/app/app.styl': [
605+
'<%%= yeoman.client %>/{app,components}/**/*.styl',
606+
'!<%%= yeoman.client %>/app/app.styl'
607+
]
608+
}
609+
},<% } %><% if(filters.sass) { %>
561610

562611
// Inject component scss into app.scss
563612
sass: {

Diff for: app/templates/_package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"passport-google-oauth": "latest",<% } %>
2626
"composable-middleware": "^0.3.0",
2727
"connect-mongo": "^0.4.1"<% if(filters.socketio) { %>,
28-
"socket.io": "~0.9.16",
28+
"socket.io": "~1.0.6",
2929
"socketio-jwt": "^2.0.2"<% } %>
3030
},
3131
"devDependencies": {
@@ -59,8 +59,9 @@
5959
"grunt-protractor-runner": "^0.2.4",
6060
"grunt-asset-injector": "^0.1.0",
6161
"grunt-karma": "~0.8.2",
62-
"grunt-mocha-test": "~0.10.2",<% if (filters.sass) { %>
63-
"grunt-contrib-sass": "^0.7.3",<% } %>
62+
"grunt-mocha-test": "~0.10.2",<% if(filters.sass) { %>
63+
"grunt-contrib-sass": "^0.7.3",<% } %><% if(filters.stylus) { %>
64+
"grunt-contrib-stylus": "latest",<% } %>
6465
"jit-grunt": "^0.5.0",
6566
"time-grunt": "~0.3.1",
6667
"grunt-express-server": "~0.4.17",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Social buttons
2+
// --------------------------------------------------
3+
4+
.btn-facebook
5+
color: #fff;
6+
background-color: #3B5998;
7+
border-color: #133783;
8+
9+
.btn-twitter
10+
color: #fff;
11+
background-color: #2daddc;
12+
border-color: #0271bf;
13+
14+
.btn-github
15+
color: #fff;
16+
background-color: #fafafa;
17+
border-color: #ccc;
18+
19+
.btn-google-plus
20+
color: #fff;
21+
background-color: #dd4b39;
22+
border-color: #c53727;
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.trash
2+
color rgb(209, 91, 71)

Diff for: app/templates/client/app/app(css).css

+16-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,24 @@
1010
url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
1111
url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
1212
url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
13+
}<% } %>
14+
15+
/**
16+
*Font Awesome Fonts
17+
*/
18+
19+
@font-face {
20+
font-family: 'FontAwesome';
21+
src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?v=4.1.0');
22+
src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'),
23+
url('../bower_components/font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'),
24+
url('../bower_components/font-awesome/fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'),
25+
url('../bower_components/font-awesome/fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
26+
font-weight: normal;
27+
font-style: normal;
1328
}
1429

15-
<% } %>/**
30+
/**
1631
* App-wide Styles
1732
*/
1833

Diff for: app/templates/client/app/app(stylus).styl

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
@import "bootstrap/dist/css/bootstrap.css"
2+
@import "font-awesome/css/font-awesome.css"
3+
4+
//
5+
// Bootstrap Fonts
6+
//
7+
8+
@font-face
9+
font-family: 'Glyphicons Halflings'
10+
src: url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot')
11+
src: url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
12+
url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
13+
url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
14+
url('../bower_components/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
15+
16+
//
17+
// Font Awesome Fonts
18+
//
19+
20+
@font-face
21+
font-family: 'FontAwesome'
22+
src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?v=4.1.0')
23+
src: url('../bower_components/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'),
24+
url('../bower_components/font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'),
25+
url('../bower_components/font-awesome/fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'),
26+
url('../bower_components/font-awesome/fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
27+
font-weight: normal
28+
font-style: normal
29+
30+
//
31+
// App-wide Styles
32+
//
33+
34+
.browsehappy
35+
background #ccc
36+
color #000
37+
margin 0.2em 0
38+
padding 0.2em 0
39+
40+
// Responsive: Portrait tablets and up
41+
@media screen and (min-width: 768px)
42+
.container
43+
max-width 730px
44+
45+
// Component styles are injected through grunt
46+
// injector
47+
@import "account/login/login"
48+
@import "admin/admin"
49+
@import "main/main"
50+
// endinjector

Diff for: app/templates/client/app/main/main(stylus).styl

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.thing-form
2+
margin 20px 0
3+
4+
#banner
5+
border-bottom none
6+
margin-top -20px
7+
8+
#banner h1
9+
font-size 60px
10+
letter-spacing -1px
11+
line-height 1
12+
13+
.hero-unit
14+
background #4393B9
15+
color #F5F5F5
16+
padding 30px 15px
17+
position relative
18+
text-align center
19+
text-shadow 0 1px 0 rgba(0, 0, 0, 0.1)
20+
21+
.footer
22+
border-top 1px solid #E5E5E5
23+
margin-top 70px
24+
padding 30px 0
25+
text-align center

Diff for: app/templates/client/components/socket(socketio)/socket.service.js

+3-20
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,13 @@
33

44
angular.module('<%= scriptAppName %>')
55
.factory('socket', function(socketFactory) {
6-
var retryInterval = 5000;
7-
var retryTimer;
86

9-
clearInterval(retryTimer);
10-
11-
var ioSocket = io.connect('', {
12-
'force new connection': true,
13-
14-
'max reconnection attempts': Infinity,
15-
16-
'reconnection limit': 10 * 1000,
17-
18-
// Send auth token on connection
7+
// socket.io now auto-configures its connection when we ommit a connection url
8+
var ioSocket = io(null, {
9+
// Send auth token on connection, you will need to DI the Auth service above
1910
// 'query': 'token=' + Auth.getToken()
2011
});
2112

22-
retryTimer = setInterval(function () {
23-
if (!ioSocket.socket.connected &&
24-
!ioSocket.socket.connecting &&
25-
!ioSocket.socket.reconnecting) {
26-
ioSocket.connect();
27-
}
28-
}, retryInterval);
29-
3013
var socket = socketFactory({
3114
ioSocket: ioSocket
3215
});

Diff for: app/templates/server/api/thing/thing.controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports.index = function(req, res) {<% if (!filters.mongoose) { %>
1717
res.json([
1818
{
1919
name : 'Development Tools',
20-
info : 'Integration with popular tools such as Bower, Grunt, Karma, Mocha, JSHint, Node Inspector, Livereload, Protractor, Jade, Sass, CoffeeScript, and Less.'
20+
info : 'Integration with popular tools such as Bower, Grunt, Karma, Mocha, JSHint, Node Inspector, Livereload, Protractor, Jade, Stylus, Sass, CoffeeScript, and Less.'
2121
}, {
2222
name : 'Server and Client integration',
2323
info : 'Built with a powerful and fun stack: MongoDB, Express, AngularJS, and Node.'

Diff for: app/templates/server/api/user(auth)/user.model.spec.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
'use strict';
22

33
var should = require('should');
4+
var app = require('../../app');
45
var User = require('./user.model');
56

6-
var user;
7+
var user = new User({
8+
provider: 'local',
9+
name: 'Fake User',
10+
11+
password: 'password'
12+
});
713

814
describe('User Model', function() {
9-
before(function(done) {
10-
user = new User({
11-
provider: 'local',
12-
name: 'Fake User',
13-
14-
password: 'password'
15-
});
16-
15+
beforeEach(function(done) {
1716
// Clear users before testing
1817
User.remove().exec().then(function() {
1918
done();

Diff for: app/templates/server/config/_local.env.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ module.exports = {
1212
TWITTER_ID: "app-id",
1313
TWITTER_SECRET: "secret",
1414
GOOGLE_ID: "app-id",
15-
GOOGLE_SECRET: "secret"
15+
GOOGLE_SECRET: "secret",
16+
// Control debug level for modules using visionmedia/debug
17+
// DEBUG: ""
1618
};

Diff for: app/templates/server/config/seed(mongoose).js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var Thing = require('../api/thing/thing.model');
1111
Thing.find({}).remove(function() {
1212
Thing.create({
1313
name : 'Development Tools',
14-
info : 'Integration with popular tools such as Bower, Grunt, Karma, Mocha, JSHint, Node Inspector, Livereload, Protractor, Jade, Sass, CoffeeScript, and Less.'
14+
info : 'Integration with popular tools such as Bower, Grunt, Karma, Mocha, JSHint, Node Inspector, Livereload, Protractor, Jade, Stylus, Sass, CoffeeScript, and Less.'
1515
}, {
1616
name : 'Server and Client integration',
1717
info : 'Built with a powerful and fun stack: MongoDB, Express, AngularJS, and Node.'

Diff for: app/templates/server/config/socketio(socketio).js

+6-8
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ function onConnect(socket) {
2222
}
2323

2424
module.exports = function (socketio) {
25-
// The amount of detail that the server should output to the logger.
26-
// 0 - error
27-
// 1 - warn
28-
// 2 - info
29-
// 3 - debug
30-
socketio.set('log level', 2);
25+
// socket.io (v1.x.x) is powered by debug.
26+
// In order to see all the debug output, set DEBUG (in server/config/local.env.js) to including the desired scope.
27+
//
28+
// ex: DEBUG: "http*,socket.io:socket"
3129

3230
// We can authenticate socket.io users and access their token through socket.handshake.decoded_token
3331
//
3432
// 1. You will need to send the token in `client/components/socket/socket.service.js`
3533
//
3634
// 2. Require authentication here:
37-
// socketio.set('authorization', require('socketio-jwt').authorize({
35+
// socketio.use(require('socketio-jwt').authorize({
3836
// secret: config.secrets.session,
3937
// handshake: true
4038
// }));
4139

42-
socketio.sockets.on('connection', function (socket) {
40+
socketio.on('connection', function (socket) {
4341
socket.address = socket.handshake.address.address + ':' +
4442
socket.handshake.address.port;
4543
socket.connectedAt = new Date();

0 commit comments

Comments
 (0)