Permalink
Browse files

feat: upgrade to Angular 5.x (#275)

* feat: upgrade to Angular 5.x

* chore(package): update deps

Closes #7 
Closes #43 
Closes #175 
Closes #241
  • Loading branch information...
Burak Tasci
Burak Tasci committed Jan 8, 2018
1 parent e357120 commit 799c229c17867160c6a1edf83b026728d589683d
Showing with 1,446 additions and 1,120 deletions.
  1. +1 −1 LICENSE
  2. +4 −4 README.md
  3. +75 −73 package.json
  4. +18 −10 src/client/app/app.browser.module.ts
  5. +31 −13 src/client/app/app.module.ts
  6. +1 −0 src/client/app/components/+about/about-apple-pear.component.e2e-spec.ts
  7. +1 −0 src/client/app/components/+about/about-banana.component.e2e-spec.ts
  8. +1 −0 src/client/app/components/+about/about-us.component.e2e-spec.ts
  9. +1 −0 src/client/app/components/+about/about.component.e2e-spec.ts
  10. +1 −0 src/client/app/components/+home/home.component.e2e-spec.ts
  11. +1 −0 src/client/app/components/+secure/secure.component.e2e-spec.ts
  12. +6 −4 src/client/app/components/layout/main.component.html
  13. +2 −12 src/client/app/components/layout/main.component.ts
  14. +1 −0 src/client/app/components/login/login.component.e2e-spec.ts
  15. +20 −6 src/client/app/framework/analytics/analytics.module.ts
  16. +43 −33 src/client/app/framework/analytics/src/analytics.service.spec.ts
  17. +5 −6 src/client/app/framework/analytics/src/analytics.service.ts
  18. +27 −15 src/client/app/framework/auth/testing/auth-testing.module.ts
  19. +0 −32 src/client/app/framework/auth/testing/mocks/auth-backend.mock.ts
  20. +37 −0 src/client/app/framework/auth/testing/mocks/backend-interceptor.mock.ts
  21. +27 −0 src/client/app/framework/auth/testing/mocks/jwt-interceptor.mock.ts
  22. +2 −5 src/client/app/framework/core/core.module.ts
  23. +0 −2 src/client/app/framework/core/shared.module.ts
  24. +0 −29 src/client/app/framework/http/http-interceptor.module.ts
  25. +0 −117 src/client/app/framework/http/src/http-interceptor.service.ts
  26. +0 −30 src/client/app/framework/http/testing/http-testing.module.ts
  27. +2 −2 src/client/app/framework/i18n/i18n.module.ts
  28. +8 −9 src/client/app/framework/i18n/src/i18n.service.spec.ts
  29. +4 −4 src/client/app/framework/i18n/src/language.effects.spec.ts
  30. +3 −5 src/client/app/framework/i18n/src/language.reducer.spec.ts
  31. +1 −0 src/client/main-browser-aot.ts
  32. +1 −0 src/client/main-browser.ts
  33. +25 −14 src/server/app/app.server.module.ts
  34. +1 −0 src/server/server.ts
  35. +60 −30 tools/build/webpack.config.js
  36. +0 −5 tools/config/html-elements.config.js
  37. +14 −6 tools/test/jest.setup.ts
  38. +5 −0 tslint.json
  39. +1,017 −653 yarn.lock
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Burak Tasci
Copyright (c) 2018 Burak Tasci

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,11 +22,11 @@ in file and application organization, providing the following features:
- [x] Adjustable **build configuration** via `json` file (*`./tools/build/build-config.json`*).
- [x] Development, staging and production modes.
- [x] Performing [AoT compilation] for rapid page loads on staging/production builds (*using [@ngtools/webpack]*).
- [x] Minifying the production builds using [UglifyJS Webpack Plugin].
- [ ] ~~Minifying the production builds using [UglifyJS Webpack Plugin].~~
- [x] Both **inline** and **external** **[SCSS]** compilation.
- [x] **[stylelint-config-standard]** as configuration preset for [stylelint] and **custom rules** to standardize stylesheets.
- [x] Transferring server responses on client bootstrap to prevent app flickering with native [TransferState]`.
- [x] Deferring initialization of modules via [Lazy loading].
- [ ] Uses **[@ngx-universal/state-transfer]** to cache server responses on client bootstrap (*w/o flickering*).
- [x] Uses [ngrx/store] for **state management**.
- [x] Uses **[ngx-config]** for configuration management.
- [x] Uses **[ngx-auth]** for basic JWT-based authentication (*w/Universal support*).
@@ -228,7 +228,7 @@ If you want to file a bug, contribute some code, or improve documentation, pleas
## <a name="license"></a> License
The MIT License (MIT)
Copyright (c) 2017 [Burak Tasci]
Copyright (c) 2018 [Burak Tasci]
[Angular]: https://angular.io
[Angular Material]: https://material.angular.io
@@ -248,7 +248,7 @@ Copyright (c) 2017 [Burak Tasci]
[stylelint-config-standard]: https://github.com/stylelint/stylelint-config-standard
[stylelint]: https://stylelint.io/
[Lazy loading]: https://angular-2-training-book.rangle.io/handout/modules/lazy-loading-module.html
[@ngx-universal/state-transfer]: https://github.com/fulls1z3/ngx-universal/tree/master/packages/@ngx-universal/state-transfer
[TransferState]: https://angular.io/api/platform-browser/TransferState
[ngrx/store]: https://github.com/ngrx/store
[ngx-config]: https://github.com/fulls1z3/ngx-config
[ngx-auth]: https://github.com/fulls1z3/ngx-auth
@@ -45,122 +45,123 @@
"compression": "~1.7.1",
"morgan": "~1.9.0",
"body-parser": "~1.18.2",
"@angular/animations": "~4.4.6",
"@angular/common": "~4.4.6",
"@angular/core": "~4.4.6",
"@angular/forms": "~4.4.6",
"@angular/http": "~4.4.6",
"@angular/platform-browser": "~4.4.6",
"@angular/platform-browser-dynamic": "~4.4.6",
"@angular/platform-server": "~4.4.6",
"@angular/router": "~4.4.6",
"@angular/cdk": "2.0.0-beta.12",
"@angular/material": "2.0.0-beta.12",
"@angular/flex-layout": "2.0.0-beta.9",
"core-js": "~2.5.1",
"rxjs": "~5.5.2",
"zone.js": "~0.8.18",
"@angular/animations": "~5.2.0-rc.0",
"@angular/common": "~5.2.0-rc.0",
"@angular/core": "~5.2.0-rc.0",
"@angular/forms": "~5.2.0-rc.0",
"@angular/http": "~5.2.0-rc.0",
"@angular/platform-browser": "~5.2.0-rc.0",
"@angular/platform-browser-dynamic": "~5.2.0-rc.0",
"@angular/platform-server": "~5.2.0-rc.0",
"@angular/router": "~5.2.0-rc.0",
"@angular/cdk": "~5.0.3",
"@angular/material": "~5.0.3",
"@angular/flex-layout": "2.0.0-beta.12",
"core-js": "~2.5.3",
"rxjs": "~5.5.6",
"zone.js": "~0.8.19",
"request": "~2.83.0",
"hammerjs": "~2.0.8",
"lodash": "~4.17.4",
"@angularclass/bootloader": "~1.0.1",
"@ngrx/store": "~4.1.0",
"@ngrx/effects": "~4.1.0",
"@nguniversal/express-engine": "~1.0.0-beta.3",
"@ngx-universal/state-transfer": "4.0.1",
"@ngx-config/core": "4.0.1",
"@ngx-config/http-loader": "4.0.1",
"@ngx-config/fs-loader": "4.0.1",
"@ngx-cache/core": "4.0.1",
"@ngx-cache/platform-browser": "4.0.1",
"@ngx-cache/platform-server": "4.0.1",
"@ngx-cache/fs-storage": "4.0.1",
"@ngx-universal/config-loader": "4.0.1",
"@ngx-auth/core": "4.1.0",
"@ngx-translate/core": "~6.0.1",
"@ngx-translate/http-loader": "~0.0.3",
"@ngx-universal/translate-loader": "4.0.1",
"@ngx-meta/core": "4.0.1",
"@ngx-i18n-router/core": "4.0.1",
"@ngx-i18n-router/config-loader": "4.0.1",
"angulartics2": "~3.2.0",
"ngx-perfect-scrollbar": "~4.8.4"
"@ngrx/store": "~4.1.1",
"@ngrx/effects": "~4.1.1",
"@nguniversal/common": "~5.0.0-beta.5",
"@nguniversal/express-engine": "~5.0.0-beta.5",
"@ngx-config/core": "5.0.0",
"@ngx-config/http-loader": "5.0.0",
"@ngx-config/fs-loader": "5.0.0",
"@ngx-cache/core": "5.0.0",
"@ngx-cache/platform-browser": "5.0.0",
"@ngx-cache/platform-server": "5.0.0",
"@ngx-cache/fs-storage": "5.0.0",
"@ngx-universal/config-loader": "5.0.0",
"@ngx-auth/core": "5.0.0",
"@ngx-translate/core": "~9.0.2",
"@ngx-translate/http-loader": "~2.0.1",
"@ngx-universal/translate-loader": "5.0.0",
"@ngx-meta/core": "5.0.0",
"@ngx-i18n-router/core": "5.0.0",
"@ngx-i18n-router/config-loader": "5.0.0",
"angulartics2": "~4.5.0",
"ngx-perfect-scrollbar": "~5.3.1"
},
"devDependencies": {
"nodemon": "~1.13.3",
"@angular/compiler": "~4.4.6",
"@angular/compiler-cli": "~4.4.6",
"@types/node": "~8.5.1",
"@types/express": "~4.0.39",
"@types/jest": "~21.1.5",
"nodemon": "~1.14.9",
"@angular/compiler": "~5.2.0-rc.0",
"@angular/compiler-cli": "~5.2.0-rc.0",
"@types/node": "~8.5.7",
"@types/express": "~4.11.0",
"@types/jest": "~22.0.1",
"@types/lodash": "4.14.55",
"@types/nightmare": "~2.10.0",
"@types/nightmare": "~2.10.1",
"rimraf": "~2.6.2",
"concurrently": "~3.5.0",
"concurrently": "~3.5.1",
"json-sub": "1.1.0",
"gulp": "gulpjs/gulp#4.0",
"gulp-load-plugins": "~1.5.0",
"lazypipe": "~1.0.1",
"async": "~2.6.0",
"gulp-changed": "~3.1.1",
"gulp-changed": "~3.2.0",
"gulp-ignore": "~2.0.2",
"gulp-debug": "~3.1.0",
"gulp-debug": "~3.2.0",
"gulp-exec": "~3.0.1",
"gulp-tslint": "~8.1.2",
"gulp-replace": "~0.6.1",
"webpack": "~3.10.0",
"angular-webpack-config": "1.4.0",
"webpack-merge": "~4.1.0",
"webpack-dev-middleware": "~1.12.0",
"webpack-hot-middleware": "~2.20.0",
"@ngtools/webpack": "~1.7.4",
"angular-webpack-config": "5.0.1",
"webpack-merge": "~4.1.1",
"webpack-dev-middleware": "~2.0.4",
"webpack-hot-middleware": "~2.21.0",
"@ngtools/webpack": "~1.9.3",
"tslint-loader": "~3.5.3",
"awesome-typescript-loader": "~3.4.1",
"angular2-template-loader": "0.6.0",
"ng-router-loader": "~2.1.0",
"json-loader": "~0.5.7",
"to-string-loader": "~1.1.5",
"style-loader": "~0.19.0",
"css-loader": "~0.28.7",
"postcss-loader": "~2.0.8",
"autoprefixer": "~7.1.6",
"style-loader": "~0.19.1",
"css-loader": "~0.28.8",
"postcss-loader": "~2.0.10",
"autoprefixer": "~7.2.4",
"stylefmt-loader": "~1.2.3",
"sass-loader": "~6.0.6",
"html-loader": "~0.5.1",
"html-loader": "~0.5.4",
"raw-loader": "~0.5.1",
"file-loader": "~1.1.5",
"file-loader": "~1.1.6",
"assets-webpack-plugin": "~3.5.1",
"copy-webpack-plugin": "~4.2.0",
"copy-webpack-plugin": "~4.3.1",
"html-webpack-plugin": "~2.30.1",
"html-elements-webpack-plugin": "~1.0.1",
"script-ext-html-webpack-plugin": "~1.8.7",
"script-ext-html-webpack-plugin": "~1.8.8",
"webpack-dll-bundles-plugin": "~1.0.0-beta.5",
"hard-source-webpack-plugin": "~0.5.11",
"hard-source-webpack-plugin": "~0.5.14",
"add-asset-html-webpack-plugin": "~2.1.2",
"optimize-js-plugin": "~0.0.4",
"uglifyjs-webpack-plugin": "~1.0.1",
"uglifyjs-webpack-plugin": "~1.1.6",
"extract-text-webpack-plugin": "~3.0.2",
"gulp-sass": "~3.1.0",
"gulp-sourcemaps": "~2.6.1",
"gulp-postcss": "~7.0.0",
"postcss-scss": "~1.0.2",
"gulp-sourcemaps": "~2.6.3",
"gulp-postcss": "~7.0.1",
"postcss-scss": "~1.0.3",
"postcss-reporter": "~5.0.0",
"gulp-sass-lint": "~1.3.4",
"stylelint": "~8.4.0",
"stylelint-config-standard": "~18.0.0",
"colorguard": "~1.2.0",
"stylelint-config-standard": "~17.0.0",
"colorguard": "~1.2.1",
"stylefmt": "~6.0.0",
"jest": "~21.2.1",
"jest-preset-angular": "~4.0.1",
"jest": "~22.0.4",
"jest-preset-angular": "~5.0.0",
"jest-junit-reporter": "~1.1.0",
"jasmine-marbles": "~0.2.0",
"nightmare": "~2.10.0",
"@compodoc/compodoc": "~1.0.1",
"standard-version": "~4.2.0",
"@compodoc/compodoc": "~1.0.5",
"standard-version": "~4.3.0",
"codelyzer": "~4.0.2",
"tslint": "~5.8.0",
"angular-tslint-rules": "1.1.0",
"tslib": "~1.8.0",
"typescript": "~2.6.2"
"tslib": "~1.8.1",
"typescript": "~2.5.3"
},
"jest": {
"preset": "jest-preset-angular",
@@ -192,7 +193,8 @@
"@types/lodash",
"json-sub",
"supports-color",
"angular2-template-loader"
"angular2-template-loader",
"stylelint-config-standard"
]
}
}
@@ -1,20 +1,21 @@
// angular
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserTransferStateModule, TransferState } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { REQUEST } from '@nguniversal/express-engine/tokens';

// libs
import { BrowserStateTransferModule, DEFAULT_STATE_ID } from '@ngx-universal/state-transfer';
import { CACHE } from '@ngx-cache/core';
import { BrowserCacheModule, MemoryCacheService, STATE_ID } from '@ngx-cache/platform-browser';
import { BrowserCacheModule, MemoryCacheService } from '@ngx-cache/platform-browser';
import { AuthModule } from '@ngx-auth/core';
import 'hammerjs';

// framework
import { ConsoleService, CoreModule, WindowService } from './framework/core/core.module';
import { AuthTestingModule } from './framework/auth/testing/auth-testing.module';

// modules & components
import { AppModule } from './app.module';
import { AppModule, REQ_KEY } from './app.module';
import { AppComponent } from './app.component';

// for AoT compilation
@@ -26,19 +27,18 @@ export function consoleFactory(): any {
return console;
}

export function requestFactory(transferState: TransferState): any {
return transferState.get<any>(REQ_KEY, {});
}

@NgModule({
imports: [
BrowserModule.withServerTransition({appId: 'my-app-id'}),
BrowserTransferStateModule,
BrowserAnimationsModule,
BrowserStateTransferModule.forRoot(),
BrowserCacheModule.forRoot([
{
provide: CACHE,
useClass: MemoryCacheService
},
{
provide: STATE_ID,
useValue: DEFAULT_STATE_ID
}
]),
CoreModule.forRoot([
@@ -52,8 +52,16 @@ export function consoleFactory(): any {
}
]),
AuthModule.forRoot(),
AuthTestingModule,
AppModule
],
providers: [
{
provide: REQUEST,
useFactory: requestFactory,
deps: [TransferState]
}
],
bootstrap: [AppComponent]
})
export class AppBrowserModule {
Oops, something went wrong.

0 comments on commit 799c229

Please sign in to comment.