Skip to content

Commit

Permalink
fix(storybook): only check existence of storybook before migrating
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Apr 20, 2023
1 parent a51ac58 commit 85eb5d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/storybook/src/migrations/update-16-0-0/update-sb-7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { storybookMajorVersion } from '../../utils/utilities';

export default async function changeStorybookTargets(tree: Tree) {
const storybookVersion = storybookMajorVersion();
if (!storybookVersion || storybookVersion === 7) {
if (!storybookVersion) {
/**
* This just checks if Storybook is installed in the workspace.
* The thing here is that during the previous step of the migration,
* during packageJsonUpdates, Nx has already set Storybook
* to version 7, if Storybook exists in the workspace.
* So, it makes no sense here to check if the version is
* 7, because it will always be.
*/
return;
}

Expand Down

0 comments on commit 85eb5d3

Please sign in to comment.