fix(storybook): only check existence of storybook before migrating (#16431)

This commit is contained in:
Katerina Skroumpelou 2023-04-20 14:39:05 +03:00 committed by GitHub
parent a51ac58a45
commit e447f2c4fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}