Skip to content

Commit

Permalink
feat(scripts-storybook): dont import packageName stories provided to …
Browse files Browse the repository at this point in the history
…getPackageStoriesGlob argument to make the function more generic
  • Loading branch information
Hotell committed Jul 14, 2023
1 parent e08e9ef commit 56945ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions apps/public-docsite-v9/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript
'../src/**/*.stories.mdx',
'../src/**/*.stories.@(ts|tsx)',
...getPackageStoriesGlob({ packageName: '@fluentui/react-components', callerPath: __dirname }),
'../../../packages/react-components/react-migration-v0-v9/stories/**/@(index.stories.@(ts|tsx)|*.stories.mdx)',
'../../../packages/react-components/react-migration-v8-v9/stories/**/@(index.stories.@(ts|tsx)|*.stories.mdx)',
'../../../packages/react-components/react-datepicker-compat/stories/**/@(index.stories.@(ts|tsx)|*.stories.mdx)',
...getPackageStoriesGlob({ packageName: '@fluentui/public-docsite-v9', callerPath: __dirname }),
],
staticDirs: ['../public'],
addons: [...rootMain.addons],
Expand Down
5 changes: 2 additions & 3 deletions scripts/storybook/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ function getPackageStoriesGlob(options) {
);

packageJson.dependencies = packageJson.dependencies ?? {};
const dependencies = Object.assign(packageJson.dependencies, {
[options.packageName]: '*',
});

const dependencies = { ...packageJson.dependencies };
const rootOffset = offsetFromRoot(options.callerPath.replace(workspaceRoot, ''));

return Object.keys(dependencies)
Expand Down

0 comments on commit 56945ba

Please sign in to comment.