Skip to content

Commit

Permalink
Implementing re export aliasing #159
Browse files Browse the repository at this point in the history
  • Loading branch information
YoVar committed Dec 17, 2017
1 parent 3795e7e commit 4590263
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion generators/app/templates/src/_main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { environment } from '@env/environment';

if (environment.production) {
enableProdMode();
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/app/_app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SplashScreen } from '@ionic-native/splash-screen';
<% } -%>

import { AppComponent } from './app.component';
import { CoreModule } from './core/core.module';
import { CoreModule } from '@app/core';

describe('AppComponent', () => {
beforeEach(() => {
Expand Down
6 changes: 3 additions & 3 deletions generators/app/templates/src/app/_app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
<% } -%>

import { environment } from '../environments/environment';
import { Logger } from './core/logger.service';
import { I18nService } from './core/i18n.service';
import { environment } from '@env/environment';
import { Logger } from '@app/core/logger.service';
import { I18nService } from '@app/core/i18n.service';

const log = new Logger('App');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { Route } from '../core/route.service';
import { extract } from '../core/i18n.service';
import { Route } from '@app/core/route.service';
import { extract } from '@app/core/i18n.service';
import { AboutComponent } from './about.component';

const routes: Routes = Route.withShell([
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/app/about/about.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';

import { environment } from '../../environments/environment';
import { environment } from '@env/environment';

@Component({
selector: 'app-about',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MockBackend, MockConnection } from '@angular/http/testing';

import { HttpService } from './http.service';
import { HttpCacheService } from './http-cache.service';
import { environment } from '../../../environments/environment';
import { environment } from '@env/environment';
import { HttpCachePolicy } from './request-options-args';

describe('HttpService', () => {
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/app/core/http/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { _throw } from 'rxjs/observable/throw';
import { catchError } from 'rxjs/operators';
import { extend } from 'lodash';

import { environment } from '../../../environments/environment';
import { environment } from '@env/environment';
import { Logger } from '../logger.service';
import { HttpCacheService } from './http-cache.service';
import { HttpCachePolicy } from './request-options-args';
Expand Down
10 changes: 10 additions & 0 deletions generators/app/templates/src/app/core/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from './core.module';
export * from './shell/shell.component';
export * from './shell/header/header.component';
export * from './authentication/authentication.service';
export * from './authentication/authentication.guard';
export * from './i18n.service';
export * from './http/http.service';
export * from './http/http-cache.service';
export * from './route.service';
export * from './logger.service';
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ObservableMedia } from '@angular/flex-layout';
<% if (props.auth) { -%>
import { AuthenticationService } from '../authentication/authentication.service';
<% } -%>
import { I18nService } from '../i18n.service';
import { I18nService } from '@app/core/i18n.service';

@Component({
selector: 'app-shell',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FlexLayoutModule } from '@angular/flex-layout';
<% if (props.ui === 'material') { -%>
import { MaterialModule } from '../material.module';
<% } -%>
import { SharedModule } from '../shared/shared.module';
import { SharedModule } from '@app/shared';
import { HomeComponent } from './home.component';
import { QuoteService } from './quote.service';

Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/src/app/home/_home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { FlexLayoutModule } from '@angular/flex-layout';
<% if (props.ui === 'material') { -%>
import { MaterialModule } from '../material.module';
<% } -%>
import { CoreModule } from '../core/core.module';
import { SharedModule } from '../shared/shared.module';
import { CoreModule } from '@app/core';
import { SharedModule } from '@app/shared';
import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component';
import { QuoteService } from './quote.service';
Expand Down
3 changes: 1 addition & 2 deletions generators/app/templates/src/app/home/home-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { Route } from '../core/route.service';
import { extract } from '../core/i18n.service';
import { Route, extract } from '@app/core';
import { HomeComponent } from './home.component';

const routes: Routes = Route.withShell([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { FlexLayoutModule } from '@angular/flex-layout';
import { MaterialModule } from '../material.module';
import { SharedModule } from '../shared/shared.module';
<% } -%>
import { CoreModule } from '../core/core.module';
import { CoreModule } from '@app/core';
import { LoginComponent } from './login.component';

describe('LoginComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { LoadingController, Platform } from 'ionic-angular';
<% } -%>
import { finalize } from 'rxjs/operators';

import { environment } from '../../environments/environment';
import { Logger } from '../core/logger.service';
import { I18nService } from '../core/i18n.service';
import { AuthenticationService } from '../core/authentication/authentication.service';
import { environment } from '@env//environment';
import { Logger, I18nService, AuthenticationService } from '@app/core';

const log = new Logger('Login');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { extract } from '../core/i18n.service';
import { extract } from '@app/core';
import { LoginComponent } from './login.component';

const routes: Routes = [
Expand Down
2 changes: 2 additions & 0 deletions generators/app/templates/src/app/shared/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './shared.module';
export * from './loader/loader.component';
7 changes: 6 additions & 1 deletion generators/app/templates/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
"lib": [
"es2017",
"dom"
]
],
"baseUrl": "src",
"paths": {
"@app/*": ["app/*"],
"@env/*": ["environments/*"]
}
},
"angularCompilerOptions": {
"preserveWhitespaces": false
Expand Down

0 comments on commit 4590263

Please sign in to comment.