File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import {join} from 'path';
33import * as yargs from 'yargs' ;
44import { ScullyConfig } from '..' ;
55import { angularRoot , scullyConfig } from './config' ;
6+ import { logWarn , yellow } from './log' ;
67
78export const { configFile : configFileName } = yargs
89 . string ( 'cf' )
@@ -15,6 +16,7 @@ export const compileConfig = async (): Promise<ScullyConfig> => {
1516 const path = join ( angularRoot , configFileName ) ;
1617 if ( ! ( await pathExists ( path ) ) ) {
1718 /** no ts config, nothing to do. */
19+ logWarn ( `Config file "${ yellow ( path ) } " not found, only rendering normal routes` )
1820 return ( { } as unknown ) as ScullyConfig ;
1921 }
2022 const { config} = await import ( path ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import {storeRoutes} from '../systemPlugins/storeRoutes';
66import { writeToFs } from '../systemPlugins/writeToFs.plugin' ;
77import { updateScullyConfig , loadConfig } from './config' ;
88import { ScullyConfig } from './interfacesandenums' ;
9- import { log } from './log' ;
9+ import { log , logWarn } from './log' ;
1010import { cpus } from 'os' ;
1111import { asyncPool } from './asyncPool' ;
1212import { chunk } from './chunk' ;
@@ -19,6 +19,10 @@ export const generateAll = async (config?: Partial<ScullyConfig>) => {
1919 try {
2020 log ( 'Finding all routes in application.' ) ;
2121 const appRouteArray = await traverseAppRoutes ( ) ;
22+ if ( appRouteArray . length < 1 ) {
23+ logWarn ( 'No routes found in application, are you sure you installed the router? Terminating.' )
24+ process . exit ( 15 ) ;
25+ }
2226 log ( 'Pull in data to create additional routes.' ) ;
2327 const dataRoutes = await addOptionalRoutes ( appRouteArray ) ;
2428 await storeRoutes ( dataRoutes ) ;
You can’t perform that action at this time.
0 commit comments