Skip to content

Commit

Permalink
fix(storybook): ensure 'storybook' dep is installed for non-crystal w…
Browse files Browse the repository at this point in the history
…orkspaces (#29235)

## Current Behavior
The `storybook` package is required to be installed to correctly find
paths correctly.
It acts almost like a shim.
It was not being installed for non-crystal workspaces

## Expected Behavior
Ensure `storybook` is installed

(cherry picked from commit 288193b)
  • Loading branch information
Coly010 authored and FrozenPandaz committed Dec 6, 2024
1 parent 046686f commit 6234d98
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/storybook/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,15 @@ function checkDependenciesInstalled(
'@nx/web': nxVersion,
};

if (schema.addPlugin) {
let storybookVersionToInstall = storybookVersion;
if (
storybookMajorVersion() >= 7 &&
getInstalledStorybookVersion() &&
gte(getInstalledStorybookVersion(), '7.0.0')
) {
storybookVersionToInstall = getInstalledStorybookVersion();
}

devDependencies['storybook'] = storybookVersionToInstall;
let storybookVersionToInstall = storybookVersion;
if (
storybookMajorVersion() >= 7 &&
getInstalledStorybookVersion() &&
gte(getInstalledStorybookVersion(), '7.0.0')
) {
storybookVersionToInstall = getInstalledStorybookVersion();
}
devDependencies['storybook'] = storybookVersionToInstall;

return addDependenciesToPackageJson(
host,
Expand Down

0 comments on commit 6234d98

Please sign in to comment.