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

app/index.js

Lines changed: 2 additions & 1 deletion
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

app/templates/Gruntfile.js

Lines changed: 54 additions & 5 deletions
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: {

app/templates/_package.json

Lines changed: 4 additions & 3 deletions
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",
Lines changed: 22 additions & 0 deletions
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;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.trash
2+
color rgb(209, 91, 71)

app/templates/client/app/app(css).css

Lines changed: 16 additions & 1 deletion
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

Lines changed: 50 additions & 0 deletions
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
Lines changed: 25 additions & 0 deletions
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

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

Lines changed: 3 additions & 20 deletions
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
});

app/templates/server/api/thing/thing.controller.js

Lines changed: 1 addition & 1 deletion
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.'

0 commit comments

Comments
 (0)