File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,12 @@ async function compress(dirPath, uploadId) {
5555
5656function filterStories ( dirPath , storybookConfig ) {
5757 let storyIds = [ ] ;
58- stories = JSON . parse ( fs . readFileSync ( `${ dirPath } /stories.json` ) ) . stories ;
58+ let stories = [ ]
59+ if ( fs . existsSync ( ( `${ dirPath } /stories.json` ) ) ) {
60+ stories = JSON . parse ( fs . readFileSync ( `${ dirPath } /stories.json` ) ) . stories ;
61+ } else if ( fs . existsSync ( ( `${ dirPath } /index.json` ) ) ) {
62+ stories = JSON . parse ( fs . readFileSync ( `${ dirPath } /index.json` ) ) . entries ;
63+ }
5964
6065 for ( const [ storyId , storyInfo ] of Object . entries ( stories ) ) {
6166 if ( ! skipStory ( storyInfo , storybookConfig ) ) {
Original file line number Diff line number Diff line change @@ -78,10 +78,11 @@ async function validateStorybookDir(dir) {
7878 console . log ( `[smartui] Given directory is not a storybook static directory. Error: No index.html found` ) ;
7979 process . exit ( constants . ERROR_CATCHALL ) ;
8080 }
81- if ( ! fs . existsSync ( dir + '/stories.json' ) ) {
82- console . log ( `[smartui] Given directory is not a storybook static directory. Error: No stories.json found` ) ;
81+ if ( ! fs . existsSync ( dir + '/stories.json' ) && ! fs . existsSync ( dir + '/index.json' ) ) {
82+ console . log ( `[smartui] Given directory is not a storybook static directory. Error: stories.json or index.json not found` ) ;
8383 process . exit ( constants . ERROR_CATCHALL ) ;
8484 }
85+
8586} ;
8687
8788async function validateLatestBuild ( options ) {
You can’t perform that action at this time.
0 commit comments