@@ -12,6 +12,28 @@ import { cpus } from 'os';
1212export const angularRoot = findAngularJsonPath ( ) ;
1313export const scullyConfig : ScullyConfig = { } as ScullyConfig ;
1414
15+ export const scullyDefaults : Partial < ScullyConfig > = {
16+ bareProject : false ,
17+ homeFolder : angularRoot ,
18+ outDir : join ( angularRoot , './dist/static/' ) ,
19+ logFileSeverity : LogSeverity . warning ,
20+ inlineStateOnly : false ,
21+ thumbnails : false ,
22+ maxRenderThreads : cpus ( ) . length ,
23+ handle404 : '' ,
24+ appPort : /** 1864 */ 'herodevs'
25+ . split ( '' )
26+ . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
27+ staticport : /** 1668 */ 'scully'
28+ . split ( '' )
29+ . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
30+ reloadPort : /** 2667 */ 'scullyLiveReload'
31+ . split ( '' )
32+ . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
33+ hostName : 'localhost' ,
34+ defaultPostRenderers : [ ] ,
35+ } ;
36+
1537const loadIt = async ( ) => {
1638 const compiledConfig = await compileConfig ( ) ;
1739 let angularConfig = { } as any ;
@@ -37,7 +59,7 @@ const loadIt = async () => {
3759 compiledConfig . projectName
3860 ) } " in 'angular.json'.`
3961 ) ;
40- process . exit ( 15 ) ;
62+ // process.exit(15);
4163 }
4264
4365 if ( compiledConfig . hostUrl && compiledConfig . hostUrl . endsWith ( '/' ) ) {
@@ -46,34 +68,18 @@ const loadIt = async () => {
4668 compiledConfig . hostUrl . length - 1
4769 ) ;
4870 }
71+
4972 // TODO: update types in interfacesandenums to force correct types in here.
5073 // tslint:disable-next-line: no-unused-expression
5174 Object . assign (
5275 scullyConfig ,
5376 /** the default config */
77+ scullyDefaults ,
78+ /** calculated defaults. */
5479 {
55- bareProject : false ,
56- homeFolder : angularRoot ,
57- outDir : join ( angularRoot , './dist/static/' ) ,
5880 sourceRoot : projectConfig . sourceRoot ,
5981 projectRoot : projectConfig . root ,
6082 distFolder,
61- logFileSeverity : LogSeverity . warning ,
62- inlineStateOnly : false ,
63- tumbnails : false ,
64- maxRenderThreads : cpus ( ) . length ,
65- handle404 : '' ,
66- appPort : /** 1864 */ 'herodevs'
67- . split ( '' )
68- . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
69- staticport : /** 1668 */ 'scully'
70- . split ( '' )
71- . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
72- reloadPort : /** 2667 */ 'scullyLiveReload'
73- . split ( '' )
74- . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
75- hostName : 'localhost' ,
76- defaultPostRenderers : [ ] ,
7783 }
7884 ) as ScullyConfig ;
7985 /** activate loaded config */
0 commit comments