Skip to content

Commit 05d8a37

Browse files
committed
Merge branch 'master' of github.com:angular-fullstack/generator-angular-fullstack into canary
2 parents 78426f1 + 221f7a4 commit 05d8a37

22 files changed

+69
-41
lines changed

Diff for: .npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
angular-fullstack-deps
22
test
3+
.idea

Diff for: angular-fullstack-deps

Diff for: app/generator.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ export default class Generator extends Base {
144144

145145
this.scriptExt = answers.transpiler === 'ts' ? 'ts' : 'js';
146146
this.templateExt = answers.markup;
147-
this.styleExt = answers.stylesheet === 'sass' ? 'scss' : answers.stylesheet;
147+
148+
var styleExt = {sass: 'scss', stylus: 'styl'}[answers.stylesheet];
149+
this.styleExt = styleExt ? styleExt : answers.stylesheet;
148150

149151
cb();
150152
}.bind(this));

Diff for: app/templates/Gruntfile(grunt).js

+4-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ module.exports = function (grunt) {
161161
},
162162
src: ['<%%= yeoman.server %>/**/*.{spec,integration}.js']
163163
},
164-
all: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock).js'],
164+
all: ['<%%= yeoman.client %>/{app,components}/**/!(*.spec|*.mock|app.constant).js'],
165165
test: {
166166
src: ['<%%= yeoman.client %>/{app,components}/**/*.{spec,mock}.js']
167167
}
@@ -424,7 +424,8 @@ module.exports = function (grunt) {
424424
dest: '<%%= yeoman.dist %>',
425425
src: [
426426
'package.json',
427-
'<%%= yeoman.server %>/**/*'
427+
'<%%= yeoman.server %>/**/*',
428+
'!<%%= yeoman.server %>/config/local.env.sample.js'
428429
]
429430
}]
430431
},
@@ -636,7 +637,7 @@ module.exports = function (grunt) {
636637
files: [{
637638
expand: true,
638639
cwd: '<%%= yeoman.server %>',
639-
src: ['**/*.{js,json}'],
640+
src: ['**/*.js'],
640641
dest: '<%%= yeoman.dist %>/<%%= yeoman.server %>'
641642
}]
642643
}

Diff for: app/templates/_bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"angular-cookies": "~1.4.0",
1313
"angular-sanitize": "~1.4.0",<% if (filters.ngroute) { %>
1414
"angular-route": "~1.4.0",<% } if (filters.uibootstrap) { %>
15-
"angular-bootstrap": "~0.13.0",<% } %>
15+
"angular-bootstrap": "~1.1.2",<% } %>
1616
"font-awesome": ">=4.1.0",
1717
"lodash": "~2.4.1"<% if(filters.socketio) { %>,
1818
"angular-socket-io": "~0.7.0"<% } if (filters.uirouter) { %>,

Diff for: app/templates/_package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@
150150
"karma-ng-jade2js-preprocessor": "^0.2.0",<% } else { %>
151151
"karma-ng-html2js-preprocessor": "~0.2.0",<% } %>
152152
"karma-spec-reporter": "~0.0.20",
153-
"sinon-chai": "^2.8.0",<% if (filters.mocha) { %>
154-
"mocha": "^2.2.5",
153+
"sinon-chai": "^2.8.0",
154+
"mocha": "^2.2.5",<% if (filters.mocha) { %>
155155
"karma-mocha": "^0.2.0",
156156
"karma-chai-plugins": "^0.6.0",<% } if (filters.jasmine) { %>
157157
"jasmine-core": "^2.3.4",

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

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
}
2525
<% } %>
2626
// injector
27-
@import 'account/login/login.less';
2827
@import 'admin/admin.less';
2928
@import 'main/main.less';
3029
// endinjector

Diff for: app/templates/client/app/app(sass).scss

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<% } %>
2525
// Component styles are injected through grunt
2626
// injector
27-
@import 'account/login/login.scss';
2827
@import 'admin/admin.scss';
2928
@import 'main/main.scss';
3029
// endinjector

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

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
<% } %>
4646
// Component styles are injected through grunt
4747
// injector
48-
@import "account/login/login"
4948
@import "admin/admin"
5049
@import "main/main"
5150
// endinjector

