diff --git a/.gitignore b/.gitignore index 6bb9dc197c..3d0baf4a0f 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,5 @@ output *.ngsummary.json *.ngfactory.ts tmp + +example-dist/ \ No newline at end of file diff --git a/docs/effects/api.md b/docs/effects/api.md index 58efdbf8e6..51765a670f 100644 --- a/docs/effects/api.md +++ b/docs/effects/api.md @@ -118,7 +118,7 @@ If you want to trigger another action, be careful to add this effect at the end. import { Injectable } from '@angular/core'; import { Actions, Effect, ofType } from '@ngrx/effects'; import { defer } from 'rxjs'; -import { LoginAction, LogoutAction } from './auth'; +import { LoginAction, LogoutAction } from './auth.actions'; @Injectable() export class SomeEffectsClass { diff --git a/docs/store/actions.md b/docs/store/actions.md index ebde1c32d1..b20e3ca373 100644 --- a/docs/store/actions.md +++ b/docs/store/actions.md @@ -6,7 +6,7 @@ Provide the `ActionReducerMap` with your reducer map for added type checking. ```ts import { ActionReducerMap } from '@ngrx/store'; -import * as fromAuth from './auth'; +import * as fromAuth from './auth.actions'; export interface State { auth: fromAuth.State; @@ -45,10 +45,7 @@ export class Reset implements Action { constructor(public payload: number) {} } -export type CounterActionsUnion = - | Increment - | Decrement - | Reset; +export type CounterActionsUnion = Increment | Decrement | Reset; ``` This provides typed actions for your reducer functions. @@ -58,7 +55,7 @@ This provides typed actions for your reducer functions. import { CounterActionTypes, CounterActionsUnion } from './counter.actions'; export function reducer(state: number = 0, action: CounterActionsUnion): State { - switch(action.type) { + switch (action.type) { case CounterActionTypes.INCREMENT: { return state + 1; } @@ -95,7 +92,7 @@ interface AppState { - +
Current Count: {{ counter | async }}
`, }) diff --git a/example-app/app/app.module.ts b/example-app/app/app.module.ts index 8d948b5ea4..1a1a8805d8 100644 --- a/example-app/app/app.module.ts +++ b/example-app/app/app.module.ts @@ -22,7 +22,7 @@ import { reducers, metaReducers } from './reducers'; import { schema } from './db'; import { CustomRouterStateSerializer } from './shared/utils'; -import { AppComponent } from './core/containers/app'; +import { AppComponent } from './core/containers/app.component'; import { environment } from '../environments/environment'; @NgModule({ diff --git a/example-app/app/auth/actions/auth.ts b/example-app/app/auth/actions/auth.actions.ts similarity index 100% rename from example-app/app/auth/actions/auth.ts rename to example-app/app/auth/actions/auth.actions.ts diff --git a/example-app/app/auth/containers/login-page.component.spec.ts b/example-app/app/auth/containers/login-page.component.spec.ts index cae6d17ae2..cc3eed4c8a 100644 --- a/example-app/app/auth/containers/login-page.component.spec.ts +++ b/example-app/app/auth/containers/login-page.component.spec.ts @@ -5,7 +5,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { StoreModule, Store, combineReducers } from '@ngrx/store'; import { LoginPageComponent } from './login-page.component'; import { LoginFormComponent } from '../components/login-form.component'; -import * as AuthActions from '../actions/auth'; +import * as AuthActions from '../actions/auth.actions'; import * as fromAuth from '../reducers'; describe('Login Page', () => { diff --git a/example-app/app/auth/containers/login-page.component.ts b/example-app/app/auth/containers/login-page.component.ts index 843f5cd916..fa9256e47b 100644 --- a/example-app/app/auth/containers/login-page.component.ts +++ b/example-app/app/auth/containers/login-page.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Store, select } from '@ngrx/store'; import { Authenticate } from '../models/user'; import * as fromAuth from '../reducers'; -import * as AuthActions from '../actions/auth'; +import * as AuthActions from '../actions/auth.actions'; @Component({ selector: 'bc-login-page', diff --git a/example-app/app/auth/effects/auth.effects.spec.ts b/example-app/app/auth/effects/auth.effects.spec.ts index 5b5d0498aa..1c4082215c 100644 --- a/example-app/app/auth/effects/auth.effects.spec.ts +++ b/example-app/app/auth/effects/auth.effects.spec.ts @@ -10,7 +10,7 @@ import { LoginRedirect, LoginSuccess, Logout, -} from '../actions/auth'; +} from '../actions/auth.actions'; import { Authenticate, User } from '../models/user'; import { AuthService } from '../services/auth.service'; import { AuthEffects } from './auth.effects'; diff --git a/example-app/app/auth/effects/auth.effects.ts b/example-app/app/auth/effects/auth.effects.ts index 11ef24d8d4..826cf3a5d9 100644 --- a/example-app/app/auth/effects/auth.effects.ts +++ b/example-app/app/auth/effects/auth.effects.ts @@ -9,7 +9,7 @@ import { Login, LoginFailure, LoginSuccess, -} from '../actions/auth'; +} from '../actions/auth.actions'; import { Authenticate } from '../models/user'; import { AuthService } from '../services/auth.service'; diff --git a/example-app/app/auth/reducers/__snapshots__/auth.spec.ts.snap b/example-app/app/auth/reducers/__snapshots__/auth.reducer.spec.ts.snap similarity index 100% rename from example-app/app/auth/reducers/__snapshots__/auth.spec.ts.snap rename to example-app/app/auth/reducers/__snapshots__/auth.reducer.spec.ts.snap diff --git a/example-app/app/auth/reducers/__snapshots__/login-page.spec.ts.snap b/example-app/app/auth/reducers/__snapshots__/login-page.reducer.spec.ts.snap similarity index 100% rename from example-app/app/auth/reducers/__snapshots__/login-page.spec.ts.snap rename to example-app/app/auth/reducers/__snapshots__/login-page.reducer.spec.ts.snap diff --git a/example-app/app/auth/reducers/auth.spec.ts b/example-app/app/auth/reducers/auth.reducer.spec.ts similarity index 91% rename from example-app/app/auth/reducers/auth.spec.ts rename to example-app/app/auth/reducers/auth.reducer.spec.ts index 15a38c3146..90b0ba404b 100644 --- a/example-app/app/auth/reducers/auth.spec.ts +++ b/example-app/app/auth/reducers/auth.reducer.spec.ts @@ -1,6 +1,6 @@ -import { reducer } from './auth'; -import * as fromAuth from './auth'; -import { Login, LoginSuccess, Logout } from '../actions/auth'; +import { reducer } from './auth.reducer'; +import * as fromAuth from './auth.reducer'; +import { Login, LoginSuccess, Logout } from '../actions/auth.actions'; import { Authenticate, User } from '../models/user'; describe('AuthReducer', () => { diff --git a/example-app/app/auth/reducers/auth.ts b/example-app/app/auth/reducers/auth.reducer.ts similarity index 97% rename from example-app/app/auth/reducers/auth.ts rename to example-app/app/auth/reducers/auth.reducer.ts index 3748bc7b51..35bf082924 100644 --- a/example-app/app/auth/reducers/auth.ts +++ b/example-app/app/auth/reducers/auth.reducer.ts @@ -1,4 +1,4 @@ -import { AuthActionsUnion, AuthActionTypes } from './../actions/auth'; +import { AuthActionsUnion, AuthActionTypes } from './../actions/auth.actions'; import { User } from '../models/user'; export interface State { diff --git a/example-app/app/auth/reducers/index.ts b/example-app/app/auth/reducers/index.ts index b51d658a65..097369aaeb 100644 --- a/example-app/app/auth/reducers/index.ts +++ b/example-app/app/auth/reducers/index.ts @@ -4,8 +4,8 @@ import { ActionReducerMap, } from '@ngrx/store'; import * as fromRoot from '../../reducers'; -import * as fromAuth from './auth'; -import * as fromLoginPage from './login-page'; +import * as fromAuth from './auth.reducer'; +import * as fromLoginPage from './login-page.reducer'; export interface AuthState { status: fromAuth.State; diff --git a/example-app/app/auth/reducers/login-page.spec.ts b/example-app/app/auth/reducers/login-page.reducer.spec.ts similarity index 88% rename from example-app/app/auth/reducers/login-page.spec.ts rename to example-app/app/auth/reducers/login-page.reducer.spec.ts index 115a1b639c..4b51fbab8f 100644 --- a/example-app/app/auth/reducers/login-page.spec.ts +++ b/example-app/app/auth/reducers/login-page.reducer.spec.ts @@ -1,6 +1,11 @@ -import { reducer } from './login-page'; -import * as fromLoginPage from './login-page'; -import { Login, LoginSuccess, LoginFailure, Logout } from '../actions/auth'; +import { reducer } from './login-page.reducer'; +import * as fromLoginPage from './login-page.reducer'; +import { + Login, + LoginSuccess, + LoginFailure, + Logout, +} from '../actions/auth.actions'; import { Authenticate, User } from '../models/user'; describe('LoginPageReducer', () => { diff --git a/example-app/app/auth/reducers/login-page.ts b/example-app/app/auth/reducers/login-page.reducer.ts similarity index 98% rename from example-app/app/auth/reducers/login-page.ts rename to example-app/app/auth/reducers/login-page.reducer.ts index 5b4c5f37c0..6a4a68778e 100644 --- a/example-app/app/auth/reducers/login-page.ts +++ b/example-app/app/auth/reducers/login-page.reducer.ts @@ -1,4 +1,4 @@ -import { AuthActionTypes, AuthActionsUnion } from './../actions/auth'; +import { AuthActionTypes, AuthActionsUnion } from './../actions/auth.actions'; export interface State { error: string | null; diff --git a/example-app/app/auth/services/auth-guard.service.spec.ts b/example-app/app/auth/services/auth-guard.service.spec.ts index 360d506c6a..8ee66ae91a 100644 --- a/example-app/app/auth/services/auth-guard.service.spec.ts +++ b/example-app/app/auth/services/auth-guard.service.spec.ts @@ -2,7 +2,7 @@ import { TestBed, inject } from '@angular/core/testing'; import { StoreModule, Store, combineReducers } from '@ngrx/store'; import { cold } from 'jasmine-marbles'; import { AuthGuard } from './auth-guard.service'; -import * as AuthActions from '../actions/auth'; +import * as AuthActions from '../actions/auth.actions'; import * as fromRoot from '../../reducers'; import * as fromAuth from '../reducers'; diff --git a/example-app/app/auth/services/auth-guard.service.ts b/example-app/app/auth/services/auth-guard.service.ts index 470ccd75f1..d110bd753b 100644 --- a/example-app/app/auth/services/auth-guard.service.ts +++ b/example-app/app/auth/services/auth-guard.service.ts @@ -3,7 +3,7 @@ import { CanActivate } from '@angular/router'; import { Store, select } from '@ngrx/store'; import { Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; -import * as AuthActions from '../actions/auth'; +import * as AuthActions from '../actions/auth.actions'; import * as fromAuth from '../reducers'; @Injectable() diff --git a/example-app/app/books/actions/book.ts b/example-app/app/books/actions/book.actions.ts similarity index 100% rename from example-app/app/books/actions/book.ts rename to example-app/app/books/actions/book.actions.ts diff --git a/example-app/app/books/actions/collection.ts b/example-app/app/books/actions/collection.actions.ts similarity index 100% rename from example-app/app/books/actions/collection.ts rename to example-app/app/books/actions/collection.actions.ts diff --git a/example-app/app/books/books.module.ts b/example-app/app/books/books.module.ts index 01cb00d388..b2b265366b 100644 --- a/example-app/app/books/books.module.ts +++ b/example-app/app/books/books.module.ts @@ -5,14 +5,14 @@ import { StoreModule } from '@ngrx/store'; import { EffectsModule } from '@ngrx/effects'; import { ComponentsModule } from './components'; -import { BookEffects } from './effects/book'; -import { CollectionEffects } from './effects/collection'; -import { BookExistsGuard } from './guards/book-exists'; +import { BookEffects } from './effects/book.effects'; +import { CollectionEffects } from './effects/collection.effects'; +import { BookExistsGuard } from './guards/book-exists.guard'; -import { FindBookPageComponent } from './containers/find-book-page'; -import { ViewBookPageComponent } from './containers/view-book-page'; -import { SelectedBookPageComponent } from './containers/selected-book-page'; -import { CollectionPageComponent } from './containers/collection-page'; +import { FindBookPageComponent } from './containers/find-book-page.component'; +import { ViewBookPageComponent } from './containers/view-book-page.component'; +import { SelectedBookPageComponent } from './containers/selected-book-page.component'; +import { CollectionPageComponent } from './containers/collection-page.component'; import { MaterialModule } from '../material'; import { reducers } from './reducers'; diff --git a/example-app/app/books/components/book-authors.ts b/example-app/app/books/components/book-authors.component.ts similarity index 100% rename from example-app/app/books/components/book-authors.ts rename to example-app/app/books/components/book-authors.component.ts diff --git a/example-app/app/books/components/book-detail.ts b/example-app/app/books/components/book-detail.component.ts similarity index 100% rename from example-app/app/books/components/book-detail.ts rename to example-app/app/books/components/book-detail.component.ts diff --git a/example-app/app/books/components/book-preview-list.ts b/example-app/app/books/components/book-preview-list.component.ts similarity index 100% rename from example-app/app/books/components/book-preview-list.ts rename to example-app/app/books/components/book-preview-list.component.ts diff --git a/example-app/app/books/components/book-preview.ts b/example-app/app/books/components/book-preview.component.ts similarity index 100% rename from example-app/app/books/components/book-preview.ts rename to example-app/app/books/components/book-preview.component.ts diff --git a/example-app/app/books/components/book-search.ts b/example-app/app/books/components/book-search.component.ts similarity index 100% rename from example-app/app/books/components/book-search.ts rename to example-app/app/books/components/book-search.component.ts diff --git a/example-app/app/books/components/index.ts b/example-app/app/books/components/index.ts index c31ceabb3f..beb30370fc 100644 --- a/example-app/app/books/components/index.ts +++ b/example-app/app/books/components/index.ts @@ -3,11 +3,11 @@ import { CommonModule } from '@angular/common'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; -import { BookAuthorsComponent } from './book-authors'; -import { BookDetailComponent } from './book-detail'; -import { BookPreviewComponent } from './book-preview'; -import { BookPreviewListComponent } from './book-preview-list'; -import { BookSearchComponent } from './book-search'; +import { BookAuthorsComponent } from './book-authors.component'; +import { BookDetailComponent } from './book-detail.component'; +import { BookPreviewComponent } from './book-preview.component'; +import { BookPreviewListComponent } from './book-preview-list.component'; +import { BookSearchComponent } from './book-search.component'; import { PipesModule } from '../../shared/pipes'; import { MaterialModule } from '../../material'; diff --git a/example-app/app/books/containers/__snapshots__/collection-page.spec.ts.snap b/example-app/app/books/containers/__snapshots__/collection-page.component.spec.ts.snap similarity index 100% rename from example-app/app/books/containers/__snapshots__/collection-page.spec.ts.snap rename to example-app/app/books/containers/__snapshots__/collection-page.component.spec.ts.snap diff --git a/example-app/app/books/containers/__snapshots__/find-book-page.spec.ts.snap b/example-app/app/books/containers/__snapshots__/find-book-page.component.spec.ts.snap similarity index 100% rename from example-app/app/books/containers/__snapshots__/find-book-page.spec.ts.snap rename to example-app/app/books/containers/__snapshots__/find-book-page.component.spec.ts.snap diff --git a/example-app/app/books/containers/__snapshots__/selected-book-page.spec.ts.snap b/example-app/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap similarity index 100% rename from example-app/app/books/containers/__snapshots__/selected-book-page.spec.ts.snap rename to example-app/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap diff --git a/example-app/app/books/containers/__snapshots__/view-book-page.spec.ts.snap b/example-app/app/books/containers/__snapshots__/view-book-page.component.spec.ts.snap similarity index 100% rename from example-app/app/books/containers/__snapshots__/view-book-page.spec.ts.snap rename to example-app/app/books/containers/__snapshots__/view-book-page.component.spec.ts.snap diff --git a/example-app/app/books/containers/collection-page.spec.ts b/example-app/app/books/containers/collection-page.component.spec.ts similarity index 84% rename from example-app/app/books/containers/collection-page.spec.ts rename to example-app/app/books/containers/collection-page.component.spec.ts index be21dd8731..11313e3c3e 100644 --- a/example-app/app/books/containers/collection-page.spec.ts +++ b/example-app/app/books/containers/collection-page.component.spec.ts @@ -1,16 +1,16 @@ -import { CollectionPageComponent } from './collection-page'; +import { CollectionPageComponent } from './collection-page.component'; import { combineReducers, Store, StoreModule } from '@ngrx/store'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { MatCardModule, MatInputModule } from '@angular/material'; -import { BookPreviewListComponent } from '../components/book-preview-list'; -import { BookPreviewComponent } from '../components/book-preview'; -import * as CollectionActions from '../actions/collection'; +import { BookPreviewListComponent } from '../components/book-preview-list.component'; +import { BookPreviewComponent } from '../components/book-preview.component'; +import * as CollectionActions from '../actions/collection.actions'; import * as fromBooks from '../reducers'; -import { EllipsisPipe } from '../../shared/pipes/ellipsis'; -import { AddCommasPipe } from '../../shared/pipes/add-commas'; -import { BookAuthorsComponent } from '../components/book-authors'; +import { EllipsisPipe } from '../../shared/pipes/ellipsis.pipe'; +import { AddCommasPipe } from '../../shared/pipes/add-commas.pipe'; +import { BookAuthorsComponent } from '../components/book-authors.component'; describe('Collection Page', () => { let fixture: ComponentFixture; diff --git a/example-app/app/books/containers/collection-page.ts b/example-app/app/books/containers/collection-page.component.ts similarity index 94% rename from example-app/app/books/containers/collection-page.ts rename to example-app/app/books/containers/collection-page.component.ts index fee975cdcc..aa7b33b316 100644 --- a/example-app/app/books/containers/collection-page.ts +++ b/example-app/app/books/containers/collection-page.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { Observable } from 'rxjs'; -import * as CollectionActions from '../actions/collection'; +import * as CollectionActions from '../actions/collection.actions'; import { Book } from '../models/book'; import * as fromBooks from '../reducers'; diff --git a/example-app/app/books/containers/find-book-page.spec.ts b/example-app/app/books/containers/find-book-page.component.spec.ts similarity index 83% rename from example-app/app/books/containers/find-book-page.spec.ts rename to example-app/app/books/containers/find-book-page.component.spec.ts index 3ac1de93df..1ac5e5f5bc 100644 --- a/example-app/app/books/containers/find-book-page.spec.ts +++ b/example-app/app/books/containers/find-book-page.component.spec.ts @@ -8,15 +8,15 @@ import { import { combineReducers, Store, StoreModule } from '@ngrx/store'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { BookSearchComponent } from '../components/book-search'; -import { BookPreviewComponent } from '../components/book-preview'; -import { BookPreviewListComponent } from '../components/book-preview-list'; +import { BookSearchComponent } from '../components/book-search.component'; +import { BookPreviewComponent } from '../components/book-preview.component'; +import { BookPreviewListComponent } from '../components/book-preview-list.component'; import { RouterTestingModule } from '@angular/router/testing'; -import { EllipsisPipe } from '../../shared/pipes/ellipsis'; -import { BookAuthorsComponent } from '../components/book-authors'; -import { AddCommasPipe } from '../../shared/pipes/add-commas'; -import { FindBookPageComponent } from './find-book-page'; -import * as BookActions from '../actions/book'; +import { EllipsisPipe } from '../../shared/pipes/ellipsis.pipe'; +import { BookAuthorsComponent } from '../components/book-authors.component'; +import { AddCommasPipe } from '../../shared/pipes/add-commas.pipe'; +import { FindBookPageComponent } from './find-book-page.component'; +import * as BookActions from '../actions/book.actions'; import * as fromBooks from '../reducers'; describe('Find Book Page', () => { diff --git a/example-app/app/books/containers/find-book-page.ts b/example-app/app/books/containers/find-book-page.component.ts similarity index 95% rename from example-app/app/books/containers/find-book-page.ts rename to example-app/app/books/containers/find-book-page.component.ts index f04d6e98e5..f81fab6b9f 100644 --- a/example-app/app/books/containers/find-book-page.ts +++ b/example-app/app/books/containers/find-book-page.component.ts @@ -3,7 +3,7 @@ import { select, Store } from '@ngrx/store'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; -import * as BookActions from '../actions/book'; +import * as BookActions from '../actions/book.actions'; import { Book } from '../models/book'; import * as fromBooks from '../reducers'; diff --git a/example-app/app/books/containers/selected-book-page.spec.ts b/example-app/app/books/containers/selected-book-page.component.spec.ts similarity index 86% rename from example-app/app/books/containers/selected-book-page.spec.ts rename to example-app/app/books/containers/selected-book-page.component.spec.ts index b952f3bec1..27c977bdf8 100644 --- a/example-app/app/books/containers/selected-book-page.spec.ts +++ b/example-app/app/books/containers/selected-book-page.component.spec.ts @@ -1,15 +1,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { SelectedBookPageComponent } from './selected-book-page'; +import { SelectedBookPageComponent } from './selected-book-page.component'; import { combineReducers, Store, StoreModule } from '@ngrx/store'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatCardModule } from '@angular/material'; -import * as CollectionActions from '../actions/collection'; +import * as CollectionActions from '../actions/collection.actions'; import * as fromBooks from '../reducers'; -import { BookDetailComponent } from '../components/book-detail'; +import { BookDetailComponent } from '../components/book-detail.component'; import { Book, generateMockBook } from '../models/book'; -import { BookAuthorsComponent } from '../components/book-authors'; -import { AddCommasPipe } from '../../shared/pipes/add-commas'; +import { BookAuthorsComponent } from '../components/book-authors.component'; +import { AddCommasPipe } from '../../shared/pipes/add-commas.pipe'; describe('Selected Book Page', () => { let fixture: ComponentFixture; diff --git a/example-app/app/books/containers/selected-book-page.ts b/example-app/app/books/containers/selected-book-page.component.ts similarity index 94% rename from example-app/app/books/containers/selected-book-page.ts rename to example-app/app/books/containers/selected-book-page.component.ts index b19f8888ea..6e2dca8b3e 100644 --- a/example-app/app/books/containers/selected-book-page.ts +++ b/example-app/app/books/containers/selected-book-page.component.ts @@ -3,7 +3,7 @@ import { Store, select } from '@ngrx/store'; import { Observable } from 'rxjs'; import * as fromBooks from '../reducers'; -import * as CollectionActions from '../actions/collection'; +import * as CollectionActions from '../actions/collection.actions'; import { Book } from '../models/book'; @Component({ diff --git a/example-app/app/books/containers/view-book-page.spec.ts b/example-app/app/books/containers/view-book-page.component.spec.ts similarity index 81% rename from example-app/app/books/containers/view-book-page.spec.ts rename to example-app/app/books/containers/view-book-page.component.spec.ts index f8fbf0ecf2..01b89868ea 100644 --- a/example-app/app/books/containers/view-book-page.spec.ts +++ b/example-app/app/books/containers/view-book-page.component.spec.ts @@ -4,13 +4,13 @@ import { ActivatedRoute } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; import { MatCardModule } from '@angular/material'; -import { ViewBookPageComponent } from './view-book-page'; -import * as BookActions from '../actions/book'; +import { ViewBookPageComponent } from './view-book-page.component'; +import * as BookActions from '../actions/book.actions'; import * as fromBooks from '../reducers'; -import { SelectedBookPageComponent } from './selected-book-page'; -import { BookDetailComponent } from '../components/book-detail'; -import { BookAuthorsComponent } from '../components/book-authors'; -import { AddCommasPipe } from '../../shared/pipes/add-commas'; +import { SelectedBookPageComponent } from './selected-book-page.component'; +import { BookDetailComponent } from '../components/book-detail.component'; +import { BookAuthorsComponent } from '../components/book-authors.component'; +import { AddCommasPipe } from '../../shared/pipes/add-commas.pipe'; describe('View Book Page', () => { let params = new BehaviorSubject({}); diff --git a/example-app/app/books/containers/view-book-page.ts b/example-app/app/books/containers/view-book-page.component.ts similarity index 95% rename from example-app/app/books/containers/view-book-page.ts rename to example-app/app/books/containers/view-book-page.component.ts index e1fb49e50d..9fd1433757 100644 --- a/example-app/app/books/containers/view-book-page.ts +++ b/example-app/app/books/containers/view-book-page.component.ts @@ -5,7 +5,7 @@ import { Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import * as fromBooks from '../reducers'; -import * as BookActions from '../actions/book'; +import * as BookActions from '../actions/book.actions'; /** * Note: Container components are also reusable. Whether or not diff --git a/example-app/app/books/effects/book.spec.ts b/example-app/app/books/effects/book.effects.spec.ts similarity index 98% rename from example-app/app/books/effects/book.spec.ts rename to example-app/app/books/effects/book.effects.spec.ts index 77998346b7..a26cb454de 100644 --- a/example-app/app/books/effects/book.spec.ts +++ b/example-app/app/books/effects/book.effects.spec.ts @@ -3,10 +3,10 @@ import { Actions } from '@ngrx/effects'; import { cold, getTestScheduler, hot } from 'jasmine-marbles'; import { empty, Observable } from 'rxjs'; -import { GoogleBooksService } from '../../core/services/google-books'; -import { Search, SearchComplete, SearchError } from '../actions/book'; +import { GoogleBooksService } from '../../core/services/google-books.service'; +import { Search, SearchComplete, SearchError } from '../actions/book.actions'; import { Book } from '../models/book'; -import { BookEffects, SEARCH_DEBOUNCE, SEARCH_SCHEDULER } from './book'; +import { BookEffects, SEARCH_DEBOUNCE, SEARCH_SCHEDULER } from './book.effects'; export class TestActions extends Actions { constructor() { diff --git a/example-app/app/books/effects/book.ts b/example-app/app/books/effects/book.effects.ts similarity index 97% rename from example-app/app/books/effects/book.ts rename to example-app/app/books/effects/book.effects.ts index 434142c975..55b62c87e3 100644 --- a/example-app/app/books/effects/book.ts +++ b/example-app/app/books/effects/book.effects.ts @@ -11,13 +11,13 @@ import { takeUntil, } from 'rxjs/operators'; -import { GoogleBooksService } from '../../core/services/google-books'; +import { GoogleBooksService } from '../../core/services/google-books.service'; import { BookActionTypes, Search, SearchComplete, SearchError, -} from '../actions/book'; +} from '../actions/book.actions'; import { Book } from '../models/book'; import { Scheduler } from 'rxjs/internal/Scheduler'; diff --git a/example-app/app/books/effects/collection.spec.ts b/example-app/app/books/effects/collection.effects.spec.ts similarity index 97% rename from example-app/app/books/effects/collection.spec.ts rename to example-app/app/books/effects/collection.effects.spec.ts index 979c6c6d7b..1a4dbc5421 100644 --- a/example-app/app/books/effects/collection.spec.ts +++ b/example-app/app/books/effects/collection.effects.spec.ts @@ -4,9 +4,9 @@ import { Actions } from '@ngrx/effects'; import { cold, hot } from 'jasmine-marbles'; import { empty, Observable } from 'rxjs'; -import * as CollectionActions from '../actions/collection'; +import * as CollectionActions from '../actions/collection.actions'; import { Book } from '../models/book'; -import { CollectionEffects } from './collection'; +import { CollectionEffects } from './collection.effects'; export class TestActions extends Actions { constructor() { diff --git a/example-app/app/books/effects/collection.ts b/example-app/app/books/effects/collection.effects.ts similarity index 98% rename from example-app/app/books/effects/collection.ts rename to example-app/app/books/effects/collection.effects.ts index 96ee3b23a6..1e49f2f7f5 100644 --- a/example-app/app/books/effects/collection.ts +++ b/example-app/app/books/effects/collection.effects.ts @@ -16,7 +16,7 @@ import { RemoveBook, RemoveBookFail, RemoveBookSuccess, -} from './../actions/collection'; +} from './../actions/collection.actions'; @Injectable() export class CollectionEffects { diff --git a/example-app/app/books/guards/book-exists.ts b/example-app/app/books/guards/book-exists.guard.ts similarity index 97% rename from example-app/app/books/guards/book-exists.ts rename to example-app/app/books/guards/book-exists.guard.ts index 07056038bb..a17d05f8f5 100644 --- a/example-app/app/books/guards/book-exists.ts +++ b/example-app/app/books/guards/book-exists.guard.ts @@ -4,8 +4,8 @@ import { select, Store } from '@ngrx/store'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap, take, tap } from 'rxjs/operators'; -import { GoogleBooksService } from '../../core/services/google-books'; -import * as BookActions from '../actions/book'; +import { GoogleBooksService } from '../../core/services/google-books.service'; +import * as BookActions from '../actions/book.actions'; import * as fromBooks from '../reducers'; /** diff --git a/example-app/app/books/reducers/__snapshots__/books.spec.ts.snap b/example-app/app/books/reducers/__snapshots__/books.reducer.spec.ts.snap similarity index 100% rename from example-app/app/books/reducers/__snapshots__/books.spec.ts.snap rename to example-app/app/books/reducers/__snapshots__/books.reducer.spec.ts.snap diff --git a/example-app/app/books/reducers/books.spec.ts b/example-app/app/books/reducers/books.reducer.spec.ts similarity index 93% rename from example-app/app/books/reducers/books.spec.ts rename to example-app/app/books/reducers/books.reducer.spec.ts index 8b78b2fb39..ad602bbf65 100644 --- a/example-app/app/books/reducers/books.spec.ts +++ b/example-app/app/books/reducers/books.reducer.spec.ts @@ -1,8 +1,8 @@ -import { reducer } from './books'; -import * as fromBooks from './books'; -import { SearchComplete, Load, Select } from '../actions/book'; +import { reducer } from './books.reducer'; +import * as fromBooks from './books.reducer'; +import { SearchComplete, Load, Select } from '../actions/book.actions'; import { Book, generateMockBook } from '../models/book'; -import { LoadSuccess } from '../actions/collection'; +import { LoadSuccess } from '../actions/collection.actions'; describe('BooksReducer', () => { const book1 = generateMockBook(); diff --git a/example-app/app/books/reducers/books.ts b/example-app/app/books/reducers/books.reducer.ts similarity index 98% rename from example-app/app/books/reducers/books.ts rename to example-app/app/books/reducers/books.reducer.ts index 8eab3b22ba..2212e53e5f 100644 --- a/example-app/app/books/reducers/books.ts +++ b/example-app/app/books/reducers/books.reducer.ts @@ -1,11 +1,11 @@ import { createSelector } from '@ngrx/store'; import { createEntityAdapter, EntityAdapter, EntityState } from '@ngrx/entity'; import { Book } from '../models/book'; -import { BookActionsUnion, BookActionTypes } from '../actions/book'; +import { BookActionsUnion, BookActionTypes } from '../actions/book.actions'; import { CollectionActionsUnion, CollectionActionTypes, -} from '../actions/collection'; +} from '../actions/collection.actions'; /** * @ngrx/entity provides a predefined interface for handling diff --git a/example-app/app/books/reducers/collection.ts b/example-app/app/books/reducers/collection.reducer.ts similarity index 96% rename from example-app/app/books/reducers/collection.ts rename to example-app/app/books/reducers/collection.reducer.ts index c468ed8d1e..8e3c0fca72 100644 --- a/example-app/app/books/reducers/collection.ts +++ b/example-app/app/books/reducers/collection.reducer.ts @@ -1,7 +1,7 @@ import { CollectionActionTypes, CollectionActionsUnion, -} from './../actions/collection'; +} from './../actions/collection.actions'; export interface State { loaded: boolean; diff --git a/example-app/app/books/reducers/index.ts b/example-app/app/books/reducers/index.ts index 61160a3e8f..923de16ba7 100644 --- a/example-app/app/books/reducers/index.ts +++ b/example-app/app/books/reducers/index.ts @@ -3,9 +3,9 @@ import { createFeatureSelector, ActionReducerMap, } from '@ngrx/store'; -import * as fromSearch from './search'; -import * as fromBooks from './books'; -import * as fromCollection from './collection'; +import * as fromSearch from './search.reducer'; +import * as fromBooks from './books.reducer'; +import * as fromCollection from './collection.reducer'; import * as fromRoot from '../../reducers'; export interface BooksState { diff --git a/example-app/app/books/reducers/search.ts b/example-app/app/books/reducers/search.reducer.ts similarity index 99% rename from example-app/app/books/reducers/search.ts rename to example-app/app/books/reducers/search.reducer.ts index 0664cb408e..d189e6e9a3 100644 --- a/example-app/app/books/reducers/search.ts +++ b/example-app/app/books/reducers/search.reducer.ts @@ -1,4 +1,4 @@ -import { BookActionTypes, BookActionsUnion } from '../actions/book'; +import { BookActionTypes, BookActionsUnion } from '../actions/book.actions'; export interface State { ids: string[]; diff --git a/example-app/app/core/actions/layout.ts b/example-app/app/core/actions/layout.actions.ts similarity index 100% rename from example-app/app/core/actions/layout.ts rename to example-app/app/core/actions/layout.actions.ts diff --git a/example-app/app/core/components/layout.ts b/example-app/app/core/components/layout.component.ts similarity index 100% rename from example-app/app/core/components/layout.ts rename to example-app/app/core/components/layout.component.ts diff --git a/example-app/app/core/components/nav-item.ts b/example-app/app/core/components/nav-item.component.ts similarity index 100% rename from example-app/app/core/components/nav-item.ts rename to example-app/app/core/components/nav-item.component.ts diff --git a/example-app/app/core/components/sidenav.ts b/example-app/app/core/components/sidenav.component.ts similarity index 100% rename from example-app/app/core/components/sidenav.ts rename to example-app/app/core/components/sidenav.component.ts diff --git a/example-app/app/core/components/toolbar.ts b/example-app/app/core/components/toolbar.component.ts similarity index 100% rename from example-app/app/core/components/toolbar.ts rename to example-app/app/core/components/toolbar.component.ts diff --git a/example-app/app/core/containers/app.ts b/example-app/app/core/containers/app.component.ts similarity index 94% rename from example-app/app/core/containers/app.ts rename to example-app/app/core/containers/app.component.ts index 5d13b583f2..0ba77b3fe6 100644 --- a/example-app/app/core/containers/app.ts +++ b/example-app/app/core/containers/app.component.ts @@ -2,10 +2,10 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { Observable } from 'rxjs'; -import * as AuthActions from '../../auth/actions/auth'; +import * as AuthActions from '../../auth/actions/auth.actions'; import * as fromAuth from '../../auth/reducers'; import * as fromRoot from '../../reducers'; -import * as LayoutActions from '../actions/layout'; +import * as LayoutActions from '../actions/layout.actions'; @Component({ selector: 'bc-app', diff --git a/example-app/app/core/containers/not-found-page.ts b/example-app/app/core/containers/not-found-page.component.ts similarity index 100% rename from example-app/app/core/containers/not-found-page.ts rename to example-app/app/core/containers/not-found-page.component.ts diff --git a/example-app/app/core/core.module.ts b/example-app/app/core/core.module.ts index de46938941..db183569aa 100644 --- a/example-app/app/core/core.module.ts +++ b/example-app/app/core/core.module.ts @@ -2,15 +2,15 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; -import { AppComponent } from './containers/app'; -import { NotFoundPageComponent } from './containers/not-found-page'; -import { LayoutComponent } from './components/layout'; -import { NavItemComponent } from './components/nav-item'; -import { SidenavComponent } from './components/sidenav'; -import { ToolbarComponent } from './components/toolbar'; +import { AppComponent } from './containers/app.component'; +import { NotFoundPageComponent } from './containers/not-found-page.component'; +import { LayoutComponent } from './components/layout.component'; +import { NavItemComponent } from './components/nav-item.component'; +import { SidenavComponent } from './components/sidenav.component'; +import { ToolbarComponent } from './components/toolbar.component'; import { MaterialModule } from '../material'; -import { GoogleBooksService } from './services/google-books'; +import { GoogleBooksService } from './services/google-books.service'; export const COMPONENTS = [ AppComponent, diff --git a/example-app/app/core/reducers/layout.ts b/example-app/app/core/reducers/layout.reducer.ts similarity index 85% rename from example-app/app/core/reducers/layout.ts rename to example-app/app/core/reducers/layout.reducer.ts index 5c2176f129..2d5fe1b87e 100644 --- a/example-app/app/core/reducers/layout.ts +++ b/example-app/app/core/reducers/layout.reducer.ts @@ -1,4 +1,7 @@ -import { LayoutActionTypes, LayoutActionsUnion } from '../actions/layout'; +import { + LayoutActionTypes, + LayoutActionsUnion, +} from '../actions/layout.actions'; export interface State { showSidenav: boolean; diff --git a/example-app/app/core/services/google-books.spec.ts b/example-app/app/core/services/google-books.service.spec.ts similarity index 96% rename from example-app/app/core/services/google-books.spec.ts rename to example-app/app/core/services/google-books.service.spec.ts index fd1692987c..f1874689da 100644 --- a/example-app/app/core/services/google-books.spec.ts +++ b/example-app/app/core/services/google-books.service.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { HttpClient } from '@angular/common/http'; import { cold } from 'jasmine-marbles'; -import { GoogleBooksService } from './google-books'; +import { GoogleBooksService } from './google-books.service'; describe('Service: GoogleBooks', () => { let service: GoogleBooksService; diff --git a/example-app/app/core/services/google-books.ts b/example-app/app/core/services/google-books.service.ts similarity index 100% rename from example-app/app/core/services/google-books.ts rename to example-app/app/core/services/google-books.service.ts diff --git a/example-app/app/reducers/index.ts b/example-app/app/reducers/index.ts index 9b5d6985aa..a4a781a671 100644 --- a/example-app/app/reducers/index.ts +++ b/example-app/app/reducers/index.ts @@ -23,7 +23,7 @@ import { storeFreeze } from 'ngrx-store-freeze'; * notation packages up all of the exports into a single object. */ -import * as fromLayout from '../core/reducers/layout'; +import * as fromLayout from '../core/reducers/layout.reducer'; /** * As mentioned, we treat each reducer like a table in a database. This means diff --git a/example-app/app/routes.ts b/example-app/app/routes.ts index 47543e2041..e5a3fcb1b6 100644 --- a/example-app/app/routes.ts +++ b/example-app/app/routes.ts @@ -1,6 +1,6 @@ import { Routes } from '@angular/router'; import { AuthGuard } from './auth/services/auth-guard.service'; -import { NotFoundPageComponent } from './core/containers/not-found-page'; +import { NotFoundPageComponent } from './core/containers/not-found-page.component'; export const routes: Routes = [ { path: '', redirectTo: '/books', pathMatch: 'full' }, diff --git a/example-app/app/shared/pipes/add-commas.spec.ts b/example-app/app/shared/pipes/add-commas.pipe.spec.ts similarity index 94% rename from example-app/app/shared/pipes/add-commas.spec.ts rename to example-app/app/shared/pipes/add-commas.pipe.spec.ts index ac58b97bfd..44102338f2 100644 --- a/example-app/app/shared/pipes/add-commas.spec.ts +++ b/example-app/app/shared/pipes/add-commas.pipe.spec.ts @@ -1,4 +1,4 @@ -import { AddCommasPipe } from './add-commas'; +import { AddCommasPipe } from './add-commas.pipe'; describe('Pipe: Add Commas', () => { let pipe: AddCommasPipe; diff --git a/example-app/app/shared/pipes/add-commas.ts b/example-app/app/shared/pipes/add-commas.pipe.ts similarity index 100% rename from example-app/app/shared/pipes/add-commas.ts rename to example-app/app/shared/pipes/add-commas.pipe.ts diff --git a/example-app/app/shared/pipes/ellipsis.spec.ts b/example-app/app/shared/pipes/ellipsis.pipe.spec.ts similarity index 98% rename from example-app/app/shared/pipes/ellipsis.spec.ts rename to example-app/app/shared/pipes/ellipsis.pipe.spec.ts index e470d212f1..379fcf0d22 100644 --- a/example-app/app/shared/pipes/ellipsis.spec.ts +++ b/example-app/app/shared/pipes/ellipsis.pipe.spec.ts @@ -1,4 +1,4 @@ -import { EllipsisPipe } from './ellipsis'; +import { EllipsisPipe } from './ellipsis.pipe'; describe('Pipe: Ellipsis', () => { let pipe: EllipsisPipe; diff --git a/example-app/app/shared/pipes/ellipsis.ts b/example-app/app/shared/pipes/ellipsis.pipe.ts similarity index 100% rename from example-app/app/shared/pipes/ellipsis.ts rename to example-app/app/shared/pipes/ellipsis.pipe.ts diff --git a/example-app/app/shared/pipes/index.ts b/example-app/app/shared/pipes/index.ts index f9f2d6ef84..37b5262e0a 100644 --- a/example-app/app/shared/pipes/index.ts +++ b/example-app/app/shared/pipes/index.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { AddCommasPipe } from './add-commas'; -import { EllipsisPipe } from './ellipsis'; +import { AddCommasPipe } from './add-commas.pipe'; +import { EllipsisPipe } from './ellipsis.pipe'; export const PIPES = [AddCommasPipe, EllipsisPipe];