Skip to content

Commit 2827b7a

Browse files
authored
Merge pull request #27 from pinanks/fixes
Fixes
2 parents 569a453 + 5ef28e9 commit 2827b7a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

commands/storybook.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

commands/utils/static.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function filterStories(dirPath, storybookConfig) {
6666
console.log('[smartui] Error: No stories found');
6767
process.exit(0);
6868
}
69+
console.log('[smartui] Stories found: ', storyIds.length);
6970

7071
return storyIds
7172
}

0 commit comments

Comments
 (0)