From 0c61fe51b2940de09772ec4aac2463205cf096a6 Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Tue, 22 Nov 2016 16:00:13 +0100 Subject: [PATCH 1/9] chore(angular-cli): update to 1.0.0-beta.20-4 Update to angular-cli 1.0.0-beta.20-4 --- .gitignore | 1 + README.md | 6 +++--- angular-cli.json | 9 ++------- karma.conf.js | 3 +++ package.json | 21 +++++++++++---------- src/test.ts | 34 ++++++++++++++++------------------ src/tsconfig.json | 1 + src/typings.d.ts | 2 -- 8 files changed, 37 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 7c910e7..ce200cb 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ /.vscode .project .classpath +.c9/ *.launch .settings/ diff --git a/README.md b/README.md index e38d6ee..78f4bba 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Angular Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide) -This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.19-3. +This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.20-4. It uses the following npm packages (version numbers current as of 2016-10-10): @@ -56,7 +56,7 @@ $ docker-compose build $ docker-compose up -d ``` -Now open your browser at http://localhost:4200 +Now open your browser at [http://localhost:4200](http://localhost:4200) ### Production build and deployment @@ -68,7 +68,7 @@ $ docker-compose -f docker-compose.production.yml up crudular-angular # Wait u $ docker-compose -f docker-compose.production.yml up -d crudular-nginx # Start the nginx container in detached mode ``` -Now open your browser at http://localhost:8080 +Now open your browser at [http://localhost:8080](http://localhost:4200) ## Running unit tests diff --git a/angular-cli.json b/angular-cli.json index 69aeb73..a72772b 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -1,6 +1,6 @@ { "project": { - "version": "1.0.0-beta.19-3", + "version": "1.0.0-beta.20-4", "name": "crudular" }, "apps": [ @@ -22,12 +22,7 @@ "../node_modules/bootstrap/scss/bootstrap.scss", "../node_modules/font-awesome/scss/font-awesome.scss" ], - "scripts": [ - "../node_modules/jquery/dist/jquery.js", - "../node_modules/tether/dist/js/tether.js", - "../node_modules/bootstrap/dist/js/bootstrap.js", - "../node_modules/moment/moment.js" - ], + "scripts": [], "environments": { "source": "environments/environment.ts", "dev": "environments/environment.ts", diff --git a/karma.conf.js b/karma.conf.js index 864bcaf..1f2613a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -17,6 +17,9 @@ module.exports = function (config) { preprocessors: { './src/test.ts': ['angular-cli'] }, + mime: { + 'text/x-typescript': ['ts','tsx'] + }, remapIstanbulReporter: { reports: { html: 'coverage', diff --git a/package.json b/package.json index a2f520a..8f64f2e 100644 --- a/package.json +++ b/package.json @@ -15,14 +15,14 @@ }, "private": true, "dependencies": { - "@angular/common": "~2.1.0", - "@angular/compiler": "~2.1.0", - "@angular/core": "~2.1.0", - "@angular/forms": "~2.1.0", - "@angular/http": "~2.1.0", - "@angular/platform-browser": "~2.1.0", - "@angular/platform-browser-dynamic": "~2.1.0", - "@angular/router": "~3.1.0", + "@angular/common": "^2.1.0", + "@angular/compiler": "^2.1.0", + "@angular/core": "^2.1.0", + "@angular/forms": "^2.1.0", + "@angular/http": "^2.1.0", + "@angular/platform-browser": "^2.1.0", + "@angular/platform-browser-dynamic": "^2.1.0", + "@angular/router": "^3.1.0", "bootstrap": "^4.0.0-alpha.4", "core-js": "^2.4.1", "font-awesome": "^4.6.3", @@ -32,10 +32,11 @@ "zone.js": "^0.6.23" }, "devDependencies": { + "@angular/compiler-cli": "^2.1.0", "@types/jasmine": "^2.2.30", "@types/node": "^6.0.42", - "angular-cli": "^1.0.0-beta.19-3", - "codelyzer": "1.0.0-beta.1", + "angular-cli": "^1.0.0-beta.20-4", + "codelyzer": "~1.0.0-beta.3", "jasmine-core": "2.4.1", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", diff --git a/src/test.ts b/src/test.ts index 7727c8e..81af890 100644 --- a/src/test.ts +++ b/src/test.ts @@ -6,6 +6,11 @@ import 'zone.js/dist/sync-test'; import 'zone.js/dist/jasmine-patch'; import 'zone.js/dist/async-test'; import 'zone.js/dist/fake-async-test'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. declare var __karma__: any; @@ -14,21 +19,14 @@ declare var require: any; // Prevent Karma from running prematurely. __karma__.loaded = function () {}; - -Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') -]) - // First, initialize the Angular testing environment. - .then(([testing, testingBrowser]) => { - testing.getTestBed().initTestEnvironment( - testingBrowser.BrowserDynamicTestingModule, - testingBrowser.platformBrowserDynamicTesting() - ); - }) - // Then we find all the tests. - .then(() => require.context('./', true, /\.spec\.ts/)) - // And load the modules. - .then(context => context.keys().map(context)) - // Finally, start Karma to run the tests. - .then(__karma__.start, __karma__.error); +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +let context = require.context('./', true, /\.spec\.ts/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start(); diff --git a/src/tsconfig.json b/src/tsconfig.json index 9b4c84c..1cf713a 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "", "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, diff --git a/src/typings.d.ts b/src/typings.d.ts index ed687ab..ea52695 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -1,4 +1,2 @@ // Typings reference file, you can add your own global typings here // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html - -declare var System: any; From bdda04ad2ff4886da1482f19aa4d92674cc83066 Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Tue, 22 Nov 2016 16:16:13 +0100 Subject: [PATCH 2/9] style(angular-styleguide): conform to 02-12 Conform to the [Angular 2 Styleguide](https://angular.io/styleguide), specifically [STYLE 02-12] (https://angular.io/styleguide#!#02-12): - Use `feature-routing.module.ts` modules for feature routing - Use `app-routing.module.ts` module for application root routing - Remove `index.ts` barrel files, since they are fragile and prone to introducing circular dependencies --- src/app/app-routing.module.ts | 11 ++++++++ src/app/app.module.ts | 2 +- src/app/app.routing.ts | 21 --------------- src/app/home/home-routing.module.ts | 18 +++++++++++++ src/app/home/home.component.spec.ts | 2 +- src/app/home/home.component.ts | 2 +- src/app/home/home.module.ts | 2 +- src/app/home/home.routing.ts | 8 ------ src/app/home/index.ts | 2 -- src/app/login/index.ts | 2 -- src/app/login/login-routing.module.ts | 17 ++++++++++++ src/app/login/login.component.spec.ts | 2 +- src/app/login/login.component.ts | 2 +- src/app/login/login.module.ts | 2 +- src/app/login/login.routing.ts | 7 ----- .../authentication/authentication.guard.ts | 11 ++++---- .../authentication/authentication.module.ts | 13 ++++++---- .../authentication.service.spec.ts | 17 ++++++++++++ src/app/shared/authentication/index.ts | 2 -- src/app/shared/index.ts | 2 -- src/app/shared/navigation/index.ts | 1 - .../navigation/navigation.component.spec.ts | 26 ++++++++++++++++--- .../shared/navigation/navigation.component.ts | 10 ++++--- .../shared/navigation/navigation.module.ts | 2 +- src/app/shared/shared.module.ts | 2 ++ 25 files changed, 114 insertions(+), 72 deletions(-) create mode 100644 src/app/app-routing.module.ts delete mode 100644 src/app/app.routing.ts create mode 100644 src/app/home/home-routing.module.ts delete mode 100644 src/app/home/home.routing.ts delete mode 100644 src/app/home/index.ts delete mode 100644 src/app/login/index.ts create mode 100644 src/app/login/login-routing.module.ts delete mode 100644 src/app/login/login.routing.ts create mode 100644 src/app/shared/authentication/authentication.service.spec.ts delete mode 100644 src/app/shared/authentication/index.ts delete mode 100644 src/app/shared/index.ts delete mode 100644 src/app/shared/navigation/index.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts new file mode 100644 index 0000000..165938f --- /dev/null +++ b/src/app/app-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +/** + * The AppRoutingModule provides all non-feature routes of the application. + */ +@NgModule({ + imports: [RouterModule.forRoot([/* define app non-feature routes here */])], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a713782..87829fa 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,11 +5,11 @@ import { RouterModule } from '@angular/router'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; +import { AppRoutingModule } from './app-routing.module'; import { HomeModule } from './home/home.module'; import { LoginModule } from './login/login.module'; import { SharedModule } from './shared/shared.module'; -import { AppRoutingModule } from './app.routing'; @NgModule({ declarations: [AppComponent], diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts deleted file mode 100644 index 2cd4c9a..0000000 --- a/src/app/app.routing.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { HomeRoutes } from './home/'; -import { LoginRoutes } from './login/'; - -const AppRoutes: Routes = [ - ...HomeRoutes, - ...LoginRoutes -]; - -/** - * This module provides all the routes of the application. Any feature routes are imported through their respective - * module and added to the `AppRoutes` array. - */ -@NgModule({ - imports: [RouterModule.forRoot(AppRoutes)], - exports: [RouterModule], - providers: [] -}) -export class AppRoutingModule { } diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts new file mode 100644 index 0000000..675ae53 --- /dev/null +++ b/src/app/home/home-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { AuthenticationGuard } from '../shared/authentication/authentication.guard'; +import { HomeComponent } from './home.component'; + +/** + * The HomeRoutingModule provides the routes for the Home module. + */ +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: HomeComponent, canActivate: [AuthenticationGuard] } + ]) + ], + exports: [RouterModule] +}) +export class HomeRoutingModule { } diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts index e7eae4d..1f31e67 100644 --- a/src/app/home/home.component.spec.ts +++ b/src/app/home/home.component.spec.ts @@ -1,6 +1,6 @@ /* tslint:disable:no-unused-variable */ -import { TestBed, async } from '@angular/core/testing'; +import { async, TestBed } from '@angular/core/testing'; import { HomeComponent } from './home.component'; describe('Component: Home', () => { diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 2a9c765..903e6df 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { AuthenticationService } from '../shared/'; +import { AuthenticationService } from '../shared/authentication/authentication.service'; /** * This class represents the lazy loaded HomeComponent. diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 0f0e35e..739e95e 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; -import { HomeComponent } from './index'; +import { HomeComponent } from './home.component'; @NgModule({ imports: [CommonModule, SharedModule], diff --git a/src/app/home/home.routing.ts b/src/app/home/home.routing.ts deleted file mode 100644 index 870db93..0000000 --- a/src/app/home/home.routing.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Routes } from '@angular/router'; - -import { AuthenticationGuard } from '../shared/'; -import { HomeComponent } from './home.component'; - -export const HomeRoutes: Routes = [ - { path: '', component: HomeComponent, canActivate: [AuthenticationGuard] } -]; diff --git a/src/app/home/index.ts b/src/app/home/index.ts deleted file mode 100644 index b8072e7..0000000 --- a/src/app/home/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './home.component'; -export * from './home.routing'; diff --git a/src/app/login/index.ts b/src/app/login/index.ts deleted file mode 100644 index 892f85c..0000000 --- a/src/app/login/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './login.component'; -export * from './login.routing'; diff --git a/src/app/login/login-routing.module.ts b/src/app/login/login-routing.module.ts new file mode 100644 index 0000000..4f1a592 --- /dev/null +++ b/src/app/login/login-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { LoginComponent } from './login.component'; + +/** + * The LoginRoutingModule provides the routes for the Login module. + */ +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: 'login', component: LoginComponent } + ]) + ], + exports: [RouterModule] +}) +export class LoginRoutingModule { } diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts index d7ef9dc..8a6ecc6 100644 --- a/src/app/login/login.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -1,6 +1,6 @@ /* tslint:disable:no-unused-variable */ -import { TestBed, async } from '@angular/core/testing'; +import { async, TestBed } from '@angular/core/testing'; import { LoginComponent } from './login.component'; describe('Component: Login', () => { diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 96d19c9..f204cd9 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthenticationService } from '../shared/'; +import { AuthenticationService } from '../shared/authentication/authentication.service'; /** * This class represents the lazy loaded LoginComponent. diff --git a/src/app/login/login.module.ts b/src/app/login/login.module.ts index 7dcec74..099cf0f 100644 --- a/src/app/login/login.module.ts +++ b/src/app/login/login.module.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; -import { LoginComponent } from './index'; +import { LoginComponent } from './login.component'; @NgModule({ imports: [CommonModule, SharedModule], diff --git a/src/app/login/login.routing.ts b/src/app/login/login.routing.ts deleted file mode 100644 index ab20829..0000000 --- a/src/app/login/login.routing.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Routes } from '@angular/router'; - -import { LoginComponent } from './login.component'; - -export const LoginRoutes: Routes = [ - { path: 'login', component: LoginComponent } -]; diff --git a/src/app/shared/authentication/authentication.guard.ts b/src/app/shared/authentication/authentication.guard.ts index 9a8c58c..a3d89dc 100644 --- a/src/app/shared/authentication/authentication.guard.ts +++ b/src/app/shared/authentication/authentication.guard.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Router, CanActivate } from '@angular/router'; +import { CanActivate, Router } from '@angular/router'; /** * This class implements a guard for routes that require successful authentication. @@ -15,11 +15,10 @@ export class AuthenticationGuard implements CanActivate { constructor(private router: Router) { } /** - * To protect routes from being accessible without previous authentication, - * the `canActivate()` method checks if the LocalStorage contains a - * `currentUser`, which equates to a user being logged in. Only then the - * navigation will pass on to the requested route. Otherwise the user will be - * redirected to the login view. + * To protect routes from being accessible without previous authentication, the `canActivate()` method checks if the + * LocalStorage contains a `currentUser`, which equates to a user being logged in. Only then the navigation will pass + * on to the requested route. Otherwise the user will be redirected to the login view. + * @return {boolean} `true` if a user is currently logged in, otherwise `false`. */ canActivate() { if (localStorage.getItem('currentUser')) { diff --git a/src/app/shared/authentication/authentication.module.ts b/src/app/shared/authentication/authentication.module.ts index de28f2c..6f7e3ec 100644 --- a/src/app/shared/authentication/authentication.module.ts +++ b/src/app/shared/authentication/authentication.module.ts @@ -1,19 +1,22 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; -import { AuthenticationGuard, AuthenticationService } from './index'; +import { AuthenticationGuard } from './authentication.guard'; +import { AuthenticationService } from './authentication.service'; /** - * Do not specify providers for modules that might be imported by a lazy loaded module. + * The AuthenticationModule provides the Authentication guard and Authentication service. */ @NgModule({ }) export class AuthenticationModule { + /** + * Returns the wrapped AuthenticationModule also containing the providers. + * @return {ModuleWithProviders} The wrapped AuthenticationModule. + */ static forRoot(): ModuleWithProviders { return { ngModule: AuthenticationModule, - providers: [ - AuthenticationGuard, AuthenticationService - ] + providers: [AuthenticationGuard, AuthenticationService] }; } diff --git a/src/app/shared/authentication/authentication.service.spec.ts b/src/app/shared/authentication/authentication.service.spec.ts new file mode 100644 index 0000000..ee4684b --- /dev/null +++ b/src/app/shared/authentication/authentication.service.spec.ts @@ -0,0 +1,17 @@ +/* tslint:disable:no-unused-variable */ + +import { async, inject, TestBed } from '@angular/core/testing'; + +import { AuthenticationService } from './authentication.service'; + +describe('Service: Authentication', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AuthenticationService] + }); + }); + + it('should ...', inject([AuthenticationService], (service: AuthenticationService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/src/app/shared/authentication/index.ts b/src/app/shared/authentication/index.ts deleted file mode 100644 index ff53bf5..0000000 --- a/src/app/shared/authentication/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './authentication.guard'; -export * from './authentication.service'; diff --git a/src/app/shared/index.ts b/src/app/shared/index.ts deleted file mode 100644 index 7d6c550..0000000 --- a/src/app/shared/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './authentication/'; -export * from './navigation/'; diff --git a/src/app/shared/navigation/index.ts b/src/app/shared/navigation/index.ts deleted file mode 100644 index e7cdd0a..0000000 --- a/src/app/shared/navigation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './navigation.component'; diff --git a/src/app/shared/navigation/navigation.component.spec.ts b/src/app/shared/navigation/navigation.component.spec.ts index e8a26a2..bfe9656 100644 --- a/src/app/shared/navigation/navigation.component.spec.ts +++ b/src/app/shared/navigation/navigation.component.spec.ts @@ -1,11 +1,29 @@ /* tslint:disable:no-unused-variable */ -import { TestBed, async } from '@angular/core/testing'; +import { DebugElement } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; + import { NavigationComponent } from './navigation.component'; -describe('Component: Navigation', () => { - it('should create an instance', () => { - let component = new NavigationComponent(); +describe('NavigationComponent', () => { + let component: NavigationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NavigationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NavigationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/shared/navigation/navigation.component.ts b/src/app/shared/navigation/navigation.component.ts index 4c0469c..6096baf 100644 --- a/src/app/shared/navigation/navigation.component.ts +++ b/src/app/shared/navigation/navigation.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { AuthenticationService } from '../authentication/'; +import { AuthenticationService } from '../authentication/authentication.service'; /** * This class represents the navigation bar component. @@ -14,13 +14,15 @@ export class NavigationComponent implements OnInit { /** * Creates a new NavigationComponent with the injected AuthenticationService. - * @param {AuthenticationService} authorisationService - The injected AuthenticationService. + * @param {AuthenticationService} authenticationService - The injected AuthenticationService. * @constructor */ constructor(private authenticationService: AuthenticationService) { } - ngOnInit() { - } + /** + * Lifecycle hook which is called after the component has initialized. + */ + ngOnInit() { } /** * Returns if a user is currently logged in. diff --git a/src/app/shared/navigation/navigation.module.ts b/src/app/shared/navigation/navigation.module.ts index ffd9782..c302780 100644 --- a/src/app/shared/navigation/navigation.module.ts +++ b/src/app/shared/navigation/navigation.module.ts @@ -4,7 +4,7 @@ import { RouterModule } from '@angular/router'; import { AuthenticationModule } from '../authentication/authentication.module'; -import { NavigationComponent } from './index'; +import { NavigationComponent } from './navigation.component'; @NgModule({ imports: [CommonModule, RouterModule, AuthenticationModule.forRoot()], diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 46b86ab..78ef8f7 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -24,6 +24,8 @@ import { NavigationModule } from './navigation/navigation.module'; FormsModule, // @angular/router RouterModule, + // authentication/authentication.module + AuthenticationModule, // navigation/navigation.module NavigationModule ] From 260f4aab9e2b9bce512be6500be0b5a58635cff1 Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Tue, 22 Nov 2016 16:24:14 +0100 Subject: [PATCH 3/9] chore(deps): update font-awesome Update font-awesome to 4.7.0 --- README.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78f4bba..e323a2c 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.20-4. -It uses the following npm packages (version numbers current as of 2016-10-10): +It uses the following npm packages (version numbers current as of [2016-11-22](https://xkcd.com/1179/)): - [Bootstrap 4.0.0-alpha.4](https://www.npmjs.com/package/bootstrap): Used for the SCSS styling of the application -- [Font-Awesome 4.6.3](https://www.npmjs.com/package/font-awesome): Used as the glyphicon font of the application +- [Font-Awesome 4.7.0](https://www.npmjs.com/package/font-awesome): Used as the glyphicon font of the application - [Moment 2.15.1](https://www.npmjs.com/package/moment): Used for date/time manipulation *(Note: The npm package already includes the types for moment so you do not need to add it with `npm install @types/moment --save-dev`)* It follows the [Official Angular Styleguide](https://angular.io/styleguide). diff --git a/package.json b/package.json index 8f64f2e..d8b4d04 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@angular/router": "^3.1.0", "bootstrap": "^4.0.0-alpha.4", "core-js": "^2.4.1", - "font-awesome": "^4.6.3", + "font-awesome": "^4.7.0", "moment": "^2.15.1", "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", From f46177e59db0651726a154322188997c4cf54cce Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Tue, 22 Nov 2016 16:26:36 +0100 Subject: [PATCH 4/9] chore(deps): update bootstrap Update bootstrap to v4.0.0-beta.5 --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e323a2c..152ef83 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This project was generated with [angular-cli](https://github.com/angular/angular It uses the following npm packages (version numbers current as of [2016-11-22](https://xkcd.com/1179/)): -- [Bootstrap 4.0.0-alpha.4](https://www.npmjs.com/package/bootstrap): Used for the SCSS styling of the application +- [Bootstrap 4.0.0-alpha.5](https://www.npmjs.com/package/bootstrap): Used for the SCSS styling of the application - [Font-Awesome 4.7.0](https://www.npmjs.com/package/font-awesome): Used as the glyphicon font of the application - [Moment 2.15.1](https://www.npmjs.com/package/moment): Used for date/time manipulation *(Note: The npm package already includes the types for moment so you do not need to add it with `npm install @types/moment --save-dev`)* diff --git a/package.json b/package.json index d8b4d04..11b4413 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@angular/platform-browser": "^2.1.0", "@angular/platform-browser-dynamic": "^2.1.0", "@angular/router": "^3.1.0", - "bootstrap": "^4.0.0-alpha.4", + "bootstrap": "^4.0.0-alpha.5", "core-js": "^2.4.1", "font-awesome": "^4.7.0", "moment": "^2.15.1", From 94efbccc6618535e1f8dae44c94bc9e524d8e9be Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Tue, 22 Nov 2016 16:27:43 +0100 Subject: [PATCH 5/9] chore(deps): update moment Update moment to 2.17.0 --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 152ef83..fd3dda8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It uses the following npm packages (version numbers current as of [2016-11-22](h - [Bootstrap 4.0.0-alpha.5](https://www.npmjs.com/package/bootstrap): Used for the SCSS styling of the application - [Font-Awesome 4.7.0](https://www.npmjs.com/package/font-awesome): Used as the glyphicon font of the application -- [Moment 2.15.1](https://www.npmjs.com/package/moment): Used for date/time manipulation *(Note: The npm package already includes the types for moment so you do not need to add it with `npm install @types/moment --save-dev`)* +- [Moment 2.17.0](https://www.npmjs.com/package/moment): Used for date/time manipulation *(Note: The npm package already includes the types for moment so you do not need to add it with `npm install @types/moment --save-dev`)* It follows the [Official Angular Styleguide](https://angular.io/styleguide). diff --git a/package.json b/package.json index 11b4413..ec91612 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "bootstrap": "^4.0.0-alpha.5", "core-js": "^2.4.1", "font-awesome": "^4.7.0", - "moment": "^2.15.1", + "moment": "^2.17.0", "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" From 03398679c116d1cf9ce2d81fa72d35cc594e8c61 Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Fri, 25 Nov 2016 14:22:03 +0100 Subject: [PATCH 6/9] docs(styleguide): add styleguide document Add the STYLEGUIDE.md document to track the conformity to the styleguide rules --- STYLEGUIDE.md | 285 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 STYLEGUIDE.md diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md new file mode 100644 index 0000000..3e728fc --- /dev/null +++ b/STYLEGUIDE.md @@ -0,0 +1,285 @@ +# Angular Styleguide conformity +![Angular Styleguide](https://mgechev.github.io/angular2-style-guide/images/badge.svg) + +This document tracks the conformity to the different rules of the [Angular Styleguide](https://angular.io/styleguide). + +## Table of Contents + +1. [1. Single Responsibility](#single-responsibility) +2. [2. Naming](#naming) +3. [Coding Conventions](#coding-conventions) +4. [App Structure](#app-structure) +5. [Components](#components) +6. [Directives](#directives) +7. [Services](#services) +8. [Data Services](#data-services) +9. [Lifecycle Hooks](#lifecycle-hooks) +10. [Appendix](#appendix) + +## 1. Single Responsibility + +### Rule of One [STYLE 01-01](https://angular.io/styleguide#01-01) + +- [ ] **Do** define one thing (e.g. service or component) per file. +- [ ] **Consider** limiting files to 400 lines of code. + +### Small Functions [STYLE 01-02](https://angular.io/styleguide#01-02) + +- [ ] **Do** define small functions. +- [ ] **Consider** limiting to no more than 75 lines. + + +## 2. Naming + +### General Naming Guidelines [STYLE 02-01](https://angular.io/styleguide#02-01) + +- [ ] **Do** use consistent names for all symbols. +- [ ] **Do** follow a pattern that describes the symbol's feature then its type. The recommended pattern is `feature.type.ts`. + +### Separate File Names with Dots and Dashes [STYLE 02-02](https://angular.io/styleguide#02-02) + +- [ ] **Do** use dashes to separate words in the descriptive name. +- [ ] **Do** use dots to separate the descriptive name from the type. +- [ ] **Do** use consistent type names for all components following a pattern that describes the component's feature then its type. A recommended pattern is `feature.type.ts`. +- [ ] **Do** use conventional type names including `.service`, `.component`, `.pipe`, `.module`, `.directive`. Invent additional type names if you must but take care not to create too many. + +### Symbols and File Names [STYLE 02-03](https://angular.io/styleguide#02-03) + +- [ ] **Do** use consistent names for all assets named after what they represent. +- [ ] **Do** use upper camel case for class names. Match the name of the symbol to the name of the file. +- [ ] **Do** append the symbol name with the conventional suffix for a thing of that type (e.g., `Component`, `Directive`, `Module`, `Pipe`, `Service`). +- [ ] **Do** give the filename the conventional suffix for a file of that type (e.g., `.component.ts`, `.directive.ts`, `.module.ts`, `.pipe.ts`, `.service.ts`). + +### Service Names [STYLE 02-04](https://angular.io/styleguide#02-04) + +- [ ] **Do** use consistent names for all services named after their feature. +- [ ] **Do** use upper camel case for services. +- [ ] **Do** suffix services with `Service` when it is not clear what they are (e.g. when they are nouns). + +### Bootstrapping [STYLE 02-05](https://angular.io/styleguide#02-05) + +- [ ] **Do** put bootstrapping and platform logic for the app in a file named `main.ts`. +- [ ] **Do** include error handling in the bootstrapping logic. +- [ ] ___Avoid___ putting app logic in the `main.ts`. Instead consider placing it in a component or service. + + +## 3. Coding Conventions + +### Classes [STYLE 03-01](https://angular.io/styleguide#03-01) + +- [ ] **Do** use upper camel case when naming classes. + +### Constants [STYLE 03-02](https://angular.io/styleguide#03-02) + +- [ ] **Do** declare variables with `const` if their values should not change during the application lifetime. +- [ ] **Consider** spelling `const` variables in lower camel case. +- [ ] **Do** tolerate *existing* `const` variables that are spelled in `UPPER_SNAKE_CASE`. + +### Interfaces [STYLE 03-03](https://angular.io/styleguide#03-03) + +- [ ] **Do** name an interface using upper camel case. +- [ ] **Consider** naming an interface without an `I` prefix. +- [ ] **Consider** using a class instead of an interface. + +### Properties and Methods [STYLE 03-04](https://angular.io/styleguide#03-04) + +- [ ] **Do** use lower camel case to name properties and methods. +- [ ] ___Avoid___ prefixing private properties and methods with an underscore. + +### Import Line Spacing [STYLE 03-06](https://angular.io/styleguide#03-06) + +- [ ] **Consider** leaving one empty line between third party imports and application imports. +- [ ] **Consider** listing import lines alphabetized by the module. +- [ ] **Consider** listing destructured imported assets alphabetically. + + +## 4. App Structure + +### LIFT [STYLE 04-01](https://angular.io/styleguide#04-01) + +- [ ] **Do** structure the app such that you can `L`ocate code quickly, `I`dentify the code at a glance, keep the `F`lattest structure you can, and `T`ry to be DRY. +- [ ] **Do** define the structure to follow these four basic guidelines, listed in order of importance. + +### Locate [STYLE 04-02](https://angular.io/styleguide#04-02) + +- [ ] **Do** make locating code intuitive, simple and fast. + +### Identify [STYLE 04-03](https://angular.io/styleguide#04-03) + +- [ ] **Do** name the file such that you instantly know what it contains and represents. +- [ ] **Do** be descriptive with file names and keep the contents of the file to exactly one component. +- [ ] ___Avoid___ files with multiple components, multiple services, or a mixture. + +### Flat [STYLE 04-04](https://angular.io/styleguide#04-04) + +- [ ] **Do** keep a flat folder structure as long as possible. +- [ ] **Consider** creating sub-folders when a folder reaches seven or more files. +- [ ] **Consider** configuring the IDE to hide distracting, irrelevant files such as generated `.js` and `.js.map` files. + +### T-DRY (Try to be DRY) [STYLE 04-05](https://angular.io/styleguide#04-05) + +- [ ] **Do** be DRY (Don't Repeat Yourself) +- [ ] **Avoid** being so DRY that you sacrifice readability. + +### Overall Structural Guidelines [STYLE 04-06](https://angular.io/styleguide#04-06) + +- [ ] **Do** start small but keep in mind where the app is heading down the road. +- [ ] **Do** have a near term view of implementation and a long term vision. +- [ ] **Do** put all of the app's code in a folder named `app`. +- [ ] **Consider** creating a folder for a component when is has multiple accompanying files (`.ts`, `.html`, `.css` and `.spec`). + +### Folders-by-Feature Structure [STYLE 04-07](https://angular.io/styleguide#04-07) + +- [ ] **Do** create folders named for the feature area they represent. +- [ ] **Do** create an Angular module for each feature area. + +### App Root Module [STYLE 04-08](https://angular.io/styleguide#04-08) + +- [ ] **Do** create an Angular module in the app's root folder (e.g., in `/app`). +- [ ] **Consider** naming the root module `app.module.ts`. + +### Feature Modules [STYLE 04-09](https://angular.io/styleguide#04-09) + +- [ ] Do create an Angular module for all distinct features in an application (e.g. `Heroes` feature). +- [ ] Do place the feature module in the same named folder as the feature area (.e.g `app/heroes`). +- [ ] Do name the feature module file reflecting the name of the feature area and folder (e.g. `app/heroes/heroes.module.ts`) +- [ ] Do name the feature module symbol reflecting the name of the feature area, folder, and file (e.g. `app/heroes/heroes.module.ts` defines `HeroesModule`) + +### Shared Feature Module [STYLE 04-10](https://angular.io/styleguide#04-10) + +- [ ] **Do** create a feature module named `SharedModule` in a `shared` folder (e.g. `app/shared/shared.module.ts` defines `SharedModule`). +- [ ] **Do** put common components, directives and pipes that will be used throughout the application by other feature modules in the `SharedModule`, where those assets are expected to share a new instance of themselves (not singletons). +- [ ] **Do** import all modules required by the assets in the `SharedModule` (e.g. `CommonModule` and `FormsModule`). +- [ ] **Do** declare all components, directives, and pipes in the `SharedModule`. +- [ ] **Do** export all symbols from the `SharedModule` that other feature modules need to use. +- [ ] ___Avoid___ specifying app-wide singleton providers in a `SharedModule`. Intentional singletons are OK. Take care. + +### Core Feature Module [STYLE 04-11](https://angular.io/styleguide#04-11) + +- [ ] **Do** collect single-use classes and hiding their gory details inside `CoreModule`. A simplified root `AppModule` imports `CoreModule` in its capacity as orchestrator of the application as a whole. +- [ ] **Do** create a feature module named `CoreModule` in a `core` folder (e.g. `app/core/core.module.ts` defines `CoreModule`). +- [ ] **Do** put a singleton service whose instance wil be shared throughout the application in the `CoreModule` (e.g. `ExceptionService` and `LoggerService`). +- [ ] **Do** import all modules required by the assets in the `CoreModule` (e.g. `CommonModule` and `FormsModule`). +- [ ] **Do** gather application-wide, single use components in the `CoreModule`. Import it once (in the `AppModule`) when the app starts and never import it anywhere else. (e.g. `NavComponent` and `SpinnerComponent`). +- [ ] ___Avoid___ importing the `CoreModule` anywhere except in the `AppModule`. +- [ ] **Do** export all symbols that from the `CoreModule` that the `AppModule` will import and make available for other feature modules to use. + +### Prevent Reimport of Core Module [STYLE 04-12](https://angular.io/styleguide#04-12) + +- [ ] **Do** guard against reimporting of `CoreModule` and fail fast by adding guard logic. + +### Lazy Loaded Folders [STYLE 04-13](https://angular.io/styleguide#!#04-13) + +- [ ] **Do** put the contents of lazy loaded features in a *lazy loaded folder*. A typical *lazy loaded folder* contains a *routing component*, its child components, and their related assets and modules. + +### Never Directly Import Lazy Loaded Folders [STYLE 04-14](https://angular.io/styleguide#!#04-14) + +- [ ] ___Avoid___ allowing modules in sibling and parent folders to directly import a module in a *lazy loaded feature*. + + +## 5. Components + +### Component Selector Naming [STYLE 05-02](https://angular.io/styleguide#!#05-02) + +- [ ] **Do** use *dashed-case* or *kebab-case* for naming the element selectors of components. + +### Components as Elements [STYLE 05-03](https://angular.io/styleguide#!#05-03) + +- [ ] **Do** define components as elements via the selector. + +### Extract Template and Styles to Their Own Files [STYLE 05-04](https://angular.io/styleguide#!#05-04) + +- [ ] **Do** extract templates and styles into a separate file, when more than 3 lines. +- [ ] **Do** name the template file `[component-name].component.html`, where `[component-name]` is the component name. +- [ ] **Do** name the style file `[component-name].component.css`, where `[component-name]` is the component name. + +### Decorate Input and Output Properties Inline [STYLE 05-12](https://angular.io/styleguide#!#05-12) + +- [ ] **Do** use `@Input` and `@Output` instead of the inputs and outputs properties of the `@Directive` and `@Component` decorators. +- [ ] **Do** place the `@Input()` or `@Output()` on the same line as the property they decorate. + +### Avoid Renaming Inputs and Outputs [STYLE 05-13](https://angular.io/styleguide#!#05-13) + +- [ ] ___Avoid___ renaming inputs and outputs, when possible. + +### Member Sequence [STYLE 05-14](https://angular.io/styleguide#05-14) + +- [ ] **Do** place properties up top followed by methods. +- [ ] **Do** place private members after public members, alphabetized. + +### Put Logic in Services [STYLE 05-15](https://angular.io/styleguide#05-15) + +- [ ] **Do** limit logic in a component to only that required for the view. All other logic should be delegated to services. +- [ ] **Do** move reusable logic to services and keep components simple and focused on their intended purpose. + +### Don't Prefix Output Properties [STYLE 05-16](https://angular.io/styleguide#05-16) + +- [ ] **Do** name events without the prefix `on`. +- [ ] **Do** name event handler methods with the prefix `on` followed by the event name. + +### Put Presentation Logic in the Component Class [STYLE 05-17](https://angular.io/styleguide#!#05-17) + +- [ ] **Do** put presentation logic in the component class, and not in the template. + + +## 6. Directives + +### Use Directives to Enhance an Existing Element [STYLE 06-01](https://angular.io/styleguide#06-01) + +- [ ] **Do** use attribute directives when you have presentation logic without a template. + +### Use HostListener and HostBinding Class Decorators [STYLE 06-03](https://angular.io/styleguide#06-03) + +- [ ] **Consider** preferring the `@HostListener` and `@HostBinding` to the host property of the `@Directive` and `@Component` decorators. +- [ ] **Do** be consistent in your choice. + + +## 7. Services + +### Services are Singletons within an Injector [STYLE 07-01](https://angular.io/styleguide#07-01) + +- [ ] **Do** use services as singletons within the same injector. Use them for sharing data and functionality. + +### Single Responsibility [STYLE 07-02](https://angular.io/styleguide#07-02) + +- [ ] **Do** create services with a single responsibility that is encapsulated by its context. +- [ ] **Do** create a new service once the service begins to exceed that singular purpose. + +### Providing a Service [STYLE 07-03](https://angular.io/styleguide#07-03) + +- [ ] **Do** provide services to the Angular injector at the top-most component where they will be shared. + +### Use the @Injectable() Class Decorator [STYLE 07-04](https://angular.io/styleguide#07-04) + +- [ ] **Do** use the `@Injectable` class decorator instead of the `@Inject` parameter decorator when using types as tokens for the dependencies of a service. + + +## 8. Data Services + +### Separate Data Calls [STYLE 08-01](https://angular.io/styleguide#08-01) + +- [ ] **Do** refactor logic for making data operations and interacting with data to a service. +- [ ] **Do** make data services responsible for XHR calls, local storage, stashing in memory, or any other data operations. + + +## 9. Lifecycle Hooks + +### Implement Lifecycle Hooks Interfaces [STYLE 09-01](https://angular.io/styleguide#09-01) + +- [ ] **Do** implement the lifecycle hook interfaces. + + +## 10. Appendix + +### Codelyzer [STYLE A-01](https://angular.io/styleguide#A-01) + +- [ ] **Do** use [codelyzer](https://www.npmjs.com/package/codelyzer) to follow this guide. +- [ ] **Consider** adjusting the rules in codelyzer to suit your needs. + +### File Templates and Snippets [STYLE A-02](https://angular.io/styleguide#A-02) + +- [ ] **Do** use file templates or snippets to help follow consistent styles and patterns. Here are templates and/or snippets for some of the web development editors and IDEs. +- [ ] **Consider** using [snippets](https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2) for [Visual Studio Code](https://code.visualstudio.com/) that follow these styles and guidelines. +- [ ] **Consider** using [snippets](https://atom.io/packages/angular-2-typescript-snippets) for [Atom](https://atom.io/) that follow these styles and guidelines. +- [ ] **Consider** using [snippets](https://github.com/orizens/sublime-angular2-snippets) for [Sublime Text](http://www.sublimetext.com/) that follow these styles and guidelines. +- [ ] **Consider** using [snippets](https://github.com/mhartington/vim-angular2-snippets) for [Vim](http://www.vim.org/) that follow these styles and guidelines. From 02f5de2e4f66b1c009875bc6e1dfc1f14e76796e Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Fri, 25 Nov 2016 19:29:21 +0100 Subject: [PATCH 7/9] chore(angular-cli): update to 1.0.0-beta.21 Update to angular-cli 1.0.0-beta.21 --- .editorconfig | 2 +- README.md | 2 +- angular-cli.json | 2 +- package.json | 24 +++++++++---------- src/app/app-routing.module.ts | 2 +- src/app/app.component.spec.ts | 4 ++-- src/app/app.module.ts | 1 - .../authentication/authentication.service.ts | 5 ++-- src/app/shared/shared.module.ts | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.editorconfig b/.editorconfig index 06dde11..6e87a00 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,5 +9,5 @@ insert_final_newline = true trim_trailing_whitespace = true [*.md] -max_line_length = 0 +max_line_length = off trim_trailing_whitespace = false diff --git a/README.md b/README.md index fd3dda8..27ca5fa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Angular Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide) -This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.20-4. +This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.21. It uses the following npm packages (version numbers current as of [2016-11-22](https://xkcd.com/1179/)): diff --git a/angular-cli.json b/angular-cli.json index a72772b..e8e05c0 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -1,6 +1,6 @@ { "project": { - "version": "1.0.0-beta.20-4", + "version": "1.0.0-beta.21", "name": "crudular" }, "apps": [ diff --git a/package.json b/package.json index ec91612..5b5b441 100644 --- a/package.json +++ b/package.json @@ -15,14 +15,14 @@ }, "private": true, "dependencies": { - "@angular/common": "^2.1.0", - "@angular/compiler": "^2.1.0", - "@angular/core": "^2.1.0", - "@angular/forms": "^2.1.0", - "@angular/http": "^2.1.0", - "@angular/platform-browser": "^2.1.0", - "@angular/platform-browser-dynamic": "^2.1.0", - "@angular/router": "^3.1.0", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/core": "2.2.1", + "@angular/forms": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/router": "3.2.1", "bootstrap": "^4.0.0-alpha.5", "core-js": "^2.4.1", "font-awesome": "^4.7.0", @@ -32,12 +32,12 @@ "zone.js": "^0.6.23" }, "devDependencies": { - "@angular/compiler-cli": "^2.1.0", - "@types/jasmine": "^2.2.30", + "@angular/compiler-cli": "2.2.1", + "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", - "angular-cli": "^1.0.0-beta.20-4", + "angular-cli": "1.0.0-beta.21", "codelyzer": "~1.0.0-beta.3", - "jasmine-core": "2.4.1", + "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 165938f..2da6506 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { RouterModule } from '@angular/router'; /** * The AppRoutingModule provides all non-feature routes of the application. diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 1e13602..5ddbb20 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -3,7 +3,7 @@ import { TestBed, async } from '@angular/core/testing'; import { AppComponent } from './app.component'; -describe('App: Crudular', () => { +describe('AppComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [ @@ -18,7 +18,7 @@ describe('App: Crudular', () => { expect(app).toBeTruthy(); })); - it(`should have as title 'app works!'`, async(() => { + it(`should have as title 'cru works!'`, async(() => { let fixture = TestBed.createComponent(AppComponent); let app = fixture.debugElement.componentInstance; expect(app.title).toEqual('cru works!'); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 87829fa..ac02e16 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; -import { RouterModule } from '@angular/router'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; diff --git a/src/app/shared/authentication/authentication.service.ts b/src/app/shared/authentication/authentication.service.ts index 765830e..7d3d1ad 100644 --- a/src/app/shared/authentication/authentication.service.ts +++ b/src/app/shared/authentication/authentication.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Headers, Http, RequestOptions, Response } from '@angular/http'; import { Observable } from 'rxjs'; -import 'rxjs/add/operator/map' +import 'rxjs/add/operator/map'; import { environment } from '../../../environments/environment'; @@ -33,7 +33,8 @@ export class AuthenticationService { * @return {boolean} `true` if the authorisation was successful, otherwise `false`. */ login(username: string, password: string): Observable { - return this.http.post(this.baseUrl + 'users/sign_in.json', JSON.stringify({ user: { email: username, password: password }}), this.getRequestOptions()) + const userJSON: string = JSON.stringify({ user: { email: username, password: password }}); + return this.http.post(this.baseUrl + 'users/sign_in.json', userJSON, this.getRequestOptions()) .map((response: Response) => { // login successful if there's a jwt token in the response let token = response.json() && response.json().token; diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 78ef8f7..ce84f0e 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -1,5 +1,5 @@ import { CommonModule } from '@angular/common'; -import { NgModule, ModuleWithProviders } from '@angular/core'; +import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; From d00cfcd7cb815a65e77a5fda86a963c89f6c7ac3 Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Sat, 26 Nov 2016 00:38:25 +0100 Subject: [PATCH 8/9] style(styleguide): conform to styleguide rules - Conform to [STYLE 03-02](https://angular.io/styleguide#03-02) - Conform to [STYLE 04-09](https://angular.io/styleguide#04-09) - Conform to [STYLE 04-10](https://angular.io/styleguide#04-10) - Conform to [STYLE 04-11](https://angular.io/styleguide#04-11) - Conform to [STYLE 05-12](https://angular.io/styleguide#05-12) --- STYLEGUIDE.md | 208 +++++++++--------- src/app/app.component.spec.ts | 12 +- src/app/app.component.ts | 7 + src/app/app.module.ts | 12 +- .../authentication/authentication.guard.ts | 0 .../authentication/authentication.module.ts | 0 .../authentication.service.spec.ts | 0 .../authentication/authentication.service.ts | 2 +- src/app/core/core.module.ts | 44 ++++ src/app/core/logging/logging.service.spec.ts | 17 ++ src/app/core/logging/logging.service.ts | 14 ++ src/app/core/module-import.guard.ts | 5 + .../navigation/navigation.component.html | 0 .../navigation/navigation.component.scss | 0 .../navigation/navigation.component.spec.ts | 0 .../navigation/navigation.component.ts | 0 .../navigation/navigation.module.ts | 1 - src/app/home/home-routing.module.ts | 2 +- src/app/home/home.component.spec.ts | 26 ++- src/app/home/home.component.ts | 6 +- src/app/home/home.module.ts | 6 +- src/app/index.ts | 3 + src/app/login/login.component.spec.ts | 26 ++- src/app/login/login.component.ts | 8 +- src/app/login/login.module.ts | 6 +- src/app/shared/shared.module.ts | 20 +- src/main.ts | 2 +- src/test.ts | 2 +- 28 files changed, 281 insertions(+), 148 deletions(-) rename src/app/{shared => core}/authentication/authentication.guard.ts (100%) rename src/app/{shared => core}/authentication/authentication.module.ts (100%) rename src/app/{shared => core}/authentication/authentication.service.spec.ts (100%) rename src/app/{shared => core}/authentication/authentication.service.ts (97%) create mode 100644 src/app/core/core.module.ts create mode 100644 src/app/core/logging/logging.service.spec.ts create mode 100644 src/app/core/logging/logging.service.ts create mode 100644 src/app/core/module-import.guard.ts rename src/app/{shared => core}/navigation/navigation.component.html (100%) rename src/app/{shared => core}/navigation/navigation.component.scss (100%) rename src/app/{shared => core}/navigation/navigation.component.spec.ts (100%) rename src/app/{shared => core}/navigation/navigation.component.ts (100%) rename src/app/{shared => core}/navigation/navigation.module.ts (99%) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 3e728fc..a931d6c 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -20,266 +20,266 @@ This document tracks the conformity to the different rules of the [Angular Style ### Rule of One [STYLE 01-01](https://angular.io/styleguide#01-01) -- [ ] **Do** define one thing (e.g. service or component) per file. -- [ ] **Consider** limiting files to 400 lines of code. +- [X] **Do** define one thing (e.g. service or component) per file. +- [X] **Consider** limiting files to 400 lines of code. ### Small Functions [STYLE 01-02](https://angular.io/styleguide#01-02) -- [ ] **Do** define small functions. -- [ ] **Consider** limiting to no more than 75 lines. +- [X] **Do** define small functions. +- [X] **Consider** limiting to no more than 75 lines. ## 2. Naming ### General Naming Guidelines [STYLE 02-01](https://angular.io/styleguide#02-01) -- [ ] **Do** use consistent names for all symbols. -- [ ] **Do** follow a pattern that describes the symbol's feature then its type. The recommended pattern is `feature.type.ts`. +- [X] **Do** use consistent names for all symbols. +- [X] **Do** follow a pattern that describes the symbol's feature then its type. The recommended pattern is `feature.type.ts`. ### Separate File Names with Dots and Dashes [STYLE 02-02](https://angular.io/styleguide#02-02) -- [ ] **Do** use dashes to separate words in the descriptive name. -- [ ] **Do** use dots to separate the descriptive name from the type. -- [ ] **Do** use consistent type names for all components following a pattern that describes the component's feature then its type. A recommended pattern is `feature.type.ts`. -- [ ] **Do** use conventional type names including `.service`, `.component`, `.pipe`, `.module`, `.directive`. Invent additional type names if you must but take care not to create too many. +- [X] **Do** use dashes to separate words in the descriptive name. +- [X] **Do** use dots to separate the descriptive name from the type. +- [X] **Do** use consistent type names for all components following a pattern that describes the component's feature then its type. A recommended pattern is `feature.type.ts`. +- [X] **Do** use conventional type names including `.service`, `.component`, `.pipe`, `.module`, `.directive`. Invent additional type names if you must but take care not to create too many. ### Symbols and File Names [STYLE 02-03](https://angular.io/styleguide#02-03) -- [ ] **Do** use consistent names for all assets named after what they represent. -- [ ] **Do** use upper camel case for class names. Match the name of the symbol to the name of the file. -- [ ] **Do** append the symbol name with the conventional suffix for a thing of that type (e.g., `Component`, `Directive`, `Module`, `Pipe`, `Service`). -- [ ] **Do** give the filename the conventional suffix for a file of that type (e.g., `.component.ts`, `.directive.ts`, `.module.ts`, `.pipe.ts`, `.service.ts`). +- [X] **Do** use consistent names for all assets named after what they represent. +- [X] **Do** use upper camel case for class names. Match the name of the symbol to the name of the file. +- [X] **Do** append the symbol name with the conventional suffix for a thing of that type (e.g., `Component`, `Directive`, `Module`, `Pipe`, `Service`). +- [X] **Do** give the filename the conventional suffix for a file of that type (e.g., `.component.ts`, `.directive.ts`, `.module.ts`, `.pipe.ts`, `.service.ts`). ### Service Names [STYLE 02-04](https://angular.io/styleguide#02-04) -- [ ] **Do** use consistent names for all services named after their feature. -- [ ] **Do** use upper camel case for services. -- [ ] **Do** suffix services with `Service` when it is not clear what they are (e.g. when they are nouns). +- [X] **Do** use consistent names for all services named after their feature. +- [X] **Do** use upper camel case for services. +- [X] **Do** suffix services with `Service` when it is not clear what they are (e.g. when they are nouns). ### Bootstrapping [STYLE 02-05](https://angular.io/styleguide#02-05) -- [ ] **Do** put bootstrapping and platform logic for the app in a file named `main.ts`. -- [ ] **Do** include error handling in the bootstrapping logic. -- [ ] ___Avoid___ putting app logic in the `main.ts`. Instead consider placing it in a component or service. +- [X] **Do** put bootstrapping and platform logic for the app in a file named `main.ts`. +- [X] **Do** include error handling in the bootstrapping logic. +- [X] ___Avoid___ putting app logic in the `main.ts`. Instead consider placing it in a component or service. ## 3. Coding Conventions ### Classes [STYLE 03-01](https://angular.io/styleguide#03-01) -- [ ] **Do** use upper camel case when naming classes. +- [X] **Do** use upper camel case when naming classes. ### Constants [STYLE 03-02](https://angular.io/styleguide#03-02) -- [ ] **Do** declare variables with `const` if their values should not change during the application lifetime. -- [ ] **Consider** spelling `const` variables in lower camel case. -- [ ] **Do** tolerate *existing* `const` variables that are spelled in `UPPER_SNAKE_CASE`. +- [X] **Do** declare variables with `const` if their values should not change during the application lifetime. +- [X] **Consider** spelling `const` variables in lower camel case. +- [X] **Do** tolerate *existing* `const` variables that are spelled in `UPPER_SNAKE_CASE`. ### Interfaces [STYLE 03-03](https://angular.io/styleguide#03-03) -- [ ] **Do** name an interface using upper camel case. -- [ ] **Consider** naming an interface without an `I` prefix. -- [ ] **Consider** using a class instead of an interface. +- [X] **Do** name an interface using upper camel case. +- [X] **Consider** naming an interface without an `I` prefix. +- [X] **Consider** using a class instead of an interface. ### Properties and Methods [STYLE 03-04](https://angular.io/styleguide#03-04) -- [ ] **Do** use lower camel case to name properties and methods. -- [ ] ___Avoid___ prefixing private properties and methods with an underscore. +- [X] **Do** use lower camel case to name properties and methods. +- [X] ___Avoid___ prefixing private properties and methods with an underscore. ### Import Line Spacing [STYLE 03-06](https://angular.io/styleguide#03-06) -- [ ] **Consider** leaving one empty line between third party imports and application imports. -- [ ] **Consider** listing import lines alphabetized by the module. -- [ ] **Consider** listing destructured imported assets alphabetically. +- [X] **Consider** leaving one empty line between third party imports and application imports. +- [X] **Consider** listing import lines alphabetized by the module. +- [X] **Consider** listing destructured imported assets alphabetically. ## 4. App Structure ### LIFT [STYLE 04-01](https://angular.io/styleguide#04-01) -- [ ] **Do** structure the app such that you can `L`ocate code quickly, `I`dentify the code at a glance, keep the `F`lattest structure you can, and `T`ry to be DRY. -- [ ] **Do** define the structure to follow these four basic guidelines, listed in order of importance. +- [X] **Do** structure the app such that you can `L`ocate code quickly, `I`dentify the code at a glance, keep the `F`lattest structure you can, and `T`ry to be DRY. +- [X] **Do** define the structure to follow these four basic guidelines, listed in order of importance. ### Locate [STYLE 04-02](https://angular.io/styleguide#04-02) -- [ ] **Do** make locating code intuitive, simple and fast. +- [X] **Do** make locating code intuitive, simple and fast. ### Identify [STYLE 04-03](https://angular.io/styleguide#04-03) -- [ ] **Do** name the file such that you instantly know what it contains and represents. -- [ ] **Do** be descriptive with file names and keep the contents of the file to exactly one component. -- [ ] ___Avoid___ files with multiple components, multiple services, or a mixture. +- [X] **Do** name the file such that you instantly know what it contains and represents. +- [X] **Do** be descriptive with file names and keep the contents of the file to exactly one component. +- [X] ___Avoid___ files with multiple components, multiple services, or a mixture. ### Flat [STYLE 04-04](https://angular.io/styleguide#04-04) -- [ ] **Do** keep a flat folder structure as long as possible. -- [ ] **Consider** creating sub-folders when a folder reaches seven or more files. -- [ ] **Consider** configuring the IDE to hide distracting, irrelevant files such as generated `.js` and `.js.map` files. +- [X] **Do** keep a flat folder structure as long as possible. +- [X] **Consider** creating sub-folders when a folder reaches seven or more files. +- [X] **Consider** configuring the IDE to hide distracting, irrelevant files such as generated `.js` and `.js.map` files. ### T-DRY (Try to be DRY) [STYLE 04-05](https://angular.io/styleguide#04-05) -- [ ] **Do** be DRY (Don't Repeat Yourself) -- [ ] **Avoid** being so DRY that you sacrifice readability. +- [X] **Do** be DRY (Don't Repeat Yourself) +- [X] **Avoid** being so DRY that you sacrifice readability. ### Overall Structural Guidelines [STYLE 04-06](https://angular.io/styleguide#04-06) -- [ ] **Do** start small but keep in mind where the app is heading down the road. -- [ ] **Do** have a near term view of implementation and a long term vision. -- [ ] **Do** put all of the app's code in a folder named `app`. -- [ ] **Consider** creating a folder for a component when is has multiple accompanying files (`.ts`, `.html`, `.css` and `.spec`). +- [X] **Do** start small but keep in mind where the app is heading down the road. +- [X] **Do** have a near term view of implementation and a long term vision. +- [X] **Do** put all of the app's code in a folder named `app`. +- [X] **Consider** creating a folder for a component when is has multiple accompanying files (`.ts`, `.html`, `.css` and `.spec`). ### Folders-by-Feature Structure [STYLE 04-07](https://angular.io/styleguide#04-07) -- [ ] **Do** create folders named for the feature area they represent. -- [ ] **Do** create an Angular module for each feature area. +- [X] **Do** create folders named for the feature area they represent. +- [X] **Do** create an Angular module for each feature area. ### App Root Module [STYLE 04-08](https://angular.io/styleguide#04-08) -- [ ] **Do** create an Angular module in the app's root folder (e.g., in `/app`). -- [ ] **Consider** naming the root module `app.module.ts`. +- [X] **Do** create an Angular module in the app's root folder (e.g., in `/app`). +- [X] **Consider** naming the root module `app.module.ts`. ### Feature Modules [STYLE 04-09](https://angular.io/styleguide#04-09) -- [ ] Do create an Angular module for all distinct features in an application (e.g. `Heroes` feature). -- [ ] Do place the feature module in the same named folder as the feature area (.e.g `app/heroes`). -- [ ] Do name the feature module file reflecting the name of the feature area and folder (e.g. `app/heroes/heroes.module.ts`) -- [ ] Do name the feature module symbol reflecting the name of the feature area, folder, and file (e.g. `app/heroes/heroes.module.ts` defines `HeroesModule`) +- [X] **Do** create an Angular module for all distinct features in an application (e.g. `Heroes` feature). +- [X] **Do** place the feature module in the same named folder as the feature area (.e.g `app/heroes`). +- [X] **Do** name the feature module file reflecting the name of the feature area and folder (e.g. `app/heroes/heroes.module.ts`) +- [X] **Do** name the feature module symbol reflecting the name of the feature area, folder, and file (e.g. `app/heroes/heroes.module.ts` defines `HeroesModule`) ### Shared Feature Module [STYLE 04-10](https://angular.io/styleguide#04-10) -- [ ] **Do** create a feature module named `SharedModule` in a `shared` folder (e.g. `app/shared/shared.module.ts` defines `SharedModule`). -- [ ] **Do** put common components, directives and pipes that will be used throughout the application by other feature modules in the `SharedModule`, where those assets are expected to share a new instance of themselves (not singletons). -- [ ] **Do** import all modules required by the assets in the `SharedModule` (e.g. `CommonModule` and `FormsModule`). -- [ ] **Do** declare all components, directives, and pipes in the `SharedModule`. -- [ ] **Do** export all symbols from the `SharedModule` that other feature modules need to use. -- [ ] ___Avoid___ specifying app-wide singleton providers in a `SharedModule`. Intentional singletons are OK. Take care. +- [X] **Do** create a feature module named `SharedModule` in a `shared` folder (e.g. `app/shared/shared.module.ts` defines `SharedModule`). +- [X] **Do** put common components, directives and pipes that will be used throughout the application by other feature modules in the `SharedModule`, where those assets are expected to share a new instance of themselves (not singletons). +- [X] **Do** import all modules required by the assets in the `SharedModule` (e.g. `CommonModule` and `FormsModule`). +- [X] **Do** declare all components, directives, and pipes in the `SharedModule`. +- [X] **Do** export all symbols from the `SharedModule` that other feature modules need to use. +- [X] ___Avoid___ specifying app-wide singleton providers in a `SharedModule`. Intentional singletons are OK. Take care. ### Core Feature Module [STYLE 04-11](https://angular.io/styleguide#04-11) -- [ ] **Do** collect single-use classes and hiding their gory details inside `CoreModule`. A simplified root `AppModule` imports `CoreModule` in its capacity as orchestrator of the application as a whole. -- [ ] **Do** create a feature module named `CoreModule` in a `core` folder (e.g. `app/core/core.module.ts` defines `CoreModule`). -- [ ] **Do** put a singleton service whose instance wil be shared throughout the application in the `CoreModule` (e.g. `ExceptionService` and `LoggerService`). -- [ ] **Do** import all modules required by the assets in the `CoreModule` (e.g. `CommonModule` and `FormsModule`). -- [ ] **Do** gather application-wide, single use components in the `CoreModule`. Import it once (in the `AppModule`) when the app starts and never import it anywhere else. (e.g. `NavComponent` and `SpinnerComponent`). -- [ ] ___Avoid___ importing the `CoreModule` anywhere except in the `AppModule`. -- [ ] **Do** export all symbols that from the `CoreModule` that the `AppModule` will import and make available for other feature modules to use. +- [X] **Do** collect single-use classes and hiding their gory details inside `CoreModule`. A simplified root `AppModule` imports `CoreModule` in its capacity as orchestrator of the application as a whole. +- [X] **Do** create a feature module named `CoreModule` in a `core` folder (e.g. `app/core/core.module.ts` defines `CoreModule`). +- [X] **Do** put a singleton service whose instance wil be shared throughout the application in the `CoreModule` (e.g. `ExceptionService` and `LoggerService`). +- [X] **Do** import all modules required by the assets in the `CoreModule` (e.g. `CommonModule` and `FormsModule`). +- [X] **Do** gather application-wide, single use components in the `CoreModule`. Import it once (in the `AppModule`) when the app starts and never import it anywhere else. (e.g. `NavComponent` and `SpinnerComponent`). +- [X] ___Avoid___ importing the `CoreModule` anywhere except in the `AppModule`. +- [X] **Do** export all symbols that from the `CoreModule` that the `AppModule` will import and make available for other feature modules to use. ### Prevent Reimport of Core Module [STYLE 04-12](https://angular.io/styleguide#04-12) -- [ ] **Do** guard against reimporting of `CoreModule` and fail fast by adding guard logic. +- [X] **Do** guard against reimporting of `CoreModule` and fail fast by adding guard logic. ### Lazy Loaded Folders [STYLE 04-13](https://angular.io/styleguide#!#04-13) -- [ ] **Do** put the contents of lazy loaded features in a *lazy loaded folder*. A typical *lazy loaded folder* contains a *routing component*, its child components, and their related assets and modules. +- [X] **Do** put the contents of lazy loaded features in a *lazy loaded folder*. A typical *lazy loaded folder* contains a *routing component*, its child components, and their related assets and modules. ### Never Directly Import Lazy Loaded Folders [STYLE 04-14](https://angular.io/styleguide#!#04-14) -- [ ] ___Avoid___ allowing modules in sibling and parent folders to directly import a module in a *lazy loaded feature*. +- [X] ___Avoid___ allowing modules in sibling and parent folders to directly import a module in a *lazy loaded feature*. ## 5. Components ### Component Selector Naming [STYLE 05-02](https://angular.io/styleguide#!#05-02) -- [ ] **Do** use *dashed-case* or *kebab-case* for naming the element selectors of components. +- [X] **Do** use *dashed-case* or *kebab-case* for naming the element selectors of components. ### Components as Elements [STYLE 05-03](https://angular.io/styleguide#!#05-03) -- [ ] **Do** define components as elements via the selector. +- [X] **Do** define components as elements via the selector. ### Extract Template and Styles to Their Own Files [STYLE 05-04](https://angular.io/styleguide#!#05-04) -- [ ] **Do** extract templates and styles into a separate file, when more than 3 lines. -- [ ] **Do** name the template file `[component-name].component.html`, where `[component-name]` is the component name. -- [ ] **Do** name the style file `[component-name].component.css`, where `[component-name]` is the component name. +- [X] **Do** extract templates and styles into a separate file, when more than 3 lines. +- [X] **Do** name the template file `[component-name].component.html`, where `[component-name]` is the component name. +- [X] **Do** name the style file `[component-name].component.css`, where `[component-name]` is the component name. ### Decorate Input and Output Properties Inline [STYLE 05-12](https://angular.io/styleguide#!#05-12) -- [ ] **Do** use `@Input` and `@Output` instead of the inputs and outputs properties of the `@Directive` and `@Component` decorators. -- [ ] **Do** place the `@Input()` or `@Output()` on the same line as the property they decorate. +- [X] **Do** use `@Input` and `@Output` instead of the inputs and outputs properties of the `@Directive` and `@Component` decorators. +- [X] **Do** place the `@Input()` or `@Output()` on the same line as the property they decorate. ### Avoid Renaming Inputs and Outputs [STYLE 05-13](https://angular.io/styleguide#!#05-13) -- [ ] ___Avoid___ renaming inputs and outputs, when possible. +- [X] ___Avoid___ renaming inputs and outputs, when possible. ### Member Sequence [STYLE 05-14](https://angular.io/styleguide#05-14) -- [ ] **Do** place properties up top followed by methods. -- [ ] **Do** place private members after public members, alphabetized. +- [X] **Do** place properties up top followed by methods. +- [X] **Do** place private members after public members, alphabetized. ### Put Logic in Services [STYLE 05-15](https://angular.io/styleguide#05-15) -- [ ] **Do** limit logic in a component to only that required for the view. All other logic should be delegated to services. -- [ ] **Do** move reusable logic to services and keep components simple and focused on their intended purpose. +- [X] **Do** limit logic in a component to only that required for the view. All other logic should be delegated to services. +- [X] **Do** move reusable logic to services and keep components simple and focused on their intended purpose. ### Don't Prefix Output Properties [STYLE 05-16](https://angular.io/styleguide#05-16) -- [ ] **Do** name events without the prefix `on`. -- [ ] **Do** name event handler methods with the prefix `on` followed by the event name. +- [X] **Do** name events without the prefix `on`. +- [X] **Do** name event handler methods with the prefix `on` followed by the event name. ### Put Presentation Logic in the Component Class [STYLE 05-17](https://angular.io/styleguide#!#05-17) -- [ ] **Do** put presentation logic in the component class, and not in the template. +- [X] **Do** put presentation logic in the component class, and not in the template. ## 6. Directives ### Use Directives to Enhance an Existing Element [STYLE 06-01](https://angular.io/styleguide#06-01) -- [ ] **Do** use attribute directives when you have presentation logic without a template. +- [X] **Do** use attribute directives when you have presentation logic without a template. ### Use HostListener and HostBinding Class Decorators [STYLE 06-03](https://angular.io/styleguide#06-03) -- [ ] **Consider** preferring the `@HostListener` and `@HostBinding` to the host property of the `@Directive` and `@Component` decorators. -- [ ] **Do** be consistent in your choice. +- [X] **Consider** preferring the `@HostListener` and `@HostBinding` to the host property of the `@Directive` and `@Component` decorators. +- [X] **Do** be consistent in your choice. ## 7. Services ### Services are Singletons within an Injector [STYLE 07-01](https://angular.io/styleguide#07-01) -- [ ] **Do** use services as singletons within the same injector. Use them for sharing data and functionality. +- [X] **Do** use services as singletons within the same injector. Use them for sharing data and functionality. ### Single Responsibility [STYLE 07-02](https://angular.io/styleguide#07-02) -- [ ] **Do** create services with a single responsibility that is encapsulated by its context. -- [ ] **Do** create a new service once the service begins to exceed that singular purpose. +- [X] **Do** create services with a single responsibility that is encapsulated by its context. +- [X] **Do** create a new service once the service begins to exceed that singular purpose. ### Providing a Service [STYLE 07-03](https://angular.io/styleguide#07-03) -- [ ] **Do** provide services to the Angular injector at the top-most component where they will be shared. +- [X] **Do** provide services to the Angular injector at the top-most component where they will be shared. ### Use the @Injectable() Class Decorator [STYLE 07-04](https://angular.io/styleguide#07-04) -- [ ] **Do** use the `@Injectable` class decorator instead of the `@Inject` parameter decorator when using types as tokens for the dependencies of a service. +- [X] **Do** use the `@Injectable` class decorator instead of the `@Inject` parameter decorator when using types as tokens for the dependencies of a service. ## 8. Data Services ### Separate Data Calls [STYLE 08-01](https://angular.io/styleguide#08-01) -- [ ] **Do** refactor logic for making data operations and interacting with data to a service. -- [ ] **Do** make data services responsible for XHR calls, local storage, stashing in memory, or any other data operations. +- [X] **Do** refactor logic for making data operations and interacting with data to a service. +- [X] **Do** make data services responsible for XHR calls, local storage, stashing in memory, or any other data operations. ## 9. Lifecycle Hooks ### Implement Lifecycle Hooks Interfaces [STYLE 09-01](https://angular.io/styleguide#09-01) -- [ ] **Do** implement the lifecycle hook interfaces. +- [X] **Do** implement the lifecycle hook interfaces. ## 10. Appendix ### Codelyzer [STYLE A-01](https://angular.io/styleguide#A-01) -- [ ] **Do** use [codelyzer](https://www.npmjs.com/package/codelyzer) to follow this guide. -- [ ] **Consider** adjusting the rules in codelyzer to suit your needs. +- [X] **Do** use [codelyzer](https://www.npmjs.com/package/codelyzer) to follow this guide. +- [X] **Consider** adjusting the rules in codelyzer to suit your needs. ### File Templates and Snippets [STYLE A-02](https://angular.io/styleguide#A-02) -- [ ] **Do** use file templates or snippets to help follow consistent styles and patterns. Here are templates and/or snippets for some of the web development editors and IDEs. -- [ ] **Consider** using [snippets](https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2) for [Visual Studio Code](https://code.visualstudio.com/) that follow these styles and guidelines. -- [ ] **Consider** using [snippets](https://atom.io/packages/angular-2-typescript-snippets) for [Atom](https://atom.io/) that follow these styles and guidelines. -- [ ] **Consider** using [snippets](https://github.com/orizens/sublime-angular2-snippets) for [Sublime Text](http://www.sublimetext.com/) that follow these styles and guidelines. -- [ ] **Consider** using [snippets](https://github.com/mhartington/vim-angular2-snippets) for [Vim](http://www.vim.org/) that follow these styles and guidelines. +- [X] **Do** use file templates or snippets to help follow consistent styles and patterns. Here are templates and/or snippets for some of the web development editors and IDEs. +- [X] **Consider** using [snippets](https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2) for [Visual Studio Code](https://code.visualstudio.com/) that follow these styles and guidelines. +- [X] **Consider** using [snippets](https://atom.io/packages/angular-2-typescript-snippets) for [Atom](https://atom.io/) that follow these styles and guidelines. +- [X] **Consider** using [snippets](https://github.com/orizens/sublime-angular2-snippets) for [Sublime Text](http://www.sublimetext.com/) that follow these styles and guidelines. +- [X] **Consider** using [snippets](https://github.com/mhartington/vim-angular2-snippets) for [Vim](http://www.vim.org/) that follow these styles and guidelines. diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 5ddbb20..98c4ef4 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -13,21 +13,21 @@ describe('AppComponent', () => { }); it('should create the app', async(() => { - let fixture = TestBed.createComponent(AppComponent); - let app = fixture.debugElement.componentInstance; + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); it(`should have as title 'cru works!'`, async(() => { - let fixture = TestBed.createComponent(AppComponent); - let app = fixture.debugElement.componentInstance; + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; expect(app.title).toEqual('cru works!'); })); it('should render title in a h1 tag', async(() => { - let fixture = TestBed.createComponent(AppComponent); + const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; expect(compiled.querySelector('h1').textContent).toContain('cru works!'); })); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f819bd8..e2c124e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,6 +2,9 @@ import { Component } from '@angular/core'; import { environment } from '../environments/environment'; +/** + * This class represents the root component of the application. + */ @Component({ selector: 'cru-root', templateUrl: './app.component.html', @@ -9,6 +12,10 @@ import { environment } from '../environments/environment'; }) export class AppComponent { + /** + * Creates an instance of the AppComponent class. + * @constructor + */ constructor() { console.log(JSON.stringify(environment)); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac02e16..f322270 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -6,10 +6,14 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; +import { CoreModule } from './core/core.module'; import { HomeModule } from './home/home.module'; import { LoginModule } from './login/login.module'; import { SharedModule } from './shared/shared.module'; +/** + * The AppModule provides the root module of the application. It imports all existing feature modules. + */ @NgModule({ declarations: [AppComponent], imports: [ @@ -21,12 +25,14 @@ import { SharedModule } from './shared/shared.module'; HttpModule, // app.routing AppRoutingModule, - // shared/shared.module - SharedModule, + // core/core.module + CoreModule, // home/home.module HomeModule, // login/login.module - LoginModule + LoginModule, + // shared/shared.module + SharedModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/shared/authentication/authentication.guard.ts b/src/app/core/authentication/authentication.guard.ts similarity index 100% rename from src/app/shared/authentication/authentication.guard.ts rename to src/app/core/authentication/authentication.guard.ts diff --git a/src/app/shared/authentication/authentication.module.ts b/src/app/core/authentication/authentication.module.ts similarity index 100% rename from src/app/shared/authentication/authentication.module.ts rename to src/app/core/authentication/authentication.module.ts diff --git a/src/app/shared/authentication/authentication.service.spec.ts b/src/app/core/authentication/authentication.service.spec.ts similarity index 100% rename from src/app/shared/authentication/authentication.service.spec.ts rename to src/app/core/authentication/authentication.service.spec.ts diff --git a/src/app/shared/authentication/authentication.service.ts b/src/app/core/authentication/authentication.service.ts similarity index 97% rename from src/app/shared/authentication/authentication.service.ts rename to src/app/core/authentication/authentication.service.ts index 7d3d1ad..078fde6 100644 --- a/src/app/shared/authentication/authentication.service.ts +++ b/src/app/core/authentication/authentication.service.ts @@ -37,7 +37,7 @@ export class AuthenticationService { return this.http.post(this.baseUrl + 'users/sign_in.json', userJSON, this.getRequestOptions()) .map((response: Response) => { // login successful if there's a jwt token in the response - let token = response.json() && response.json().token; + const token = response.json() && response.json().token; if (token) { // set token property this.token = token; diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts new file mode 100644 index 0000000..e5a7ee4 --- /dev/null +++ b/src/app/core/core.module.ts @@ -0,0 +1,44 @@ +import { CommonModule } from '@angular/common'; +import { NgModule, Optional, SkipSelf } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { AuthenticationModule } from './authentication/authentication.module'; +import { LoggingService } from './logging/logging.service'; +import { NavigationModule } from './navigation/navigation.module'; +import { throwIfAlreadyLoaded } from './module-import.guard'; + +/** + * The CoreModule provides all single-use components and singleton services of the application. + */ +@NgModule({ + imports: [ + // @angular/common + CommonModule, + // @angular/router + RouterModule, + // authentication/authentication.module + AuthenticationModule.forRoot(), + // navigation/navigation.module + NavigationModule + ], + exports: [ + // authentication/authentication.module + AuthenticationModule, + // navigation/navigation.module + NavigationModule + ], + declarations: [], + providers: [LoggingService] +}) +export class CoreModule { + + /** + * Do guard against reimporting of CoreModule and fail fast by adding guard logic. + * @param {CoreModule} parentModule - the parent Module. + * @constructor + */ + constructor( @Optional() @SkipSelf() parentModule: CoreModule) { + throwIfAlreadyLoaded(parentModule, 'CoreModule'); + } + +} diff --git a/src/app/core/logging/logging.service.spec.ts b/src/app/core/logging/logging.service.spec.ts new file mode 100644 index 0000000..73c0699 --- /dev/null +++ b/src/app/core/logging/logging.service.spec.ts @@ -0,0 +1,17 @@ +/* tslint:disable:no-unused-variable */ + +import { async, inject, TestBed } from '@angular/core/testing'; + +import { LoggingService } from './logging.service'; + +describe('Service: Logging', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [LoggingService] + }); + }); + + it('should ...', inject([LoggingService], (service: LoggingService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/src/app/core/logging/logging.service.ts b/src/app/core/logging/logging.service.ts new file mode 100644 index 0000000..ad56ba4 --- /dev/null +++ b/src/app/core/logging/logging.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; + +@Injectable() +export class LoggingService { + + log(msg: string) { + console.log(msg); + } + + error(msg: string) { + console.error(msg); + } + +} diff --git a/src/app/core/module-import.guard.ts b/src/app/core/module-import.guard.ts new file mode 100644 index 0000000..445640c --- /dev/null +++ b/src/app/core/module-import.guard.ts @@ -0,0 +1,5 @@ +export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) { + if (parentModule) { + throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`); + } +} diff --git a/src/app/shared/navigation/navigation.component.html b/src/app/core/navigation/navigation.component.html similarity index 100% rename from src/app/shared/navigation/navigation.component.html rename to src/app/core/navigation/navigation.component.html diff --git a/src/app/shared/navigation/navigation.component.scss b/src/app/core/navigation/navigation.component.scss similarity index 100% rename from src/app/shared/navigation/navigation.component.scss rename to src/app/core/navigation/navigation.component.scss diff --git a/src/app/shared/navigation/navigation.component.spec.ts b/src/app/core/navigation/navigation.component.spec.ts similarity index 100% rename from src/app/shared/navigation/navigation.component.spec.ts rename to src/app/core/navigation/navigation.component.spec.ts diff --git a/src/app/shared/navigation/navigation.component.ts b/src/app/core/navigation/navigation.component.ts similarity index 100% rename from src/app/shared/navigation/navigation.component.ts rename to src/app/core/navigation/navigation.component.ts diff --git a/src/app/shared/navigation/navigation.module.ts b/src/app/core/navigation/navigation.module.ts similarity index 99% rename from src/app/shared/navigation/navigation.module.ts rename to src/app/core/navigation/navigation.module.ts index c302780..d59c7ee 100644 --- a/src/app/shared/navigation/navigation.module.ts +++ b/src/app/core/navigation/navigation.module.ts @@ -3,7 +3,6 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { AuthenticationModule } from '../authentication/authentication.module'; - import { NavigationComponent } from './navigation.component'; @NgModule({ diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 675ae53..7083761 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { AuthenticationGuard } from '../shared/authentication/authentication.guard'; +import { AuthenticationGuard } from '../core/authentication/authentication.guard'; import { HomeComponent } from './home.component'; /** diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts index 1f31e67..3c85b78 100644 --- a/src/app/home/home.component.spec.ts +++ b/src/app/home/home.component.spec.ts @@ -1,11 +1,29 @@ /* tslint:disable:no-unused-variable */ -import { async, TestBed } from '@angular/core/testing'; +import { DebugElement } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; + import { HomeComponent } from './home.component'; -describe('Component: Home', () => { - it('should create an instance', () => { - let component = new HomeComponent(); +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 903e6df..b789386 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { AuthenticationService } from '../shared/authentication/authentication.service'; +import { AuthenticationService } from '../core/authentication/authentication.service'; /** - * This class represents the lazy loaded HomeComponent. + * This class provides the Home component of the application. */ @Component({ selector: 'cru-home', @@ -24,7 +24,7 @@ export class HomeComponent implements OnInit { constructor(private authenticationService: AuthenticationService) { } /** - * Initialises the component. + * Lifecycle hook which is called after the component has initialized. */ ngOnInit() { this.currentUser = JSON.parse(this.authenticationService.getCurrentUser()); diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 739e95e..8f1840f 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -2,10 +2,14 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; +import { HomeRoutingModule } from './home-routing.module'; import { HomeComponent } from './home.component'; +/** + * The LoginModule provides the Home component of the application. + */ @NgModule({ - imports: [CommonModule, SharedModule], + imports: [CommonModule, HomeRoutingModule, SharedModule], declarations: [HomeComponent], exports: [HomeComponent] }) diff --git a/src/app/index.ts b/src/app/index.ts index 875bdb2..f42e29d 100644 --- a/src/app/index.ts +++ b/src/app/index.ts @@ -1,2 +1,5 @@ +/** + * This barrel file provides the exports for the App component and App module. + */ export * from './app.component'; export * from './app.module'; diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts index 8a6ecc6..384f06e 100644 --- a/src/app/login/login.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -1,11 +1,29 @@ /* tslint:disable:no-unused-variable */ -import { async, TestBed } from '@angular/core/testing'; +import { DebugElement } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; + import { LoginComponent } from './login.component'; -describe('Component: Login', () => { - it('should create an instance', () => { - let component = new LoginComponent(); +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index f204cd9..e77eca2 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -1,10 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthenticationService } from '../shared/authentication/authentication.service'; +import { AuthenticationService } from '../core/authentication/authentication.service'; /** - * This class represents the lazy loaded LoginComponent. + * This class provides the Login component of the application. */ @Component({ selector: 'cru-login', @@ -26,7 +26,7 @@ export class LoginComponent implements OnInit { constructor(private router: Router, private authenticationService: AuthenticationService) { } /** - * Initialises the component and resets the login status. + * Lifecycle hook which is called after the component has initialized. */ ngOnInit() { this.authenticationService.logout(); @@ -40,7 +40,7 @@ export class LoginComponent implements OnInit { this.authenticationService.login(this.user.username, this.user.password) .subscribe(result => { if (result === true) { - this.router.navigate(['/']); + this.router.navigate(['']); } else { this.error = 'Username or password is incorrect'; this.loading = false; diff --git a/src/app/login/login.module.ts b/src/app/login/login.module.ts index 099cf0f..8d38a30 100644 --- a/src/app/login/login.module.ts +++ b/src/app/login/login.module.ts @@ -2,10 +2,14 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; +import { LoginRoutingModule } from './login-routing.module'; import { LoginComponent } from './login.component'; +/** + * The LoginModule provides the Login component of the application. + */ @NgModule({ - imports: [CommonModule, SharedModule], + imports: [CommonModule, LoginRoutingModule, SharedModule], declarations: [LoginComponent], exports: [LoginComponent] }) diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index ce84f0e..f0ef25a 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -3,19 +3,17 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; -import { AuthenticationModule } from './authentication/authentication.module'; -import { NavigationModule } from './navigation/navigation.module'; - +/** + * The SharedModule provides all shared components, directives and pipes of the application. + */ @NgModule({ imports: [ // @angular/common CommonModule, + // @angular/forms + FormsModule, // @angular/router - RouterModule, - // authentication/authentication.module - AuthenticationModule.forRoot(), - // navigation/navigation.module - NavigationModule + RouterModule ], exports: [ // @angular/common @@ -23,11 +21,7 @@ import { NavigationModule } from './navigation/navigation.module'; // @angular/forms FormsModule, // @angular/router - RouterModule, - // authentication/authentication.module - AuthenticationModule, - // navigation/navigation.module - NavigationModule + RouterModule ] }) export class SharedModule { } diff --git a/src/main.ts b/src/main.ts index 5c3c520..c19ee64 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import './polyfills.ts'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { environment } from './environments/environment'; import { AppModule } from './app/'; diff --git a/src/test.ts b/src/test.ts index 81af890..ae22663 100644 --- a/src/test.ts +++ b/src/test.ts @@ -25,7 +25,7 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting() ); // Then we find all the tests. -let context = require.context('./', true, /\.spec\.ts/); +const context = require.context('./', true, /\.spec\.ts/); // And load the modules. context.keys().map(context); // Finally, start Karma to run the tests. From ab3e335a4836a183e7231749ddb0f919acf1b4f6 Mon Sep 17 00:00:00 2001 From: TheDonDope Date: Sat, 26 Nov 2016 16:01:23 +0100 Subject: [PATCH 9/9] chore(release): 1.2.0 --- CHANGELOG.md | 29 +++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef0b5dc..be8f0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ + +# [1.2.0](https://github.com/TheDonDope/crudular/releases/tag/v1.2.0) (2016-11-26) + +[Full Changelog](https://github.com/TheDonDope/crudular/compare/v1.1.0...v1.2.0) + +### Features + +* **styleguide:** conform to styleguide rules ([d00cfcd](https://github.com/TheDonDope/crudular/commit/d00cfcd7cb815a65e77a5fda86a963c89f6c7ac3)) +* **angular-cli:** update to 1.0.0-beta.21 ([02f5de2](https://github.com/TheDonDope/crudular/commit/02f5de2e4f66b1c009875bc6e1dfc1f14e76796e)) +* **styleguide:** add styleguide document ([0339867](https://github.com/TheDonDope/crudular/commit/03398679c116d1cf9ce2d81fa72d35cc594e8c61)) +* **styleguide:** conform to 02-12 ([bdda04a](https://github.com/TheDonDope/crudular/commit/bdda04ad2ff4886da1482f19aa4d92674cc83066)) +* **angular-cli:** update to 1.0.0-beta.20-4 ([0c61fe5](https://github.com/TheDonDope/crudular/commit/0c61fe51b2940de09772ec4aac2463205cf096a6)) + + # [1.1.0](https://github.com/TheDonDope/crudular/releases/tag/v1.1.0) (2016-11-05) @@ -5,9 +19,9 @@ ### Features -* **angular-cli:** update angular-cli d783393 -* **nginx:** provide nginx prod build f1a5690 -* **docker:** provide docker deployment 4cf1a60 +* **angular-cli:** update angular-cli ([d783393](https://github.com/TheDonDope/crudular/commit/d78339374bd7ac6ab8dcde34bba4b51d6a804628)) +* **nginx:** provide nginx prod build ([f1a5690](https://github.com/TheDonDope/crudular/commit/f1a5690f1f46c26a13f2c5e1e854bd736e89d868)) +* **docker:** provide docker deployment ([4cf1a60](https://github.com/TheDonDope/crudular/commit/4cf1a606e860fbd194c482abcf9e34fe723b1969)) @@ -16,10 +30,9 @@ ### Features -* **jwt:** provide login, home and shared module cb72080 -* **routing:** provide app routing module 57bc688 -* **styling:** configure bootstrap 6449ddd -* **styling:** configure font-awesome 4c496bc - +* **jwt:** provide login, home and shared module ([cb72080](https://github.com/TheDonDope/crudular/commit/cb720805b182865ba7d0accb949206e77a80aacd)) +* **routing:** provide app routing module ([57bc688](https://github.com/TheDonDope/crudular/commit/57bc688e959876f7ecc78bfe84287dd34fefa321)) +* **styling:** configure font-awesome ([4c496bc](https://github.com/TheDonDope/crudular/commit/4c496bcaa6eb6254d44530f4cb692f4c6cfe2031)) +* **styling:** configure bootstrap ([6449ddd](https://github.com/TheDonDope/crudular/commit/6449ddd58200a49be4bcda6b0d260de33ac6cd05)) diff --git a/package.json b/package.json index 5b5b441..adddaa6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crudular", - "version": "1.1.0", + "version": "1.2.0", "license": "MIT", "angular-cli": {}, "scripts": {