From 579e5573a44ffa95d482d9e75ee1ada5f6f5cdd3 Mon Sep 17 00:00:00 2001 From: SanderElias Date: Wed, 22 Jan 2020 15:25:30 +0100 Subject: [PATCH 1/2] fix(scullyroutesservice): dont error when nor routefile is found When used in a specific way, the routeServie couls error out. This fixes that issue --- projects/scullyio/ng-lib/package.json | 2 +- .../ng-lib/src/lib/route-service/scully-routes.service.ts | 4 +++- scully/package.json | 2 +- scully/utils/defaultAction.ts | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/scullyio/ng-lib/package.json b/projects/scullyio/ng-lib/package.json index bbbc457a2..c2483cc1b 100644 --- a/projects/scullyio/ng-lib/package.json +++ b/projects/scullyio/ng-lib/package.json @@ -1,6 +1,6 @@ { "name": "@scullyio/ng-lib", - "version": "0.0.12", + "version": "0.0.13", "repository": { "type": "GIT", "url": "https://github.com/scullyio/scully/tree/master/projects/scullyio/ng-lib" diff --git a/projects/scullyio/ng-lib/src/lib/route-service/scully-routes.service.ts b/projects/scullyio/ng-lib/src/lib/route-service/scully-routes.service.ts index a8e99dc0b..efe8d3e34 100644 --- a/projects/scullyio/ng-lib/src/lib/route-service/scully-routes.service.ts +++ b/projects/scullyio/ng-lib/src/lib/route-service/scully-routes.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; import {Observable, of, ReplaySubject} from 'rxjs'; -import {catchError, map, shareReplay, switchMap} from 'rxjs/operators'; +import {catchError, map, shareReplay, switchMap, filter} from 'rxjs/operators'; import {fetchHttp} from '../utils/fetchHttp'; export interface ScullyRoute { @@ -25,6 +25,8 @@ export class ScullyRoutesService { ); return of([] as ScullyRoute[]); }), + /** filter out all non-array results */ + filter(routes => Array.isArray(routes)), shareReplay({refCount: false, bufferSize: 1}) ); available$ = this.allRoutes$.pipe( diff --git a/scully/package.json b/scully/package.json index 4ed9453d8..4e91f65ce 100644 --- a/scully/package.json +++ b/scully/package.json @@ -1,6 +1,6 @@ { "name": "@scullyio/scully", - "version": "0.0.58", + "version": "0.0.59", "description": "Scully CLI", "repository": { "type": "GIT", diff --git a/scully/utils/defaultAction.ts b/scully/utils/defaultAction.ts index 12edd3870..4d39e5896 100644 --- a/scully/utils/defaultAction.ts +++ b/scully/utils/defaultAction.ts @@ -19,7 +19,6 @@ export const generateAll = async (config?: Partial) => { try { log('Finding all routes in application.'); const unhandledRoutes = await traverseAppRoutes(); - console.log('hr', unhandledRoutes); if (unhandledRoutes.length < 1) { logWarn('No routes found in application, are you sure you installed the router? Terminating.'); From ff8016fb6fefbbe8bd1030907362aa1cb76dd2dc Mon Sep 17 00:00:00 2001 From: SanderElias Date: Wed, 22 Jan 2020 15:33:49 +0100 Subject: [PATCH 2/2] chore(update version number): update version number --- scully/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scully/package.json b/scully/package.json index 4e91f65ce..6a03100df 100644 --- a/scully/package.json +++ b/scully/package.json @@ -1,6 +1,6 @@ { "name": "@scullyio/scully", - "version": "0.0.59", + "version": "0.0.60", "description": "Scully CLI", "repository": { "type": "GIT",