Skip to content

Commit 0320e46

Browse files
committed
Merge branch 'release/0.1.3' into main
2 parents b3da7d8 + 4f6fcba commit 0320e46

File tree

96 files changed

+221
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+221
-281
lines changed

package-lock.json

+26-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "angular-boilerplate",
3-
"version": "0.1.2-beta",
3+
"version": "0.1.3",
4+
"description": "Angular starter for large front-end projects built under a clean architecture that helps to scale and maintain a fast workflow.",
5+
"author": "juanmesa2097",
6+
"license": "MIT",
47
"scripts": {
58
"ng": "ng",
69
"start": "ng serve",
@@ -24,7 +27,7 @@
2427
"@angular/router": "~10.1.6",
2528
"@angular/service-worker": "~10.1.6",
2629
"rxjs": "~6.6.3",
27-
"tslib": "^2.0.0",
30+
"tslib": "^2.0.3",
2831
"zone.js": "~0.10.2"
2932
},
3033
"devDependencies": {
@@ -37,19 +40,19 @@
3740
"@types/node": "^14.11.10",
3841
"codelyzer": "^6.0.1",
3942
"jasmine-core": "~3.6.0",
40-
"jasmine-spec-reporter": "~5.0.0",
43+
"jasmine-spec-reporter": "~6.0.0",
4144
"karma": "~5.2.3",
4245
"karma-chrome-launcher": "~3.1.0",
4346
"karma-coverage-istanbul-reporter": "~3.0.2",
44-
"karma-jasmine": "~3.3.0",
47+
"karma-jasmine": "~4.0.1",
4548
"karma-jasmine-html-reporter": "^1.5.0",
4649
"postcss-import": "^12.0.1",
4750
"postcss-loader": "^4.0.4",
4851
"postcss-scss": "^3.0.2",
4952
"protractor": "~7.0.0",
5053
"tailwindcss": "^1.9.4",
51-
"ts-node": "~8.3.0",
52-
"tslint": "~6.1.0",
54+
"ts-node": "~9.0.0",
55+
"tslint": "~6.1.3",
5356
"typescript": "~3.9.6",
5457
"webpack-bundle-analyzer": "^3.8.0"
5558
}

