storybook-addon-sdc 0.11.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preset.js +13 -6
- package/package.json +1 -1
package/dist/preset.js
CHANGED
|
@@ -395,15 +395,16 @@ var dynamicImports = (stories, namespaces) => {
|
|
|
395
395
|
);
|
|
396
396
|
return Array.from(imports).join("\n");
|
|
397
397
|
};
|
|
398
|
-
var createStoryIndex = (fileName, baseTitle, stories) => {
|
|
399
|
-
const storiesIndex = [
|
|
400
|
-
|
|
398
|
+
var createStoryIndex = (fileName, baseTitle, stories, disableBasicStory) => {
|
|
399
|
+
const storiesIndex = [];
|
|
400
|
+
if (disableBasicStory === false) {
|
|
401
|
+
storiesIndex.push({
|
|
401
402
|
type: "story",
|
|
402
403
|
importPath: fileName,
|
|
403
404
|
exportName: "Basic",
|
|
404
405
|
title: baseTitle
|
|
405
|
-
}
|
|
406
|
-
|
|
406
|
+
});
|
|
407
|
+
}
|
|
407
408
|
if (stories) {
|
|
408
409
|
Object.keys(stories).forEach((storyKey) => {
|
|
409
410
|
storiesIndex.push({
|
|
@@ -504,9 +505,15 @@ var yamlStoriesIndexer = {
|
|
|
504
505
|
const content = readSDC(fileName);
|
|
505
506
|
const baseTitle = makeTitle(`${getProjectName(fileName)}/${content.name}`);
|
|
506
507
|
const stories = content.thirdPartySettings?.sdcStorybook?.stories;
|
|
508
|
+
const disableBasicStory = content.thirdPartySettings?.sdcStorybook?.disableBasicStory ?? false;
|
|
507
509
|
const storiesContent = loadStoryFilesSync(fileName);
|
|
508
510
|
const mergedStories = { ...stories, ...storiesContent };
|
|
509
|
-
return createStoryIndex(
|
|
511
|
+
return createStoryIndex(
|
|
512
|
+
fileName,
|
|
513
|
+
baseTitle,
|
|
514
|
+
mergedStories,
|
|
515
|
+
disableBasicStory
|
|
516
|
+
);
|
|
510
517
|
} catch (error) {
|
|
511
518
|
logger.error(`Error creating index for YAML file: ${fileName}, ${error}`);
|
|
512
519
|
throw error;
|