Skip to content

Commit 58e4f43

Browse files
authored
Merge pull request angular-fullstack#2729 from angular-fullstack/deps
Deps updates
2 parents c647874 + 8bfb7a9 commit 58e4f43

File tree

8 files changed

+24294
-34
lines changed

8 files changed

+24294
-34
lines changed

Diff for: docs/package-lock.json

+10,961
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package-lock.json

+13,299
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: templates/app/_package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
"main": "server/index.js",
55
"dependencies": {
66
"compression": "^1.7.1",
7-
"core-js": "^2.4.1",
8-
"cors": "^2.8.1",
7+
"core-js": "^2.5.0",
98
"express": "^4.13.3",
10-
"morgan": "~1.8.2",
9+
"morgan": "^1.9.0",
1110
"body-parser": "^1.13.3",
1211
"method-override": "^2.3.10",
1312
"cookie-parser": "^1.3.5",
@@ -45,7 +44,7 @@
4544
"passport-google-oauth20": "^1.0.0",<% } %><% if(filters.ws) { %>
4645
"primus": "^7.0.1",
4746
"primus-emit": "^1.0.0",
48-
"uws": "^8.14.1",<% } %>
47+
"uws": "^10.148.0",<% } %>
4948
"serve-favicon": "^2.3.0"
5049
},
5150
"devDependencies": {
@@ -64,7 +63,7 @@
6463
<%#"@angular/material": "5.0.0-rc0",%>
6564
"@angularclass/hmr": "^2.1.3",
6665
<%_ if(filters.ts) { -%>
67-
"@types/core-js": "^0.9.41",
66+
"@types/core-js": "^2.5.0",
6867
<%_ if(filters.jasmine) { -%>
6968
"@types/jasmine": "^2.5.47",
7069
<%_ } -%>
@@ -104,7 +103,7 @@
104103

105104
<%# END CLIENT %>
106105

107-
"autoprefixer": "^7.1.3",
106+
"autoprefixer": "^8.6.0",
108107
"babel-eslint": "^8.2.3",
109108
"babel-register": "^6.16.0",
110109
"bs-fullscreen-message": "^1.0.0",
@@ -115,6 +114,7 @@
115114
"babel-plugin-transform-class-properties": "^6.6.0",
116115
"babel-plugin-istanbul": "^4.1.4",
117116
"babel-preset-env": "^1.6.1",
117+
"cors": "^2.8.4",
118118
"cross-env": "^5.1.1",
119119
"eslint": "^4.19.1",
120120
"del": "^3.0.0",
@@ -155,8 +155,8 @@
155155
"html-webpack-harddisk-plugin": "~0.2.0",
156156
<%_ if(filters.pug) { _%>
157157
"pug-html-loader": "^1.1.5",<% } %>
158-
"typescript": "~2.6.1",
159-
"awesome-typescript-loader": "^3.3.0",
158+
"typescript": "~2.9.0",
159+
"awesome-typescript-loader": "^4.0.0",
160160
"babel-loader": "^7.1.2",
161161
"css-loader": "^0.28.7",
162162
"file-loader": "^0.11.2",

Diff for: templates/app/client/app/account(auth)/signup/signup.component.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { Component } from '@angular/core';
33
<%_ if(filters.uirouter) { -%>
44
import { StateService } from 'ui-router-ng2';<% } %>
55
<%_ if(filters.ngroute) { -%>
6-
import { Router } from '@angular/router';<% } %>
6+
import { Router } from '@angular/router';<% } %><% if(filters.mongoose) { %>
7+
import { ValidationError } from 'mongoose';<% } %>
78
import { AuthService } from '../../../components/auth/auth.service';
89

910
<%_ if(filters.flow) { -%>
@@ -28,7 +29,7 @@ export class SignupComponent {
2829
email: '',
2930
password: ''
3031
};
31-
errors = {};
32+
errors: {field?: Error} = {};
3233
submitted = false;
3334
AuthService;
3435
<%_ if(filters.ngroute) { -%>
@@ -56,21 +57,22 @@ export class SignupComponent {
5657
password: this.user.password
5758
})
5859
.then(() => {
59-
// Account created, redirect to home
60-
<% if(filters.ngroute) { %>this.Router.navigateByUrl('/home');<% } -%>
61-
<% if(filters.uirouter) { %>this.StateService.go('main');<% } -%>
62-
})
63-
.catch(err => {<% if(filters.mongooseModels) { %>
60+
// Account created, redirect to home<% if(filters.ngroute) { %>
61+
this.Router.navigateByUrl('/home');<% } %><% if(filters.uirouter) { %>
62+
this.StateService.go('main');<% } %>
63+
})<% if(filters.mongooseModels) { %>
64+
.catch((err: {errors: {field: ValidationError}}) => {
6465
this.errors = err.errors;
6566

6667
// Update validity of form fields that match the mongoose errors
67-
Object.entries(err.errors).forEach(([field, error]) => {
68+
Object.entries(err.errors).forEach(([field, error]: [string, ValidationError]) => {
6869
this.errors[field] = error.message;
6970

7071
if(field === 'email' && error.kind === 'user defined') {
71-
form.form.controls[field].setErrors({inUse: true});
72-
}
72+
form.form.controls[field].setErrors({inUse: true});
73+
}
7374
});<% } %><% if(filters.sequelizeModels) { %>
75+
.catch(err => {
7476
this.errors = {};
7577

7678
// Update validity of form fields that match the sequelize errors

Diff for: templates/app/client/app/app.constants.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
<%_ if(filters.babel) { -%>
2-
export default from '../../server/config/environment/shared';<% } %>
3-
<%_ if(filters.ts) { -%>
4-
import shared from '../../server/config/environment/shared.js';
5-
6-
export default shared;<% } %>
1+
export * from '../../server/config/environment/shared';

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable, EventEmitter, Output } from '@angular/core';
22
import { UserService } from './user.service';
33
import { HttpClient } from '@angular/common/http';
44
import { safeCb } from '../util';
5-
import constants from '../../app/app.constants';
5+
import { userRoles } from '../../app/app.constants';
66

77
// @flow
88
class User {
@@ -16,7 +16,7 @@ class User {
1616
export class AuthService {
1717
_currentUser: User = new User();
1818
@Output() currentUserChanged = new EventEmitter(true);
19-
userRoles = constants.userRoles || [];
19+
userRoles = userRoles || [];
2020
UserService;
2121

2222
static parameters = [HttpClient, UserService];
@@ -43,7 +43,7 @@ export class AuthService {
4343
* @param {String} role - role to check against
4444
*/
4545
static hasRole(userRole, role) {
46-
return constants.userRoles.indexOf(userRole) >= constants.userRoles.indexOf(role);
46+
return userRoles.indexOf(userRole) >= userRoles.indexOf(role);
4747
}
4848

4949
get currentUser() {

Diff for: templates/app/server/config/environment/shared.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
'use strict';
22
/*eslint no-process-env:0*/
33

4-
module.exports.default = {
5-
env: process.env.NODE_ENV,
6-
port: process.env.PORT || <%= devPort %>,
7-
// List of user roles
8-
userRoles: ['guest', 'user', 'admin']
4+
export const env = process.env.NODE_ENV;
5+
export const port = process.env.PORT || 9000;
6+
// List of user roles
7+
export const userRoles = ['guest', 'user', 'admin'];
8+
9+
export default {
10+
env,
11+
port,
12+
userRoles,
913
};

Diff for: templates/app/server/config/express.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Express configuration
33
*/
44

5-
'use strict';
6-
75
import express from 'express';
86
import favicon from 'serve-favicon';
97
import morgan from 'morgan';
@@ -31,6 +29,7 @@ export default function(app) {
3129

3230
if(env === 'development' || env === 'test') {
3331
app.use(express.static(path.join(config.root, '.tmp')));
32+
app.use(require('cors')());
3433
}
3534

3635
if(env === 'production') {

0 commit comments

Comments
 (0)