Diff for: app/templates/client/app/main/main(html).html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h1>'Allo, 'Allo!</h1>
1111
<div class="col-lg-12">
1212
<h1 class="page-header">Features:</h1>
1313
<ul class="nav nav-tabs nav-stacked col-md-4 col-lg-4 col-sm-6" ng-repeat="thing in main.awesomeThings">
14-
<li><a href="#" tooltip="{{thing.info}}">{{thing.name}}<% if (filters.socketio) { %><button type="button" class="close" ng-click="main.deleteThing(thing)">&times;</button><% } %></a></li>
14+
<li><a href="#" uib-tooltip="{{thing.info}}">{{thing.name}}<% if (filters.socketio) { %><button type="button" class="close" ng-click="main.deleteThing(thing)">&times;</button><% } %></a></li>
1515
</ul>
1616
</div>
1717
</div><% if (filters.socketio) { %>

Diff for: app/templates/client/app/main/main(jade).jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ header#banner.hero-unit
1010
h1.page-header Features:
1111
ul.nav.nav-tabs.nav-stacked.col-md-4.col-lg-4.col-sm-6(ng-repeat='thing in main.awesomeThings')
1212
li
13-
a(href='#', tooltip='{{thing.info}}')
13+
a(href='#', uib-tooltip='{{thing.info}}')
1414
| {{thing.name}}<% if (filters.socketio) { %>
1515
button.close(type='button', ng-click='main.deleteThing(thing)') &times;<% } %><% if (filters.socketio) { %>
1616

Diff for: app/templates/client/components/modal(uibootstrap)/modal.service.js

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

33
angular.module('<%= scriptAppName %>')
4-
.factory('Modal', function($rootScope, $modal) {
4+
.factory('Modal', function($rootScope, $uibModal) {
55
/**
66
* Opens a modal
77
* @param {Object} scope - an object to be merged with modal's scope
88
* @param {String} modalClass - (optional) class(es) to be applied to the modal
9-
* @return {Object} - the instance $modal.open() returns
9+
* @return {Object} - the instance $uibModal.open() returns
1010
*/
1111
function openModal(scope = {}, modalClass = 'modal-default') {
1212
var modalScope = $rootScope.$new();
1313

1414
angular.extend(modalScope, scope);
1515

16-
return $modal.open({
16+
return $uibModal.open({
1717
templateUrl: 'components/modal/modal.html',
1818
windowClass: modalClass,
1919
scope: modalScope

Diff for: app/templates/client/components/navbar/navbar(html).html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</button>
1010
<a href="/" class="navbar-brand"><%= lodash.slugify(lodash.humanize(appname)) %></a>
1111
</div>
12-
<div collapse="nav.isCollapsed" class="navbar-collapse collapse" id="navbar-main">
12+
<div uib-collapse="nav.isCollapsed" class="navbar-collapse collapse" id="navbar-main">
1313
<ul class="nav navbar-nav">
1414
<li ng-repeat="item in nav.menu" <% if (filters.uirouter) { %>ui-sref-active="active"<% } else { %>ng-class="{active: nav.isActive(item.link)}"<% } %>>
1515
<a <% if (filters.uirouter) { %>ui-sref="{{item.state}}"<% } else { %>ng-href="{{item.link}}"<% } %>>{{item.title}}</a>

Diff for: app/templates/client/components/navbar/navbar(jade).jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ div.navbar.navbar-default.navbar-static-top(ng-controller='NavbarController')
88
span.icon-bar
99
a.navbar-brand(href='/') <%= lodash.slugify(lodash.humanize(appname)) %>
1010

11-
div#navbar-main.navbar-collapse.collapse(collapse='nav.isCollapsed')
11+
div#navbar-main.navbar-collapse.collapse(uib-collapse='nav.isCollapsed')
1212
ul.nav.navbar-nav
1313
li(ng-repeat='item in nav.menu', <% if (filters.uirouter) { %>ui-sref-active='active'<% } else { %>ng-class='{active: nav.isActive(item.link)}'<% } %>)
1414
a(<% if (filters.uirouter) { %>ui-sref='{{item.state}}'<% } else { %>ng-href='{{item.link}}'<% } %>) {{item.title}}<% if (filters.auth) { %>

Diff for: app/templates/client/tslint.json(ts)

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"no-shadowed-variable": true,
2828
"no-string-literal": true,
2929
"no-switch-case-fall-through": true,
30-
"no-trailing-comma": true,
3130
"no-trailing-whitespace": true,
3231
"no-unused-expression": true,
3332
"no-unused-variable": true,
@@ -42,6 +41,7 @@
4241
"quotemark": [true, "single"],
4342
"radix": true,
4443
"semicolon": true,
44+
"trailing-comma": false,
4545
"triple-equals": [true, "allow-null-check"],
4646
"typedef-whitespace": [true, {
4747
"call-signature": "nospace",

Diff for: app/templates/gulpfile.babel(gulp).js

+34-7
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,26 @@ gulp.task('inject:js', () => {
218218
transform: (filepath) => '<script src="' + filepath.replace(`/${clientPath}/`, '')<% if(filters.ts) { %>.replace('.ts', '.js')<% } %> + '"></script>'
219219
}))
220220
.pipe(gulp.dest(clientPath));
221-
});
221+
});<% if(filters.ts) { %>
222+
223+
gulp.task('inject:tsconfig', () => {
224+
let src = gulp.src([
225+
`${clientPath}/**/!(*.spec|*.mock).ts`,
226+
`!${clientPath}/bower_components/**/*`,
227+
`${clientPath}/typings/**/*.d.ts`
228+
], {read: false})
229+
.pipe(plugins.sort());
230+
231+
return gulp.src('./tsconfig.client.json')
232+
.pipe(plugins.inject(src, {
233+
starttag: '"files": [',
234+
endtag: ']',
235+
transform: (filepath, file, i, length) => {
236+
return `"${filepath.substr(1)}"${i + 1 < length ? ',' : ''}`;
237+
}
238+
}))
239+
.pipe(gulp.dest('./'));
240+
});<% } %>
222241

223242
gulp.task('inject:css', () => {
224243
return gulp.src(paths.client.mainView)
@@ -280,7 +299,7 @@ gulp.task('copy:constant', () => {
280299
})
281300

282301
let tsProject = plugins.typescript.createProject('./tsconfig.client.json');
283-
gulp.task('transpile:client', ['constant', 'copy:constant'], () => {
302+
gulp.task('transpile:client', ['inject:tsconfig', 'constant', 'copy:constant'], () => {
284303
return tsProject.src()
285304
.pipe(plugins.sourcemaps.init())
286305
.pipe(plugins.typescript(tsProject)).js
@@ -312,7 +331,11 @@ gulp.task('transpile:server', () => {
312331
gulp.task('lint:scripts', cb => runSequence(['lint:scripts:client', 'lint:scripts:server'], cb));
313332

314333
gulp.task('lint:scripts:client', () => {
315-
return gulp.src(_.union(paths.client.scripts, _.map(paths.client.test, blob => '!' + blob)))
334+
return gulp.src(_.union(
335+
paths.client.scripts,
336+
_.map(paths.client.test, blob => '!' + blob),
337+
[`!${clientPath}/app/app.constant.<%= scriptExt %>`]
338+
))
316339
.pipe(lintClientScripts());
317340
});
318341

@@ -373,15 +396,19 @@ gulp.task('watch', () => {
373396
.pipe(plugins.livereload());
374397
});
375398

376-
plugins.watch(paths.client.views)
399+
plugins.watch(paths.client.views)<% if(filters.jade) { %>
400+
.pipe(plugins.jade())
401+
.pipe(gulp.dest('.tmp'))<% } %>
377402
.pipe(plugins.plumber())
378-
.pipe(plugins.livereload());
403+
.pipe(plugins.livereload());<% if(filters.babel) { %>
379404

380405
plugins.watch(paths.client.scripts) //['inject:js']
381406
.pipe(plugins.plumber())
382407
.pipe(transpileClient())
383408
.pipe(gulp.dest('.tmp'))
384-
.pipe(plugins.livereload());
409+
.pipe(plugins.livereload());<% } %><% if(filters.ts) { %>
410+
411+
gulp.watch(paths.client.scripts, ['inject:tsconfig', 'lint:scripts:client', 'transpile:client']);<% } %>
385412

386413
plugins.watch(_.union(paths.server.scripts, testFiles))
387414
.pipe(plugins.plumber())
@@ -393,7 +420,7 @@ gulp.task('watch', () => {
393420

394421
gulp.task('serve', cb => {
395422
runSequence(['clean:tmp', 'constant'<% if(filters.ts) { %>, 'tsd'<% } %>],
396-
['lint:scripts', 'inject'<% if(filters.jade) { %>, 'jade'<% } %>],
423+
['lint:scripts', 'inject'<% if(filters.jade) { %>, 'jade'<% } %><% if(filters.ts) { %>, 'inject:tsconfig'<% } %>],
397424
['wiredep:client'],
398425
['transpile:client', 'styles'],
399426
['start:server', 'start:client'],

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ module.exports = function(sequelize, DataTypes) {
3838
},
3939
provider: DataTypes.STRING,
4040
salt: DataTypes.STRING<% if (filters.oauth) { %>,<% if (filters.facebookAuth) { %>
41-
facebook: DataTypes.TEXT,<% } %><% if (filters.twitterAuth) { %>
42-
twitter: DataTypes.TEXT,<% } %><% if (filters.googleAuth) { %>
43-
google: DataTypes.TEXT,<% } %>
44-
github: DataTypes.TEXT<% } %>
41+
facebook: DataTypes.JSON,<% } %><% if (filters.twitterAuth) { %>
42+
twitter: DataTypes.JSON,<% } %><% if (filters.googleAuth) { %>
43+
google: DataTypes.JSON,<% } %>
44+
github: DataTypes.JSON<% } %>
4545

4646
}, {
4747

Diff for: app/templates/server/auth(auth)/facebook(facebookAuth)/passport.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export function setup(User, config) {
1313
},
1414
function(accessToken, refreshToken, profile, done) {
1515
<% if (filters.mongooseModels) { %>User.findOneAsync({<% }
16-
if (filters.sequelizeModels) { %>User.find({<% } %>
16+
if (filters.sequelizeModels) { %>User.find({where:{<% } %>
1717
'facebook.id': profile.id
18-
})
18+
<% if (filters.sequelizeModels) { %>}<% } %>})
1919
.then(user => {
2020
if (user) {
2121
return done(null, user);

Diff for: app/templates/server/auth(auth)/google(googleAuth)/passport.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export function setup(User, config) {
99
},
1010
function(accessToken, refreshToken, profile, done) {
1111
<% if (filters.mongooseModels) { %>User.findOneAsync({<% }
12-
if (filters.sequelizeModels) { %>User.find({<% } %>
12+
if (filters.sequelizeModels) { %>User.find({where:{<% } %>
1313
'google.id': profile.id
14-
})
14+
<% if (filters.sequelizeModels) { %>}<% } %>})
1515
.then(user => {
1616
if (user) {
1717
return done(null, user);

Diff for: app/templates/server/auth(auth)/twitter(twitterAuth)/passport.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export function setup(User, config) {
99
},
1010
function(token, tokenSecret, profile, done) {
1111
<% if (filters.mongooseModels) { %>User.findOneAsync({<% }
12-
if (filters.sequelizeModels) { %>User.find({<% } %>
13-
'twitter.id_str': profile.id
14-
})
12+
if (filters.sequelizeModels) { %>User.find({where:{<% } %>
13+
'twitter.id': profile.id
14+
<% if (filters.sequelizeModels) { %>}<% } %>})
1515
.then(user => {
1616
if (user) {
1717
return done(null, user);

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-angular-fullstack",
3-
"version": "3.3.0-beta.0",
3+
"version": "3.3.0",
44
"description": "Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node",
55
"keywords": [
66
"yeoman-generator",

Diff for: readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Source code: https://github.com/DaftMonk/fullstack-demo
1616

1717
## Usage
1818

19-
Install `yo`, `grunt-cli`, `bower`, and `generator-angular-fullstack`:
19+
Install `yo`, `grunt-cli`/`gulp-cli`, `bower`, and `generator-angular-fullstack`:
2020
```
21-
npm install -g yo grunt-cli bower generator-angular-fullstack
21+
npm install -g yo grunt-cli gulp-cli bower generator-angular-fullstack
2222
```
2323

2424
Make a new directory, and `cd` into it:
@@ -135,7 +135,7 @@ Options:
135135
-h, --help # Print the generator's options and usage
136136
--skip-cache # Do not remember prompt answers Default: false
137137
--route # URL for the endpoint
138-
--models # Specify which model(s) to use
138+
--models # Specify which model(s) to use Options: mongoose, sequelize
139139
--endpointDirectory # Parent directory for enpoints
140140

141141
Arguments:

0 commit comments

Comments
 (0)