Skip to content

Commit ec94d08

Browse files
authored
fix(scullyroutesservice): dont error when nor routefile is found (#218)
* fix(scullyroutesservice): dont error when nor routefile is found When used in a specific way, the routeServie couls error out. This fixes that issue * chore(update version number): update version number
1 parent fc4f5c1 commit ec94d08

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

projects/scullyio/ng-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@scullyio/ng-lib",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"repository": {
55
"type": "GIT",
66
"url": "https://github.com/scullyio/scully/tree/master/projects/scullyio/ng-lib"

projects/scullyio/ng-lib/src/lib/route-service/scully-routes.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Injectable} from '@angular/core';
22
import {Observable, of, ReplaySubject} from 'rxjs';
3-
import {catchError, map, shareReplay, switchMap} from 'rxjs/operators';
3+
import {catchError, map, shareReplay, switchMap, filter} from 'rxjs/operators';
44
import {fetchHttp} from '../utils/fetchHttp';
55

66
export interface ScullyRoute {
@@ -25,6 +25,8 @@ export class ScullyRoutesService {
2525
);
2626
return of([] as ScullyRoute[]);
2727
}),
28+
/** filter out all non-array results */
29+
filter(routes => Array.isArray(routes)),
2830
shareReplay({refCount: false, bufferSize: 1})
2931
);
3032
available$ = this.allRoutes$.pipe(

scully/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@scullyio/scully",
3-
"version": "0.0.58",
3+
"version": "0.0.60",
44
"description": "Scully CLI",
55
"repository": {
66
"type": "GIT",

scully/utils/defaultAction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const generateAll = async (config?: Partial<ScullyConfig>) => {
1919
try {
2020
log('Finding all routes in application.');
2121
const unhandledRoutes = await traverseAppRoutes();
22-
console.log('hr', unhandledRoutes);
2322

2423
if (unhandledRoutes.length < 1) {
2524
logWarn('No routes found in application, are you sure you installed the router? Terminating.');

0 commit comments

Comments
 (0)