Skip to content

Commit

Permalink
Merge branch 'next' into restore-template-component
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Aug 28, 2024
2 parents 3d53b49 + e0ebaf4 commit ebc3b29
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/indexer/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { combineTags } from '@storybook/csf';
import type { IndexInput, Indexer } from 'storybook/internal/types';

import { parseForIndexer } from '#indexer/parser';
Expand All @@ -24,7 +23,7 @@ export const createIndexer = (legacyTemplate: boolean): Indexer => ({
exportName: story.exportName,
name: story.name,
title: makeTitle(meta.title),
tags: combineTags(...(meta.tags ?? []), ...(story.tags ?? [])),
tags: [...(meta.tags ?? []), ...(story.tags ?? [])],
} satisfies IndexInput;
});
} catch (error) {
Expand Down
24 changes: 24 additions & 0 deletions tests/stories/Tags.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script context="module">
import { defineMeta } from '@storybook/addon-svelte-csf';
/**
* Testing tags parsing in the addon's indexer.
* - In the sidebar, only the _"With Dev"_ story should be visible.
* - In docs, only the _"With Autodocs"_ story should be visible.
*/
const { Story } = defineMeta({
title: 'Tags',
parameters: {
controls: { disable: true },
},
tags: ['!dev', '!autodocs', '!test'],
});
</script>

<Story name="With Autodocs" tags={['autodocs']}>With autodocs</Story>

<Story name="With Dev" tags={['dev']}>With dev</Story>

<Story name="With Test" tags={['test']}>With test</Story>

<Story name="No Tags">No tags</Story>

0 comments on commit ebc3b29

Please sign in to comment.