Skip to content

Commit 0958142

Browse files
authored
Merge pull request #82 from LambdaTest/stage
Storybook Version 8 Support
2 parents 636dce8 + 9f75a89 commit 0958142

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

commands/utils/static.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ async function compress(dirPath, uploadId) {
5555

5656
function 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)) {

commands/utils/validate.js

+3-2
Original file line numberDiff line numberDiff 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

8788
async function validateLatestBuild(options) {

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/smartui-storybook",
3-
"version": "1.1.16",
3+
"version": "1.1.17",
44
"description": "LambdaTest's command-line interface (CLI) aimed to help you run your SmartUI tests on LambdaTest platform",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)