Skip to content

Commit

Permalink
chore: add more info about pkgMetadataStories
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Apr 30, 2024
1 parent 372e972 commit da65e4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/storybook/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ function getPackageStoriesGlob(options) {

const storiesGlob = '**/@(index.stories.@(ts|tsx)|*.stories.mdx)';

// if defined package has stories project use that
// if defined package(project) has stories sibling project, that means we need to look for stories in sibling project as the original project doesn't have stories anymore
// @see https://github.com/microsoft/fluentui/issues/30516
const pkgMetadataStories = projects.get(`${pkgName}-stories`);
if (pkgMetadataStories) {
acc.push(`${rootOffset}${pkgMetadataStories.root}/src/${storiesGlob}`);
Expand Down
5 changes: 5 additions & 0 deletions scripts/storybook/src/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ describe(`utils`, () => {

expect(actual).not.toContain(expect.stringContaining('/react-text/stories/'));
});

// @TODO: Once we will have at least 1 project migrated to the new structure we can enable/implement this test
it.todo(
`should generate storybook stories string array of glob based on package.json#dependencies field pointing to sibling /stories project if it exists`,
);
});

describe(`#processBabelLoaderOptions`, () => {
Expand Down

0 comments on commit da65e4b

Please sign in to comment.