From 96364a78d894ccec2f36cd020f4c7de503fabf77 Mon Sep 17 00:00:00 2001 From: Andrew Koroluk Date: Sun, 4 Mar 2018 05:38:10 -0800 Subject: [PATCH] fix(gen): canary cleanup --- src/generators/app/index.js | 15 ++++++++++++--- templates/app/_package.json | 3 +-- .../app/account(auth)/signup/signup.component.js | 3 +-- .../client/components/navbar/navbar.component.js | 3 +-- templates/app/tsconfig(ts).json | 1 + templates/app/webpack.make.js | 4 ++-- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/generators/app/index.js b/src/generators/app/index.js index 62d892a42..f6c1e9c0e 100644 --- a/src/generators/app/index.js +++ b/src/generators/app/index.js @@ -1,3 +1,4 @@ +import {exec} from 'child_process'; import path from 'path'; import Promise from 'bluebird'; import { runCmd } from '../util'; @@ -547,9 +548,17 @@ export class Generator extends Base { function pugReplacer(contents) { return contents - .replace('ngif', 'ngIf') - .replace('ngfor', 'ngFor') - .replace('ngmodel', 'ngModel'); + .replace(/confirmpassword/g, 'confirmPassword') + .replace(/loginform/g, 'loginForm') + .replace(/newpassword/g, 'newPassword') + .replace(/ngif/g, 'ngIf') + .replace(/ngfor/g, 'ngFor') + .replace(/ngmodel/g, 'ngModel') + .replace(/ngsubmit/g, 'ngSubmit') + .replace(/oldpassword/g, 'oldPassword') + .replace(/routerlinkactive/g, 'routerLinkActive') + .replace(/routerlink/g, 'routerLink') + .replace(/signupform/g, 'signupForm'); } this.registerTransformStream([ diff --git a/templates/app/_package.json b/templates/app/_package.json index 46ef89b3b..4496a2869 100644 --- a/templates/app/_package.json +++ b/templates/app/_package.json @@ -32,7 +32,7 @@ "ejs": "^2.5.3",<% } %><% if(filters.mongoose) { %> "mongoose": "^4.1.2", "bluebird": "^3.3.3", - "connect-mongo": "^1.2.1",<% } %><% if(filters.sequelize) { %> + "connect-mongo": "^2.0.1",<% } %><% if(filters.sequelize) { %> "sequelize": "^3.23.6", "sqlite3": "~3.1.1", "connect-session-sequelize": "^4.1.0",<% } %><% if(filters.auth) { %> @@ -80,7 +80,6 @@ "@types/selenium-webdriver": "^3.0.3", "@types/webpack": "^3.0.10", <%_ } -%> - "angular2-universal": "2.1.0-rc.1", "angular2-jwt": "^0.2.3", <% if(filters.auth) { %> "angular-validation-match": "^1.9.0",<% } %> diff --git a/templates/app/client/app/account(auth)/signup/signup.component.js b/templates/app/client/app/account(auth)/signup/signup.component.js index e6b9dbe69..c2d9caf49 100644 --- a/templates/app/client/app/account(auth)/signup/signup.component.js +++ b/templates/app/client/app/account(auth)/signup/signup.component.js @@ -5,7 +5,6 @@ import { StateService } from 'ui-router-ng2';<% } %> <%_ if(filters.ngroute) { -%> import { Router } from '@angular/router';<% } %> import { AuthService } from '../../../components/auth/auth.service'; -import template from './signup.html'; <%_ if(filters.flow) { -%> type User = { @@ -21,7 +20,7 @@ interface User { @Component({ selector: 'signup', - template, + template: require('./signup.<%=templateExt%>'), }) export class SignupComponent { user: User = { diff --git a/templates/app/client/components/navbar/navbar.component.js b/templates/app/client/components/navbar/navbar.component.js index 381b4835c..e1864c5f2 100644 --- a/templates/app/client/components/navbar/navbar.component.js +++ b/templates/app/client/components/navbar/navbar.component.js @@ -5,11 +5,10 @@ import { StateService } from 'ui-router-ng2';<% } %> <%_ if (filters.ngroute) { -%> import { Router } from '@angular/router';<% } %> import { AuthService } from '../auth/auth.service';<% } %> -import template from './navbar.html'; @Component({ selector: 'navbar', - template, + template: require('./navbar.<%=templateExt%>'), }) export class NavbarComponent { isCollapsed = true; diff --git a/templates/app/tsconfig(ts).json b/templates/app/tsconfig(ts).json index 5cf8d0979..7097d80c3 100644 --- a/templates/app/tsconfig(ts).json +++ b/templates/app/tsconfig(ts).json @@ -17,6 +17,7 @@ "moduleResolution": "node", "lib": [ "es2016", + "es2017", "dom" ] }, diff --git a/templates/app/webpack.make.js b/templates/app/webpack.make.js index bea1ac5d6..8743ab4e2 100644 --- a/templates/app/webpack.make.js +++ b/templates/app/webpack.make.js @@ -131,8 +131,8 @@ module.exports = function makeWebpackConfig(options) { modules: false, }] ], - plugins: [ - 'transform-flow-comments', + plugins: [<% if(filters.flow) { %> + 'transform-flow-comments',<% } %> 'angular2-annotations', 'transform-runtime', 'transform-decorators-legacy',