Skip to content

Commit

Permalink
Merge pull request #25406 from reyronald/patch-1
Browse files Browse the repository at this point in the history
CLI: Check optionalDependencies for storybook versions
  • Loading branch information
ndelangen authored Jan 10, 2024
2 parents feb4a6a + 94d113a commit 080bf57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/lib/cli/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@ export async function adjustTemplate(templatePath: string, templateData: Record<
// Given a package.json, finds any official storybook package within it
// and if it exists, returns the version of that package from the specified package.json
export function getStorybookVersionSpecifier(packageJson: PackageJsonWithDepsAndDevDeps) {
const allDeps = { ...packageJson.dependencies, ...packageJson.devDependencies };
const allDeps = {
...packageJson.dependencies,
...packageJson.devDependencies,
...packageJson.optionalDependencies,
};
const storybookPackage = Object.keys(allDeps).find((name: string) => {
return storybookMonorepoPackages[name as keyof typeof storybookMonorepoPackages];
});
Expand Down

0 comments on commit 080bf57

Please sign in to comment.