Skip to content

Commit

Permalink
chore(react-components): align storybook configuration with rest of t…
Browse files Browse the repository at this point in the history
…he suite (#25661)

* refactor(scripts): update spec name

* chore(react-components): align storybook configuration with rest of the suite

* generate changefiles
  • Loading branch information
Hotell authored Nov 15, 2022
1 parent ea76850 commit 131d20e
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 212 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore(react-components): align storybook configuration with rest of the suite",
"packageName": "@fluentui/react-components",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
const { getPackageStoriesGlob } = require('@fluentui/scripts/storybook');

const rootMain = require('../../../../.storybook/main');

module.exports = /** @type {Omit<import('../../../../.storybook/main'), 'typescript'|'babel'>} */ ({
...rootMain,
stories: [
...rootMain.stories,
'../src/**/*.stories.mdx',
'../src/**/index.stories.@(ts|tsx)',
...getPackageStoriesGlob({ packageName: '@fluentui/react-components', callerPath: __dirname }),
],
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/index.stories.@(ts|tsx)'],
staticDirs: ['../public'],
addons: [...rootMain.addons],
webpackFinal: (config, options) => {
Expand Down

This file was deleted.

This file was deleted.

33 changes: 2 additions & 31 deletions packages/react-components/react-components/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
import * as rootPreview from '../../../../.storybook/preview';

/** @type {NonNullable<import('@storybook/react').Story['decorators']>} */
export const decorators = rootPreview.decorators;
export const decorators = [...rootPreview.decorators];

/** @type {typeof rootPreview.parameters} */
export const parameters = {
...rootPreview.parameters,
docs: {
...rootPreview.parameters.docs,
},
options: {
storySort: {
method: 'alphabetical',
/**
* @see https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy#sorting-stories
*/
order: [
'Concepts',
[
'Introduction',
'Developer',
['Quick Start', 'Styling Components', 'Positioning Components', 'Accessibility', ['*', 'Components']],
'Upgrading',
[
'from v8',
['Overview', 'Important changes', 'Planning your journey', 'Component Mapping', 'Troubleshooting'],
],
],
'Theme',
'Components',
'Migrations',
],
},
},
};
export const parameters = { ...rootPreview.parameters };
41 changes: 0 additions & 41 deletions packages/react-components/react-components/.storybook/theme.js

This file was deleted.

Binary file not shown.
Binary file not shown.
4 changes: 0 additions & 4 deletions packages/react-components/react-components/public/fluent.svg

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion scripts/storybook/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe(`utils`, () => {
});
});

describe(`#getReactComponentsStories`, () => {
describe(`#getPackageStoriesGlob`, () => {
it(`should generate storybook stories string array of glob based on package.json#dependencies field`, () => {
const actual = getPackageStoriesGlob({ packageName: '@fluentui/react-components', callerPath: __dirname });

Expand Down

0 comments on commit 131d20e

Please sign in to comment.