src/app/@core/enums/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { PathMap } from './path-map.enum';
1+
export { Path } from './path.enum';
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
export enum PathMap {
2-
App = '',
1+
export enum Path {
2+
// Public
3+
Home = '',
4+
InternalServerError = 'internal-server-error',
5+
NotFound = '404',
6+
37
// Auth
48
Auth = '',
59
Login = 'login',
@@ -9,5 +13,10 @@ export enum PathMap {
913
PasswordReset = 'password-reset',
1014
PasswordResetSucceeded = 'password-reset-succeeded',
1115
PasswordResetFailed = 'password-reset-failed',
12-
Home = '',
16+
17+
// App base url
18+
App = 'app',
19+
20+
// Features
21+
Dashboard = 'dashboard',
1322
}

src/app/@core/guards/auth.guard.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
RouterStateSnapshot,
77
UrlTree,
88
} from '@angular/router';
9-
import { AuthService } from '@app/@auth';
9+
import { AuthService } from '@app/features/_auth';
1010
import { Observable } from 'rxjs';
11-
import { PathMap } from '../enums';
11+
import { Path } from '../enums';
1212

1313
@Injectable({
1414
providedIn: 'root',
@@ -31,7 +31,7 @@ export class AuthGuard implements CanActivate {
3131
}
3232

3333
// not logged in so redirect to login page with the return url
34-
this.router.navigate([`/${PathMap.Login}`], {
34+
this.router.navigate([`/${Path.Login}`], {
3535
queryParams: { returnUrl: state.url },
3636
});
3737

src/app/@core/guards/no-auth.guard.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RouterStateSnapshot,
77
UrlTree,
88
} from '@angular/router';
9-
import { AuthService } from '@app/@auth';
9+
import { AuthService } from '@app/features/_auth';
1010
import { Observable } from 'rxjs';
1111

1212
@Injectable({

src/app/@core/guards/role.guard.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RouterStateSnapshot,
77
UrlTree,
88
} from '@angular/router';
9-
import { AuthService } from '@app/@auth';
9+
import { AuthService } from '@app/features/_auth';
1010
import { Observable } from 'rxjs';
1111

1212
@Injectable({

src/app/@core/interceptors/jwt.interceptor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
HttpRequest,
66
} from '@angular/common/http';
77
import { Injectable } from '@angular/core';
8-
import { AuthService } from '@app/@auth';
8+
import { AuthService } from '@app/features/_auth';
99
import { environment } from '@environments/environment';
1010
import { Observable } from 'rxjs';
1111

src/app/@core/interceptors/server-error.interceptor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@angular/common/http';
88
import { Injectable } from '@angular/core';
99
import { Router } from '@angular/router';
10-
import { AuthService } from '@app/@auth';
10+
import { AuthService } from '@app/features/_auth';
1111
import { Observable, throwError } from 'rxjs';
1212
import { catchError, retry } from 'rxjs/operators';
1313

src/app/@ui/_internal-server-error/internal-server-error-routing.module.ts

-11
This file was deleted.

src/app/@ui/_internal-server-error/internal-server-error.module.ts

-10
This file was deleted.

src/app/@ui/_internal-server-error/pages/internal-server-error/internal-server-error.page.ts

-12
This file was deleted.

src/app/@ui/_not-found/not-found-routing.module.ts

-16
This file was deleted.

src/app/@ui/_not-found/not-found.module.ts

-10
This file was deleted.

src/app/@ui/_not-found/pages/not-found/not-found.page.ts

-12
This file was deleted.

src/app/app-routing.module.ts

+22-17
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,47 @@
11
import { NgModule } from '@angular/core';
22
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
3-
import { PathMap } from './@core/enums/path-map.enum';
3+
import { NotFoundPage } from '@public/pages/not-found/not-found.page';
4+
import { Path } from './@core/enums/path.enum';
45
import { AuthGuard, NoAuthGuard } from './@core/guards';
56

67
const routes: Routes = [
7-
// ===== Uncomment if pathMap.Home is different from empty =====
8-
// { path: '', redirectTo: PathMap.Home, pathMatch: 'full' },
8+
// ===== Uncomment if Path.Home is different from empty =====
9+
// { path: '', redirectTo: Path.Home, pathMatch: 'full' },
910

10-
// Home page
11+
// Public
1112
{
12-
path: PathMap.Home,
13-
canActivate: [AuthGuard],
13+
path: '',
1414
loadChildren: () =>
15-
import('@features/home/home.module').then((m) => m.HomeModule),
15+
import('@public/public.module').then((m) => m.PublicModule),
1616
},
1717

1818
// Auth
1919
{
20-
path: PathMap.Auth,
20+
path: Path.Auth,
2121
canActivate: [NoAuthGuard],
2222
loadChildren: () =>
23-
import('@app/@auth/auth.module').then((m) => m.AuthModule),
23+
import('@features/_auth/auth.module').then((m) => m.AuthModule),
2424
},
2525

26-
// Internal server error page response
26+
// App
2727
{
28-
path: 'internal-server-error',
29-
loadChildren: () =>
30-
import('@ui/_internal-server-error/internal-server-error.module').then(
31-
(m) => m.InternalServerErrorModule
32-
),
28+
path: Path.App,
29+
canActivate: [AuthGuard],
30+
children: [
31+
{
32+
path: Path.Dashboard,
33+
loadChildren: () =>
34+
import('@features/dashboard/dashboard.module').then(
35+
(m) => m.DashboardModule
36+
),
37+
},
38+
],
3339
},
3440

3541
// Not found page (must go at the bottom)
3642
{
3743
path: '**',
38-
loadChildren: () =>
39-
import('@ui/_not-found/not-found.module').then((m) => m.NotFoundModule),
44+
component: NotFoundPage,
4045
},
4146
];
4247

0 commit comments

Comments
 (0)