@@ -42,11 +42,9 @@ async function storybook(serve, options) {
4242 if ( Object . keys ( stories ) . length === 0 ) {
4343 console . log ( '[smartui] Error: No stories found' ) ;
4444 process . exit ( 0 ) ;
45- } else {
46- for ( const [ storyId , storyInfo ] of Object . entries ( stories ) ) {
47- console . log ( '[smartui] Story found: ' + storyInfo . name ) ;
48- }
4945 }
46+ console . log ( '[smartui] Stories found: ' , Object . keys ( stories ) . length ) ;
47+
5048 // Capture DoM of every story and send it to renderer API
5149 await sendDoM ( url , stories , storybookConfig , options ) ;
5250 } )
@@ -74,26 +72,27 @@ async function storybook(serve, options) {
7472 // Compress static build
7573 await static . compress ( dirPath , uploadId )
7674 . then ( function ( ) {
77- console . log ( ' [smartui] Successfully compressed static build.' )
75+ console . log ( ` [smartui] ${ dirPath } compressed.` )
7876 } )
7977 . catch ( function ( err ) {
80- console . log ( ' [smartui] Cannot compress static build . Error: ' , err . message ) ;
78+ console . log ( ` [smartui] Cannot compress ${ dirPath } . Error: ${ err . message } ` ) ;
8179 process . exit ( 0 ) ;
8280 } ) ;
8381
8482 // Upload to S3
8583 const zipData = fs . readFileSync ( 'storybook-static.zip' ) ;
84+ console . log ( '[smartui] Upload in progress...' )
8685 await axios . put ( url , zipData , {
8786 headers : {
8887 'Content-Type' : 'application/zip' ,
8988 'Content-Length' : zipData . length
9089 } } )
9190 . then ( function ( response ) {
92- console . log ( ' [smartui] Static build successfully uploaded' ) ;
91+ console . log ( ` [smartui] ${ dirPath } uploaded.` ) ;
9392 fs . rmSync ( 'storybook-static.zip' ) ;
9493 } )
9594 . catch ( function ( error ) {
96- console . log ( ' [smartui] Cannot upload static build . Error: ' , error . message ) ;
95+ console . log ( ` [smartui] Cannot upload ${ dirPath } . Error: ${ err . message } ` ) ;
9796 fs . rmSync ( 'storybook-static.zip' ) ;
9897 process . exit ( 0 ) ;
9998 } ) ;
@@ -130,7 +129,7 @@ async function storybook(serve, options) {
130129 } )
131130 . catch ( function ( error ) {
132131 if ( error . response ) {
133- console . log ( '[smartui] Build failed: Error: ' , error . response . data . message ) ;
132+ console . log ( '[smartui] Build failed: Error: ' , error . response . data . error ?. message ) ;
134133 } else {
135134 console . log ( '[smartui] Build failed: Error: ' , error . message ) ;
136135 }
0 commit comments