From 72f1d1294e499cdd3ee4f2f57c0c49ff837e2279 Mon Sep 17 00:00:00 2001 From: puku0x Date: Sat, 23 Apr 2022 21:17:23 +0900 Subject: [PATCH] fix(storybook): ignore experimental packages during migrating to v14 --- .../migrate-defaults-5-to-6.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts b/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts index 21becac1d2cf2..50609accb43de 100644 --- a/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts +++ b/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts @@ -76,6 +76,19 @@ export function migrateStorybookInstance( function maybeUpdateVersion(tree: Tree): GeneratorCallback { let needsInstall = false; updateJson(tree, 'package.json', (json) => { + const ignoredStorybookPackages = [ + '@storybook/builder-vite', + '@storybook/jest', + '@storybook/react-native', + '@storybook/storybook-deployer', + '@storybook/test-runner', + '@storybook/testing-library', + '@storybook/testing-angular', + '@storybook/testing-react', + '@storybook/testing-vue', + '@storybook/testing-vue3', + ]; + json.dependencies = json.dependencies || {}; json.devDependencies = json.devDependencies || {}; @@ -84,8 +97,7 @@ function maybeUpdateVersion(tree: Tree): GeneratorCallback { ).filter( (packageName: string) => packageName.startsWith('@storybook/') && - !packageName.includes('@storybook/react-native') && - !packageName.includes('@storybook/storybook-deployer') + !ignoredStorybookPackages.includes(packageName) ); const allStorybookPackagesInDevDependencies = Object.keys( @@ -93,8 +105,7 @@ function maybeUpdateVersion(tree: Tree): GeneratorCallback { ).filter( (packageName: string) => packageName.startsWith('@storybook/') && - !packageName.includes('@storybook/react-native') && - !packageName.includes('@storybook/storybook-deployer') + !ignoredStorybookPackages.includes(packageName) ); const storybookPackages = [