From 85eb5d3d1bd7c3e595a4fe0ed4e07e5c90fd1f47 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Thu, 20 Apr 2023 14:06:35 +0300 Subject: [PATCH] fix(storybook): only check existence of storybook before migrating --- .../src/migrations/update-16-0-0/update-sb-7.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/storybook/src/migrations/update-16-0-0/update-sb-7.ts b/packages/storybook/src/migrations/update-16-0-0/update-sb-7.ts index 9ed8ec1be802a..11f278b896d49 100644 --- a/packages/storybook/src/migrations/update-16-0-0/update-sb-7.ts +++ b/packages/storybook/src/migrations/update-16-0-0/update-sb-7.ts @@ -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; }