File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -142,14 +142,13 @@ function validateConfig(configFile) {
142142 }
143143 } ) ;
144144
145- if ( storybookConfig . waitForTimeout <= 0 ) {
146- console . log ( '[smartui] Error: Invalid value of waitForTimeout. Must be > 0' ) ;
147- console . log ( 'If you do not wish to include waitForTimeout parameter, remove it from the config file.' )
148- process . exit ( 0 ) ;
149- }
150- if ( storybookConfig . waitForTimeout > 30000 ) {
151- console . log ( '[smartui] Error: Invalid value of waitForTimeout. Must be <= 30000' ) ;
152- process . exit ( 0 ) ;
145+ // Sanity check waitForTimeout
146+ if ( ! Object . hasOwn ( storybookConfig , 'waitForTimeout' ) ) {
147+ storybookConfig . waitForTimeout = 0 ;
148+ } else if ( storybookConfig . waitForTimeout <= 0 || storybookConfig . waitForTimeout > 30000 ) {
149+ console . log ( '[smartui] Warning: Invalid config, value of waitForTimeout must be > 0 and <= 30000' ) ;
150+ console . log ( 'If you do not wish to include waitForTimeout parameter, remove it from the config file.' ) ;
151+ storybookConfig . waitForTimeout = 0 ;
153152 }
154153
155154 return storybookConfig
Original file line number Diff line number Diff line change @@ -36,14 +36,15 @@ program.command('storybook')
3636 . option ( '--force-rebuild' , 'Force a rebuild of an already existing build.' , false )
3737 . action ( async function ( serve , options ) {
3838 options . env = program . opts ( ) . env || 'prod' ;
39- if ( options . config ) {
40- options . config = validateConfig ( options . config ) ;
41- }
42-
39+
4340 console . log ( 'SmartUI Storybook CLI v' + version ) ;
4441 await checkUpdate ( version , options ) ;
4542 console . log ( '\n' ) ;
4643
44+ if ( options . config ) {
45+ options . config = validateConfig ( options . config ) ;
46+ }
47+
4748 await validateProjectToken ( options ) ;
4849 if ( ! options . forceRebuild ) await validateLatestBuild ( options ) ;
4950 storybook ( serve , options ) ;
You can’t perform that action at this time.
0 commit comments