Skip to content

Commit 2836089

Browse files
authored
Merge pull request #66 from LambdaTest/stage
Release 1.1.13
2 parents ed70311 + 8ccaafe commit 2836089

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

commands/storybook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function storybook(serve, options) {
3030
.then(async function (response) {
3131
let stories = {}
3232
for (const [storyId, storyInfo] of Object.entries(response.data.stories)) {
33-
if (!skipStory(storyInfo.name, storybookConfig)) {
33+
if (!skipStory(storyInfo, storybookConfig)) {
3434
stories[storyId] = {
3535
name: storyInfo.name,
3636
kind: storyInfo.kind,

commands/utils/static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function filterStories(dirPath, storybookConfig) {
5858
stories = JSON.parse(fs.readFileSync(`${dirPath}/stories.json`)).stories;
5959

6060
for (const [storyId, storyInfo] of Object.entries(stories)) {
61-
if (!skipStory(storyInfo.name, storybookConfig)) {
61+
if (!skipStory(storyInfo, storybookConfig)) {
6262
storyIds.push(storyId);
6363
}
6464
}

commands/utils/story.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
// Returns true or false if the story should be skipped based on include and exclude config
2-
function skipStory(name, config) {
2+
function skipStory(story, config) {
3+
// skip story if it's docs
4+
if (story.parameters && story.parameters.docsOnly) {
5+
return true;
6+
}
7+
38
let matches = regexp => {
4-
if (typeof regexp === 'string') {
5-
let [, parsed, flags] = /^\/(.+)\/(\w+)?$/.exec(regexp) || [];
6-
regexp = new RegExp(parsed ?? regexp, flags);
7-
}
9+
if (typeof regexp === 'string') {
10+
let [, parsed, flags] = /^\/(.+)\/(\w+)?$/.exec(regexp) || [];
11+
regexp = new RegExp(parsed ?? regexp, flags);
12+
}
813

9-
return regexp?.test?.(name);
14+
return regexp?.test?.(story.name);
1015
};
1116

1217
let include = [].concat(config?.include).filter(Boolean);
@@ -15,6 +20,6 @@ function skipStory(name, config) {
1520
let skip = include?.length ? !include.some(matches) : false;
1621
if (!skip && !exclude?.some(matches)) return false;
1722
return true;
18-
};
23+
};
1924

20-
module.exports = { skipStory };
25+
module.exports = { skipStory };

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/smartui-storybook",
3-
"version": "1.1.12",
3+
"version": "1.1.13",
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)