Skip to content

Commit

Permalink
fix(isolate storybook specific files to copy): moved example storyboo…
Browse files Browse the repository at this point in the history
…k specific file

Now only storybook theme generated example will contain the stories file unlike before when theme generated with patternlab also consisted of stories file.
  • Loading branch information
Taher committed Nov 12, 2021
1 parent c7d32a3 commit 1364ad0
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
9 changes: 8 additions & 1 deletion generators/app/index.js
Expand Up @@ -316,7 +316,7 @@ postCSSOptions.push(rtl());`;
};

this.fs.copy(
this.templatePath('options/storybook/copy/**'),
this.templatePath('options/storybook/copy/config/**'),
this.destinationPath(`${this.theme}/.storybook/`),
{
globOptions: {
Expand All @@ -325,6 +325,13 @@ postCSSOptions.push(rtl());`;
},
);

this.fs.copy(
this.templatePath('options/storybook/copy/example/button.stories.js'),
this.destinationPath(
`${this.theme}/components/02-atoms/button/button.stories.js`,
),
);

this.fs.copy(
this.templatePath('options/ds/storybook.js'),
this.destinationPath(`${this.theme}/gulp-tasks/storybook.js`),
Expand Down
@@ -0,0 +1,22 @@
import buttonTemplate from './button.twig';
import buttonData from './button.json';
import '@atoms/button/button.css';

export default {
title: 'Components/Button',
component: buttonTemplate,
}

export const Primary = () => (
buttonTemplate({
button_title: buttonData.button_title,
variant: 'primary',
})
);

export const Secondary = () => (
buttonTemplate({
button_title: buttonData.button_title,
variant: 'secondary',
})
);

0 comments on commit 1364ad0

Please sign in to comment.