Skip to content

Commit

Permalink
fix(react-components): stories for migrated v9 packages are included …
Browse files Browse the repository at this point in the history
…again (microsoft#25540)
  • Loading branch information
TristanWatanabe authored and Hotell committed Feb 9, 2023
1 parent f5aea06 commit a388318
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "fix: stories from migrated v9 packages are now included.",
"packageName": "@fluentui/react-components",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ function getVnextStories() {
.filter(pkgName => pkgName.startsWith('@fluentui/') && !excludedDependencies.includes(pkgName))
.map(pkgName => {
const name = pkgName.replace('@fluentui/', '');
const storiesGlob = '/src/**/@(index.stories.@(ts|tsx)|*.stories.mdx)';
const storiesGlob = '**/@(index.stories.@(ts|tsx)|*.stories.mdx)';

return `../../${name}${storiesGlob}`;
//TODO: simplify once v9 migration [https://github.com/microsoft/fluentui/issues/24129] is complete.
if (fs.existsSync(`../${name}/stories/`)) {
return `../../${name}/stories/${storiesGlob}`;
} else {
return `../../${name}/src/${storiesGlob}`;
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe(`main utils`, () => {

const first = actual[0];
expect(first.startsWith('../../react-')).toBeTruthy();
expect(first.endsWith('/src/**/@(index.stories.@(ts|tsx)|*.stories.mdx)')).toBeTruthy();
expect(first.endsWith('/stories/**/@(index.stories.@(ts|tsx)|*.stories.mdx)')).toBeTruthy();
});
});
});

0 comments on commit a388318

Please sign in to comment.